4 #####################################################################
5 # create_mhd_4D argument : repertoire nom_fichier_de_sortie #
6 #####################################################################
9 echo "Usage: create_mhd_4D.sh directory output_file_name(without path)"
14 nbph=`find . -iname "*0.mhd" | wc -l`
17 echo "Error: no phase found"
20 orig=`ls -1 *0.mhd | head -n 1`
22 cat $orig | sed "s/NDims = .*/NDims = 4/
23 s/TransformMatrix = .*/TransformMatrix = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1/
25 /CenterOfRotation/ s/.*/& 0/
26 s/AnatomicalOrientation = .*/AnatomicalOrientation = ????/
27 /ElementSpacing/ s/.*/& 1/
28 /DimSize/ s/.*/& $nbph/
29 s/ElementDataFile = .*/ElementDataFile = LIST/" > $2