|
913 | 913 |
|
914 | 914 | # ============================= FASTSURFER - STATS ========================================= |
915 | 915 |
|
916 | | - if [ "$fsaparc" == "0" ] ; then |
917 | | - # get stats for the aseg (note these are surface fine tuned, that may be good or bad, below we also do the stats for the input aseg (plus some processing) |
918 | | - # cmd="recon-all -subject $subject -segstats $hiresflag $fsthreads" |
919 | | - if [[ "$segstats_legacy" == "true" ]] ; then |
920 | | - cmd=($python "$FASTSURFER_HOME/FastSurferCNN/mri_brainvol_stats.py" |
921 | | - --subject "$subject") |
922 | | - RunIt "$(echo_quoted "${cmd[@]}")" "$LF" |
923 | | - |
924 | | - cmd=($python "$FASTSURFER_HOME/FastSurferCNN/mri_segstats.py" --seed 1234 |
925 | | - --seg "$mdir/aseg.mgz" --sum "$statsdir/aseg.stats" --pv "$mdir/norm.mgz" |
926 | | - "--in-intensity-name" norm "--in-intensity-units" MR --subject "$subject" |
927 | | - --surf-wm-vol --ctab "$FREESURFER_HOME/ASegStatsLUT.txt" --etiv |
928 | | - --threads "$threads") |
929 | | -# cmd="$python $FASTSURFER_HOME/FastSurferCNN/mri_segstats.py --seed 1234 --seg $mdir/wmparc.mgz --sum $statsdir/wmparc.stats --pv $mdir/norm.mgz --in-intensity-name norm --in-intensity-units MR --subject $subject --surf-wm-vol --ctab $FREESURFER_HOME/WMParcStatsLUT.txt --etiv" |
930 | | - else |
931 | | - # calculate brainvol stats and aseg stats with segstats.py |
932 | | - cmd=($python "$FASTSURFER_HOME/FastSurferCNN/segstats.py" --sid "$subject" |
933 | | - --segfile "$mdir/aseg.mgz" --segstatsfile "$statsdir/aseg.stats" |
934 | | - --pvfile "$mdir/norm.mgz" --normfile "$mdir/norm.mgz" --threads "$threads" |
935 | | - # --excl-ctxgmwm: exclude Left/Right WM / Cortex despite ASegStatsLUT.txt |
936 | | - --excludeid 0 2 3 41 42 |
937 | | - --lut "$FREESURFER_HOME/ASegStatsLUT.txt" --empty |
938 | | - measures --compute "BrainSeg" "BrainSegNotVent" "VentricleChoroidVol" |
939 | | - "lhCortex" "rhCortex" "Cortex" "lhCerebralWhiteMatter" |
940 | | - "rhCerebralWhiteMatter" "CerebralWhiteMatter" |
941 | | - "SubCortGray" "TotalGray" "SupraTentorial" |
942 | | - "SupraTentorialNotVent" "Mask($mdir/mask.mgz)" |
943 | | - "BrainSegVol-to-eTIV" "MaskVol-to-eTIV" "lhSurfaceHoles" |
944 | | - "rhSurfaceHoles" "SurfaceHoles" |
945 | | - "EstimatedTotalIntraCranialVol") |
946 | | - RunIt "$(echo_quoted "${cmd[@]}")" "$LF" |
947 | | - echo "Extract the brainvol stats section from segstats output." | tee -a "$LF" |
948 | | - # ... so stats/brainvol.stats also exists (but it is slightly different |
949 | | -# cmd="recon-all -subject $subject -segstats $hiresflag $fsthreads" |
950 | | -# RunIt "$cmd" "$LF" |
951 | | - |
952 | | - # this call is only "required" to "compute" brainvol.stats, so --normfile/--pvfile |
953 | | - # are not required |
954 | | - cmd=($python "$FASTSURFER_HOME/FastSurferCNN/segstats.py" --sid "$subject" |
955 | | - --segfile "$mdir/aseg.mgz" --pvfile "$mdir/norm.mgz" |
956 | | - --measure_only --threads "$threads" --segstatsfile "$statsdir/brainvol.stats" |
957 | | - measures --file "$statsdir/aseg.stats" |
958 | | - --import "BrainSeg" "BrainSegNotVent" "SupraTentorial" |
959 | | - "SupraTentorialNotVent" "SubCortGray" "lhCortex" "rhCortex" |
960 | | - "Cortex" "TotalGray" "lhCerebralWhiteMatter" |
961 | | - "rhCerebralWhiteMatter" "CerebralWhiteMatter" "Mask" |
962 | | - --compute "SupraTentorialNotVentVox" "BrainSegNotVentSurf" |
963 | | - "VentricleChoroidVol") |
964 | | - fi |
| 916 | + # get stats for the aseg (note these are surface fine tuned, that may be good or bad, below we also do the stats for the input aseg (plus some processing) |
| 917 | + # cmd="recon-all -subject $subject -segstats $hiresflag $fsthreads" |
| 918 | + if [[ "$segstats_legacy" == "true" ]] ; then |
| 919 | + cmd=($python "$FASTSURFER_HOME/FastSurferCNN/mri_brainvol_stats.py" |
| 920 | + --subject "$subject") |
965 | 921 | RunIt "$(echo_quoted "${cmd[@]}")" "$LF" |
| 922 | + |
| 923 | + cmd=($python "$FASTSURFER_HOME/FastSurferCNN/mri_segstats.py" --seed 1234 |
| 924 | + --seg "$mdir/aseg.mgz" --sum "$statsdir/aseg.stats" --pv "$mdir/norm.mgz" |
| 925 | + "--in-intensity-name" norm "--in-intensity-units" MR --subject "$subject" |
| 926 | + --surf-wm-vol --ctab "$FREESURFER_HOME/ASegStatsLUT.txt" --etiv |
| 927 | + --threads "$threads") |
| 928 | +# cmd="$python $FASTSURFER_HOME/FastSurferCNN/mri_segstats.py --seed 1234 --seg $mdir/wmparc.mgz --sum $statsdir/wmparc.stats --pv $mdir/norm.mgz --in-intensity-name norm --in-intensity-units MR --subject $subject --surf-wm-vol --ctab $FREESURFER_HOME/WMParcStatsLUT.txt --etiv" |
| 929 | + else |
| 930 | + # calculate brainvol stats and aseg stats with segstats.py |
| 931 | + cmd=($python "$FASTSURFER_HOME/FastSurferCNN/segstats.py" --sid "$subject" |
| 932 | + --segfile "$mdir/aseg.mgz" --segstatsfile "$statsdir/aseg.stats" |
| 933 | + --pvfile "$mdir/norm.mgz" --normfile "$mdir/norm.mgz" --threads "$threads" |
| 934 | + # --excl-ctxgmwm: exclude Left/Right WM / Cortex despite ASegStatsLUT.txt |
| 935 | + --excludeid 0 2 3 41 42 |
| 936 | + --lut "$FREESURFER_HOME/ASegStatsLUT.txt" --empty |
| 937 | + measures --compute "BrainSeg" "BrainSegNotVent" "VentricleChoroidVol" |
| 938 | + "lhCortex" "rhCortex" "Cortex" "lhCerebralWhiteMatter" |
| 939 | + "rhCerebralWhiteMatter" "CerebralWhiteMatter" |
| 940 | + "SubCortGray" "TotalGray" "SupraTentorial" |
| 941 | + "SupraTentorialNotVent" "Mask($mdir/mask.mgz)" |
| 942 | + "BrainSegVol-to-eTIV" "MaskVol-to-eTIV" "lhSurfaceHoles" |
| 943 | + "rhSurfaceHoles" "SurfaceHoles" |
| 944 | + "EstimatedTotalIntraCranialVol") |
| 945 | + RunIt "$(echo_quoted "${cmd[@]}")" "$LF" |
| 946 | + echo "Extract the brainvol stats section from segstats output." | tee -a "$LF" |
| 947 | + # ... so stats/brainvol.stats also exists (but it is slightly different |
| 948 | +# cmd="recon-all -subject $subject -segstats $hiresflag $fsthreads" |
| 949 | +# RunIt "$cmd" "$LF" |
| 950 | + |
| 951 | + # this call is only "required" to "compute" brainvol.stats, so --normfile/--pvfile |
| 952 | + # are not required |
| 953 | + cmd=($python "$FASTSURFER_HOME/FastSurferCNN/segstats.py" --sid "$subject" |
| 954 | + --segfile "$mdir/aseg.mgz" --pvfile "$mdir/norm.mgz" |
| 955 | + --measure_only --threads "$threads" --segstatsfile "$statsdir/brainvol.stats" |
| 956 | + measures --file "$statsdir/aseg.stats" |
| 957 | + --import "BrainSeg" "BrainSegNotVent" "SupraTentorial" |
| 958 | + "SupraTentorialNotVent" "SubCortGray" "lhCortex" "rhCortex" |
| 959 | + "Cortex" "TotalGray" "lhCerebralWhiteMatter" |
| 960 | + "rhCerebralWhiteMatter" "CerebralWhiteMatter" "Mask" |
| 961 | + --compute "SupraTentorialNotVentVox" "BrainSegNotVentSurf" |
| 962 | + "VentricleChoroidVol") |
966 | 963 | fi |
| 964 | + RunIt "$(echo_quoted "${cmd[@]}")" "$LF" |
| 965 | + |
967 | 966 |
|
968 | 967 | # ============================= MAPPED-WMPARC ========================================= |
969 | 968 | { |
|
0 commit comments