5ttgen hsvs template option

Dear experts,

I am upgrading my current connectome pipeline based on mrtrix’s newer release, thereby taking advantage of 5ttgen’s newer algorithm hsvs. Currently I am using fsl algorithm as follow:
5ttgen fsl freesurfer_brainmask.mgz 5TT.mif -premasked -nocrop -nthreads 35.

5ttgen hsvs provides an option to use a template image **-template** Provide an image that will form the template for the generated 5TT image. May you please explain a bit more about this option and advice what image should we use, apologizes in advance as I could not find more details about it anywhere in the doc? Currently, my DWI is registered to freesurfer space (yes memory overload, although I have changed my strides for continuous memory storage early on in my pre-processing steps), so I would expect my template to be in freesurfer space too right?

Thank you,
Sneha

Hi Sneha,

May you please explain a bit more about this option and advice what image should we use

The primary use of 5ttgen hsvs's -template option is to generate the 5TT image at a different spatial resolution to that of the FreeSurfer 1mm voxel grid. E.g. I’ve shown 5TT images at 0.5mm using this script. This could theoretically give more precise results in cases where different estimated surfaces are within a mm of one another, but I’ve not thoroughly evaluated the effect of such on tracking execution speed. I decided to provide this capability via the -template option rather than just setting the voxel size as it is a more general solution, e.g. this way one can define a template image where the axis orientations are different.

Currently, my DWI is registered to freesurfer space (yes memory overload, although I have changed my strides for continuous memory storage early on in my pre-processing steps), so I would expect my template to be in freesurfer space too right?

  1. Sorry to be draconian on language, but I presume that you mean that your DWI data have been re-gridded to FreeSurfer space? It’s possible to register DWI to T1, and transform DWI data to spatially overlap with the T1 image, without ever re-gridding / re-sampling the image data onto the higher-resolution voxel grid?

    We should write a Wiki entry on the differences between registration / transformation / re-gridding…

  2. 5ttgen is wholly agnostic of the DWI data and therefore can’t be based on the voxel grid of such. In the absence of the -template option, the output image is based on image aparc+aseg.mgz.

Rob

1 Like

The primary use of 5ttgen hsvs's -template option is to generate the 5TT image at a different spatial resolution to that of the FreeSurfer 1mm voxel grid.

Is this similar to what mrgrid achieves?

Sorry to be draconian on language, but I presume that you mean that your DWI data have been re-gridded to FreeSurfer space? It’s possible to register DWI to T1, and transform DWI data to spatially overlap with the T1 image, without ever re-gridding / re-sampling the image data onto the higher-resolution voxel grid?

While preprocessing DWI data I have used epi_reg outside of mrtrix for fieldmap correction (reason being that some of our data only have gradient field maps as phase/magnitude pair). In my understanding epi_reg does both transformation and resampling onto higher resolution freesurfer T1 image which I have used as a reference image, but please correct me if I am wrong. I had to tend to epi_reg given the limitation of our dataset for EPI distortion correction. I believe resampling it back to lower-resolution might involve add-on interpolation which would be better off avoided, but open to better solutions.

We should write a Wiki entry on the differences between registration / transformation / re-gridding…

I bet we do :grimacing:

5ttgen is wholly agnostic of the DWI data and therefore can’t be based on the voxel grid of such. In the absence of the -template option, the output image is based on image aparc+aseg.mgz .

Perfect, this is good to know as I was not able to find its default

Another related question I have is if 5ttgen hsvs can be used when we are using samseg routine instead of recon-all -all option?

Is this similar to what mrgrid achieves?

No. mrgrid would take image data stored on one voxel grid, and resample it onto a different voxel grid. Where the target voxel grid is of higher spatial resolution than the input, the result will be “blurry”. With 5ttgen hsvs, anything with a surface-based representation (whether native or intermediate) can be mapped to a partial volume image on any target voxel grid. So even if the target voxel grid is of absurdly high spatial resolution, the partial volume image will still be exceptionally sharp, reflecting the infinitessimally thin nature of the surface-based representation.

While preprocessing DWI data I have used epi_reg outside of mrtrix for fieldmap correction (reason being that some of our data only have gradient field maps as phase/magnitude pair). In my understanding epi_reg does both transformation and resampling onto higher resolution freesurfer T1 image which I have used as a reference image, but please correct me if I am wrong. I had to tend to epi_reg given the limitation of our dataset for EPI distortion correction. I believe resampling it back to lower-resolution might involve add-on interpolation which would be better off avoided, but open to better solutions.

While I head of epi_reg regularly I’m not familiar with its operation. If this is the case it’s probably more justification to finally get around to supporting field maps in dwifslpreproc; it just keeps getting bumped down the priority list because I don’t have any such data myself, so if anyone feels like getting their hands dirty with some Python please do…

Another related question I have is if 5ttgen hsvs can be used when we are using samseg routine instead of recon-all -all option?

If it doesn’t overwrite the standard FreeSurfer output files but instead creates its own with different names, then no, hsvs won’t identify them. I’d not heard of it until now, so I’d need to see what it produces and whether or not it can be used.

Hi Rob,

Thank you so much for your input.

If it doesn’t overwrite the standard FreeSurfer output files but instead creates its own with different names, then no, hsvs won’t identify them. I’d not heard of it until now, so I’d need to see what it produces and whether or not it can be used.

For now it does follow an independent but similar output files. It creates a separate output folder named samseg and saves all files created by this routine under it in addition to standard mri folder. I do have couple of subjects that I ran with this routine and can try running it and see if it proceeds without any error. It is packaged with their newer release and we tried it for its faster run time. Per their release notes:
“Sequence Adaptive Multimodal Segmentation (SAMSEG). This is a new tool that provides whole-head segmentation (like the aseg in the recon-all stream). It can operate on any modality or combination of modalities. It can run in cross-sectional and longitudinal modes. SAMSEG also has an advanced white matter lesion segmentation (cross-sectional only). The cross-sectional segmentation runs in about 45min single threaded.”

Thank you,
Sneha