-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathDown_sample_3d.sh
executable file
·30 lines (20 loc) · 1014 Bytes
/
Down_sample_3d.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
echo "fange an"
delta_x=$(3dinfo -di $1)
delta_y=$(3dinfo -dj $1)
delta_z=$(3dinfo -dk $1)
sdelta_x=$(echo "((sqrt($delta_x * $delta_x) * 4))"|bc -l)
sdelta_y=$(echo "((sqrt($delta_y * $delta_y) * 4))"|bc -l)
sdelta_z=$(echo "((sqrt($delta_z * $delta_z) * 4))"|bc -l)
echo "$sdelta_x"
echo "$sdelta_y"
echo "$sdelta_z"
3dresample -dxyz $sdelta_x $sdelta_y $sdelta_z -rmode Cu -overwrite -prefix dscaled_$1 -input $1
#3dresample -dxyz $sdelta_x $sdelta_y $sdelta_z -rmode NN -overwrite -prefix scaled_$1 -input $1
echo "############################################################"
echo "############################################################"
echo "########################## BE AWARE #######################"
echo "############ AFNI SCREWS UP THE HEADER ####################"
echo "######## use fslcpgeom source.nii destination.nii ##########"
echo "################# to fix it ###############################"
echo "############################################################"