computationalpathologygroup / ASAP

Program for the analysis and visualization of whole-slide images in digital pathology
https://computationalpathologygroup.github.io/ASAP/
GNU General Public License v2.0
620 stars 165 forks source link

Annotation problem.. #82

Closed jskim92 closed 6 years ago

jskim92 commented 6 years ago

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!

HHZ94 commented 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.