xgrg / pyxnat

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

Add columns abbreviations #3

Open jhuguetn opened 5 years ago

jhuguetn commented 5 years ago

For usability purposes would be good to support human-readable columns (xpaths) abbreviations when possible as is currently accepted in the XNAT REST API. Making this example call:

c.array.scans(experiment_id=e,columns=['xnat:mrScanData/quality', 
                                                                  'xsiType',
                                                                  'xnat:mrScanData/type',
                                                                  'xnat:mrScanData/frames'])

analogous to this one:

c.array.scans(experiment_id=e,columns=['ID','quality', 'xsiType','type','frames'])
jhuguetn commented 5 years ago

Main issue is related on how this call is translated into an XNAT REST API call:

c.array.scans(experiment_id=e,columns=[...])

should ideally be translated by this:

[GET] /data/experiments/{e}/scans?columns={...}

however pyxnat translates it into this tricky one:

[GET] /data/experiments?ID={e}&columns={...}

Thus, my assumption is that XNAT cannot make the proper translation among xpaths VERSUS human-readable abbreviations because it does not know beforehand what type of experiment details are we querying to.