Skip to content

dwifslpreproc

Jared Tanner edited this page Mar 9, 2023 · 22 revisions

These commands depended on the scanner/sequence. The Philips PA sequence required the mrgrid (reslicing to match geometry) command. The Prisma scans did not require this step.

All b values = 100 were manually changed in the bval files to 101. EDDY has problems with b=100. It's possible 100.01 might work but that has not been verified. Alternatively, the b=100 shells could be removed. The commands below are an example run for one participant's data at one time point.

This processing was tested most recently on a machine with an nvidia GPU running CUDA 12.0 and FSL 6.0.6.2. The eddy_cuda10.2 binaries called by the dwifslpreproc script successfully ran.

mrconvert COLON02_POST_dwi.nii.gz -fslgrad COLON02_POST_dwi.bvec COLON02_POST_dwi.bval dwi.mif

dwidenoise dwi.mif dwi_den.mif -noise noise.mif

dwiextract dwi_den.mif - -bzero | mrmath - mean mean_b0_AP.mif -axis 3

fslroi COLON02_POST_dwi_PA.nii.gz dwi_b0_PA.nii.gz 0 1

mrconvert dwi_b0_PA.nii.gz -fslgrad dwi_b0_PA.bvec dwi_b0_PA.bval dwi_b0_PA.mif #dwi_b0_PA.bvec and .bval files were copies of the dwi bvec and bvals that were edited to just include 0 0 0 and 0, respectively (with the bvec file having one column of three 0 values and not one row).

mrgrid dwi_b0_PA.mif regrid -template mean_b0_AP.mif b0_PA_resampled.mif #only necessary if the dimensions don't match exactly. Not an issue with our Siemens data.

mrcat mean_b0_AP.mif b0_PA_resampled.mif -axis 3 b0_pair.mif

dwifslpreproc dwi_den.mif dwi_den_preproc.mif -nocleanup -pe_dir AP -rpe_pair -se_epi b0_pair.mif -eddy_options " --slm=linear --data_is_shelled" #--slm=linear might be needed when fewer than 60 directions. Our data have more than that but each shell has fewer than 60 directions so I kept this command in. I'm not sure what difference it makes not having it.

dwibiascorrect ants dwi_den_preproc.mif dwi_den_preproc_unbiased.mif -bias bias.mif

dwi2mask dwi_den_preproc_unbiased.mif mask.mif

mrview dwi_den_preproc_unbiased.mif

mrconvert dwi_den_preproc_unbiased.mif dwi_den_preproc_unbiased.nii.gz -export_grad_fsl dwi_den_preproc_unbiased.bvec dwi_den_preproc_unbiased.bval

Running this on the cluster requires additional steps

To run in an interactive session (not necessarily recommended but done for testing)

srun -p gpu --nodes=1 --gpus=a100:1 --time=05:00:00 --mem=6gb --pty -u bash -i #This requests one of the A100 GPUs with 6GB RAM for 5 hours

module load fsl/6.0.6 mrtrix cuda #to run everything above we need ants module load cuda gcc/5.2.0 ants fsl/6.0.6 mrtrix but check to make sure this loads correctly

Running this from a SLURM script would include the following in the header

#SBATCH --partition=gpu

#SBATCH --gpus=a100:1