I am developing a python Rest API to XNAT for transferring the data locally or to server. I am trying to download all experiments(data format eg:CT,MR,ECOG,MEEG) those are associated with one subject of Project from XNAT to my local file system. But I am able to download only the experiment with data format of MR &CT sessions(Dicom files) of that subject. Below you can see my python code and please let me know for the changes I have to make.
import xnat
import os
#creating a session
session = xnat.connect('https://xnat.prj.ae.mpg.de', user='xxxx', password='xxxx')
test_project = session.projects["Test"] #loading a project Test
test_subject = test_project.subjects #loading subjects of project
download_folder = os.path.expanduser(r"C:\Users\rkls\Documents\Python-Restapi") # download path
print('Your data is downladed in this directory {} '.format(download_folder))
if not os.path.exists(download_folder):
os.makedirs(download_folder)
test_project.subjects['S2_RS'].download_dir(download_folder) # using download_dir() to download subject S2_RS
session.disconnect()
Now the above code gives me only experiment with CT, MR session data (DICOM files) but not ECOG and MEEG session data(EDF & FIF files). How do I download all the experiments associated within single subject of a project?