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

Field Maps Not Being Applied in FMRIPrep #3386

Open
EmilyJD777 opened this issue Oct 22, 2024 · 8 comments
Open

Field Maps Not Being Applied in FMRIPrep #3386

EmilyJD777 opened this issue Oct 22, 2024 · 8 comments
Labels

Comments

@EmilyJD777
Copy link

What happened?

My field map files are not being used. I have submitted this issue on Neurostars, and sent a zip folder of one subject to an admin there. He was able to get the field maps to be associated with the correct runs using the exact same data without making any modifications (see thread here for more information).

He was able to get the indicator for field maps being appropriately applied:
241021-10:57:48,361 nipype.workflow INFO: Setting-up fieldmap "fmap_19" (EstimatorType.PEPOLAR) with <sub-055_acq-mbep2d19mm_dir-AP_epi.nii.gz, sub-055_acq-mbep2d19mm_dir-PA_epi.nii.gz> 2024-10-21 10:57:48,361 [ INFO] Setting-up fieldmap "fmap_19" (EstimatorType.PEPOLAR) with <sub-055_acq-mbep2d19mm_dir-AP_epi.nii.gz, sub-055_acq-mbep2d19mm_dir-PA_epi.nii.gz> 241021-10:57:48,377 nipype.workflow INFO: Setting-up fieldmap "fmap_14" (EstimatorType.PEPOLAR) with <sub-055_acq-mbep2d14mm_dir-AP_epi.nii.gz, sub-055_acq-mbep2d14mm_dir-PA_epi.nii.gz> 2024-10-21 10:57:48,377 [ INFO] Setting-up fieldmap "fmap_14" (EstimatorType.PEPOLAR) with <sub-055_acq-mbep2d14mm_dir-AP_epi.nii.gz, sub-055_acq-mbep2d14mm_dir-PA_epi.nii.gz>

When I run the exact same version 21. 4.1oc2 (I've also tried 24.1.1) of fMRIPrep, SDC is not being done on any data and I am not getting any message related to field maps like he is. If it is the exact same data without any modifications (folder structure, file names, .json contents, etc. are all identical), why are field maps not being applied for me?

What command did you use?

#!/bin/bash

export DOCKER_CONTENT_TRUST=0

# Check if subject number argument is provided
if [ $# -ne 1 ]; then
    echo "Usage: $0 <subject_number>"
    exit 1
fi

# Subject number provided as argument
subj=$1
echo "Starting subject ${subj}"

# Set paths
bids_root_dir="/lbc/lbc1/derivatives/brainstem_funk/BIDS_DAY2"
bids_deriv_dir="/lbc/lbc1/derivatives/brainstem_funk/fmriprep"
workdir="/lbc/lbc1/derivatives/brainstem_funk/work/sub-${subj}_wd"
license_dir="/lbc/lbc1/derivatives/brainstem_funk/license.txt"

# Create working directory
mkdir -p "$workdir"

# Run fMRIPrep with Docker
docker run --rm --user $(id -u):$(id -g) \
    -v $bids_root_dir:/data \
    -v $bids_deriv_dir:/out \
    -v $license_dir:/license.txt \
    -v $workdir:/work \
    nipreps/fmriprep:24.1.1 /data /out participant \
    --participant-label $subj \
    --fs-license-file /license.txt \
    --output-spaces fsnative \
    --n_cpus 8 \
    --omp-nthreads 8 \
    --mem-mb 204800 \
    --skull-strip-t1w force \
    --me-output-echos \
    --ignore slicetiming \
    -w /work

echo "Finished processing subject ${subj}"

# Clean up the work directory if desired
# rm -rf "$workdir"

What version of fMRIPrep are you running?

24.1.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.

emilyd@burgundy:/lbc/lbc1/derivatives/brainstem_funk/scripts$ ./run_fmriprep.sh 055
Starting subject 055
2024-10-18 15:38:15,095 [ WARNING] WARNING: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies
2024-10-18 15:38:22,949 [ WARNING] WARNING: `sentry_sdk.Hub` is deprecated and will be removed in a future major release. Please consult our 1.x to 2.x migration guide for details on how to migrate `Hub` usage to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x
2024-10-18 15:38:23,111 [ WARNING] WARNING: sentry_sdk.configure_scope is deprecated and will be removed in the next major version. Please consult our migration guide to learn how to migrate to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x#scope-configuring
2024-10-18 15:38:32,887 [ WARNING] WARNING: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies
2024-10-18 15:38:33,103 [ WARNING] WARNING: Niworkflows will be deprecating reporting in favor of a standalone library "nireports".
2024-10-18 15:38:33,179 [ WARNING] WARNING: Niworkflows will be deprecating visualizations in favor of a standalone library "nireports".
2024-10-18 15:38:34,619 [IMPORTANT] Running fMRIPrep version 24.1.1

         License NOTICE ##################################################
         fMRIPrep 24.1.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.
         #################################################################
241018-15:38:34,619 nipype.workflow IMPORTANT:
         Running fMRIPrep version 24.1.1

         License NOTICE ##################################################
         fMRIPrep 24.1.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.
         #################################################################
241018-15:38:35,920 nipype.workflow IMPORTANT:
         Building fMRIPrep's workflow:
           * BIDS dataset path: /data.
           * Participant list: ['055'].
           * Run identifier: 20241018-153815_67dc983f-e34e-4d3f-9dda-07f86b2c2b63.
           * Output spaces: fsnative.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /out/sourcedata/freesurfer.
2024-10-18 15:38:35,920 [IMPORTANT] Building fMRIPrep's workflow:
           * BIDS dataset path: /data.
           * Participant list: ['055'].
           * Run identifier: 20241018-153815_67dc983f-e34e-4d3f-9dda-07f86b2c2b63.
           * Output spaces: fsnative.
           * Pre-run FreeSurfer's SUBJECTS_DIR: /out/sourcedata/freesurfer.
241018-15:38:36,993 nipype.workflow INFO:
         ANAT Stage 1: Adding template workflow
2024-10-18 15:38:36,993 [    INFO] ANAT Stage 1: Adding template workflow
2024-10-18 15:38:37,087 [ WARNING] WARNING: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
2024-10-18 15:38:37,087 [ WARNING] WARNING: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
2024-10-18 15:38:37,368 [    INFO] ANAT Stage 2: Preparing brain extraction workflow
241018-15:38:37,368 nipype.workflow INFO:
         ANAT Stage 2: Preparing brain extraction workflow
241018-15:38:37,493 nipype.workflow INFO:
         ANAT Stage 3: Preparing segmentation workflow
2024-10-18 15:38:37,493 [    INFO] ANAT Stage 3: Preparing segmentation workflow
2024-10-18 15:38:37,499 [    INFO] ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
241018-15:38:37,499 nipype.workflow INFO:
         ANAT Stage 4: Preparing normalization workflow for ['MNI152NLin2009cAsym']
2024-10-18 15:38:37,509 [    INFO] ANAT Stage 5: Preparing surface reconstruction workflow
241018-15:38:37,509 nipype.workflow INFO:
         ANAT Stage 5: Preparing surface reconstruction workflow
241018-15:38:37,533 nipype.workflow INFO:
         ANAT Stage 6: Preparing mask refinement workflow
2024-10-18 15:38:37,533 [    INFO] ANAT Stage 6: Preparing mask refinement workflow
2024-10-18 15:38:37,536 [    INFO] ANAT No T2w images provided - skipping Stage 7
2024-10-18 15:38:37,536 [    INFO] ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
241018-15:38:37,536 nipype.workflow INFO:
         ANAT No T2w images provided - skipping Stage 7
241018-15:38:37,536 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI surfaces for ['white', 'pial', 'midthickness', 'sphere_reg', 'sphere']
241018-15:38:37,557 nipype.workflow INFO:
         ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
2024-10-18 15:38:37,557 [    INFO] ANAT Stage 8: Creating GIFTI metrics for ['thickness', 'sulc']
241018-15:38:37,566 nipype.workflow INFO:
         ANAT Stage 8a: Creating cortical ribbon mask
2024-10-18 15:38:37,566 [    INFO] ANAT Stage 8a: Creating cortical ribbon mask
241018-15:38:37,570 nipype.workflow INFO:
         ANAT Stage 9: Creating fsLR registration sphere
2024-10-18 15:38:37,570 [    INFO] ANAT Stage 9: Creating fsLR registration sphere
241018-15:38:37,575 nipype.workflow INFO:
         ANAT Stage 10: Creating MSM-Sulc registration sphere
2024-10-18 15:38:37,575 [    INFO] ANAT Stage 10: Creating MSM-Sulc registration sphere
241018-15:38:39,591 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-cloudySCR_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:39,591 [    INFO] No single-band-reference found for sub-055_task-cloudySCR_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:39,709 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:39,709 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:39,719 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:39,719 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:39,730 [    INFO] Stage 3: Adding coregistration boldref workflow
241018-15:38:39,730 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:39,732 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

241018-15:38:40,78 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:40,078 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:40,381 [    INFO] No single-band-reference found for sub-055_task-cloudy_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
241018-15:38:40,381 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-cloudy_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:40,497 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:40,497 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:40,506 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:40,506 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:40,514 [    INFO] Stage 3: Adding coregistration boldref workflow
241018-15:38:40,514 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:40,515 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:40,848 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:40,848 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:41,123 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-fmri_acq-3D12mm_dir-PA_run-01_bold.nii.gz.
2024-10-18 15:38:41,123 [    INFO] No single-band-reference found for sub-055_task-fmri_acq-3D12mm_dir-PA_run-01_bold.nii.gz.
2024-10-18 15:38:41,235 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:41,235 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:41,244 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:41,244 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:41,252 [    INFO] Stage 3: Adding coregistration boldref workflow
241018-15:38:41,252 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:41,254 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:41,786 [    INFO] No single-band-reference found for sub-055_task-fmri_acq-3D12mm_run-01_bold.nii.gz.
241018-15:38:41,786 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-fmri_acq-3D12mm_run-01_bold.nii.gz.
241018-15:38:41,883 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:41,883 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:41,891 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:41,891 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:41,896 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:41,896 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:41,898 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:43,560 [    INFO] No single-band-reference found for sub-055_task-fmri_acq-3D12mm_run-02_bold.nii.gz.
241018-15:38:43,560 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-fmri_acq-3D12mm_run-02_bold.nii.gz.
241018-15:38:43,671 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:43,671 [    INFO] Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:43,682 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:43,682 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
241018-15:38:43,689 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:43,689 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:43,691 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

241018-15:38:44,33 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-presentSCR_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:44,033 [    INFO] No single-band-reference found for sub-055_task-presentSCR_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
241018-15:38:44,151 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:44,151 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:44,160 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:44,160 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:44,168 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:44,168 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:44,169 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

241018-15:38:44,510 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:44,510 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:44,816 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-present_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:44,816 [    INFO] No single-band-reference found for sub-055_task-present_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:44,930 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:44,930 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
241018-15:38:44,940 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:44,940 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:44,947 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:44,947 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:44,949 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

241018-15:38:45,293 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:45,293 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:45,584 [    INFO] No single-band-reference found for sub-055_task-rest_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
241018-15:38:45,584 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-rest_acq-ep2d19mm_run-01_echo-1_bold.nii.gz.
2024-10-18 15:38:45,705 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:45,705 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
241018-15:38:45,714 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:45,714 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:45,721 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:45,721 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:45,723 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:46,059 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:46,59 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:46,347 [    INFO] No single-band-reference found for sub-055_task-rest_acq-megre14mm_dir-PA_run-01_echo-1_bold.nii.gz.
241018-15:38:46,347 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-rest_acq-megre14mm_dir-PA_run-01_echo-1_bold.nii.gz.
241018-15:38:46,465 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:46,465 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:46,474 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:46,474 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:46,482 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:46,482 [    INFO] Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:46,483 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:46,825 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:46,825 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:47,120 nipype.workflow INFO:
         No single-band-reference found for sub-055_task-rest_acq-megre14mm_run-02_echo-1_bold.nii.gz.
2024-10-18 15:38:47,120 [    INFO] No single-band-reference found for sub-055_task-rest_acq-megre14mm_run-02_echo-1_bold.nii.gz.
2024-10-18 15:38:47,238 [    INFO] Stage 1: Adding HMC boldref workflow
241018-15:38:47,238 nipype.workflow INFO:
         Stage 1: Adding HMC boldref workflow
2024-10-18 15:38:47,248 [    INFO] Stage 2: Adding motion correction workflow
241018-15:38:47,248 nipype.workflow INFO:
         Stage 2: Adding motion correction workflow
2024-10-18 15:38:47,255 [    INFO] Stage 3: Adding coregistration boldref workflow
241018-15:38:47,255 nipype.workflow INFO:
         Stage 3: Adding coregistration boldref workflow
2024-10-18 15:38:47,257 [ WARNING] WARNING: niworkflows.interfaces.nibabel.BinaryDilation is deprecated in favor of
niworkflows.interfaces.morphology.BinaryDilation. Please validate that
interface for your use case and switch.

2024-10-18 15:38:47,609 [IMPORTANT] Generating T2* map and optimally combined ME-EPI time series.
241018-15:38:47,609 nipype.workflow IMPORTANT:
         Generating T2* map and optimally combined ME-EPI time series.
2024-10-18 15:38:50,831 [ WARNING] WARNING: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies
2024-10-18 15:38:51,049 [ WARNING] WARNING: Niworkflows will be deprecating reporting in favor of a standalone library "nireports".
2024-10-18 15:38:51,126 [ WARNING] WARNING: Niworkflows will be deprecating visualizations in favor of a standalone library "nireports".
2024-10-18 15:38:53,987 [    INFO] fMRIPrep workflow graph with 1820 nodes built successfully.
241018-15:38:53,987 nipype.workflow INFO:
         fMRIPrep workflow graph with 1820 nodes built successfully.
2024-10-18 15:38:57,326 [ WARNING] WARNING: Niworkflows will be deprecating reporting in favor of a standalone library "nireports".
2024-10-18 15:38:57,405 [ WARNING] WARNING: Niworkflows will be deprecating visualizations in favor of a standalone library "nireports".
2024-10-18 15:39:07,227 [ WARNING] WARNING: SOCKS support in urllib3 requires the installation of optional dependencies: specifically, PySocks.  For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#socks-proxies
2024-10-18 15:39:07,446 [ WARNING] WARNING: Niworkflows will be deprecating reporting in favor of a standalone library "nireports".
2024-10-18 15:39:07,522 [ WARNING] WARNING: Niworkflows will be deprecating visualizations in favor of a standalone library "nireports".
2024-10-18 15:39:09,946 [ WARNING] WARNING: sentry_sdk.configure_scope is deprecated and will be removed in the next major version. Please consult our migration guide to learn how to migrate to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x#scope-configuring
241018-15:39:11,585 nipype.workflow IMPORTANT:
         fMRIPrep started!
2024-10-18 15:39:11,585 [IMPORTANT] fMRIPrep started!

Additional information / screenshots

Screenshot showing SDC is not being applied.

image

@EmilyJD777 EmilyJD777 added the bug label Oct 22, 2024
@effigies
Copy link
Member

Can you pare your dataset down to a single subject with one anatomical, one BOLD series (all echos) and the fieldmap that should correct your BOLD file?

Then could you share the file listing and the JSON files for all fieldmap and BOLD scans?

@EmilyJD777
Copy link
Author

EmilyJD777 commented Oct 23, 2024

I've attached the link to this here.
This was the same subject that was successful by the Neurostars admin as well. Hopefully we can figure out why it will not work on my end.

@effigies
Copy link
Member

So this also works for me.

2024-10-24 14:11:21,469 [    INFO] B0 field inhomogeneity map will be estimated with the following 1 estimator(s): [<EstimatorType.PEPOLAR: 2>].
2024-10-24 14:11:21,523 [    INFO] Setting-up fieldmap "fmap_19" (EstimatorType.PEPOLAR) with <sub-055_acq-mbep2d19mm_dir-AP_epi.nii.gz, sub-055_acq-mbep2d19mm_dir-PA_epi.nii.gz>

I've attempted to run with basically the same parameters:

fmriprep sourcedata/raw . participant \
    --sloppy --skip-bids-validation --notrack -vv \
    --output-spaces fsnative \
    --skull-strip-t1w force \
    --me-output-echos \
    --ignore slicetiming

Are you using a separate B0FieldIdentifier for each subject's fieldmaps?

@EmilyJD777
Copy link
Author

Are you using a separate B0FieldIdentifier for each subject's fieldmaps?

No. Should I be doing so? At this point, I've just been trying to get this one subject to work for me since it seems others can get it going, so I don't know how relevent this would be for me yet.

Is there some dependency I might be missing that is causing the issue? Or a problem with the code I am using to initiate docker and fmriprep?

@effigies
Copy link
Member

Yes, you need to use a different B0FieldIdentifier for every fieldmap in a dataset, not just every fieldmap within a subject. It's possible that the error is that, when the files are collected across subjects, they don't form a coherent basis to estimate a fieldmap and so are dropped.

@EmilyJD777
Copy link
Author

I have modified all of the field map and anat .jsons to include an individuating marker:

fmap files: "B0FieldIdentifier": "fmap_sub-055_14"
func files : "B0FieldSource": ["fmap_sub-055_14"]

Nevertheless, the problem persists. Is there some possibility that something is being retained in memory and it is using an older setting? Some dependency missing? Something wrong with my initial input code?

@effigies
Copy link
Member

Try something like pepolar055, where pepolar is the fieldmap type, and 055 is the subject label. I think we should handle dashes okay, but let's not tempt fate.

I can't see anything in your script. You're not using any features that would include configuration from a previous run. You can always try clearing out your working directory, but the working directory only matters after the workflow is built, and the problem is with building the workflow.

What happens if you just build a dataset with one subject, as we've done with your example data? That'd be the closest apples-to-apples comparison.

@EmilyJD777
Copy link
Author

EmilyJD777 commented Oct 24, 2024

I have just tried the exact same dataset with one subject and pared down to one within its own BIDS folder. The issue persists. At this point, it has to be some dependency I am missing or something, right? Is that possible?

Update: I've also just tried it with Singularity instead of Docker using the following script:
`#!/bin/bash -l

Define memory limits for fMRIPrep

mem_mb="63500"
nprocs="32"
omp_nprocs="16"

Make outputs read/writable for group

umask 0002
set -eu # Code will stop on errors

Define versions and paths

fmriprep_version="24.1.0rc2"
freesurfer_version="7.4.1"
bids_dir="/lbc/lbc1/derivatives/brainstem_funk/BIDS_DAY2"
output_dir="/lbc/lbc1/derivatives/brainstem_funk/fmriprep"
fmriprep_IMG="/lbc/lbc1/derivatives/brainstem_funk/scripts/fmriprep_${fmriprep_version}.sif"
templateflow_dir="/lbc/lbc1/derivatives/brainstem_funk/templateflow"
fs_license="/lbc/lbc1/derivatives/brainstem_funk/license.txt"
export fs_license="/lbc/lbc1/derivatives/brainstem_funk/license.txt"
export SINGULARITYENV_TEMPLATEFLOW_HOME=/templateflow

echo "TemplateFlow Directory: $templateflow_dir"
echo "FMRIPrep Image: $fmriprep_IMG"

Check if subject number argument is provided

if [ $# -ne 1 ]; then
echo "Usage: $0 <subject_number>"
exit 1
fi

Import subject ID from command line

subject=$1
echo "Processing Subject ID: $subject"
echo "BIDS Directory: $bids_dir"

Do fMRIPrep directly on the original data without copying

echo "Running fMRIPrep command..."

fmriprep_cmd="singularity run -e --containall
-B /lbc/lbc1/derivatives/brainstem_funk/BIDS_DAY2,
/lbc/lbc1/derivatives/brainstem_funk/fmriprep,
/lbc/lbc1/derivatives/brainstem_funk/templateflow_cache:/templateflow,
/lbc/lbc1/derivatives/brainstem_funk:/derivatives
/lbc/lbc1/derivatives/brainstem_funk/scripts/fmriprep_${fmriprep_version}.sif
--skip-bids-validation --participant_label ${subject}
--fs-license-file /derivatives/license.txt
--fs-subjects-dir /derivatives/fmriprep/freesurfer_${freesurfer_version}/
--mem_mb ${mem_mb} --nprocs ${nprocs} --omp-nthreads ${omp_nprocs}
--skull-strip-t1w force --me-output-echos
--output-spaces fsnative --ignore slicetiming --low-mem
${bids_dir} ${output_dir}/fmriprep_${fmriprep_version}/ participant"

echo "Submitted fmriprep job for: ${subject}"
echo -e "Command:\n${fmriprep_cmd}"
${fmriprep_cmd}
`

The issue persists with both Docker and Singularity, so the issue really must be something trivial on my end, but I can't fathom what it could be.

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