This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dice(im1, im2): | |
""" | |
Computes the Dice coefficient, a measure of set similarity. | |
Parameters | |
---------- | |
im1 : array-like, bool | |
Any array of arbitrary size. If not boolean, will be converted. | |
im2 : array-like, bool | |
Any other array of identical size. If not boolean, will be converted. | |
Returns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from skimage.draw import polygon | |
import numpy as np | |
import plistlib | |
def load_inbreast_mask(mask_path, imshape=(4084, 3328)): | |
""" | |
This function loads a osirix xml region as a binary numpy array for INBREAST | |
dataset | |
@mask_path : Path to the xml file |