nipreps / fmriprep

fMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse fMRI data. The transparent workflow dispenses of manual intervention, thereby ensuring the reproducibility of the results.
https://fmriprep.org
Apache License 2.0
635 stars 293 forks source link

msm options no longer work in FSL 6.0.7.11 #3303

Closed CogBrainHealthLab closed 4 months ago

CogBrainHealthLab commented 4 months ago

What happened?

the fmriprep run on a single subject completed with an error specific to the FSL msm command. I realized that the configuration parameters used in site-packages/smriprep/data/msm/MSMSulcStrainFinalconf no longer work when FSL 6.0.7.11 is installed. More specifically, the following msm configuration options no longer exist

--regoption=3 --dopt=HOCR --triclique --k_exponent=2 --bulkmod=1.6 --shearmod=0.4

I understand that i am supposed to use FSL 6.0.6.2 instead of FSL 6.0.7.11, but the latest version was installed in my HPC cluster, so i have to make do with it.

so would you suggest i comment out these options, or simply run fmriprep with --no-msm?

What command did you use?

fmriprep BIDS output participant --skip_bids_validation --output-spaces MNI152NLin6Asym --participant-label $d --nthreads 8

What version of fMRIPrep are you running?

23.2.3

How are you running fMRIPrep?

Local installation ("bare-metal")

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

FreeSurfer

Please copy and paste any relevant log output.

Cmdline:
        msm --conf=/home/junhong.yu/fmriprepenv2/lib64/python3.11/site-packages/smriprep/data/msm/MSMSulcStrainFinalconf --indata=/home/junhong.yu/syn/work/fmriprep_23_2_wf/sub_CISC13877_wf/anat_fit_wf/msm_sulc_wf/invert_sulc/mapflow/_invert_sulc0/sub-XYZ.L.sulc.native.shape.gii --inmesh=/home/junhong.yu/syn/work/fmriprep_23_2_wf/sub_CISC13877_wf/anat_fit_wf/msm_sulc_wf/modify_sphere/mapflow/_modify_sphere0/lh.sphere_converted_xformed.surf_mod.surf.gii --out=lh. --refdata=/home/junhong.yu/fmriprepenv2/lib64/python3.11/site-packages/smriprep/data/atlases/L.refsulc.164k_fs_LR.shape.gii --refmesh=/home/junhong.yu/fmriprepenv2/lib64/python3.11/site-packages/smriprep/data/atlases/fsaverage.L_LR.spherical_std.164k_fs_LR.surf.gii --verbose
Stdout:

Stderr:

        Part of FSL (ID: "")
        msm configuration parameters

        Usage:

        Optional arguments (You may optionally specify one or more of):
                --opt   optimisation method. Choice of: AFFINE,DISCRETE (default)
                --simval        code for determining which similarty measure is used to assess cost during registration: options are 1) SSD; 2) pearsons correlation (default); 3) NMI;)
                --it    number of iterations at each resolution (default -–it=3,3,3)
                --sigma_in      smoothing parameter for input image (default --sigma_in=2,2,2)
                --sigma_ref     Sigma parameter - smoothing parameter for reference image  (set equal to sigma_in by default)
                --lambda        Lambda parameter - controls contribution of regulariser
                --datagrid      DATA grid resolution (default --datagrid=5,5,5). If parameter = 0 then the native mesh is used.
                --CPgrid        Control point grid resolution (default --CPgrid=2,3,4)
                --SGgrid        Sampling grid resolution (default = 2 levels higher than the control point grid)
                --anatgrid      Anatomical grid resolution (default = 2 levels higher than the control point grid)
                --aKNN  Number of neighbours for estimation of kNN graph and alpha entropy measure (default --aKNN=5,5,5)
                --cutthr        Upper and lower thresholds for defining cut vertices (default --cutthr=0,0)
                --mInt  Method used for mesh interpolations, options: TPS or BARY (default)
                --dInt  Method used for data interpolations, options: GAUSSIAN or ADAP_BARY (default)
                --regexp        Regulariser exponent 'rexp' (default 2.0)
                --weight        weight regulariser cost using areal distortion weighting
                --anorm norm regulariser cost using mean angle (for HCP compatibility)
                --rescaleL      rescale label grid rather than using barycentres
                --log   log transform and normalise the data
                --IN    Normalize intensity ranges using histogram matching
                --INc   Normalize intensity ranges using histogram matching excluding cut
                --VN    Variance normalize data
                --scale Scale intensity ranges of a features in multivariate data to be equal to that of the first (useful for multimodal contrasts)
                --excl  Ignore the cut when resampling the data
                --stepsize      gradient stepping for affine optimisation (default 0.01)
                --gradsampling  Determines the finite distance spacing for the affine gradient calculation (default 0.5)
                --numthreads    number of threads for tbb (default 1)

        --dopt: Option doesn't exist!
Traceback:
        RuntimeError: subprocess exited with code 1.

Additional information / screenshots

No response

effigies commented 4 months ago

If you install a conda environment with conda env create -f env.yml, then a compatible version of FSL will get installed there. You can set the $FSLDIR environment variable to look there for its FSL tools.

$ conda env config vars set -n fmriprep FSLDIR=$(conda activate fmriprep && echo $CONDA_PREFIX)
effigies commented 4 months ago

Actually, MSM isn't distributed with FSL, so this is a different problem. You need to get MSM from https://github.com/ecr05/MSM_HOCR/releases/.

Here's what we do in Docker:

https://github.com/nipreps/fmriprep/blob/6c4cb04b22b2354f0df99cdcf7b1e3a21afcfaf7/Dockerfile#L254-L256

You could drop that into your fmriprep environment:

$ MSM=$(conda activate fmriprep && echo $CONDA_PREFIX)/bin
$ curl -L -H "Accept: application/octet-stream" https://api.github.com/repos/ecr05/MSM_HOCR/releases/assets/16253707 -o $MSM
$ chmod +x $MSM