6 cat $orig | sed "s/NDims = .*/NDims = 4/
7 s/TransformMatrix = .*/TransformMatrix = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1/
9 /CenterOfRotation/ s/.*/& 0/
10 s/AnatomicalOrientation = .*/AnatomicalOrientation = ????/
11 /ElementSpacing/ s/.*/& 1/
12 /DimSize/ s/.*/& $nbph/
13 s/ElementDataFile = .*/ElementDataFile = LIST/" > "$1/$file_name_4D"
18 echo "$phase" >> "$1/$file_name_4D"
22 #################################################
23 # create_mhd_4D argument : repertoire #
24 #################################################
27 echo "Usage: create_mhd_4D.sh DIRECTORY"
34 list_phase_file=`ls -1 $1*[0-9].mhd`
35 nb_phase_file=`ls -1 $1*[0-9].mhd | wc -l`
36 if [ $nb_phase_file = 0 ]
38 echo "Error: no phase found"
43 orig=`echo $list_phase_file | cut -f 1 -d ' '`
44 listph=`echo $list_phase_file | sed 's:\.mhd:\.raw:g'`
46 file_name_4D=`echo "${pattern}4D.mhd"`
49 echo "$dirname/$file_name_4D"