File size: 1,627 Bytes
eee57cc | 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 | import os
import sys
# Add the topology directory to Python path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..'))
from topologyScoring import partitionTopologicalDiceScore
def evaluateMoonAscendingManifold(gtFilename : str, reconFilename : str, verbose : bool = False) -> int:
"""
Given two ascending manifolds of the same domain, return a similarity score from 0-10.
A score of 0 is considered bad and a score of 10 is considered good. The segmentations should be
represented by a point array called "AscendingManifold" that assigs a region identifier to each point in
the domain. The region identifiers between the ground truth and reconstructed files do not need to match.
Args:
gtFilename: The name of a file storing VTK image data (.vti) storing the ground truth ascending manifold.
each point's region ID should be stored in a point array called "AscendingManifold".
reconFilename: The name of a file storing VTK image data (.vti) storing the reconstructed ascending manifold.
verbose: Should error messages be printed if there are issues with the input files.
"""
return partitionTopologicalDiceScore(gtFilename, "AscendingManifold", reconFilename, "AscendingManifold", verbose)
if __name__ == "__main__":
if len(sys.argv) != 3:
print(f"{os.path.basename(__file__)}: usage is 'python3 {os.path.basename(__file__)} gt_filename.vti recon_filename.vti")
exit(1)
score = evaluateMoonAscendingManifold(sys.argv[1], sys.argv[2], verbose=True)
print(f"This ascending manifold scored: {score}") |