pBFSLab / DeepPrep

DeepPrep: An accelerated, scalable, and robust pipeline for neuroimaging preprocessing empowered by deep learning
https://deepprep.readthedocs.io
Apache License 2.0
18 stars 6 forks source link

One frame of bold data deleted from projecting from t1w space to MNI #118

Closed xingyu-liu closed 2 months ago

xingyu-liu commented 2 months ago

Hi I came across a wired thing when running bold preprocessing, the bold preprocessing dropped one frame (from 601 to 600 frames) while projecting from t1w space to MNI. And it happened for every run from every session.

raw data

fslinfo sub-03_ses-rest_task-rest_run-1_bold.nii.gz

data_type INT16 dim1 84 dim2 84 dim3 48 dim4 601 datatype 4 pixdim1 2.476191 pixdim2 2.476191 pixdim3 3.000000 pixdim4 1.000000 cal_max 0.000000 cal_min 0.000000 file_type NIFTI-1+`

T1w space

fslinfo sub-03_ses-rest_task-rest_run-1_space-T1w_desc-preproc_bold.nii.gz

data_type FLOAT32 dim1 62 dim2 69 dim3 50 dim4 601 datatype 16 pixdim1 2.476000 pixdim2 2.476000 pixdim3 3.000000 pixdim4 1.000000 cal_max 0.000000 cal_min 0.000000 file_type NIFTI-1+

MNI space

fslinfo sub-03_ses-rest_task-rest_run-1_space-MNI152NLin2009cAsym_res-2_desc-preproc_bold.nii.gz

data_type FLOAT32 dim1 97 dim2 115 dim3 97 dim4 600 datatype 16 pixdim1 2.000000 pixdim2 2.000000 pixdim3 2.000000 pixdim4 1.000000 cal_max 0.000000 cal_min 0.000000 file_type NIFTI-1+

I was using ninganme/deepprep:23.1.0 and running nextflow run /opt/DeepPrep/deepprep/nextflow/deepprep.nf -c /output/MDTB_deepprep/WorkDir/nextflow/run.config -w /output/MDTB_deepprep/WorkDir/nextflow -with-report /output/MDTB_deepprep/QC/report.html -with-timeline /output/MDTB_deepprep/QC/timeline.html --bids_dir /data --output_dir /output/MDTB_deepprep --fs_license_file /output/freesurfer_license.txt --bold_only --bold_surface_space --bold_volume_space MNI152NLin2009cAsym --bold_volume_res 02 --bold_task_type rest

and an example summary report of bold preproc is below

Original orientation: LAS Repetition time (TR): 1s Phase-encoding (PE) direction: Anterior-Posterior Single-echo EPI sequence. Slice timing correction: Applied Susceptibility distortion correction: FMB (fieldmap-based) - phase-difference map Registration: FreeSurfer bbregister (boundary-based registration, BBR) - 6 dof Non-steady-state volumes: 0

Any idea on this? I've also tested fmriprep, their ouptut has the correct number of frames.

Thanks! Xingyu

lincong8722 commented 2 months ago

Hi! @xingyu-liu,

I just tested two data to run the bold_only type of data and there was no missing frame number. I looked at the command you used, among which -c /output/MDTB_deepprep/WorkDir/nextflow/run.config -w / output/MDTB_deepprep/WorkDir/nextflow -with-report /output/MDTB_deepprep/QC/report.html -with-timeline /output/MDTB_deepprep/QC/timeline.html,These do not need to be filled in. The /opt/DeepPrep/deepprep/nextflow/deepprep.nfcommand you should be followed by bids_dir,output_dir,participant; Maybe you can try it again using the deepprep command I tested: nextflow run /opt/DeepPrep/deepprep/nextflow/deepprep.nf /data /output/MDTB_deepprep participant --bold_task_type rest --fs_license_file /output/freesurfer_license.txt --bold_only --bold_volume_space MNI152NLin2009cAsym --resume

If you still have any questions, please contact me in time!

xingyu-liu commented 2 months ago

Thanks for the quick response! The nextflow command was what I copied from the log file. The command I was actually running is docker run -it --rm --gpus all \ -v ${output_root}:/output \ -v ${data_dir}:/data \ ninganme/deepprep:23.1.0 \ /data /output/${dataset}_deepprep participant \ --fs_license_file ${fs_license_f} \ --bold_only \ --bold_surface_space '' \ --bold_volume_space MNI152NLin2009cAsym \ --bold_volume_res 02 \ --bold_task_type 'a'

I did run deepprep for several datasets, all of them were fine except for this particular dataset (https://openneuro.org/datasets/ds002105/versions/1.1.0), and the number of frame was correct until projecting to MNI template, which is kind of weird.

lincong8722 commented 2 months ago

Thank you for finding a bug for us! @xingyu-liu

At present, the bug has been solved. Please pull the latest code of deepprep, or pull the latest docker (pbfslab/deepprep:23.1.9) of deepprep for testing. Additionally, the latest code updates confounds to be consistent with fMRIPrep.

If you have any questions, please communicate with us in time~

xingyu-liu commented 2 months ago

Hi!太感谢你们开发deepprep了,实在很好用。不好意思总要提出需求麻烦你们,还另有一些小点不知道是否方便添加一下微信交流一下(我的号码是:duanchiheihei)。如果不方便也没有关系的,忽略就好啦。谢谢!