I have a volume of image slices and their according masks. I've been trying to use skimage.segmentation
library to mark the object in mind for each slice according to its mask.
import numpy as np
from skimage.segmentation import mark_boundaries
import matplotlib.pyplot as plt
def plot_marked_volume(marked_image_volume, mask):
for slice in range(len(marked_image_volume)):
if np.count_nonzero(mask[slice,:,:]):
plt.figure(figsize=(10,10))
edges_pz = mark_boundaries(marked_image_volume[slice,:,:], mask[slice].astype(np.int),
color=(1,0,0), mode='thin')
plt.imshow(edges_pz)
plt.title('slice ' + str(slice))
plt.show()
Here's a sample image and mask slice:
However running the code results in given boundaries with black backgrounds.
I am expecting an output like the following yellow boundAry (Ignore the 'CG'):
Any thoughts and suggestions as to what might be the issue is appreciated.