Summary of what happened:
Hi all! I have been having some issues running fMRIprep for a dataset of participants. I had issues using clpipe, so recently I turned to Python to run dcm2bids as a way to do a conversion. For most of our participant data, fMRIprep has worked fine, but for some, we are getting error messages that don’t seem to reflect errors with the data. When running BIDS validation, we get “BOLD scans need 4 dimensions” and “SliceTiming > RepetitionTiming” error messages. When running fMRIprep, we get the “tuple index out of range” error.
I have tried updating versions, editing the configuration file, and trying to split up dcm2niix and a Nifti to BIDS conversion to try to find the root of the issue but I haven’t had any luck figuring out what’s wrong.
Command used (and if a helper script was used, a link to the helper script or the command generated):
%matplotlib inline
import os
import glob
from tqdm import tqdm
import pandas as pd
import numpy as np
base_dir = '/proj/hng/keelylab/projects/npirs'
!pip install nltools
!pip install dcm2niix
!pip install dcm2bids
nifti_dir = os.path.join(base_dir,'niftis','NPIRS-111')
dicom2nifti = "/nas/longleaf/home/mktark/dcm2niix/build/bin/dcm2niix -z y"
!{dicom2nifti} {nifti_dir}
conv = os.path.join(base_dir, 'conversion_config.json')
bids_dir = os.path.join(base_dir, 'data_BIDS')
!dcm2bids -d {nifti_dir} -p 111 -c {conv} -o {bids_dir} --clobber --force_dcm2bids
Version:
fMRIprep v. 22.1.1 (the newer version wouldn’t run for any participant data) / dcm2bids v. 3.1.1 / dcm2niix v. 1.0.20230411
Environment (Docker, Singularity / Apptainer, custom installation):
pip install; clpipeData formatted according to a validatable standard? Please provide the output of the validator:
PASTE VALIDATOR OUTPUT HERE
Relevant log outputs (up to 20 lines):
INFO: Environment variable SINGULARITYENV_TEMPLATEFLOW_HOME is set, but APPTAINERENV_TEMPLATEFLOW_HOME is preferred
You are using fMRIPrep-22.1.1, and a newer version of fMRIPrep is available: 23.1.4.
Please check out our documentation about how and when to upgrade:
https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading
--topup-max-vols input is no longer used and the flag will be removed in a future release.
240116-08:52:36,557 nipype.workflow IMPORTANT:
Running fMRIPrep version 22.1.1
License NOTICE ##################################################
fMRIPrep 22.1.1
Copyright 2022 The NiPreps Developers.
This product includes software developed by
the NiPreps Community (https://nipreps.org/).
Portions of this software were developed at the Department of
Psychology at Stanford University, Stanford, CA, US.
This software redistributes the versioneer Python package, which is
Public domain source code.
This software is also distributed as a Docker container image.
The bootstraping file for the image ("Dockerfile") is licensed
under the MIT License.
This software may be distributed through an add-on package called
"Docker Wrapper" that is under the BSD 3-clause License.
#################################################################
240116-08:52:36,559 nipype.workflow WARNING:
Previous output generated by version 0+unknown found.
240116-08:52:48,210 nipype.workflow IMPORTANT:
Building fMRIPrep's workflow:
* BIDS dataset path: /proj/hng/keelylab/projects/npirs/data_BIDS.
* Participant list: ['112'].
* Run identifier: 20240116-085107_135568a3-84f3-46a4-b8a3-1d63eff9c853.
* Output spaces: MNI152NLin2009cAsym:res-native.
* Pre-run FreeSurfer's SUBJECTS_DIR: /proj/hng/keelylab/projects/npirs/data_fmriprep_downgrade/sourcedata/freesurfer.
240116-08:52:59,563 nipype.workflow INFO:
B0 field inhomogeneity map will be estimated with the following 27 estimators: [<EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>, <EstimatorType.PEPOLAR: 2>].
240116-08:53:00,459 nipype.workflow INFO:
No single-band-reference found for sub-112_task-impressions_bold.nii.gz.
240116-08:53:00,460 nipype.workflow CRITICAL:
None of the available B0 fieldmaps are associated to </proj/hng/keelylab/projects/npirs/data_BIDS/sub-112/func/sub-112_task-impressions_bold.nii.gz>
240116-08:53:00,821 nipype.workflow IMPORTANT:
BOLD series will be slice-timing corrected to an offset of 0.346s.
Process Process-2:
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
self.run()
File "/opt/conda/lib/python3.9/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/lib/python3.9/site-packages/fmriprep/cli/workflow.py", line 115, in build_workflow
retval["workflow"] = init_fmriprep_wf()
File "/opt/conda/lib/python3.9/site-packages/fmriprep/workflows/base.py", line 91, in init_fmriprep_wf
single_subject_wf = init_single_subject_wf(subject_id)
File "/opt/conda/lib/python3.9/site-packages/fmriprep/workflows/base.py", line 413, in init_single_subject_wf
func_preproc_wf = init_func_preproc_wf(bold_file, has_fieldmap=has_fieldmap)
File "/opt/conda/lib/python3.9/site-packages/fmriprep/workflows/bold/base.py", line 204, in init_func_preproc_wf
nvols = nb.load(bold_file[0] if isinstance(bold_file, (list, tuple)) else bold_file).shape[3]
IndexError: tuple index out of range