nipreps / smriprep

Structural MRI PREProcessing (sMRIPrep) workflows for NIPreps (NeuroImaging PREProcessing tools)
https://nipreps.github.io/smriprep
Apache License 2.0
131 stars 39 forks source link

Write out fsnative surface files registered to fsLR space #447

Open tsalo opened 1 month ago

tsalo commented 1 month ago

Is your feature request related to a problem? Please describe.

My understanding is that the resulting surface files will have the same vertices and mesh as the standard-space (dhcpAsym or fsLR) surface, but will retain the subject's fsnative geometry. This way users can visualize standard-space surface maps on the subject's unique topology (sulci, gyri, etc.), as is recommended in Jeganathan et al. (preprint).

Describe the solution you'd like

sMRIPrep would output pial, white matter, midthickness, inflated, and very-inflated surface files with space-fsLR.

Describe alternatives you've considered

Currently, XCP-D performs this step, but I'm pretty sure the nipreps team and DCAN lab have discussed it and wanted to move it into sMRIPrep/fMRIPrep/Nibabies.

Additional context

This is a duplicate of https://github.com/nipreps/nibabies/issues/367.

tsalo commented 1 month ago

XCP-D's workflow includes the following steps:

  1. Split up the anatomical-to-template transform (any volumetric template is fine) from fMRIPrep into affine and warpfield components.
  2. Convert the affine transform into a world transform format.
  3. Convert the warpfield transform into FNIRT format. The same is done for the warpfield component of the template-to-anatomical transform as well.
  4. Convert the sphere.reg file to GIFTI format.
  5. Project the sphere_reg file to fsLR to get a sphere_reg_fsLR file.
  6. Resample the pial and white matter surfaces to fsLR-32k.
  7. Apply the world-format affine to the pial and white matter surfaces.
  8. Apply the FNIRT-format warpfield to the pial and white matter surfaces.
  9. Generate new midthickness, inflated, and very-inflated surfaces from the fsLR-space pial and white matter files.

I don't think steps 1-3 or 7-8 are necessary for sMRIPrep. My understanding is that XCP-D only does this so the surfaces can be overlaid on top of the volumetric anatomical outputs that have been warped to the chosen template. XCP-D should be able to do the same thing after the rest of the steps.

sMRIPrep already does steps 4 and 5, and it seems to apply step 6 only to the midthickness files in init_resample_midthickness_wf. I think we just need to make init_resample_midthickness_wf more general to apply the same step to the pial, white matter, inflated, and very-inflated files.