From d321604e4e4fe641e2495d5934985440141c75b4 Mon Sep 17 00:00:00 2001 From: Gauthier Bouilhol Date: Wed, 12 Oct 2011 13:21:27 +0200 Subject: [PATCH] create_sequence.sh and dcm_sort_by_field.sh removed --- scripts/create_sequence.sh | 15 -------------- scripts/dcm_sort_by_field.sh | 38 ------------------------------------ 2 files changed, 53 deletions(-) delete mode 100755 scripts/create_sequence.sh delete mode 100755 scripts/dcm_sort_by_field.sh diff --git a/scripts/create_sequence.sh b/scripts/create_sequence.sh deleted file mode 100755 index 339d351..0000000 --- a/scripts/create_sequence.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -#Create a sequence of mhd images from the various UNTAGGED directories -if [ $# -lt 1 ] -then - echo "Usage: create_sequence.sh prefix" - exit 1 -fi -for i in $1* -do - filename=CT_$1_$(echo "$i" | sed "s/.*,_//;s/\..*//").mhd - echo $filename - find "$i" -iname "*.dcm" | clitkDicom2Image --focal_origin -o "$filename" --std_input -done - -create_mhd_4D.sh . diff --git a/scripts/dcm_sort_by_field.sh b/scripts/dcm_sort_by_field.sh deleted file mode 100755 index 81d1b6b..0000000 --- a/scripts/dcm_sort_by_field.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -if [ $# -lt 1 ] -then - echo Usage: dcm_sort_by_field.sh \"field name\" - exit -fi -path_dir=`pwd` -dir_name=`basename "$path_dir"` -[ -d "../${dir_name}_sorted" ] && rm -r "../${dir_name}_sorted" -mkdir "../${dir_name}_sorted" -find . -type f -iname "*.dcm" > ../${dir_name}_sorted/dicom_files -finished=0 -total=$(wc -l ../${dir_name}_sorted/dicom_files) -cat ../${dir_name}_sorted/dicom_files | while : -do - jobrunning=0 - conc_jobs=50 - while [ $jobrunning -lt $conc_jobs ] - do - read i || { wait; break 2; } - { - name="$(clitkDicomInfo "$i" | grep "$1" | head -n 1 | sed "s/.*\[//;s/.$//;s/ /_/g")" - [ -z "$name" ] && echo "Warning: key not found in file $i" 1>&2 && mkdir -p "../${dir_name}_unsorted" && basename=$(basename "$i") && cp -l "$i" "../${dir_name}_unsorted/$basename" && exit 1 #copy to unsorted directory if dicom key not found - #[ -z "$name" ] && echo "Warning: key not found in file $i" 1>&2 && exit 1 #don't do anything if dicom key not found - name=`echo "$name" | sed 's/\//_/g'` - name=`echo "$name" | sed 's/\\\/_/g'` - name=`echo "$name" | sed 's/\*/_/g'` - [ -d "../${dir_name}_sorted/$name" ] || mkdir "../${dir_name}_sorted/$name" 2>>/dev/null - basename=$(basename "$i") - cp -l "$i" "../${dir_name}_sorted/$name/$basename" - }& - jobrunning=$(( $jobrunning + 1 )) - done - finished=$(( $finished + $conc_jobs )) - echo -e -n "( $finished / $total )\r" - wait -done -rm ../${dir_name}_sorted/dicom_files -- 2.47.1