From ee568ccc2ae2be4d9d60967e522e2d81cb148d95 Mon Sep 17 00:00:00 2001 From: dbcache Date: Wed, 4 Jul 2012 18:49:50 +0200 Subject: [PATCH] using get_dicom_field_value in midp scripts --- scripts/midp_common.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/midp_common.sh b/scripts/midp_common.sh index a5d0baf..e120168 100755 --- a/scripts/midp_common.sh +++ b/scripts/midp_common.sh @@ -9,6 +9,9 @@ # ############################################################################### +bin=`dirname $0` +source $bin/tools.sh + # # check return value passed and abort if it represents an error (ie, ret != 0) # optionally, a function can be passed as a 3rd parameter, to be called just @@ -219,7 +222,7 @@ select_contour_gui() if [ -z $roi ] then zenity --warning --text="You must choose one contour." - select_contour $roi_list + select_contour_gui $roi_list else rtstruct_roi_name=$roi fi;; @@ -228,7 +231,7 @@ select_contour_gui() then exit else - select_contour $roi_list + select_contour_gui $roi_list fi;; -1) zenity --error --text="Unexpected error. Please relaunch the application." @@ -259,8 +262,8 @@ select_contour() select_roi() { - rtstruct_roi_name_list=( `clitkDicomInfo ${rtstruct_file} | grep "3006|0026" | cut -d '[' -f 4 | sed 's/| V 3006|0026[LO] [ROI Name] \|]//'` ) - rtstruct_roi_number_list=( `clitkDicomInfo ${rtstruct_file} | grep "3006|0022" | cut -d '[' -f 4 | sed 's/| V 3006|0026[LO] [ROI Number] \|]//'` ) + rtstruct_roi_name_list=( `get_dicom_field_value "3006|0026" ${rtstruct_file} all | sed 's/ /_/g'` ) + rtstruct_roi_number_list=( `get_dicom_field_value "3006|0022" ${rtstruct_file} all | sed 's/ //g'` ) rtstruct_roi_list=( ) for i in $(seq 0 1 $(( ${#rtstruct_roi_name_list[@]} - 1 ))); do rtstruct_roi_list[$i]=${rtstruct_roi_number_list[$i]}:${rtstruct_roi_name_list[$i]} @@ -275,4 +278,4 @@ select_roi() rtstruct_roi=${rtstruct_roi_number_list[$(( $rtstruct_roi_index ))]} rtstruct_roi_name=${rtstruct_roi_name_list[$(( $rtstruct_roi_index ))]} fi -} \ No newline at end of file +} -- 2.45.1