def evidence_to_result(num=999, overwrite=None, save=True): if overwrite: ves, mem, syn = overwrite else: ves, mem, syn = load_evidence(num) c = ClusterAnalysis(ves, mem, syn) if save: if not overwrite: synv.seek(num) save_results(num, synv, c) return c
def compare_results(num): import os path = 'Comparison/%d' % num imgv.seek(num) synv.seek(num) try: os.mkdir(path) except: pass c = evidence_to_result(num, None, False) c.image_clusters(areas=True, only_synapses=True, background=imgv).save(path+'/My Result.tif') imgv.red_mark(synv).save(path+'/Verification Result.tif') imgv.save(path+'/Original Image.tif') ves, mem, syn = load_evidence(num) synv.red_mark(mem).blue_mark(ves).green_mark(syn).save(path+'/fusion.png')
c = evidence_to_result(num, None, False) c.image_clusters(areas=True, only_synapses=True, background=imgv).save(path+'/My Result.tif') imgv.red_mark(synv).save(path+'/Verification Result.tif') imgv.save(path+'/Original Image.tif') ves, mem, syn = load_evidence(num) synv.red_mark(mem).blue_mark(ves).green_mark(syn).save(path+'/fusion.png') if __name__=='__main__': if len(sys.argv)==2: NUM = int(sys.argv[1]) else: NUM = 2 print NUM imgv.seek(NUM) synv.seek(NUM) if DEBUG: ves, mem, syn = load_evidence(NUM) else: ves, mem, syn = get_evidence(imgv, NUM) compare_results(0)