uploading nifty files

312 views
Skip to first unread message

Miklos Espak

unread,
Sep 18, 2012, 11:31:52 AM9/18/12
to xnat_di...@googlegroups.com
Hi there,

I would like to upload nifty (*.nii and *.nii.gz) files to XNAT.

Is there a way for that?

Cheers,
Miklos

Herrick, Rick

unread,
Sep 18, 2012, 11:36:55 AM9/18/12
to xnat_di...@googlegroups.com

Miklos,

 

Funny you should ask. At the demo and workshop in Munich last week, we were harassed endlessly… er, politely requested by many kind users to provide exactly this functionality. As it happens, I literally JUST opened a Python script from Christian that does just this operation. Let me have a look through it and then, with Christian’s review and permission, will post it to the XNAT Marketplace. I’ll let you know when it’s ready to go.

--
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.




The material in this message is private and may contain Protected Healthcare Information (PHI). If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Miklos Espak

unread,
Sep 18, 2012, 12:00:59 PM9/18/12
to xnat_di...@googlegroups.com
Hi Rick,

you mean that's a Python script that simply uploads the file through the REST API, right?

That's possible, I know, that was a question at the workshop at the WashU as well.

Or is it a module that adds a web interface?

Herrick, Rick

unread,
Sep 18, 2012, 12:20:37 PM9/18/12
to xnat_di...@googlegroups.com

Correct, it’s a Python script. We don’t have a built-in facility for NIFTI yet. That will probably one of the big things we work on immediately after the 1.6.1 release. We’re also planning on a major refactoring of the upload applet and that will probably go hand-in-hand with supporting NIFTI, NRRD, and probably a couple of other formats. Ideally it will be implemented modularly so that we can then plug format handlers in dynamically, but sometimes that’s easier said than done J

Miklos Espak

unread,
Sep 18, 2012, 12:39:39 PM9/18/12
to xnat_di...@googlegroups.com
That sounds good.

However, I have to create a web service this week that processes nifty files. I  then I will hack something now. With a new action maybe?

Herrick, Rick

unread,
Sep 18, 2012, 12:44:48 PM9/18/12
to xnat_di...@googlegroups.com

Sure, absolutely. The main issue is that you guys are still on 1.5.4, so the custom REST service support is not in there yet. We need to validate the 1.6 update process and go from there.

Miklos Espak

unread,
Sep 18, 2012, 1:17:02 PM9/18/12
to xnat_di...@googlegroups.com
No, this is a new site on 1.6.

https://hipposeg.cs.ucl.ac.uk

Miklos Espak

unread,
Sep 20, 2012, 12:45:23 PM9/20/12
to xnat_di...@googlegroups.com
Hi,

I found a bug / restriction in the current state of Nifty format support.

If I upload a *.nii.gz reconstruction file then no files are shown under the reconstruction on the web. If only *.nii files are uploaded then those are listed well.



Miklos

Mohana Ramaratnam

unread,
Sep 20, 2012, 9:29:07 PM9/20/12
to xnat_di...@googlegroups.com
What is the REST call that you are using to upload files?

Miklos Espak

unread,
Sep 21, 2012, 4:46:49 AM9/21/12
to xnat_di...@googlegroups.com
Create the reco:

$ curl -u test1:test1 -X PUT https://hipposeg.cs.ucl.ac.uk/data/archive/projects/testproject1/subjects/HippoSeg_S00001/experiments/HippoSeg_E00002/reconstructions/hippocampus

Upload Nifti:
$ curl -u test1:test1 -X PUT --data-binary @mdeft.1.nii "https://hipposeg.cs.ucl.ac.uk/data/archive/projects/testproject1/subjects/HippoSeg_S00001/experiments/HippoSeg_E00002/reconstructions/hippocampus/files/scan-2-right-hippocampus.nii?format=NIFTI&inbody=true"

The image appears well on the web.

Then upload the compressed Nifti:

$ curl -u test1:test1 -X PUT --data-binary @mdeft.1.nii.gz "https://hipposeg.cs.ucl.ac.uk/data/archive/projects/testproject1/subjects/HippoSeg_S00001/experiments/HippoSeg_E00002/reconstructions/hippocampus/files/scan-2-right-hippocampus.nii.gz?format=NIFTI&inbody=true"

They appear, however in the file manager:




scans

 

2 dt_mdeft_trio_phase


 

DICOM  176 files, 31.16 Mb DICOM RAW  


 

NIFTI  1 files, 19.25 Mb NIFTI NIFTI_RAW  

 

3 dt_mdeft_trio_phase


 

DICOM  176 files, 31.17 Mb DICOM RAW  


 

NIFTI  1 files, 19.25 Mb NIFTI NIFTI_RAW  
 

reconstructions

 

hippocampus


 

NO LABEL  2 files, 29.60 Mb NIFTI  



  scan-2-right-hippocampus.nii NIFTI  19.25 Mb   



  scan-2-right-hippocampus.nii.gz NIFTI  10.35 Mb   

Miklos Espak

unread,
Sep 23, 2012, 8:12:28 AM9/23/12
to xnat_di...@googlegroups.com
It seems that the problem is not with the compressed nifty format.

If I upload two files to the same reconstruction then none of them will be displayed. I can see them in the file manager, though.

Now I created a new reconstruction for each.

Miklos

Reply all
Reply to author
Forward
0 new messages