after running dmriprep, we met an topup error because we have odd number of slices, such as if we use fslinfo to take a look at our dwi data:
fslinfo /scratch/projects/hartleylab/crcns/data/mri/sub-6040/sub-6040/dwi/sub-6040_acq-103vols_dwi.nii.gz
data_type INT16
dim1 140
dim2 140
dim3 **81**
dim4 103
and based on the fmap of dwi only containing one volume:
fslinfo sub-6040_acq-dwi_dir-AP_epi.nii.gz
data_type INT16
dim1 140
dim2 140
dim3 **81**
dim4 **1**
therefore, we decide to
(1) copy the original data, including dmri, fmri, fmap and anat to another folder
(2) create a oneZslice.nii.gz from dwi AP fmap with fslroi (which don't need to be splitted by split the slice into separate 3D volumes) since fmap only has one volume
(3) pad the AP and PA fmap with 1 slice (oneZslice.nii.gz) with fslmerge
(4) create a 103-timeseries (vol0000.nii.gz) out of the oneZslice.nii.gz with fslmerge
(5) pad the dwi data with vol0000.nii.gz so the slice number is even
(6) call dmriprep with a sbatch code
(7) after dmriprep is done, remove the added slice of fmap and dwi, and proceed with the later analysis
I wrote a bash file, and we could directly trigger all the steps by
go to /scratch/projects/hartleylab/crcns/preproc/dmriprep and then do
sh get_ready4topup.sh 2896
note: the 2896 is SUBJ id