Analysing Dicoms step takes a long time when running Heudiconv

Summary of what happened:

Running Heudiconv for a full session of scans takes a lot of time. Conversion itself is not so bad but the “Analysing Dicoms” step in the beginning of takes approximately 30 minutes per participant and session. Each sessioin is around 50 000 dicom files so maybe it is simply the dataset that should be split in some way.

Is there some way to speed up this step or do you see some error in my code? I did not find any relevant log files to add but please tell me if any are needed.

Command used (and if a helper script was used, a link to the helper script or the command generated):

#!/bin/bash

# Define base path
BASE_DIR="/location/for/heuristic/file" #changed to publish online

# Output BIDS directory
OUTPUT_DIR="/location/for/heuristic/file" #changed to publish online

# Subjects and sessions to process
# Replace /your/path with your actual folder path
SUBJECTS=(116 117)
SESSIONS=(01 02)

# Path to heuristic file
HEURISTIC="/location/for/heuristic/file" #changed to publish online

# Loop through each subject and session
for subj in "${SUBJECTS[@]}"; do
    for sess in "${SESSIONS[@]}"; do
        
        # Find the first matching DICOM directory
        DICOM_DIR=$(find "$BASE_DIR/7T063_${subj}/ses-${sess}/" -type d -name "Dicom" | head -n 1)
        
        if [ -z "$DICOM_DIR" ]; then
            echo "No DICOM folder found for subject $subj, session $sess"
            continue
        fi

        echo "Found DICOM directory for sub-${subj}, ses-${sess}: $DICOM_DIR"

        # Run heudiconv
        heudiconv \
            --files "$DICOM_DIR" \
            -o "$OUTPUT_DIR" \
            -s "$subj"  \
            -ss "$sess" \
            -c dcm2niix \
            -f "$HEURISTIC" \
            -b notop --overwrite --minmeta
        
        echo "Finished processing sub-${subj}, ses-${sess}"
        echo "---------------------------------------------"
    done
done

Version:

1.3.3

Environment (Docker, Singularity / Apptainer, custom installation):

I have tried running it using a docker container and a python installation with very similar results. The dcm2niix conversion was however much faster using the container. The “analysing dicoms” step was very long in both steps.

Relevant log outputs (up to 20 lines):

Found DICOM directory for sub-117, ses-02: /Volumes/T7_Shield/prami/raw_dicom/7T063_117/ses-02/Dicom
Current time: 11:57:37
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
WARNING: Could not check for version updates: Connection to server could not be made
INFO: Running heudiconv version 1.3.3 latest Unknown
INFO: Analyzing 56302 dicoms
INFO: Generated sequence info for 1 studies with 7 entries total
INFO: Heuristic is missing an `infotoids` method, assigning empty method and using provided subject id 117. Provide `session` and `locator` fields for best results.
INFO: Study session for StudySessionInfo(locator=None, session='02', subject='117')
INFO: Need to process 1 study sessions
INFO: PROCESSING STARTS: {'subject': '117', 'outdir': '/output/', 'session': '02'}
INFO: Processing 7 pre-sorted seqinfo entries
INFO: Doing conversion using dcm2niix
INFO: Converting /output/sub-117/ses-02/anat/sub-117_ses-02_T1w (400 DICOMs) -> /output/sub-117/ses-02/anat . Converter: dcm2niix . Output types: ('nii.gz',)
250615-10:27:33,588 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niixbdvzrbz1/convert".
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niixbdvzrbz1/convert".
250615-10:27:33,653 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: stdout 2025-06-15T10:27:37.518030:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:27:37.518030:Found 400 DICOM file(s)
250615-10:27:37,518 nipype.interface INFO:
	 stdout 2025-06-15T10:27:37.518030:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:27:37,518 nipype.interface INFO:
	 stdout 2025-06-15T10:27:37.518030:Found 400 DICOM file(s)
250615-10:27:37,518 nipype.interface INFO:
	 stdout 2025-06-15T10:27:37.518030:::autoBids:Philips pulseSeq:'T1TFE' scanSeq:'GR' seqVariant:'MP'
INFO: stdout 2025-06-15T10:27:37.518030:::autoBids:Philips pulseSeq:'T1TFE' scanSeq:'GR' seqVariant:'MP'
INFO: stdout 2025-06-15T10:27:37.518030:Philips Scaling Values RS:RI:SS = 2.44273:0:0.00114748 (see PMC3998685)
INFO: stdout 2025-06-15T10:27:37.518030:Convert 400 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_T1w_heudiconv746 (288x288x400x1)
250615-10:27:37,518 nipype.interface INFO:
	 stdout 2025-06-15T10:27:37.518030:Philips Scaling Values RS:RI:SS = 2.44273:0:0.00114748 (see PMC3998685)
250615-10:27:37,518 nipype.interface INFO:
	 stdout 2025-06-15T10:27:37.518030:Convert 400 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_T1w_heudiconv746 (288x288x400x1)
INFO: stdout 2025-06-15T10:27:38.735469:Conversion required 4.825102 seconds (1.530032 for core code).
250615-10:27:38,735 nipype.interface INFO:
	 stdout 2025-06-15T10:27:38.735469:Conversion required 4.825102 seconds (1.530032 for core code).
250615-10:27:38,757 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 4.956022s.
INFO: [Node] Finished "convert", elapsed time 4.956022s.
INFO: Post-treating /output/sub-117/ses-02/anat/sub-117_ses-02_T1w.json file
INFO: Converting /output/sub-117/ses-02/anat/sub-117_ses-02_FLAIR (168 DICOMs) -> /output/sub-117/ses-02/anat . Converter: dcm2niix . Output types: ('nii.gz',)
250615-10:27:38,852 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niixtq89_rrj/convert".
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niixtq89_rrj/convert".
250615-10:27:38,868 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: stdout 2025-06-15T10:27:40.479402:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:27:40.479402:Found 168 DICOM file(s)
INFO: stdout 2025-06-15T10:27:40.479402:::autoBids:Philips pulseSeq:'TIR' scanSeq:'IR' seqVariant:'SK'
INFO: stdout 2025-06-15T10:27:40.479402:Philips Scaling Values RS:RI:SS = 3.69158:0:0.000875483 (see PMC3998685)
INFO: stdout 2025-06-15T10:27:40.479402:Convert 168 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_FLAIR_heudiconv212 (336x336x168x1)
250615-10:27:40,479 nipype.interface INFO:
	 stdout 2025-06-15T10:27:40.479402:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:27:40,479 nipype.interface INFO:
	 stdout 2025-06-15T10:27:40.479402:Found 168 DICOM file(s)
250615-10:27:40,479 nipype.interface INFO:
	 stdout 2025-06-15T10:27:40.479402:::autoBids:Philips pulseSeq:'TIR' scanSeq:'IR' seqVariant:'SK'
250615-10:27:40,479 nipype.interface INFO:
	 stdout 2025-06-15T10:27:40.479402:Philips Scaling Values RS:RI:SS = 3.69158:0:0.000875483 (see PMC3998685)
250615-10:27:40,479 nipype.interface INFO:
	 stdout 2025-06-15T10:27:40.479402:Convert 168 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_FLAIR_heudiconv212 (336x336x168x1)
250615-10:27:41,387 nipype.interface INFO:
	 stdout 2025-06-15T10:27:41.387714:Conversion required 2.412605 seconds (0.998171 for core code).
INFO: stdout 2025-06-15T10:27:41.387714:Conversion required 2.412605 seconds (0.998171 for core code).
INFO: [Node] Finished "convert", elapsed time 2.53595s.
250615-10:27:41,405 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 2.53595s.
INFO: Post-treating /output/sub-117/ses-02/anat/sub-117_ses-02_FLAIR.json file
INFO: Converting /output/sub-117/ses-02/anat/sub-117_ses-02_fieldmap (92 DICOMs) -> /output/sub-117/ses-02/anat . Converter: dcm2niix . Output types: ('nii.gz',)
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niixecs8x30d/convert".
250615-10:27:42,218 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niixecs8x30d/convert".
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
250615-10:27:42,245 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
250615-10:27:42,440 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:27:42,440 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:Found 92 DICOM file(s)
INFO: stdout 2025-06-15T10:27:42.440721:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:27:42.440721:Found 92 DICOM file(s)
250615-10:27:42,440 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:Slices not stacked: TR varies (0, 4, issue 641). Use 'merge 2D slices' option to force stacking
250615-10:27:42,440 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:::autoBids:Philips pulseSeq:'FFE' scanSeq:'RM' seqVariant:'SS'
250615-10:27:42,441 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:Philips Scaling Values RS:RI:SS = 0.2442:-500:4.095 (see PMC3998685)
250615-10:27:42,441 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.440721:Convert 46 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_fieldmap_heudiconv709_e1 (64x64x46x1)
INFO: stdout 2025-06-15T10:27:42.440721:Slices not stacked: TR varies (0, 4, issue 641). Use 'merge 2D slices' option to force stacking
INFO: stdout 2025-06-15T10:27:42.440721:::autoBids:Philips pulseSeq:'FFE' scanSeq:'RM' seqVariant:'SS'
INFO: stdout 2025-06-15T10:27:42.440721:Philips Scaling Values RS:RI:SS = 0.2442:-500:4.095 (see PMC3998685)
INFO: stdout 2025-06-15T10:27:42.440721:Convert 46 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_fieldmap_heudiconv709_e1 (64x64x46x1)
250615-10:27:42,462 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.462951:::autoBids:Philips pulseSeq:'FFE' scanSeq:'GR' seqVariant:'SS'
250615-10:27:42,463 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.462951:Philips Scaling Values RS:RI:SS = 1.23297:0:7.40402e-06 (see PMC3998685)
250615-10:27:42,463 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.462951:Convert 46 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_fieldmap_heudiconv709_e1a (64x64x46x1)
INFO: stdout 2025-06-15T10:27:42.462951:::autoBids:Philips pulseSeq:'FFE' scanSeq:'GR' seqVariant:'SS'
INFO: stdout 2025-06-15T10:27:42.462951:Philips Scaling Values RS:RI:SS = 1.23297:0:7.40402e-06 (see PMC3998685)
INFO: stdout 2025-06-15T10:27:42.462951:Convert 46 DICOM as /output/sub-117/ses-02/anat/sub-117_ses-02_fieldmap_heudiconv709_e1a (64x64x46x1)
250615-10:27:42,473 nipype.interface INFO:
	 stdout 2025-06-15T10:27:42.473693:Conversion required 0.104977 seconds (0.052110 for core code).
INFO: stdout 2025-06-15T10:27:42.473693:Conversion required 0.104977 seconds (0.052110 for core code).
INFO: [Node] Finished "convert", elapsed time 0.246553s.
250615-10:27:42,492 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 0.246553s.
WARNING: For now not embedding BIDS and info generated .nii.gz itself since sequence produced multiple files
INFO: Converting /output/sub-117/ses-02/func/sub-117_ses-02_task-var_bold (9050 DICOMs) -> /output/sub-117/ses-02/func . Converter: dcm2niix . Output types: ('nii.gz',)
250615-10:28:47,324 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niixpq6jsgem/convert".
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niixpq6jsgem/convert".
250615-10:28:48,165 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
250615-10:30:19,636 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:30:19,636 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Found 9050 DICOM file(s)
250615-10:30:19,637 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Warning: Instance Number (0020,0013) order is not spatial.
INFO: stdout 2025-06-15T10:30:19.636352:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:30:19.636352:Found 9050 DICOM file(s)
250615-10:30:19,637 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
250615-10:30:19,637 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Philips Scaling Values RS:RI:SS = 2.07521:0:0.00339974 (see PMC3998685)
250615-10:30:19,637 nipype.interface INFO:
	 stdout 2025-06-15T10:30:19.636352:Convert 9050 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-var_bold_heudiconv567 (128x128x50x181)
INFO: stdout 2025-06-15T10:30:19.636352:Warning: Instance Number (0020,0013) order is not spatial.
INFO: stdout 2025-06-15T10:30:19.636352:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
INFO: stdout 2025-06-15T10:30:19.636352:Philips Scaling Values RS:RI:SS = 2.07521:0:0.00339974 (see PMC3998685)
INFO: stdout 2025-06-15T10:30:19.636352:Convert 9050 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-var_bold_heudiconv567 (128x128x50x181)
INFO: stdout 2025-06-15T10:30:27.256531:Conversion required 98.976315 seconds (12.450822 for core code).
250615-10:30:27,256 nipype.interface INFO:
	 stdout 2025-06-15T10:30:27.256531:Conversion required 98.976315 seconds (12.450822 for core code).
250615-10:30:27,282 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 99.116827s.
INFO: [Node] Finished "convert", elapsed time 99.116827s.
INFO: Post-treating /output/sub-117/ses-02/func/sub-117_ses-02_task-var_bold.json file
INFO: Converting /output/sub-117/ses-02/func/sub-117_ses-02_task-rest_bold (20000 DICOMs) -> /output/sub-117/ses-02/func . Converter: dcm2niix . Output types: ('nii.gz',)
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niixg7lay0_o/convert".
250615-10:30:29,678 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niixg7lay0_o/convert".
250615-10:30:31,503 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
250615-10:33:11,622 nipype.interface INFO:
	 stdout 2025-06-15T10:33:11.622655:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:33:11,623 nipype.interface INFO:
	 stdout 2025-06-15T10:33:11.622655:Found 20000 DICOM file(s)
250615-10:33:11,623 nipype.interface INFO:
	 stdout 2025-06-15T10:33:11.622655:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
250615-10:33:11,623 nipype.interface INFO:
	 stdout 2025-06-15T10:33:11.622655:Philips Scaling Values RS:RI:SS = 2.00586:0:0.00339974 (see PMC3998685)
INFO: stdout 2025-06-15T10:33:11.622655:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:33:11.622655:Found 20000 DICOM file(s)
INFO: stdout 2025-06-15T10:33:11.622655:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
INFO: stdout 2025-06-15T10:33:11.622655:Philips Scaling Values RS:RI:SS = 2.00586:0:0.00339974 (see PMC3998685)
250615-10:33:11,623 nipype.interface INFO:
	 stdout 2025-06-15T10:33:11.622655:Convert 20000 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-rest_bold_heudiconv535 (128x128x50x400)
INFO: stdout 2025-06-15T10:33:11.622655:Convert 20000 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-rest_bold_heudiconv535 (128x128x50x400)
INFO: stdout 2025-06-15T10:33:28.809858:Conversion required 177.185233 seconds (26.624573 for core code).
250615-10:33:28,809 nipype.interface INFO:
	 stdout 2025-06-15T10:33:28.809858:Conversion required 177.185233 seconds (26.624573 for core code).
INFO: [Node] Finished "convert", elapsed time 177.340996s.
250615-10:33:28,845 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 177.340996s.
INFO: Post-treating /output/sub-117/ses-02/func/sub-117_ses-02_task-rest_bold.json file
INFO: Converting /output/sub-117/ses-02/func/sub-117_ses-02_task-mid_bold (26500 DICOMs) -> /output/sub-117/ses-02/func . Converter: dcm2niix . Output types: ('nii.gz',)
250615-10:36:29,553 nipype.workflow INFO:
	 [Node] Setting-up "convert" in "/tmp/dcm2niix8b8guwdz/convert".
INFO: [Node] Setting-up "convert" in "/tmp/dcm2niix8b8guwdz/convert".
250615-10:36:31,941 nipype.workflow INFO:
	 [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: [Node] Executing "convert" <nipype.interfaces.dcm2nii.Dcm2niix>
INFO: stdout 2025-06-15T10:38:05.425384:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
INFO: stdout 2025-06-15T10:38:05.425384:Found 26500 DICOM file(s)
INFO: stdout 2025-06-15T10:38:05.425384:Warning: Instance Number (0020,0013) order is not spatial.
INFO: stdout 2025-06-15T10:38:05.425384:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
INFO: stdout 2025-06-15T10:38:05.425384:Philips Scaling Values RS:RI:SS = 2.116:0:0.00339974 (see PMC3998685)
250615-10:38:05,425 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Chris Rorden's dcm2niiX version v1.0.20240202  (JP2:OpenJPEG) (JP-LS:CharLS) GCC12.2.0 x86-64 (64-bit Linux)
250615-10:38:05,426 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Found 26500 DICOM file(s)
250615-10:38:05,426 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Warning: Instance Number (0020,0013) order is not spatial.
250615-10:38:05,426 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Warning: Unable to distinguish Philips fieldmaps: phase difference, two phase/magnitude, direct fieldmapping.::autoBids:Philips pulseSeq:'FEEPI' scanSeq:'GR' seqVariant:'SP'
250615-10:38:05,426 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Philips Scaling Values RS:RI:SS = 2.116:0:0.00339974 (see PMC3998685)
250615-10:38:05,426 nipype.interface INFO:
	 stdout 2025-06-15T10:38:05.425384:Convert 26500 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-mid_bold_heudiconv919 (128x128x50x530)
INFO: stdout 2025-06-15T10:38:05.425384:Convert 26500 DICOM as /output/sub-117/ses-02/func/sub-117_ses-02_task-mid_bold_heudiconv919 (128x128x50x530)
250615-10:38:28,499 nipype.interface INFO:
	 stdout 2025-06-15T10:38:28.498988:Conversion required 116.433648 seconds (30.363613 for core code).
INFO: stdout 2025-06-15T10:38:28.498988:Conversion required 116.433648 seconds (30.363613 for core code).
INFO: [Node] Finished "convert", elapsed time 116.60461s.
250615-10:38:28,547 nipype.workflow INFO:
	 [Node] Finished "convert", elapsed time 116.60461s.
INFO: Post-treating /output/sub-117/ses-02/func/sub-117_ses-02_task-mid_bold.json file
INFO: PROCESSING DONE: {'subject': '117', 'outdir': '/output/', 'session': '02'}
Finished processing sub-117, ses-02
Processing started at: 11:57:37

Screenshots / relevant information:

I am running the conversion on a Macbook Pro M2 with dicom files saved on an external SSD.


@yarikoptic can probably provide insight.

I believe that heudiconv reads your DICOMs twice:

  1. Analyzing * dicoms uses pydicom to read each file to extract sequence information.
  2. Converting dicoms to NIfTI with dcm2niix - this step is designed to scale well with huge numbers of files.

Given the huge number of files you have, I infer that you are saving data as classic DICOMs (one file per 2D image). For future acquisitions, since you use a Philips scanner, you may want to export as Enhanced DICOMs which should create one file per series. Do be aware that Philips enhanced DICOMs have a lot of bloat, so make sure this does not have impact on other PACS and tools that interact with the data. The Philips Clinical Scientist associated with your center can provide more details. As an aside, for Siemens users with VA-VE the EPI scans should be set to mosaic mode with for XA systems the export should be enhanced: this will only create one DICOM file per 3D volume.

For the present data, one thing you should consider is the performance of your SSD. Your m2 will not support thunderbolt 5 (tb5, e.g. Trebleet TRE-8132), but it will support an external thunderbolt 3/4 device (tb3/4) like the ACASIS TBU405 ($59 or $80 if you also want usb support). In my experience, these are dramatically faster than traditional usb 3.2 device (especially as Mac’s do not leverage 2x2). For my M4 Pro, write/read speeds in mb/s are:

Device Write Read
tb5 6346 5724
tb3/4 2674 2513
usb3.2 712 675

Thank you very much for your reply! I will talk to the Philips Scientist at our location and see if it is possible to get the enhanced Dicom format in the future. I will look into a thunderbolt ssd instead as well.