We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello all! I am having some problems calculating feret_diameter_max in regionprops.
def calculate_feret_dia(lbl_img): props = measure.regionprops(lbl_img,spacing=(0.215,0.0401,0.0401)) #z,y,x px size feret_dia = [x.feret_diameter_max for x in props] return feret_dia
Error trace:
ValueError Traceback (most recent call last) Cell In[26], line 1 ----> 1 pre_feret_dia = calculate_feret_dia(pre_syn_label) Cell In[24], line 3 1 def calculate_feret_dia(lbl_img): 2 props = measure.regionprops(lbl_img) ----> 3 feret_dia = [x.feret_diameter_max for x in props] 4 return feret_dia Cell In[24], line 3 1 def calculate_feret_dia(lbl_img): 2 props = measure.regionprops(lbl_img) ----> 3 feret_dia = [x.feret_diameter_max for x in props] 4 return feret_dia File c:\Users\BiswanathSaha\miniconda3\envs\stable\lib\site-packages\skimage\measure\_regionprops.py:482, in RegionProperties.feret_diameter_max(self) 479 coordinates = np.vstack(find_contours(identity_convex_hull, .5, 480 fully_connected='high')) 481 elif self._ndim == 3: --> 482 coordinates, _, _, _ = marching_cubes(identity_convex_hull, 483 level=.5) 484 distances = pdist(coordinates * self._spacing, 'sqeuclidean') 485 return sqrt(np.max(distances)) File c:\Users\BiswanathSaha\miniconda3\envs\stable\lib\site-packages\skimage\measure\_marching_cubes_lewiner.py:131, in marching_cubes(volume, level, spacing, gradient_direction, step_size, allow_degenerate, method, mask) 129 elif method != 'lewiner': 130 raise ValueError("method should be either 'lewiner' or 'lorensen'") --> 131 return _marching_cubes_lewiner(volume, level, spacing, 132 gradient_direction, step_size, 133 allow_degenerate, use_classic=use_classic, 134 mask=mask) File c:\Users\BiswanathSaha\miniconda3\envs\stable\lib\site-packages\skimage\measure\_marching_cubes_lewiner.py:160, in _marching_cubes_lewiner(volume, level, spacing, gradient_direction, step_size, allow_degenerate, use_classic, mask) 158 level = float(level) 159 if level < volume.min() or level > volume.max(): --> 160 raise ValueError("Surface level must be within volume data range.") 161 # spacing 162 if len(spacing) != 3: ValueError: Surface level must be within volume data range.
def calculate_feret_dia(lbl_img): props = measure.regionprops(lbl_img,spacing=(0.215,0.0401,0.0401)) #z,y,x px size feret_dia = [x.feret_diameter_max for x in props] return feret_dia pre_feret_dia = calculate_feret_dia(pre_syn_label)
3.9.18 (main, Sep 11 2023, 14:09:26) [MSC v.1916 64 bit (AMD64)] Windows-10-10.0.22621-SP0 scikit-image version: 0.22.0 numpy version: 1.24.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description:
Hello all! I am having some problems calculating feret_diameter_max in regionprops.
Error trace:
Way to reproduce:
def calculate_feret_dia(lbl_img):
props = measure.regionprops(lbl_img,spacing=(0.215,0.0401,0.0401)) #z,y,x px size
feret_dia = [x.feret_diameter_max for x in props]
return feret_dia
pre_feret_dia = calculate_feret_dia(pre_syn_label)
Version information:
The text was updated successfully, but these errors were encountered: