Help with pyXnat

Sprry for the newbie qn. Has anybody got any examples of how to use nipype with their xnat box?
I have read the documents did’nt find that helpfull. Found some code by satra:

dg = Node(XNATSource(infields=[‘subject_id’, ‘mpr_id’],
outfields=[‘struct’],
config=’/Users/satra/xnatconfig’),
name=‘xnatsource’)

dg.inputs.query_template = (’/projects/CENTRAL_OASIS_CS/subjects/’
‘%s/experiments/%s_MR1/scans/mpr-%d/’
‘resources/files’)

dg.inputs.query_template_args[‘struct’] = [[‘subject_id’,
‘subject_id’,
‘mpr_id’]]

dg.inputs.subject_id = ‘OAS1_0002’
dg.inputs.mpr_id = 1

This is helpful but has anyone got any ideas how the config file should look like? Or is there an easy way to specify your server with credentialsz in your jupyter notebook? Thankm you in advance.

Kevin

https://nipype.readthedocs.io/en/latest/interfaces/generated/nipype.interfaces.io.html#xnatsource

You can replace the config= with
server = ‘http://myserver/
user=‘foo’
pwd=‘mypass’