Skip to content
8 changes: 4 additions & 4 deletions lib/mrtrix3/_5ttgen/neonatal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

DHCP_CGM = list(range(5, 40))
DHCP_SGM = [17, 18]
DHCP_WM = [19] + range(40, 49) + range(51, 83) + range(85, 88)
DHCP_WM = [19] + list(range(40, 49)) + list(range(51, 83)) + list(range(85, 88))
DHCP_CSF = [49, 50, 83]
DHCP_AMYG_HIPP = list(range(1, 5))

MCRIB_CGM = list(range(1000, 1036) + range(2000, 2036))
MCRIB_CGM = list(range(1000, 1004)) + list(range(1005,1036)) + list(range(2000, 2004)) + list(range(2005,2036))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relates to my question RE: absent / duplicated indices. Looks like the elements I thought may have been accidentally omitted you intended to omit; but I have some recollection that there were additionally indices that were duplicated in your original code. This is the better way to do it, but I was partly curious whether or not you would spot the influence of those duplications in a change in output of the script.

(P.S. Given it looks like an unusual omission, it might be worth adding a code comment indicating the structures omitted and why)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

We have been working on this, these are the new changes:

  • Now the algorithms are called mcrib and dhcp.
  • The dHCP algorithm has been modified, now you just need to input the path of the derivates (/anat) folder and that's all, no mask required anymore. Note that there are some versions of the dHCP pipeline around with different names, I think now it covers all the possible cases.
  • In the dHCP algorithm we added a filter to ensure that the merging of the sGM doesn't overlap with the CSF.
  • A note has been added about the missing labels: the labels 1004 and 2004 don't exist in the original M-CRIB atlas.

As it is now, the dHCP algorithm is the same as in my original paper (with the addition of this CSF filter to ensure that the sGM doesn't enter in the CSF). Basically, it combines the tissue probability maps of the dHCP pipeline with the binary subcortical gray matter parcellations of the M-CRIB atlas. However, I've been thinking to modify it and add two possibilities: the use of the probability maps or not. This will translate in the addition of a new flag (-posteriors), that if specify it it will work as it does now, the only difference will be the use of tissue probability maps for the subcortical GM, in this way all the tissues will have the partial volumes. If not specify it, the algorithm will use only the binary segmentations for everything. I was thinking about this because probably a lot of the people that run the dHCP pipeline didn't use the -additional flag (for example in the dHCP data itself, this data is not there). What do you think? Does this make sense?

MCRIB_SGM = [9, 11, 12, 13, 26, 48, 50, 51, 52, 58]
MCRIB_WM = [2, 41, 75, 76, 90, 170, 192]
MCRIB_CSF = [4, 14, 15, 24, 43]
Expand Down Expand Up @@ -121,7 +121,7 @@ def execute(): #pylint: disable=unused-variable
+ ants_options)

run.command('antsJointFusion -d 3 -t input.nii --verbose 1 '
+ ' '.join('-g input_parcellation_template_hist_%02d_%d_Warped.nii.gz -l input_parcellation_template_hist_%02d_%d_WarpedLabels.nii.gz' % (i, i-1) for i in range(1, 11))
+ ' '.join('-g input_parcellation_template_hist_%02d_%d_Warped.nii.gz -l input_parcellation_template_hist_%02d_%d_WarpedLabels.nii.gz' % (i, i-1, i, i-1) for i in range(1, 11))
+ ' -o [input_parcellation_Labels.nii.gz,input_parcellation_Intensity.nii.gz,posterior%04d.nii.gz]')

if app.ARGS.dhcp_path:
Expand Down Expand Up @@ -152,7 +152,7 @@ def execute(): #pylint: disable=unused-variable
for tissue, indices in { 'cGM': MCRIB_CGM + ([] if app.ARGS.sgm_amyg_hipp else MCRIB_AMYG_HIPP),
'sGM': MCRIB_SGM + MCRIB_CEREBELLAR + (MCRIB_AMYG_HIPP if app.ARGS.sgm_amyg_hipp else []),
'WM' : MCRIB_WM,
'CSF': MCRIB_CSF }:
'CSF': MCRIB_CSF }.items():
run.command(['mrmath', ['posterior%04d.nii.gz' % i for i in indices], 'sum', tissue + '.mif'])

#Force normalization
Expand Down