Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDC is not working on multiple files only #3354

Closed
sognoe opened this issue Aug 27, 2024 · 1 comment
Closed

SDC is not working on multiple files only #3354

sognoe opened this issue Aug 27, 2024 · 1 comment
Labels

Comments

@sognoe
Copy link

sognoe commented Aug 27, 2024

What happened?

Hi, experts

I got the fmriprep results ‘Susceptibility distortion correction: FMB (field map-based) - phase-difference map’ in case I analyzed just one fMRI file.
However, when analyzing three files in the same way, the following error appears:
KeyError: “‘phasediff_fmap0’ is already in mapping”

I don’t know if this config file is the correct way.
These fMRI fieldmap files were gained in Simens and had two magnitude files and one phasediff file.

Below is the explanation in part of the config file.
I put “B0FieldSource”: [“phasediff_fmap0”] in func(rest) section.
Also put “B0FieldIdentifier”: “phasediff_fmap0” in two magnitude sections and one phasediff section.

What command did you use?

fmriprep-docker d:\t15 d:\t15\derivatives --fs-license-file d:\freesurfer.txt

What version of fMRIPrep are you running?

fMRIPrep v24.0.1

How are you running fMRIPrep?

Docker

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

RUNNING: docker run --rm -e DOCKER_VERSION_8395080871=27.1.1 -it -v d:\freesurfer.txt:/opt/freesurfer/license.txt:ro -v d:\t15:/data:ro -v d:\t15\derivatives:/out nipreps/fmriprep:24.0.1 /data /out participant
[email protected]
(node:9) Warning: Closing directory handle on garbage collection
(Use `node --trace-warnings ...` to show where the warning was created)
        1: [WARN] The Authors field of dataset_description.json should contain an array of fields - with one author per field. This was triggered based on the presence of only one author field. Please ignore if all contributors are already properly listed. (code: 102 - TOO_FEW_AUTHORS)

        Please visit https://neurostars.org/search?q=TOO_FEW_AUTHORS for existing conversations about this issue.

        2: [WARN] The Name field of dataset_description.json is present but empty of visible characters. (code: 115 - EMPTY_DATASET_NAME)

        Please visit https://neurostars.org/search?q=EMPTY_DATASET_NAME for existing conversations about this issue.

        Summary:                  Available Tasks:        Available Modalities:
        41 Files, 415.49MB        rest                    MRI
        3 - Subjects
        1 - Session


        If you have any questions, please post on https://neurostars.org/tags/bids.
240824-16:21:18,689 nipype.workflow IMPORTANT:
         Running fMRIPrep version 24.0.1

         License NOTICE ##################################################
         fMRIPrep 24.0.1
         Copyright 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 is also distributed as a Docker container image.
         The bootstrapping 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.
         #################################################################
240824-16:21:18,708 nipype.workflow IMPORTANT:
         Building fMRIPrep's workflow:
           * BIDS dataset path: /data.
           * Participant list: ['y072', 'y073', 'y074'].
           * Run identifier: 20240824-162111_25609c1e-6e57-4ac0-8ab0-1760c929ab31.
           * Output spaces: MNI152NLin2009cAsym:res-native.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /out/sourcedata/freesurfer.
240824-16:21:19,47 nipype.workflow INFO:
         ANAT Stage 1: Adding template workflow
240824-16:21:19,250 nipype.workflow INFO:
         ANAT Stage 2: Preparing brain extraction workflow
240824-16:21:19,295 nipype.workflow INFO:
         ANAT Stage 3: Preparing segmentation workflow
240824-16:21:19,297 nipype.workflow INFO:
         ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
240824-16:21:19,301 nipype.workflow INFO:
         ANAT Stage 5: Preparing surface reconstruction workflow
240824-16:21:19,311 nipype.workflow INFO:
         ANAT Stage 6: Preparing mask refinement workflow
240824-16:21:19,313 nipype.workflow INFO:
         ANAT No T2w images provided - skipping Stage 7
240824-16:21:19,313 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
240824-16:21:19,321 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
240824-16:21:19,324 nipype.workflow INFO:
         ANAT Stage 8a: Creating cortical ribbon mask
240824-16:21:19,326 nipype.workflow INFO:
         ANAT Stage 9: Creating fsLR registration sphere
240824-16:21:19,328 nipype.workflow INFO:
         ANAT Stage 10: Creating MSM-Sulc registration sphere
240824-16:21:19,424 nipype.workflow INFO:
         B0 field inhomogeneity map will be estimated with the following 1 estimator(s): [<EstimatorType.PHASEDIFF: 3>].
240824-16:21:19,442 nipype.workflow INFO:
         Setting-up fieldmap "phasediff_fmap0" (EstimatorType.PHASEDIFF) with <sub-y072_ses-2_magnitude1.nii, sub-y072_ses-2_magnitude2.nii, sub-y072_ses-2_phasediff.nii>
240824-16:21:19,456 nipype.workflow INFO:
         No single-band-reference found for sub-y072_ses-2_task-rest_run-01_bold.nii.
240824-16:21:19,467 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
240824-16:21:19,470 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
240824-16:21:19,473 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
240824-16:21:19,501 nipype.workflow IMPORTANT:
         BOLD series will be slice-timing corrected to an offset of 0.961s.
240824-16:21:19,546 nipype.workflow INFO:
         No single-band-reference found for sub-y072_ses-2_task-rest_run-02_bold.nii.
240824-16:21:19,557 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
240824-16:21:19,559 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
240824-16:21:19,561 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
240824-16:21:19,590 nipype.workflow IMPORTANT:
         BOLD series will be slice-timing corrected to an offset of 0.96s.
240824-16:21:19,833 nipype.workflow INFO:
         ANAT Stage 1: Adding template workflow
240824-16:21:19,835 nipype.workflow INFO:
         ANAT Stage 2: Preparing brain extraction workflow
240824-16:21:19,871 nipype.workflow INFO:
         ANAT Stage 3: Preparing segmentation workflow
240824-16:21:19,873 nipype.workflow INFO:
         ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
240824-16:21:19,878 nipype.workflow INFO:
         ANAT Stage 5: Preparing surface reconstruction workflow
240824-16:21:19,887 nipype.workflow INFO:
         ANAT Stage 6: Preparing mask refinement workflow
240824-16:21:19,888 nipype.workflow INFO:
         ANAT No T2w images provided - skipping Stage 7
240824-16:21:19,888 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
240824-16:21:19,896 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
240824-16:21:19,900 nipype.workflow INFO:
         ANAT Stage 8a: Creating cortical ribbon mask
240824-16:21:19,902 nipype.workflow INFO:
         ANAT Stage 9: Creating fsLR registration sphere
240824-16:21:19,903 nipype.workflow INFO:
         ANAT Stage 10: Creating MSM-Sulc registration sphere
Process Process-2:
Traceback (most recent call last):
  File "/opt/conda/envs/fmriprep/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/envs/fmriprep/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/cli/workflow.py", line 126, in build_workflow
    retval['workflow'] = init_fmriprep_wf()
                         ^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/workflows/base.py", line 94, in init_fmriprep_wf
    single_subject_wf = init_single_subject_wf(subject_id)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/workflows/base.py", line 515, in init_single_subject_wf
    fmap_estimators, estimator_map = map_fieldmap_estimation(
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/fmriprep/workflows/base.py", line 763, in map_fieldmap_estimation
    fmap_estimators = find_estimators(
                      ^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/utils/wrangler.py", line 354, in find_estimators
    e = fm.FieldmapEstimation(
        ^^^^^^^^^^^^^^^^^^^^^^
  File "<attrs generated init sdcflows.fieldmaps.FieldmapEstimation>", line 7, in __init__
    self.__attrs_post_init__()
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/fieldmaps.py", line 434, in __attrs_post_init__
    _estimators[self.bids_id] = self.paths()
    ~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/opt/conda/envs/fmriprep/lib/python3.11/site-packages/sdcflows/utils/bimap.py", line 144, in __setitem__
    raise KeyError(
KeyError: "'phasediff_fmap0' is already  in mapping"
fMRIPrep: Please report errors to https://github.com/nipreps/fmriprep/issues

Additional information / screenshots

[dcm2bids] config file

{
"dcm2niixOptions": "-ba n",
"descriptions": [
{
"datatype": "anat",
"suffix": "T1w",
"criteria": {
"SeriesDescription": "t1*",
"EchoTime": 0.00236,
"RepetitionTime": 2.3
},
"sidecar_changes": {
"ProtocolName": "T1"
}
},
{
"datatype": "anat",
"suffix": "FLAIR",
"criteria": {
"SeriesDescription": "t2*",
"EchoTime": 0.093,
"RepetitionTime": 9
},
"sidecar_changes": {
"ProtocolName": "FLAIR"
}
},
{
"id": "id_task-rest",
"datatype": "func",
"suffix": "bold",
"custom_entities": "task-rest",
"criteria": {
"EchoTime": 0.03,
"RepetitionTime": 2
},
"sidecar_changes": {
"TaskName": "rest",
"B0FieldSource": ["phasediff_fmap0"]
}
},
{
"datatype": "fmap",
"suffix": "magnitude1",
"criteria": {
"ProtocolName": "field_map",
"EchoTime": 0.00492
},
"sidecar_changes": {
"IntendedFor": ["id_task-rest"],
"B0FieldIdentifier": "phasediff_fmap0"
}
},
{
"datatype": "fmap",
"suffix": "magnitude2",
"criteria": {
"ProtocolName": "field_map",
"EchoTime": 0.00738,
"ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"]
},
"sidecar_changes": {
"IntendedFor": "id_task-rest",
"B0FieldIdentifier": "phasediff_fmap0"
}
},
{
"datatype": "fmap",
"suffix": "phasediff",
"criteria": {
"ProtocolName": "field_map",
"EchoTime": 0.00738,
"ImageType": ["ORIGINAL", "PRIMARY", "P", "ND", "PHASE"]
},
"sidecar_changes": {
"IntendedFor": ["id_task-rest"],
"B0FieldIdentifier": "phasediff_fmap0"
}
}
]
}

@sognoe sognoe added the bug label Aug 27, 2024
@effigies
Copy link
Member

Duplicate of nipreps/sdcflows#455

@effigies effigies marked this as a duplicate of nipreps/sdcflows#455 Aug 27, 2024
@effigies effigies closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants