Xnat in Python
Project description
Pyxnat is a simple python library that relies on the REST API provided
by the XNAT platform since its 1.4 version. XNAT is an extensible database for
neuroimaging data. The main objective is to ease communications with an XNAT
server to plug-in external tools or python scripts to process the data. It
features:
#. resources browsing capabilities
#. read and write access to resources
#. complex searches
#. disk-caching of requested files and resources
.. [#] http://www.xnat.org/
.. [#] http://packages.python.org/pyxnat/
____
**A short overview**
*Setup the connection*
>>> from pyxnat import Interface
>>> interface = Interface(server='http://central.xnat.org:8080',
user='login',
password='pass',
datastore=os.path.join(
os.path.expanduser('~'),
'XnatStore'
)
)
*Browse the resources*
>>> interface.projects()
[u'CENTRAL_OASIS_CS', u'CENTRAL_OASIS_LONG', ...]
*Create new resources*
>>> interface.project('my_project').create()
>>>
interface.project('my_project').file('image.nii').put('/tmp/image.nii')
*Metadata support*
>>> proj = interface.project('my_project')
>>> proj.attrib.keys()
['note','alias','secondary_ID','name','pi_lastname',
'label','keywords','pi_firstname','ID','description']
>>> proj.attrib.set('note', 'a note')
>>> proj.attrib.get('note')
'a note'
*Make complex searches*
>>> search = interface.search( 'my_search',
[
('xnat:subjectData/SUBJECT_ID','LIKE','%'),
('xnat:subjectData/PROJECT', '=',
'my_project'),
'AND'
]
)
>>> search.get_subjects()
by the XNAT platform since its 1.4 version. XNAT is an extensible database for
neuroimaging data. The main objective is to ease communications with an XNAT
server to plug-in external tools or python scripts to process the data. It
features:
#. resources browsing capabilities
#. read and write access to resources
#. complex searches
#. disk-caching of requested files and resources
.. [#] http://www.xnat.org/
.. [#] http://packages.python.org/pyxnat/
____
**A short overview**
*Setup the connection*
>>> from pyxnat import Interface
>>> interface = Interface(server='http://central.xnat.org:8080',
user='login',
password='pass',
datastore=os.path.join(
os.path.expanduser('~'),
'XnatStore'
)
)
*Browse the resources*
>>> interface.projects()
[u'CENTRAL_OASIS_CS', u'CENTRAL_OASIS_LONG', ...]
*Create new resources*
>>> interface.project('my_project').create()
>>>
interface.project('my_project').file('image.nii').put('/tmp/image.nii')
*Metadata support*
>>> proj = interface.project('my_project')
>>> proj.attrib.keys()
['note','alias','secondary_ID','name','pi_lastname',
'label','keywords','pi_firstname','ID','description']
>>> proj.attrib.set('note', 'a note')
>>> proj.attrib.get('note')
'a note'
*Make complex searches*
>>> search = interface.search( 'my_search',
[
('xnat:subjectData/SUBJECT_ID','LIKE','%'),
('xnat:subjectData/PROJECT', '=',
'my_project'),
'AND'
]
)
>>> search.get_subjects()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyxnat-0.5.0.dev.tar.gz
(208.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
pyxnat-0.5.0.dev-py2.6.egg
(4.8 MB
view details)
File details
Details for the file pyxnat-0.5.0.dev.tar.gz.
File metadata
- Download URL: pyxnat-0.5.0.dev.tar.gz
- Upload date:
- Size: 208.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dd286c915791f39d3851e3d82cb9babf1ef779db931d17006953ef0357924c9
|
|
| MD5 |
7fbb0df40b3fc84dd15ee6152fcb1430
|
|
| BLAKE2b-256 |
8aaeec5b67ad34fdd078d4828a23c66e1498c8bdd2ef685b6cad17b9a84e5b5e
|
File details
Details for the file pyxnat-0.5.0.dev-py2.6.egg.
File metadata
- Download URL: pyxnat-0.5.0.dev-py2.6.egg
- Upload date:
- Size: 4.8 MB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc5591d2b89853b2bd278ef86148df8a7a250e627c247c066fd749f2b126055d
|
|
| MD5 |
4c8213f4e1f7ff1486965ab787e937de
|
|
| BLAKE2b-256 |
68f62c838d959cff35208ab752fbf0781a968b301766f76eff31dbc431ad473d
|