-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtractseg.sh
60 lines (31 loc) · 1.93 KB
/
tractseg.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
#!/bin/bash
for participantdir in `cat $1`; do
cd $participantdir
cd Brain/DWI
echo "Create participant's log file variables"
participant=$(basename $participantdir)
date=$(date)
projectdir=/home/pjakuszyk/seropositive_project
fixeldir=/home/pjakuszyk/seropositive_project/template_random/
echo "Processing participant: $participant"
mrtransform $fixeldir/FC_weighted_mean_voxel_smoothed/${participant}_FC_weighted_mean_smooth.mif -warp template2subject_warp.mif -interp nearest FC_native.nii.gz
mrtransform $fixeldir/FD_sum_voxel_smoothed/${participant}_FD_sum_smooth.mif -warp template2subject_warp.mif -interp nearest FD_native.nii.gz
mrtransform $fixeldir/FDC_sum_voxel_smoothed/${participant}_FDC_sum_smooth.mif -warp template2subject_warp.mif -interp nearest FDC_native.nii.gz
sh2peaks wmfod_norm.mif peaks.nii.gz
TractSeg -i peaks.nii.gz -o tractseg_output --output_type tract_segmentation
TractSeg -i peaks.nii.gz -o tractseg_output --output_type endings_segmentation
TractSeg -i peaks.nii.gz -o tractseg_output --output_type TOM
Tracking -i peaks.nii.gz -o tractseg_output --nr_fibers 5000
cd tractseg_output
Tractometry -i TOM_trackings/ -o Tractometry_NODDI_ND.csv -e endings_segmentations/ -s ../NODDI_ficvf.nii
Tractometry -i TOM_trackings/ -o Tractometry_fixel_FC.csv -e endings_segmentations/ -s ../FC_native.nii.gz
Tractometry -i TOM_trackings/ -o Tractometry_fixel_FD.csv -e endings_segmentations/ -s ../FD_native.nii.gz
Tractometry -i TOM_trackings/ -o Tractometry_fixel_FDC.csv -e endings_segmentations/ -s ../FDC_native.nii.gz
if [[ -f Tractometry_NODDI_ND.csv && -f Tractometry_fixel_FC.csv && -f Tractometry_fixel_FD.csv && -f Tractometry_fixel_FDC.csv ]]; then
echo "Finished tractometry for $participant on $date" >> $projectdir/TractSeg.log
else
echo "Something went wrong for $participant - check it manually" >> $projectdir/TractSeg.log
fi
done
exit