Skip to content

Commit

Permalink
update paths
Browse files Browse the repository at this point in the history
  • Loading branch information
singlesp authored Dec 16, 2024
1 parent 685ce6e commit ef873ea
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions curation/dcm2bids/dcm2bids_submit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
#SBATCH --time=24:00:00 # Maximum runtime
#SBATCH --cpus-per-task=4 # Number of CPUs per task
#SBATCH --mem=8G # Memory per job
#SBATCH --output=/cbica/projects/grmpy/data/bids/code/dcm2bids/logs/dcm2bids_%A_%a.out # Output log
#SBATCH --error=/cbica/projects/grmpy/data/bids/code/dcm2bids/logs/dcm2bids_%A_%a.err # Error log
#SBATCH --output=/cbica/projects/grmpy/code/curation/dcm2bids/logs/dcm2bids_%A_%a.out # Output log
#SBATCH --error=/cbica/projects/grmpy/code/curation/dcm2bids/logs/dcm2bids_%A_%a.err # Error log

# Define paths
bids="/cbica/projects/grmpy/data/bids"

# Step 1: Get all subject IDs
# subjects=($(ls -d ${bids}/sourcedata/GRMPY_822831/SUBJECTS/* | xargs -n 1 basename))
subjects=("95257" "20120") # For debugging
subjects=($(ls -d /cbica/projects/grmpy/sourcedata/GRMPY_822831/SUBJECTS/* | xargs -n 1 basename))

# Step 2: Select the current subject based on the SLURM array task ID
subID=${subjects[${SLURM_ARRAY_TASK_ID}]}

# Step 3: Find all DICOM directories for all sessions of the current subject
mapfile -t session_dirs < <(find ${bids}/sourcedata/GRMPY_822831/SUBJECTS/${subID}/SESSIONS/*/ACQUISITIONS -maxdepth 0 -type d)
mapfile -t session_dirs < <(find /cbica/projects/grmpy/sourcedata/GRMPY_822831/SUBJECTS/${subID}/SESSIONS/*/ACQUISITIONS -maxdepth 0 -type d)

# Step 4: Process each session
session_num=1 # Initialize session counter
Expand All @@ -28,7 +27,7 @@ for session_dir in "${session_dirs[@]}"; do

~/miniforge3/envs/dcmconv/bin/dcm2bids -p ${subID} \
-s ${session_num} \
-c ${bids}/code/dcm2bids/config.json \
-c /cbica/projects/grmpy/code/dcm2bids/config.json \
-o ${bids} \
-d ${session_dir} \
--force_dcm2bids
Expand Down

0 comments on commit ef873ea

Please sign in to comment.