-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslicer.sh
More file actions
executable file
·24 lines (21 loc) · 789 Bytes
/
slicer.sh
File metadata and controls
executable file
·24 lines (21 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
#
# Call 3DSlicer with a volume and a label file
# (based on training in dataset.json).
#
# use 0 as the default
pair="0"
if [ $# -eq 1 ]; then
pair="$1"
fi
# open slicer and load one example
image=$(jq -r ".training[$pair].image" data/SpineSegmentation/dataset.json)
mask=$(jq -r ".training[$pair].label" data/SpineSegmentation/dataset.json)
image=$(readlink -f data/SpineSegmentation/${image})
mask=$(readlink -f data/SpineSegmentation/${mask})
image_name=$(basename "$image")
mask_name=$(basename "$mask")
/Applications/Slicer.app/Contents/MacOS/Slicer --python-code "slicer.util.loadVolume('${image}',{'name': '${image_name}'}); slicer.util.loadSegmentation('${mask}',{'name': '${mask_name}'})"
#
# To safe the output back convert to a binary label first.
#