Closed jskim92 closed 6 years ago
Make sure 'load_img_name' is the target tif file and 'load_annotation_name' is the target xml file. 'output_path' is the format: path+'mask.tif', then it will work. Notice the tif source is 16 or 17 to set 'camelyon17_type_mask' to False or True.
Hello! I'm using ASAP for Camelyon17 dataset.
I have some problem in the annotation code.
This is the code.
mr_image = reader.open(load_img_name) annotation_list = mir.AnnotationList() xml_repository = mir.XmlRepository(annotation_list) xml_repository.setSource(load_annotation_name) xml_repository.load() annotation_mask = mir.AnnotationToMask() camelyon17_type_mask = True label_map = {'metastases': 1, 'normal': 2} if camelyon17_type_mask else {'_0': 1, '_1': 1, '_2': 0} conversion_order = ['metastases', 'normal'] if camelyon17_type_mask else ['_0', '_1', '_2']
output_path = '' annotation_mask.convert(annotation_list, output_path, mr_image.getDimensions(), mr_image.getSpacing(), label_map, conversion_order)
When I run this code, can I see the annotation figure(ground-truth)?
If i can do it, How to to?
Thanks!