-
Notifications
You must be signed in to change notification settings - Fork 1
/
dicom_discover.sh
executable file
·48 lines (39 loc) · 1.53 KB
/
dicom_discover.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# ============================================================
# This script is used to discover DICOM files using HeuDiConv.
#
# It is assumed that you have a conda environment called 'heudiconv' available (check with 'conda env list').
# If not, create a conda environment with the heudiconv and dcm2niix packages installed.
#
# Usage: ./dicom_discover.sh
#
# ============================================================
# ------------------------------------------------------------
# Define your variables
# ------------------------------------------------------------
# Your project's root directory
PROJECT_PATH='/imaging/correia/da05/wiki/BIDS_conversion/MRI'
# Path to the raw DICOM files
DICOM_PATH='/mridata/cbu/CBU090942_MR09029'
# Location of the output data (it will be created if it doesn't exist)
OUTPUT_PATH="${PROJECT_PATH}/work/dicom_discovery/"
# Subject ID
SUBJECT_ID='01'
# ------------------------------------------------------------
# Activate the heudiconv environment
# ------------------------------------------------------------
conda activate heudiconv
# ------------------------------------------------------------
# Run the heudiconv
# ------------------------------------------------------------
heudiconv \
--files "${DICOM_PATH}"/*/*/*.dcm \
--outdir "${OUTPUT_PATH}" \
--heuristic convertall \
--subjects "${SUBJECT_ID}" \
--converter none \
--bids \
--overwrite
# ------------------------------------------------------------
# Deactivate the heudiconv environment
conda deactivate