Dcm2bids not working running sif file through shell script--need to convert dcm to BIDS

Summary of what happened:

Hi everyone. I am looking to convert DICOM to BIDS format for dataset that is either .dcm or .ima but my script doesn’t seem to be working.

This is my shell script

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

#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --account=PAS2302

# Paths
input_dir="/users/PCON0381/madhavans16/Downloads"
output_dir="/users/PCON0381/madhavans16/Downloads/BIDS"
config_file="/users/PCON0381/madhavans16/Downloads/cofig.json"

# Function to sanitize subject ID
sanitize_subject_id() {
    local subject_id="$1"
    # Remove non-alphanumeric characters from subject_id
    sanitized_id=$(echo "${subject_id}" | tr -cd '[:alnum:]')
    echo "${sanitized_id}"
}

# Iterate over subject directories
for subject_dir in "${input_dir}"/*/; do
    subject_id=$(basename "${subject_dir}")
    sanitized_subject_id=$(sanitize_subject_id "${subject_id}")

    if [ "${subject_id}" != "${sanitized_subject_id}" ]; then
        echo "Sanitizing subject ID: ${subject_id} to ${sanitized_subject_id}"
    fi

    output_subject_dir="${output_dir}/sub-${sanitized_subject_id}"  # Adjusted output directory structure

    # Create output directory if it doesn't exist
    mkdir -p "${output_subject_dir}"

    # Find all DICOM files within SCANS/*/DICOM/*
    dicom_files=("${input_dir}/${subject_id}/SCANS"/*/DICOM/*)

    # Convert each DICOM file to BIDS
    for dicom_file in "${dicom_files[@]}"; do
        echo "Converting ${dicom_file} to BIDS format..."
        singularity exec --cleanenv /users/PCON0381/madhavans16/Downloads/dcm2bids_latest.sif \
            dcm2bids \
            -d "${dicom_file}" \
            -p "${sanitized_subject_id}" \
            -o "${output_subject_dir}" \
            -c "${config_file}"
    done
done

My dicom directory is like so:

/users/PCON0381/madhavans16/Downloads/{subject_ID}/SCANS/{subfolder}/DICOM/*

Version:

dcm2bids version: 3.1.0. It’s also not letting me download the latest version as a sif file.

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

Singularity

Relevant log outputs (up to 20 lines):

2024-06-25 19:49:33.787 - INFO     - dcm2bids.main | --- dcm2bids start ---
2024-06-25 19:49:33.788 - INFO     - dcm2bids.main | Running the following command: /usr/local/bin/dcm2bids -d /users/PCON0381/madhavans16/Downloads/YT-0690827A_20240426-20240426/SCANS/301_104_B0_map-AP/DICOM/IM_0007 -p YT0690827A2024042620240426 -o /users/PCON0381/madhavans16/Downloads/BIDS/sub-YT0690827A2024042620240426 -c /users/PCON0381/madhavans16/Downloads/cofig.json
2024-06-25 19:49:33.791 - INFO     - dcm2bids.main | OS version: Linux-3.10.0-1160.118.1.el7.x86_64-x86_64-with-glibc2.35
2024-06-25 19:49:33.791 - INFO     - dcm2bids.main | Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
2024-06-25 19:49:33.791 - INFO     - dcm2bids.main | dcm2bids version: 3.1.0
2024-06-25 19:49:33.803 - INFO     - dcm2bids.main | dcm2niix version: v1.0.20230411
2024-06-25 19:49:33.803 - INFO     - dcm2bids.main | Checking for software update
2024-06-25 19:49:33.894 - WARNING  - tools.check_github_latest | Checking latest version of UNFmontreal/Dcm2Bids was not possible, the server couldn't fulfill the request.
2024-06-25 19:49:33.894 - DEBUG    - tools.check_github_latest | Error code: 403
2024-06-25 19:49:33.953 - WARNING  - tools.check_github_latest | Checking latest version of rordenlab/dcm2niix was not possible, the server couldn't fulfill the request.
2024-06-25 19:49:33.953 - DEBUG    - tools.check_github_latest | Error code: 403
2024-06-25 19:49:33.953 - INFO     - dcm2bids.main | participant: sub-YT0690827A2024042620240426
2024-06-25 19:49:33.954 - INFO     - dcm2bids.main | config: /users/PCON0381/madhavans16/Downloads/cofig.json
2024-06-25 19:49:33.954 - INFO     - dcm2bids.main | BIDS directory: /users/PCON0381/madhavans16/Downloads/BIDS/sub-YT0690827A2024042620240426
2024-06-25 19:49:33.954 - INFO     - dcm2bids.main | Auto extract entities: False
2024-06-25 19:49:33.954 - INFO     - dcm2bids.main | Validate BIDS: False

2024-06-25 19:49:33.959 - ERROR    - dcm2niix_gen.execute | 
/users/PCON0381/madhavans16/Downloads/YT-0690827A_20240426-20240426/SCANS/301_104_B0_map-AP/DICOM/IM_0007 is not a supported file extension.tar, tar.bz2, tar.gz or zip are supported.

My config.json file is this:


{
    "descriptions": [
        {
            "dataType": "anat",
            "modalityLabel": "T1w",
            "criteria": {
                "SeriesDescription": {
                    "contains": "T1W"
                }
            }
        },
        {
            "dataType": "anat",
            "modalityLabel": "T2w",
            "criteria": {
                "SeriesDescription": {
                    "contains": "T2w"
                }
            }
        },
        {
            "dataType": "func",
            "modalityLabel": "bold",
            "customLabels": "task-sst_dir-PA",
            "criteria": {
                "SeriesDescription": {
                    "contains": "STT2"
                }
            }
        }
    ]
}

Hi @MadhavanSubhashini,

What is the tree structure of your dicom folder? Is it a folder that is outside your home directory and thus would not be to mounted in singularity?

Best,
Steven

Hi my tree structure looks like this.

/users/PCON0381/madhavans16/Downloads/YT-0690827A_20240426-20240426/SCANS/601_106_FMRI-NX1-STT2-PA/DICOM/

My subject ID is YT-0690827A_20240426-20240426

Within that is a SCANS folder.

Each SCANS folder has multiple subject folders like 601_106_FMRI-NX1-STT2-PA. There are about 30 subfolders like this within SCANS. Which is why I do SCANS/*/DICOM

The dicom files are within the DICOM folder

There is no folder outside of home directory. I am just running this as a test right now but in the future not sure if this will be an issue.

image

The pictures aren’t entirely clear to me, looks like something’s might be cut off. In the future, it’s better to paste the text and format it as code with tick marks so it shows up nice

like this.

Dcm2bids might work better if you reorganize into something like scans/subject/acqusition/dicoms, and then you could pass in scans/subject/acquisition as the dicom folder. I do not know what inside of your dicom folders look like, so it is hard for me to help much further and say if your dicom organization looks valid.

Best,
Steven

Hi,

I revised my script #!/bin/bash

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


# Function to sanitize subject ID
sanitize_subject_id() {
    local subject_id="$1"
    # Remove non-alphanumeric characters from subject_id
    sanitized_id=$(echo "${subject_id}" | tr -cd '[:alnum:]')
    echo "${sanitized_id}"
}

# Iterate over subject directories
for subject_dir in /users/PCON0381/madhavans16/Downloads/*/; do
    subject_id=$(basename "${subject_dir}")
    sanitized_subject_id=$(sanitize_subject_id "${subject_id}")

    if [ "${subject_id}" != "${sanitized_subject_id}" ]; then
        echo "Sanitizing subject ID: ${subject_id} to ${sanitized_subject_id}"
    fi

    output_subject_dir=/users/PCON0381/madhavans16/Downloads/BIDS/sub-${sanitized_subject_id}

    # Create output directory if it doesn't exist
    mkdir -p "${output_subject_dir}"

    # Ensure directory is readable and writable
    chmod -R 777 "${output_subject_dir}"


    # Convert DICOM files to BIDS
    echo "Converting DICOM files for subject ${sanitized_subject_id} to BIDS format..."
    singularity run --cleanenv /users/PCON0381/madhavans16/Downloads/dcm2bids_latest.sif \
        dcm2bids \
        -d /users/PCON0381/madhavans16/Downloads/${subject_id}/SCANS/*/DICOM/* \
        -p ${sanitized_subject_id} \
        -o /users/PCON0381/madhavans16/Downloads/BIDS \
        -c /users/PCON0381/madhavans16/Downloads/cofig.json \
        --clobber  # Overwrite existing output if necessary
done

Now I’m getting this error:
subprocess.CalledProcessError: Command '['dcm2niix', '-b', 'y', '-ba', 'y', '-z', 'y', '-f', '%3s_%f_%p_%t', '-o', PosixPath('/users/PCON0381/madhavans16/Downloads/BIDS/tmp_dcm2bids/sub-YT0690827A2024042620240426'), PosixPath('/users/PCON0381/madhavans16/Downloads/BIDS/tmp_dcm2bids/sub-YT0690827A2024042620240426_tmp')]' returned non-zero exit status 5.

I think this may have to do with the path to directory dicom but that is structured like this:

/users/PCON0381/madhavans16/Downloads/YT-0690827A_20240426-20240426/SCANS/1001_104D_B0_map-PA/DICOM/

The * after SCANS is for each of the subfolders within the SCANS directory and then there is a DICOM folder within each of those directories after which the DICOM directory contains dicom files

Like this:

That doesn’t look like a folder full of DICOMs. There are usually several .dcm files.

Maybe fixed by mounting the directory in singularity?

Hi. The scanner type is Phillips so I think it only outputs one file for some of them. It does convert to nii.gz when I run through MRIcroGL. I updated my bash script. I’m basically trying to get it to read through each row of the CSV file and where the site is TERBO_Bronx run dcm2bids on that through the config.json file specifications. But I seem to be running into an error with my wildcards. I don’t know why its not reading the dicom directory folders corrects. Here is an example of a log file:

2024-06-26 08:33:55.428 - INFO - dcm2bids.main | — dcm2bids start —
2024-06-26 08:33:55.428 - INFO - dcm2bids.main | Running the following command: /usr/local/bin/dcm2bids -d /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0690827A_20240426-20240426
/SCANS//DICOM/ -p YT0690827A -o /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS -c /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/config.json --clobber
2024-06-26 08:33:55.431 - INFO - dcm2bids.main | OS version: Linux-3.10.0-1160.118.1.el7.x86_64-x86_64-with-glibc2.35
2024-06-26 08:33:55.431 - INFO - dcm2bids.main | Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
2024-06-26 08:33:55.431 - INFO - dcm2bids.main | dcm2bids version: 3.1.0
2024-06-26 08:33:55.444 - INFO - dcm2bids.main | dcm2niix version: v1.0.20230411
2024-06-26 08:33:55.444 - INFO - dcm2bids.main | Checking for software update
2024-06-26 08:33:55.597 - WARNING - tools.check_latest | A newer version exists for dcm2bids: 3.1.1
2024-06-26 08:33:55.597 - WARNING - tools.check_latest | You should update it → GitHub - UNFmontreal/Dcm2Bids: Reorganising NIfTI files from dcm2niix into the Brain Imaging Data Structure.
2024-06-26 08:33:55.662 - WARNING - tools.check_latest | A newer version exists for dcm2niix: v1.0.20240202
2024-06-26 08:33:55.662 - WARNING - tools.check_latest | You should update it → GitHub - rordenlab/dcm2niix: dcm2nii DICOM to NIfTI converter: compiled versions available from NITRC.
2024-06-26 08:33:55.662 - INFO - dcm2bids.main | participant: sub-YT0690827A
2024-06-26 08:33:55.663 - INFO - dcm2bids.main | config: /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/config.json
2024-06-26 08:33:55.663 - INFO - dcm2bids.main | BIDS directory: /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS
2024-06-26 08:33:55.663 - INFO - dcm2bids.main | Auto extract entities: False
2024-06-26 08:33:55.663 - INFO - dcm2bids.main | Validate BIDS: False

It should not be what the bold is like above. This is the path to the dicom directory. dicom_path=“/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/${folder}/SCANS/*/DICOM”

It needs to read each of the subfolders after SCANS. Why is the wildcard not working?

#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --account=PAS2302

Define the input CSV file

csv_file=“/fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/TERBO_YT2.csv”

Define the BIDS output directory

bids_dir=“/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS”

Read the CSV file and process each row where site is TERBO_Bronx

while IFS=, read -r subject session site folder; do
# Skip the header row
if [ “$subject” == “xnat:mrsessiondata/label” ]; then
continue
fi

# Ensure subject does not contain dashes or underscores
if [[ "$subject" == *"-"* || "$subject" == *"_"* ]]; then
    echo "Subject $subject contains dashes or underscores, skipping."
    continue
fi

# Only consider rows where the site is TERBO_Bronx
if [ "$site" == "TERBO_Bronx" ]; then
    # Ensure the BIDS directory and all subfolders are readable and writable
    chmod -R u+rw,g+rw "$bids_dir"
    chgrp -R PAS2302 "$bids_dir"

    # Construct the DICOM path with a specific session and subject
    dicom_path="/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/${folder}/SCANS/*/DICOM"

    # Run dcm2bids for the matching folder
    singularity run --cleanenv \
        /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/dcm2bids_latest.sif \
        dcm2bids \
        -d $dicom_path/* \
        -p $subject \
        -s $session \
        -o $bids_dir \
        -c /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/cofig.json \
        --clobber

    echo "Ran dcm2bids for folder: $folder, subject: $subject, session: $session"
fi

done < “$csv_file”

Hi @Steven I think I may be a bit confused. Does dcm2bids only work on Nifti files and not on dicoms? I’m trying to do dicom to BIDS conversion and heudiconv does not work for this dataset?

How does the config.file work after nii.gz files are generated if it only works for Nifti files?

Thanks.

–Subbi M.

Hello @MadhavanSubhashini ,

It works with dicom, yours are advanced dicoms. Nothing to worry.

I think you are the perfect candidate to test our new docker version.
Give me a couple of minutes and I will share with you this new version so you can test it.

Best,
Arnaud

Hi @abore Great! Thanks. If you could pass along the pull command for a sif file. I’m a bit new to Linux/Bash that would be great. My config.json file is at the version top of this convo.

Current error I’m getting is:

subprocess.CalledProcessError: Command ‘[‘dcm2niix’, ‘-b’, ‘y’, ‘-ba’, ‘y’, ‘-z’, ‘y’, ‘-f’, ‘%3s_%f_%p_%t’, ‘-o’, PosixPath(’/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS/tmp_dcm2bids/sub-YT0691035_ses-1’), PosixPath(‘/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS/tmp_dcm2bids/sub-YT0691035_ses-1_tmp’)]’ returned non-zero exit status 5.

Thanks.

–Subbi M.

@MadhavanSubhashini

Ok first let’s try building this singularity:
singularity build dcm2bids_dev.sif docker://unfmontreal/dcm2bids:dev
Then in your script:

    singularity exec  \
        /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/dcm2bids_dev.sif \
        dcm2bids \
        -d $dicom_path/* \
        -p $subject \
        -s $session \
        -o $bids_dir \
        -c /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/cofig.json \
        --clobber

If there is any error with dcm2niix you should now be able to get a “nice” visible error message.

:warning: This image contains a dev version of dcm2bids. A proper release will be available soon. :warning:

Hi @abore SIF file is taking a while to create. Will message back on here once I run this updated script.

Thanks.

–Subbi M.

**This is the SLURM Error.

FileNotFoundError: [Errno 2] No such file or directory: ‘/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS/tmp_dcm2bids/sub-YT0690459C_ses-1_tmp’
Ran dcm2bids for folder: YT-0690459C_20240508-20240508, subject: YT0690459C, session: 1

@abore BIDS tree structure

image

Hi @abore Any tips on how to resolve?

Thanks.

–Subbi M.

I’m still working on your issue.
You removed all your logs instead and you started a new thread.
I think it adds noise to the community.

Start over the conversion but only for one subject and attach the log to the thread please.

Hi @abore,

My apologies. Feel free to delete the other thread if its taking up space on the community. This is the log file for a single subject.

Subject ID: YT0691035i
Session ID: 1

2024-06-26 14:45:17.434 - INFO - dcm2bids.main | — dcm2bids start —
2024-06-26 14:45:17.434 - INFO - dcm2bids.main | Running the following command: /venv/bin/dcm2bids -d /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1001_104C_B0_map-AP/DICOM/IM_0021 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/101_101_SURVEY_MST/DICOM/IM_0002 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1101_104D_B0_map-PA/DICOM/IM_0025 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1401_108_FMRI-NX1-MID2-PA/DICOM/IM_0030 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1501_104E_B0_map-AP/DICOM/IM_0031 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1601_104F_B0_map-PA/DICOM/IM_0035 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1901_110_FMRI-NX1-NB2-PA/DICOM/IM_0041 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2001_101_SURVEY_MST/DICOM/IM_0044 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/201_102_3min_T1W_3D_TFE/DICOM/IM_0004 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/203_SAGITTAL/DICOM/IM_0005 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/204_CORONAL/DICOM/IM_0006 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2101_104G_B0_map-AP/DICOM/IM_0045 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2201_104H_B0_map-PA/DICOM/IM_0049 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2301_113_DTI_MB4_102d_PA/DICOM/IM_0054 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2303_DIFF_SAG/DICOM/IM_0056 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2304_DIFF_COR/DICOM/IM_0057 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2401_114A_B0_map-AP/DICOM/IM_0058 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2501_114B_B0_map-PA/DICOM/IM_0062 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2801_115_NX1-2/DICOM/IM_0067 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/2901_114C_B0_map-AP/DICOM/IM_0068 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/3001_114D_B0_map-PA/DICOM/IM_0072 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/301_104_B0_map-AP/DICOM/IM_0007 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/3101_103_3D__T2_SAG_RAW/DICOM/IM_0078 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/3103_MPR_COR_0.8_-0.4mm/DICOM/IM_0079 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/3104_MPR_AX_0.8_-0.4mm/DICOM/IM_0080 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/401_104B_B0_map-PA/DICOM/IM_0011 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/601_101_SURVEY_MST/DICOM/IM_0017 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/901_106_FMRI-NX1-STT2-PA/DICOM/IM_0020 -p YT0691035i -s 1 -o /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS -c /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/cofig.json --clobber
2024-06-26 14:45:17.458 - INFO - dcm2bids.main | OS version: Linux-3.10.0-1160.118.1.el7.x86_64-x86_64-with-glibc2.36
2024-06-26 14:45:17.458 - INFO - dcm2bids.main | Python version: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:38:13) [GCC 12.3.0]
2024-06-26 14:45:17.458 - INFO - dcm2bids.main | dcm2bids version: 3.1.1
2024-06-26 14:45:17.623 - INFO - dcm2bids.main | dcm2niix version: v1.0.20240202
2024-06-26 14:45:17.623 - INFO - dcm2bids.main | Checking for software update
2024-06-26 14:45:17.813 - INFO - tools.check_latest | Currently using the latest version of dcm2bids.
2024-06-26 14:45:17.951 - INFO - tools.check_latest | Currently using the latest version of dcm2niix.
2024-06-26 14:45:17.951 - INFO - dcm2bids.main | participant: sub-YT0691035i
2024-06-26 14:45:17.952 - INFO - dcm2bids.main | session: ses-1
2024-06-26 14:45:17.952 - INFO - dcm2bids.main | config: /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/cofig.json
2024-06-26 14:45:17.953 - INFO - dcm2bids.main | BIDS directory: /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS
2024-06-26 14:45:17.953 - INFO - dcm2bids.main | Auto extract entities: False
2024-06-26 14:45:17.953 - INFO - dcm2bids.main | Validate BIDS: False

2024-06-26 14:45:18.19 - ERROR - dcm2niix_gen.execute |
/fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/1001_104C_B0_map-AP/DICOM/IM_0021 is not a supported file extension.tar, tar.bz2, tar.gz or zip are supported.
2024-06-26 14:45:18.20 - INFO - utils.run_shell_command | Running: dcm2niix -b y -ba y -z y -f %3s_%f_%p_%t -o /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS/tmp_dcm2bids/sub-YT0691035i_ses-1 /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS/tmp_dcm2bids/sub-YT0691035i_ses-1_tmp

I can’t delete your new thread.

ok try this command and send me the whole output you see in the :

singularity exec /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/dcm2bids_dev.sif dcm2bids -d /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/YT-0691035i_20240430-20240430/SCANS/ -s 1 -o /fs/ess/PAS2302/Subbi/TURBO/TERBO/data/YT/DICOM/BIDS -c /fs/ess/PAS2302/Subbi/TURBO/TERBO/Scripts/cofig.json --clobber

You should not have multiple input folder.

@abore When I run the above in the CLI directly it gives me this warning:

WARNING: Environment variable LD_PRELOAD already has value , will not forward new value [/apps/xalt/xalt/lib64/libxalt_init.so] from parent process environment
FATAL: “-d”: executable file not found in $PATH