]> Creatis software - clitk.git/blob - vv/scripts/create_mhd_4D.sh
Moved signal files to clitk-tests/signal
[clitk.git] / vv / scripts / create_mhd_4D.sh
1 #!/bin/sh
2
3 ###############################################
4 # create_mhd_4D         argument : repertoire #
5 ###############################################
6 if [ $# -lt 1 ]
7 then
8     echo "Usage: create_mhd_4D directory"
9     exit 1
10 fi
11
12 cd $1
13 nbph=`ls -l *0.mhd | wc -l`
14 orig=`ls -1 *0.mhd | head -n 1`
15
16 cat $orig | sed "s/NDims = .*/NDims = 4/
17                  s/TransformMatrix = .*/TransformMatrix = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1/
18                  /Offset/ s/.*/& 0/
19                  /CenterOfRotation/ s/.*/& 0/
20                  s/AnatomicalOrientation = .*/AnatomicalOrientation = ????/
21                  /ElementSpacing/ s/.*/& 1/
22                  /DimSize/ s/.*/& $nbph/
23                  s/ElementDataFile = .*/ElementDataFile = LIST/" > CT_4D.mhd
24
25 ls -1 *0.raw >> CT_4D.mhd
26 cd ..