performanceanalysis *lesionmask*.nii.gz 0.5 *manualmask*.nii.gz euclidean mean symmetric 1"
echo" "
echo"The script calculates measures of overlap between the lesion mask generated by any algorithm and the manual mask and lesion volumes of both"
echo" "
echo"Threshold = probability threshold that will be applied to output before calculation of the overlap measures"
echo" "
echo"Saveoutput = if set to 0 it will output the measures' names and values on the screen with the following format:"
echo"
# Dice Similarity Index(SI)
# Sensitivity
# Precision
# Specificity
# Jaccardindex
# Conformity
# HausdorffDistance
# Overlapcoefficient
# Tanimotocoefficient
# Matthewscorrelationcoefficient
# Accuracy
# Voxel-level false discovery rate(FDR)
# Voxel-level false negative ratio(FNR)
# Cluster-level FDR
# Cluster-level FNR
# Detection error rate(DER)
# utline error rate(OER)
# Mean Total Area(MTA)
# Volume of segmentation
# Volume of manual mask"
echo" "
echo"-If Saveoutput set to 1 it will save only the values (in the same order) in a .txt filethe output file will be saved in the same folder of the lesion mask with the name Overlap_and_Volumes_<lesionmask>_<threshold>.txt"
echo"Identifying the inputs required for the calculation of Hausdorff Distance"
if[$# -gt 3 ];then
ems="$4 "
else
ems="euclidean "
fi
if[$# -gt 4 ];then
ems+=" $5"
fct="$5"
else
ems+=" mean"
fct="mean"
fi
if[$# -gt 5 ];then
ems+=" $6"
symt="$6"
else
ems+=" symmetric"
symt="symmetric"
fi
if[$# -gt 6 ];then
ems+=" $7"
else
ems+=" 1.0"
fi
if[$# -gt 7 ];then
ems+=" $8"
else
ems+=" 2.0"
fi
echo"Distance function, factor, symmetry, weight and p_norm:"$ems
# echo "dist:" $dist
# echo "input arg:" $ems
# echo "fact:" $fact
if[$# -lt 9 ];then
saveoutput=1
else
saveoutput=$9
fi
# euclidean mean symmetric
# cd into the directory containing the lesion mask. It will create all the files at this level. At the end it will go back to the folder where the command was called from.
# one histogram bin for each positive cluster (index). If there are voxels with that value, there is overlap (TP), if not, that cluster is a false positive (it was in the automatic mask, but no overlap)
# one histogram bin for each true cluster (index). If there are voxels with that value, there is overlap, if not, that cluster is a false negative (it was in the manual mask, but no overlap)
# echo SI $Dice FPR $FPR FNR $FNR FPR_clusters $FPR_cluster FNR_clusters $FNR_cluster DER $DER OER $OER MTA $MTA LESION_vol $lesionvol MANUAL_vol # $manualvol >> Overlap_and_Volumes_${lesmask}_${thresh}.txt
echo"The measure of overlap between the lesion mask($1) and the manual mask($3) and lesion volumes of both">> Overlap_and_Volumes_${lesmask}_${thresh}.txt