Heudiconv error DICOM to Nifti Singularity WARNING: We cannot setup exception hook since not in interactive mode

Summary of what happened:

I’m trying to do DICOM to Nifti conversion through Singularity container and am running into a new error with the latest version of heudiconv. I have previously successfully converted this subject before and when I run the dcm2niix on the terminal just by itself the files get converted successfully to NIFTI so its not a file issue.

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

#SBATCH --time=04:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --account=PAS2302

echo "Starting BIDS conversion for subject" $subject $session

singularity run --cleanenv \
/fs/ess/PAS2302/Subbi/TURBO/TERBO/heudiconv_1.1.0.sif \
-d /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/*/DICOM/{subject}/SCANS/*/DICOM/* \
-o /fs/ess/PCON0341/projects/TERBO/YA/BIDS \
-f /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/TERBO/Heuristic/convert_TURBO_Baylor_SM_YA.py \
-s $subject \
-ss $session \
-c dcm2niix \
--minmeta \
--dbg \
-b \
--overwrite ;

echo "Finished subject" $subject $session

Please note that I have run the script about using both singularity --cleanenv and singularity --no-home. Sometimes the issue is that it does not convert and I get the error below. Other times it only converts part of the data (i.e., only converts anatomy files and func files and not dwi folder).


Running heudiconv version 1.1.0 latest 1.1.0

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

Singularity container

Data formatted according to a validatable standard? Please provide the output of the validator:


Relevant log outputs (up to 20 lines):

Starting BIDS conversion for subject YA-381116K 1
INFO: Running heudiconv version 1.1.0 latest 1.1.0
INFO: Need to process 1 study sessions
INFO: PROCESSING STARTS: {'subject': 'YA-381116K', 'outdir': '/fs/ess/PCON0341/projects/TERBO/YA/BIDS/', 'session': '1'}
INFO: Processing 4503 dicoms
WARNING: 'YA-381116K' label contained non-alphanumeric character(s), it was cleaned to be 'YA381116K'
INFO: Analyzing 4503 dicoms
INFO: Generated sequence info for 38 studies with 4503 entries total
WARNING: We cannot setup exception hook since not in interactive mode
Finished subject YA-381116K 1

Screenshots / relevant information:

The --dbg flag will setup to launch pdb (python debugger), whenver there is an exception. However, you started a slurm job and hence there is no terminal attached to your process and heudiconv warns, that it wouldn’t be able to start a debugger. That’s not really an error, but an expected warning.