Segmentation (compartment) files in functional space/resolution for/after fmriprep

Dear fmriprep developers,

After running fmriprep with default settings, the segmentation compartment files seem to be only available in the subject’s native space.

However, we would like to use these compartments to extract (compartment-average) time course signals for further analysis and data clean-up.

Hence my request: (1) would you know, off the top of your head, what the syntax is to apply the necessary (.h5) transformation files to the segmentation output to be written in the MNI functional space/resolution, and (2) would this be a reasonable feature request (maybe as an optional flag for fmriprep) to have these files written by the pipeline?

Below is a copy of an email one of my colleagues wrote to me, which contains the list of files he has available (for one subject).

Thanks so much for your support!!

Cheers,
/jochen

%% forwarded email content:

Hi Jochen,

Here are the func files. same list of files per task. that includes the segmentation and parcellation files, which might be the same for every single run.

sub-drisc20_task-demContMov_run-1_bold_confounds.tsv
sub-drisc20_task-demContMov_run-1_bold_space-fsaverage5.L.func.gii
sub-drisc20_task-demContMov_run-1_bold_space-fsaverage5.R.func.gii
sub-drisc20_task-demContMov_run-1_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz
sub-drisc20_task-demContMov_run-1_bold_space-MNI152NLin2009cAsym_preproc.nii.gz
sub-drisc20_task-demContMov_run-1_bold_space-T1w_label-aparcaseg_roi.nii.gz
sub-drisc20_task-demContMov_run-1_bold_space-T1w_label-aseg_roi.nii.gz

Here is the list of anat files.

sub-drisc20_T1w_brainmask.nii.gz
sub-drisc20_T1w_inflated.R.surf.gii
sub-drisc20_T1w_pial.R.surf.gii
sub-drisc20_T1w_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz
sub-drisc20_T1w_target-fsnative_affine.txt
sub-drisc20_T1w_class-CSF_probtissue.nii.gz
sub-drisc20_T1w_label-aparcaseg_roi.nii.gz
sub-drisc20_T1w_preproc.nii.gz
sub-drisc20_T1w_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz
sub-drisc20_T1w_target-MNI152NLin2009cAsym_warp.h5
sub-drisc20_T1w_class-GM_probtissue.nii.gz
sub-drisc20_T1w_label-aseg_roi.nii.gz
sub-drisc20_T1w_smoothwm.L.surf.gii
sub-drisc20_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz
sub-drisc20_T1w_class-WM_probtissue.nii.gz
sub-drisc20_T1w_midthickness.L.surf.gii
sub-drisc20_T1w_smoothwm.R.surf.gii
sub-drisc20_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz
sub-drisc20_T1w_dtissue.nii.gz
sub-drisc20_T1w_midthickness.R.surf.gii
sub-drisc20_T1w_space-MNI152NLin2009cAsym_brainmask.nii.gz
sub-drisc20_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5
sub-drisc20_T1w_inflated.L.surf.gii
sub-drisc20_T1w_pial.L.surf.gii

I suspect that the aseg and aparcaseg files are from the anatomical and are resliced to the funcional voxel space. it probably gives it per run to complete a set that has the same naming convention even though they are the same and are based on anatomical rather than functional. I think that the functional “native space” is the space of the anatomical and all the functional runs are coregistered to it.

It will be very helpful to have those files in the MNI space…

Quick question - what output spaces did you specify? Or in other words do you see sub-drisc20_task-demContMov_run-1_bold_space-T1w_preproc.nii.gz in your outputs?

Did not specify space. So outputs are in the default MNI space and deafult FS space. The provided list of files under func is the full list. So no space-T1w output was produced.

I don’t, but you should look into antsApplyTransforms command. the h5 file should be all that you need. You can use the sub-drisc20_task-demContMov_run-1_bold_space-MNI152NLin2009cAsym_preproc.nii.gz as a reference.

I opened an issue: https://github.com/poldracklab/fmriprep/issues/1290. This could be a great way to get into the project - would you like to try to implement this?