Created
May 25, 2014 20:18
-
-
Save vighneshbirodkar/7d0be4b90056bcd14b7c to your computer and use it in GitHub Desktop.
Watershed 3D test
This file contains 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
import graph | |
import time | |
import sys | |
import tiffile as tf | |
from skimage import io | |
from matplotlib import pyplot as plt | |
import numpy as np | |
import random | |
from skimage.morphology import watershed | |
from scipy.ndimage import label | |
from scipy.ndimage.filters import gaussian_filter as gf | |
from skimage.util import img_as_float | |
from scipy.ndimage.measurements import watershed_ift | |
slice = 200 | |
img = tf.imread('../data/image.tif') | |
boundary = tf.imread('../data/prob.tif') | |
boundary = img_as_float(boundary) | |
boundary = gf(boundary,5) | |
seed_mask = boundary < 0.01 | |
seed_label,n = label(seed_mask) | |
print "Found %d Seeds" % n | |
w = watershed(img, seed_label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment