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}")