Ok I will try to follow your pipeline as well as your atlas. Thank you very much for your precious help.
Rosella
Hi,
I am going to start using your alternative algorithm to 5ttgen for tissue segmentation of infant data. However, I have 3dT1 as structural data. Does it work all the same instead of using T2?
Of note, you find attached:
- the 5tt.mif image I have obtained trying to apply default 5ttgen algorithm to one of my 3dT1.
- the WM fODFs resulting from multi shell multi tissue csd displayed together with the tissue signals contribution map
Do you think these results are not good enough ?
thanks
Rosella
Hi,
The dHCP pipeline won’t work with the T1. You can design your own framework using the T1 templates from the mcrib atlas.
I don’t think the segmentation is good, I can not see the separation between the CSF and the WM. In the FODs the same, WM and CSF are mixed and the GM is almost gone.
Best regards,
Manuel
thank you very much. I will look for the corresponding T2 images , or implement my own framework
Thanks
Rosella
Hi,
would you suggest some starting point for designing my own framework for segmenting T1 images?
thanks
Rosella
Hi,
You can do it with the manually segmented T1 images from the mcrib atlas and the script antsJointlabelfusion.sh (or something like this, I don’t remember exactly the name). Then with any software you can combine the labels you are interested in.
Finally, for the parcellation, you can use in the same output labelconvert to get the desired labels. I hope this helps.
Best regards,
Manuel
Ok, thank you. However, I do not understand how to get * seg_mrtrix.nii.gz files (you derived from dHCP pipeline) in order to run antsJointLabelFusion script
antsJointLabelFusion.sh -d 3 -t ${BASENAME}_T2w_restore_brain.nii.gz -x ${BASENAME}_brainmask_drawem.nii.gz -o ${BASENAME}_MCRIB_Structural_ -q 0 -g ${BASENAME}_P01_hist.nii.gz -l P01_seg_mrtrix.nii.gz -g ${BASENAME}_P02_hist.nii.gz -l P02_seg_mrtrix.nii.gz -g ${BASENAME}_P03_hist.nii.gz -l P03_seg_mrtrix.nii.gz -g ${BASENAME}_P04_hist.nii.gz -l P04_seg_mrtrix.nii.gz -g ${BASENAME}_P05_hist.nii.gz -l P05_seg_mrtrix.nii.gz -g ${BASENAME}_P06_hist.nii.gz -l P06_seg_mrtrix.nii.gz -g ${BASENAME}_P07_hist.nii.gz -l P07_seg_mrtrix.nii.gz -g ${BASENAME}_P08_hist.nii.gz -l P08_seg_mrtrix.nii.gz -g ${BASENAME}_P09_hist.nii.gz -l P09_seg_mrtrix.nii.gz -g ${BASENAME}_P10_hist.nii.gz -l P10_seg_mrtrix.nii.gz
thank you
Hi,
That’s because I used labelconvert before that command. You need to replace the T2w for the T1w and use the T1w atlases with the segmented images.
You could be interested also to save the tissue probability maps, check for the correct flag to do that.
Best regards,
Manuel
Hi,
thank you. My precise question is how to obtain ID_seg.nii.gz images if I can’t use dhHCP pipeline.
labelconvert **ID_seg.nii.gz** M-CRIB_labels_FreeSurfer_format.txt M-CRIB_labels_FreeSurfer_format_default.txt ID_seg_mrtrix.nii.gz
thank you
Rosella
Hi,
That files are provided with the mcrib atlas, are the manually segmented images.
Best regards,
Manuel
Ok. So you mean the hard_segmentations files within MCRIB atlas?
And the first step would be use labelconvert
like this?
labelconvert ID_seg.nii.gz M-CRIB_labels_FreeSurfer_format.txt M-CRIB_labels_FreeSurfer_format_default.txt ID_seg_mrtrix.nii.gz
where ID_seg.nii.gz is replaced by M-CRIB_hardseg_*.nii.gz ?
thank you as always
Rosella
Hi,
Yes, you can find it here OSF | Original M-CRIB neonatal brain atlas manual parcellations
Best regards,
Manuel
Hi,
I would run the label convert at the end. The antsJointfusion should be executed first, adding as an output the probability labels. Then you combine the probability labels you need to obtain the 5TT file and after that in the hard labels you run labelconvert.
Best regards,
Manuel
ok thank you . In the command below,
-
${BASENAME}_T1w_restore_brain.nii.gz is my subject’s skull stripped T1
-
${BASENAME}_brainmask_drawem.nii.gz is its corresponding mask
-
${BASENAME}_P01_hist.nii.gz is obtained from
mrhistmatch
command -
P01_seg_mrtrix.nii.gz is the manually segmented labels from MCRIB atlas for each of the 10 subjects
antsJointLabelFusion.sh -d 3 -t ${BASENAME}_T1w_restore_brain.nii.gz -x ${BASENAME}_brainmask_drawem.nii.gz -o ${BASENAME}_MCRIB_Structural_ -q 0 -g ${BASENAME}_P01_hist.nii.gz -l P01_seg_mrtrix.nii.gz -g ${BASENAME}_P02_hist.nii.gz -l P02_seg_mrtrix.nii.gz -g ${BASENAME}_P03_hist.nii.gz -l P03_seg_mrtrix.nii.gz -g ${BASENAME}_P04_hist.nii.gz -l P04_seg_mrtrix.nii.gz -g ${BASENAME}_P05_hist.nii.gz -l P05_seg_mrtrix.nii.gz -g ${BASENAME}_P06_hist.nii.gz -l P06_seg_mrtrix.nii.gz -g ${BASENAME}_P07_hist.nii.gz -l P07_seg_mrtrix.nii.gz -g ${BASENAME}_P08_hist.nii.gz -l P08_seg_mrtrix.nii.gz -g ${BASENAME}_P09_hist.nii.gz -l P09_seg_mrtrix.nii.gz -g ${BASENAME}_P10_hist.nii.gz -l P10_seg_mrtrix.nii.gz
Is this first command applied correctly?
I never use 5ttgen for this cohort (I never made it work properly), instead I use specific neonatal segmentation algorithm, the dHCP pipeline for example. You can see the results I obtain here.
I’m sure you’d make a number of people happy by taking those instructions, implementing them in a Python script, and contributing it as a novel 5ttgen
algorithm
Finally, I didn’t understand completely how to use
labelconvert
command:
See documentation page here. It’s a matter of manually defining a file that contains only those nodes of the parcellation that you wish to retain.
Hi @rsmith,
I’ll be happy to try it, is there any place I can read how to create a 5tt algorithm?
Best regards,
Manuel
is there any place I can read how to create a 5tt algorithm?
No; I’ve intended to do this for some time. I did recently have @rmito document the process of contributing a new Python script to MRtrix3 for the sake of a presentation, and I’d like to generate some more public documentation based on that experience. The software engineering side of things (i.e. not the novel content but the mechanisms of contributing such) is described here.
Contributing to scripts that use the algorithm
module (currently 5ttgen
, dwi2response
, dwibiascorrect
, dwinormalise
) is slightly different to adding a new standalone script.
If you:
- Generate a copy of an existing functioning script in e.g.
lib/mrtrix3/_5ttgen/
and give it an appropriate name; - Edit this line so that the name of the parser matches the name of the new file from step 1
, then 5ttgen
should present this “new” entry as an algorithm that can be selected and executed from the command-line. From there it’s a matter of modifying the code relating to the command-line interface and the internal execution of commands in order to make the script manifest the behaviour you want. But starting from something that already works, and making small changes and seeing their influence, is always a good entry point.
Rob
Thanks Robert! I’ll start with this.
I’ll get back to you once I have something functional.
Best regards,
Manuel
Hi @rsmith,
I have a version of the algorithm that works. We are currently testing it in different populations and with different options. I’ll send you the code and the results as soon as we have the results so you can have a look.
Best regards,
Manuel
Hi @rsmith,
I sent you an email with the code and some results. Let me know what do you think.
Best regards,
Manuel