Skip to main content

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:

  1. resources browsing capabilities

  2. read and write access to resources

  3. complex searches

  4. disk-caching of requested files and resources


A short overview

Setup the connection
>>> from pyxnat import Interface
>>> interface = Interface(
         server='http://central.xnat.org:8080',
         user='login',
         password='pass',
         cachedir=os.path.join(os.path.expanduser('~'), '.store')
         )
Browse the resources
>>> interface.select.projects().get()
[u'CENTRAL_OASIS_CS', u'CENTRAL_OASIS_LONG', ...]
Create new resources
>>> interface.select.project('my_project').create()
>>> interface.select.project('my_project').resource('images'
                      ).file('image.nii').put('/tmp/image.nii')
Make complex searches
>>> table = interface.select('xnat:subjectData',
                             ['xnat:subjectData/PROJECT',
                              'xnat:subjectData/SUBJECT_ID'
                              ]
       ).where([('xnat:subjectData/SUBJECT_ID','LIKE','%'),
                ('xnat:subjectData/PROJECT', '=', 'my_project'),
                'AND'
                ])

Project details


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.7.0.tar.gz (309.5 kB view details)

Uploaded Source

Built Distribution

pyxnat-0.7.0-py2.6.egg (310.8 kB view details)

Uploaded Source

File details

Details for the file pyxnat-0.7.0.tar.gz.

File metadata

  • Download URL: pyxnat-0.7.0.tar.gz
  • Upload date:
  • Size: 309.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyxnat-0.7.0.tar.gz
Algorithm Hash digest
SHA256 c544192d75b5edb44d0fc6e7497eb522eaac340dcc831abcc39a13ac33759b4f
MD5 3acadeb6e68c98c92463316477daa322
BLAKE2b-256 df9c260eaed9d9ab98d853915eeb453d9ac00a8c2c81cc6c2246cb0742fb01ec

See more details on using hashes here.

File details

Details for the file pyxnat-0.7.0-py2.6.egg.

File metadata

  • Download URL: pyxnat-0.7.0-py2.6.egg
  • Upload date:
  • Size: 310.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyxnat-0.7.0-py2.6.egg
Algorithm Hash digest
SHA256 faa744c6d6d88adafb7a0c1c32f34713faaec1e4139c5bcd4ac51ad79b4dfb56
MD5 e912f2246b5ebc9d7bc24e3df0aa994e
BLAKE2b-256 a602cdc4d0bf2126d95a477bfbc2ea586109fc707287c47f2de2d7acedb85d60

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page