example.py 774 Bytes
import numpy
import classify
import matplotlib.pyplot as plt
from envi import envi

mask_path = '/home/sberisha/data/masks/'
mask_stack = classify.image2class(mask_path + "class_blood.png", mask_path + "class_coll.png", mask_path +  "class_epith.png",
                         mask_path + "class_lymph.png", mask_path + "class_necrosis.png")

color_image = classify.classcolor2(mask_stack)
plt.imshow(color_image)

data_path ='/home/sberisha/data/cnn/brc961-nfp8/envi/'

feature_matrix, target_matrix = classify.generate_training(data_path + 'brc961-nfp8-project-br1003', mask_stack)

prob_path = '/home/sberisha/data/'
prob_envi= envi(prob_path + "cnn-response")
prob_image = prob_envi.loadall()

class_image = classify.prob2class(prob_image)
plt.imshow(class_image[4,:,:])