Skip to content

This script helps to create binary mask files from XML based on the color of annotation. If you want to change the color of annotation, refer to another code in my repository for XML modification.

Notifications You must be signed in to change notification settings

Mayo-Radiology-Informatics-Lab/XML_to_Binarymask_withPython

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

XML_to_Binarymask_withPython

This script helps to create binary mask files from XML based on the color of annotation. If you want to change the color of annotation, refer to another code in my repository for XML modification.

Provide the folder paths:

xml_path= '.../Test_xml_path/'
file_path = r".../Test_svsfiles/"
mask_output =r".../Mak_out"

dict_mask =get_points_base(w,"yellow",custom_colors=[]) # selected "yellow" color to extract mask of it

required python library:

import openslide
from WSI_handling import wsi
import os
import numpy as np
import matplotlib.pyplot as plt
import xml.etree.ElementTree as ET
import numpy as np

from pathlib import Path
from shapely.geometry import Polygon, MultiPolygon
from shapely.strtree import STRtree
import shapely.affinity
import rasterio.features
import cv2
from tqdm import *
from skimage.util import view_as_blocks
import gc

About

This script helps to create binary mask files from XML based on the color of annotation. If you want to change the color of annotation, refer to another code in my repository for XML modification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%