xgrg / pyxnat

XNAT in Python
https://pyxnat.github.io/pyxnat
Other
0 stars 0 forks source link

interface.array.experiments() returns MRSessions only #4

Closed jhuguetn closed 5 years ago

jhuguetn commented 5 years ago

interface.array.experiments() method should apparently provide a list of experiments but it does solely provide a list of mrSessionData-typed ones. Example:

interface.array.experiments(project_id='sandbox',columns=['session_label']).data

translates to:

[GET] /data/experiments?xsiType=xnat:mrSessionData&project=sandbox&columns=ID,project,xnat:mrSessionData/subject_id,session_label&format=csv

Potential issue in a nearby future:

In [479]: s = c.array.experiments(project_id='ALFA_PLUS_PET',columns=['session_label']).data
In [480]: s
Out[480]: []
jhuguetn commented 5 years ago

Fixed. Using experiment_type shall do the trick (remembering MRSessionData is used as default when none is specified):

s = c.array.experiments(project_id='ALFA_PLUS_PET',experiment_type='xnat:petSessionData')

Closing it, not an issue.