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
634 stars 293 forks source link

fMRIPrep v23.2.0a1 cannot find my T1s "no attribute 'T1w_preproc'" #3189

Closed cmpetty closed 10 months ago

cmpetty commented 10 months ago

What happened?

I've run about 35 subjects from a different site through the 23.2.0a1 pipeline without issues, but the first subject from our site fails to find the T1w images regardless of the bids-filter-file

231219-10:42:18,443 nipype.workflow IMPORTANT:
         fMRIPrep started!
231219-10:42:19,440 nipype.workflow CRITICAL:
         fMRIPrep failed: 'DynamicTraitedSpec' object has no attribute 'T1w_preproc'

This subject's tree:

(myenv) [cmp12@blade25 code]$ tree ../sub-01667
../sub-01667
└── ses-01
    ├── anat
    │   ├── sub-01667_ses-01_T1w.json
    │   ├── sub-01667_ses-01_T1w.nii
    │   ├── sub-01667_ses-01_T2w.json
    │   └── sub-01667_ses-01_T2w.nii
    ├── fmap
    │   ├── sub-01667_ses-01_dir-AP_epi.json
    │   ├── sub-01667_ses-01_dir-AP_epi.nii
    │   ├── sub-01667_ses-01_dir-PA_epi.json
    │   └── sub-01667_ses-01_dir-PA_epi.nii
    ├── func
    │   ├── sub-01667_ses-01_task-rest_bold.json
    │   └── sub-01667_ses-01_task-rest_bold.nii
    └── perf
        ├── sub-01667_ses-01_asla.json
        ├── sub-01667_ses-01_asla.nii
        ├── sub-01667_ses-01_asl.json
        ├── sub-01667_ses-01_asl.nii
        ├── sub-01667_ses-01_cbf.json
        └── sub-01667_ses-01_cbf.nii

5 directories, 16 files

My bids filter file:

{
    "t1w": {
        "datatype": "anat",
        "suffix": "T1w",
        "session": "01"
    },
    "t2w": {
        "datatype": "anat",
        "suffix": "T2w",
        "session": "01"
    },
    "bold": {
        "datatype": "func",
        "session": "01",
        "suffix": "bold"
    },
    "fmap": {
        "datatype": "fmap",
        "session": "01"
    }
}

My execution of fmriprep via singularity. Removing the filter file didn't matter:

singularity run --cleanenv -B $PACKDIR:/mnt/packages -B ${SINGULARITYENV_TEMPLATEFLOW_HOME}:/opt/templateflow \
 ${PACKDIR}/singularity/images/fmriprep-v23.2.1.sif \
 ${EXPERIMENT}/BIDS \
 ${EXPERIMENT}/BIDS/derivatives/fmriprep \
 participant --participant-label ${SUBJ} \
 --nthreads 12 --omp-nthreads 12 --skip_bids_validation \
 --work-dir ${EXPERIMENT}/work \
 --fs-subjects-dir  ${EXPERIMENT}/BIDS/derivatives/fs-ses-${SESS} \
 --bids-filter-file ${EXPERIMENT}/BIDS/code/bids_filter_ses-${SESS}.json \

My query of pybids layout outside of fmriprep works without issue:

In [14]: layout.get(subject='01667',suffix='T1w',session='01',datatype="anat")
Out[14]:
[<BIDSJSONFile filename='/mnt/munin2/Hasan/NIA_SCORE.01/Analysis/BIDS/sub-01667/ses-01/anat/sub-01667_ses-01_T1w.json'>,
 <BIDSImageFile filename='/mnt/munin2/Hasan/NIA_SCORE.01/Analysis/BIDS/sub-01667/ses-01/anat/sub-01667_ses-01_T1w.nii'>]

I reverted back to a v23.0.1 singularity image and its running without issue, using all the above inputs, filters, BIDS, etc.

Diff between a processed subject's T1 metadata and this current one that is failing. Besides the site difference and a few scanner parameters, the only thing i can think of is the difference between dcm2bids versions.

(myenv) [cmp12@blade25 code]$ diff ../sub-01667/ses-01/anat/sub-01667_ses-01_T1w.json ../sub-0033/ses-01/anat/sub-0033_ses-01_T1w.json
4c4
<     "ImagingFrequency": 127.754886,
---
>     "ImagingFrequency": 127.753966,
6,9c6,9
<     "ManufacturersModelName": "SIGNA UHP",
<     "InstitutionName": "Duke University Hospital",
<     "DeviceSerialNumber": "0000000919684MR5",
<     "StationName": "bia5",
---
>     "ManufacturersModelName": "SIGNA Premier",
>     "InstitutionName": "Iowa MRRF",
>     "DeviceSerialNumber": "0000000319335MR2",
>     "StationName": "Iowa3T",
12,13c12,13
<     "ProcedureStepDescription": "nia_score.01",
<     "SoftwareVersions": "28\\LX\\MR Software release:RX28.0_R04_UHP3T_2122.a",
---
>     "ProcedureStepDescription": "DH_COICA",
>     "SoftwareVersions": "28\\LX\\MR Software release:RX28.0_R05_2035.a",
27c27
<     "AcquisitionTime": "11:12:55.000000",
---
>     "AcquisitionTime": "11:10:19.000000",
31,33c31,33
<     "SAR": 0.0821994,
<     "EchoTime": 0.0039,
<     "RepetitionTime": 2.41505,
---
>     "SAR": 0.0679135,
>     "EchoTime": 0.003624,
>     "RepetitionTime": 2.38357,
37,39c37,39
<         -4,
<         -28,
<         -132
---
>         36,
>         -11,
>         -199
41c41
<     "PrescanReuseString": "RN/s1,Coil/s1",
---
>     "PrescanReuseString": "TG/s1,CF/s1,AS/s1,RN/s1,Coil/s1",
61c61
**<     "Dcm2bidsVersion": "3.1.1"**
---
>     "Dcm2bidsVersion": "2.1.7"
` ``

### What command did you use?

```shell
231219-10:41:32,341 nipype.workflow IMPORTANT:
         Running fMRIPrep version 23.2.0a1

         License NOTICE ##################################################
         fMRIPrep 23.2.0a1
         Copyright 2023 The NiPreps Developers.

What version of fMRIPrep are you running?

23.2.0a1

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

No response

Additional information / screenshots

231219-10:41:37,206 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
231219-10:41:37,229 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
231219-10:41:37,239 nipype.workflow INFO:
         ANAT Stage 8a: Creating cortical ribbon mask
231219-10:41:37,244 nipype.workflow INFO:
         ANAT Stage 9: Creating fsLR registration sphere
231219-10:41:37,250 nipype.workflow INFO:
         ANAT Stage 10: Creating MSM-Sulc registration sphere
231219-10:41:42,560 nipype.workflow INFO:
         B0 field inhomogeneity map will be estimated with the following 1 estimator(s): [<EstimatorType.PEPOLAR: 2>].
231219-10:41:43,104 nipype.workflow INFO:
         Setting-up fieldmap "pepolar1" (EstimatorType.PEPOLAR) with <sub-01667_ses-01_dir-AP_epi.nii, sub-01667_ses-01_dir-PA_epi.nii>
231219-10:41:48,183 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
231219-10:41:48,192 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
231219-10:41:48,203 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
231219-10:41:48,318 nipype.workflow IMPORTANT:
         BOLD series will be slice-timing corrected to an offset of 0.326s.
231219-10:41:57,20 nipype.workflow INFO:
         fMRIPrep workflow graph with 484 nodes built successfully.
231219-10:42:18,443 nipype.workflow IMPORTANT:
         fMRIPrep started!
231219-10:42:19,440 nipype.workflow CRITICAL:
         fMRIPrep failed: 'DynamicTraitedSpec' object has no attribute 'T1w_preproc'
mgxd commented 10 months ago

This has been fixed, please try 23.2.0a3 - thank you for piloting the alpha!

cmpetty commented 10 months ago

will do, thanks.