XnatRestClient Downloading files...xnat1.5.2

38 views
Skip to first unread message

Rodrigo Perea

unread,
Jun 30, 2011, 5:17:54 PM6/30/11
to xnat_discussion
So...I've been playing around the pipelines and I am trying to create
a test pipeline for segmentating my image. First I created a dcm2nii
conversion pipeline and successfully uploaded my niftii conversion
using the xnatrest client. Now, I want to get the uploaded file but I
am having some problems with the remote argument when I called my
XNATRestClient resource descriptor......any help?

Here is my step used to upload my NIFTI file in my dcm2nii XML
pipeline descriptor:

<step id="3" description="Upload files to XNAT" >
<resource name="XnatRestClient" location="xnat_tools">
<argument id="user">
<value>^/Pipeline/parameters/parameter[name='user']/values/unique/
text()^</value>
</argument>
<argument id="password">
<value>^/Pipeline/parameters/parameter[name='pwd']/values/unique/
text()^</value>
</argument>
<argument id="host">
<value>^/Pipeline/parameters/parameter[name='host']/values/unique/
text()^</value>
</argument>
<argument id="method">
<value>PUT</value>
</argument>
<argument id="remote">
<value>^concat('"/data/archive/projects/',/Pipeline/parameters/
parameter[name='project']/values/unique/text(),'/subjects/',/Pipeline/
parameters/parameter[name='subject']/values/unique/text(),'/
experiments/',/Pipeline/parameters/parameter[name='xnat_id']/values/
unique/text(),'/scans/',PIPELINE_LOOPON(series),'/resources/NIFTI/
files/',PIPELINE_LOOPON(series),'.nii?
format=NIFTI&amp;content=NIFTI_RAW"')^</value>
</argument>
<argument id="local">
<value>^concat(/Pipeline/parameters/parameter[name='workdir']/
values/unique/text(),'/NIFTI/',PIPELINE_LOOPON(series),'/*.nii')^</
value>
</argument>

</resource>
</step>





Here is my step that I am trying to create for downloading my niftii
file. specifically I am having problems in the argument "remote". Is
there any more documentation on how the files are organized in the
remote host in the XNATRestClient?? I am a little lost here. Any XML
editors that might be useful?


<step id="1a" description="GET Scan NIFTII DATA">
<resource name="XnatRestClient" location="xnat_tools">
<argument id="user">
<value>^/Pipeline/parameters/parameter[name='user']/values/unique/
text()^</value>
</argument>
<argument id="password">
<value>^/Pipeline/parameters/parameter[name='pwd']/values/unique/
text()^</value>
</argument>
<argument id="host">
<value>^/Pipeline/parameters/parameter[name='host']/values/unique/
text()^</value>
</argument>
<argument id="method">
<value>GET</value>
</argument>
<argument id="remote">
<value>^concat('"/data/archive/projects/',/Pipeline/parameters/
parameter[name='project']/values/unique/text(),'/subjects/',/Pipeline/
parameters/parameter[name='subject']/values/unique/text(),'/
experiments/',/Pipeline/parameters/parameter[name='xnat_id']/values/
unique/text(),'/scans/',PIPELINE_LOOPON(series),'/resources/NIFTI/
files/','PIPELINE_LOOPON(series)/files?format=nii"')^</value>
</argument>
<argument id="redirect_output">
<value>^concat(/Pipeline/parameters/parameter[name='workdir']/
values/unique/text(),'/SPM_Seg/',PIPELINE_LOOPON(series),'/Seg_RAW')^</
value>
</argument>
</resource>
</step>

Rodrigo Perea

unread,
Jul 6, 2011, 12:05:33 PM7/6/11
to xnat_discussion
Anybody that could help?
> Here is my step that I am trying to create fordownloadingmy niftii

Mohana Ramaratnam

unread,
Jul 6, 2011, 12:11:42 PM7/6/11
to xnat_di...@googlegroups.com
Hi Rodrigo,

Your remote tag should be:


<value>^concat('"/data/archive/experiments/',/Pipeline/parameters/parameter[name='xnat_id']/values/
unique/text(),'/scans/',PIPELINE_LOOPON(series),'/resources/NIFTI/files?format=zip&structure=legacy"')^</value>

then unzip before you can use the files.

structure=legacy would create a convenient folder structure of the scan files.

> --
> You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
> To post to this group, send email to xnat_di...@googlegroups.com.
> To unsubscribe from this group, send email to xnat_discussi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xnat_discussion?hl=en.
>
>

Mohana Ramaratnam

unread,
Jul 6, 2011, 12:13:12 PM7/6/11
to xnat_di...@googlegroups.com
Forgot to add reference to XNAT documentation:

http://docs.xnat.org/XNAT+REST+Download

Mohana

Reply all
Reply to author
Forward
0 new messages