Introduction to PyXNAT: Simplifying Data Interactions with XNAT's REST API

Slide Note
Embed
Share

PyXNAT is a Python interface to XNAT's REST API, providing a local programmable interface for accessing and manipulating XNAT's data. It simplifies the process of interacting with XNAT by offering methods for searching, accessing objects, and uploading/downloading files. This introduction covers topics such as connecting to a server, accessing and creating objects, managing attributes, and uploading different types of files.


Uploaded on May 13, 2024 | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. PyXNAT PyXNAT 101 : Introduction to pyxnat. David J. Just 1

  2. Agenda What is pyXNAT Connecting to a server Accessing Objects Creating Objects Reading/Writing attributes Uploading/Downloading Files 2

  3. What is pyXNAT PyXNAT is a python interface to XNAT s REST API Simplifys writing data interactions with xnat by giving you a local programmable interface to XNAT s data. Supplies methods of searching, object access, and file upload/download. Getting started: http://pythonhosted.org/pyxnat/ 3

  4. Connecting to XNAT 4

  5. Accessing an Object: 5

  6. Accessing objects : Paths. XNAT Paths are deterministic. It is possible to generate the valid path to any object by knowing it s label and it s parents labels. If you want a list of all objects at any given level, leave off the last label. /projects : list of all projects. /projects/myproject : handle to project <myproject> /projects/myproject/subjects/mysubject/experiments/theExperiment/scans /scanOne This is a direct reference to scan with label scanOne under experiment theExperiment subject mysubject and project myProject 6

  7. Creating Objects 7

  8. Setting Attributes 8

  9. Getting Attributes 9

  10. Uploading Files (DICOM) 10

  11. Uploading Files (DICOM) 11

  12. Uploading files (Not DICOM) PyXNAT is not limited to dicom files. You can upload any type of file you want to any resource you want. 12

  13. Downloading a File Get_copy pulls a copy of the file off of xnat and saves it to the full path specified. When using get_copy it is required to specify the file name along with the path. 13

  14. Downloading a whole resource When downloading a whole resource it downloads as a zip file by default. The path that you give must exist before calling get. You can specify extract=true if you want pyxnat to extract the zip file for you. If left as a zip, the zip will contain the same data structure format as the resource did on XNAT. 14

More Related Content