コード例 #1
0
    def phi(self, size=(151, 151)):
        """Returns implicit contour representation of the worm shape
    
    Arguments:
      size (tuple ro array): size of the contour representation
    
    Returns:
      array:  contour representation of the worm
      
    Note: 
      worm border is given by phi==0
    """

        return mask_to_phi(self.mask(size=size))
コード例 #2
0
 def phi(self, size = (151, 151)):
   """Returns implicit contour representation of the worm shape
   
   Arguments:
     size (tuple ro array): size of the contour representation
   
   Returns:
     array:  contour representation of the worm
     
   Note: 
     worm border is given by phi==0
   """
   
   return mask_to_phi(self.mask(size = size));  
コード例 #3
0
 def phi_from_image(self, img, threshold = 75):
   return msk.mask_to_phi(img < threshold);
コード例 #4
0
 def phi_from_image(self, img, threshold=75):
     return msk.mask_to_phi(img < threshold)
コード例 #5
0
import worm.model as wm;


# load image
img = exp.load_img(wid = 80, t= 500000, smooth = 1.0);

aplt.plot_array(img);


from skimage.filters import threshold_otsu
threshold_factor = 0.95;
level = threshold_factor * threshold_otsu(img);

from imageprocessing.masking import mask_to_phi 
phi_img = mask_to_phi(img < level);

### worm  -> Phi

w = wm.WormModel(npoints = 20);

w.from_image(img, sigma = None)
w.plot(image = img);

phi =  w.phi()


plt.figure(1);
plt.subplot(1,3,1);
plt.imshow(phi);
plt.subplot(1,3,2);
コード例 #6
0
import worm.model as wm

# load image
img = exp.load_img(wid=80, t=500000, smooth=1.0)

aplt.plot_array(img)

from skimage.filters import threshold_otsu

threshold_factor = 0.95
level = threshold_factor * threshold_otsu(img)

from imageprocessing.masking import mask_to_phi

phi_img = mask_to_phi(img < level)

### worm  -> Phi

w = wm.WormModel(npoints=20)

w.from_image(img, sigma=None)
w.plot(image=img)

phi = w.phi()

plt.figure(1)
plt.subplot(1, 3, 1)
plt.imshow(phi)
plt.subplot(1, 3, 2)
plt.imshow(phi_img)