nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
144 stars 54 forks source link

Create a script that runs FreeSurfer, ANTs, and mindboggle. #111

Closed binarybottle closed 7 years ago

binarybottle commented 7 years ago

I have created a draft for a simple nipype pipeline that will -- with the single command "mindboggle123" -- run recon-all, antsCorticalThickness.sh, and mindboggle. However, I don't know how to connect nipype's ReconAll and antsCorticalThickness nodes to a function node I created for mindboggle. See:

https://github.com/nipy/mindboggle/blob/master/mindboggle/mindboggle123#L197-L201

binarybottle commented 7 years ago

I wrote a function that concatenates strings (outputs of nipype's recon-all or antsCorticalThickness.sh functions) to construct paths for the mindboggle123 nipype pipeline, which is now working.

Now I need to figure out how to use ENTRYPOINT in the Dockerfile.mindboggle.complete so that I can 'docker run mindboggle' with arguments properly.

satra commented 7 years ago

outputs of nodes are not available this way.

subjects_dir = reconall.outputs.subjects_dir
subject_id = reconall.outputs.subject_id

the outputs function simply lists the output names rather than the values.

you would connect the outputs from recon-all and ants segmentation to your mindboggle function. you don't need the concatenate function in the normal nipype connect way. and then you can do whatever you want inside that function to create the mindboggle call.

binarybottle commented 7 years ago

I removed the extraneous lines from mindboggle123, which doesn't rely on them to connect reconall and corticalthickness nodes to the mindboggle node, but instead relies on an intermediary node that joins path strings:

mbFlow.connect(JoinStrings1, 'new_string', Mindboggle, 'DATA') mbFlow.connect(JoinStrings2, 'new_string', Mindboggle, 'ants')

satra commented 7 years ago

i don't see the need for JoinStringsX at all. why couldn't you do that in the mindboggle function?

which can take as input (fsdir, subjectid, antsseg) and do the things joinstrings is doing.

binarybottle commented 7 years ago

Of course! Thank you -- fixed.

The Docker container can now be run as an executable with:

docker run --rm -ti -v $HOST:/home/jovyan/work nipy/mindboggle $IMAGE --id $ID --out $OUT

with the following in the Dockerfile.mindboggle.complete:

ENTRYPOINT ["mindboggle123"] CMD ["IMAGE", "--id", "--out"]