Hi all,
So Ive bee trying to make a script that runs fsl_anat, then calculates the volume based on the results of the FIRST segmentation. Im trying to do this so that all I have to do is show someone how to run a script, and record the values. So far my script looks like this:
===================================
#!/bin/sh
do
fsl_anat -i cos*.nii.gz -o T1
cd T1.anat/first_results
fslmaths T1_first_all_fast_firstseg.nii.gz - thr 49 -uthr 49 Thalamus_R.nii.gz
fslmaths T1_first_all_fast_firstseg.nii.gz -thr 10 -uthr 10 Thalamus_L.nii.gz
fslmaths Thalamus_L.nii.gz -ero Thalamus_L_1.nii.gz
fslmaths Thalamus_R.nii.gz -ero Thalamus_R_1.nii.gz
fslstats ../T1.nii.gz -k Thalamus_L.nii.gz -V
fslstats ../T1.nii.gz -k Thalamus_L_1.nii.gz -V
fslstats ../T1.nii.gz -k Thalamus_R.nii.gz -V
fslstats ../T1.nii.gz -k Thalamus_R_1.nii.gz -V
cd ../../..
done
======================================
For some reason though, all the files that are generated are saved with a page break:
"T1
.anat" for example. It appears as "T1?.anat" when I list the file in the terminal.
Rendering the rest of the script useless. Im guessing this error is due to my very limited knowledge, but was wondering if anyone has any helpful ideas. I tried separating using the fslmaths part of the script onwards, but it still did the same thing with the page break. If anyone has any ideas or suggestions, itd be great!
|