Mapnode over multiple values for DCM converison

22 views
Skip to first unread message

thomas.nickson

unread,
Sep 19, 2014, 1:21:13 PM9/19/14
to nipy...@googlegroups.com
Hello All,

I wrote the following code https://gist.github.com/anonymous/fa75120b4a4d914611d2 in order to automate some nifti reconstruction. It works fine without the mapnode but when I add the mapnode in it dies on me. I want to map over three lists with an identitynode and use the output from that to feed in to the datagrabber, to get the file, and also into the datasink via a custom function. This doesn't work for a number of reasons. The output of the datagrabber generates a list of lists for some reason and when i pop this and feed it in to the dcm2nifti node I just get junk nifti files out the otherside. Then instead of still returning a single value from the identitynode it returns a list to the custom function that generates the file paths. Is it possible to make this work.

Also, I don't really understand how the dcm2nifti node works. The command it outputs in command.txt is nonsense as it points to a file that doesn't exist. Is it supposed to have the input as the files that I indicate with the datagrabber or does the datagrabber copy all the files and then delete them after. IT's very confusing.

Any help appreciated.

Thanks,

Tom

Satrajit Ghosh

unread,
Sep 23, 2014, 9:52:04 AM9/23/14
to nipy-user
hi tom,

MapNodes and IdentityInterfaces are not good combinations. i would classify this as a bug - with a complicated fix. mapnodes expand at runtime, identityinterfaces  disappear pre runtime as part of graph expansion.

perhaps the solution is as follows.

1. make your identity interface return simply a subject id and set it's iterables to subjects.
2. add a function node that takes the subject id and returns code, groupnumber, time
3. connect the output of the function node to the rest of the code.

re: dcm2nii

it creates softlinks for only the files it needs to convert. the normal dcm2nii program will otherwise convert every single dcm session in a given directory.

also if you are converting/organizing dicoms the following gist might be of help:


caveats:

1. we have only tested it on siemens dicoms
2. our local code might be more upto date
3. i can send you more detail on how to use it

cheers,

satra

--

---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thomas Nickson

unread,
Sep 24, 2014, 9:57:44 AM9/24/14
to nipy...@googlegroups.com
Hi Satra,

I managed to solve this by using a synchronised iterable list in the identity interface! After that things were pretty easy. I was really confused by the behaviour of mapnode at first but I think it makes sense to me now.

Thanks for your help as usual!

Tom
Reply all
Reply to author
Forward
0 new messages