Hello,
I've been working on taking the outputs of the fmriprep BOLD preprocessing tool
(https://fmriprep.readthedocs.io/en/latest/index.html) and coercing them into
the fsfast structure so that first levels can be run with mkanalysis-sess and
selxavg3b-sess. It's been a bit trickier than anticipated and I was hoping to
get some help verifying my current approach (attached to this email).
Question 1:
fmriprep outputs the preprocessed BOLD data in the T1 space (mni305 is not an
option). However, the typical spatial normalization workflow uses a
registration matrix from the bold to T1 to transform to talairach. Is there a
way to do this transformation without having to specify a registration matrix
given the functional data is already in the T1 space? My current approach is to
use mri_convert with the --apply_transform flag pointing to the talairach.xfm
registration matrix in the subject's recon folder, but I am not sure if this is
a reasonable workaround.
Question 2:
fsfast normally calculates the global mean value of the raw data to be used for
intensity normalization. However, with fmriprep I only have access to the
preprocessed data in T1 space. Would extracting the global mean value for
intensity normalization from the preprocessed BOLD in T1 space be valid?
Question 3:
Is there a way to do first levels in the native subcortical space? If so, what
is the filename structure expected (maybe mni305.2mm gets replaced with the
subject name as with the surface data)? I've only seen examples transforming to
mni305 space, but ideally an option would be to just transfer the preprocessed
BOLD in T1 space and run first levels staying in the native T1 space.
Thanks for your help!
Matt
subject=sub-hc001
fsd=msit
fmriprep_path=$subject/func
fsfast_path=fsfast
fmp_stem=${subject}_task-${fsd}_bold
# smoothing
fwhm=4
tr=1.75
# make the fsfast hierarchy
mkdir $fsfast_path/$subject
echo $subject > $fsfast_path/$subject/subjectname
mkdir $fsfast_path/$subject/$fsd
mkdir $fsfast_path/$subject/$fsd/001
fsfast_path=$fsfast_path/$subject/$fsd/001
mkdir $fsfast_path/masks
# extract the global mean value
mri_binarize --i $fmriprep_path/${fmp_stem}_space-T1w_brainmask.nii.gz \
--o $fsfast_path/masks/brain.e3.nii.gz --min 0.5 --zero-edges
--erode 3
meanval --i $fmriprep_path/${fmp_stem}_space-T1w_brainmask.nii.gz \
--m $fsfast_path/masks/brain.e3.nii.gz --o
$fsfast_path/global.meanval.dat --avgwf $fsfast_path/global.waveform.dat
declare -a hemis=("l" "r")
for hemi in "${hemis[@]}"
do
uphemi=$(echo $hemi| awk '{print toupper($0)}')
# convert fsnative surface files
mri_surf2surf --srcsubject $subject --trgsubject $subject \
--sval
$fmriprep_path/${fmp_stem}_space-fsnative.${uphemi}.func.gii \
--tval $fsfast_path/fmcpr.sm${fwhm}.${subject}.${hemi}h.nii.gz
\
--fwhm-trg $fwhm --hemi ${hemi}h
mri_convert $fsfast_path/fmcpr.sm${fwhm}.${subject}.${hemi}h.nii.gz
$fsfast_path/fmcpr.sm${fwhm}.${subject}.${hemi}h.nii.gz -tr $tr
# convert fsaverage surface files
mri_surf2surf --srcsubject fsaverage --trgsubject fsaverage \
--sval
$fmriprep_path/${fmp_stem}_space-fsaverage.${uphemi}.func.gii \
--tval $fsfast_path/fmcpr.sm${fwhm}.fsaverage.${hemi}h.nii.gz \
--fwhm-trg $fwhm --hemi ${hemi}h
mri_convert $fsfast_path/fmcpr.sm${fwhm}.fsaverage.${hemi}h.nii.gz
$fsfast_path/fmcpr.sm${fwhm}.fsaverage.${hemi}h.nii.gz -tr $tr
done
# convert mni305
mri_convert -at $SUBJECTS_DIR/$subject/mri/transforms/talairach.xfm -tr $tr
--fwhm $fwhm \
$fmriprep_path/${fmp_stem}_space-T1w_preproc.nii.gz \
$fsfast_path/fmcpr.sm${fwhm}.mni305.2mm.nii.gz
# convert native volume
mri_convert -tr $tr --fwhm $fwhm
$fmriprep_path/${fmp_stem}_space-T1w_preproc.nii.gz \
$fsfast_path/fmcpr.sm${fwhm}.sub-hc001.nii.gz
_______________________________________________
Freesurfer mailing list
[email protected]
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.