Skip to content

Commit

Permalink
Raise more informative error message when data with a large z-spacing…
Browse files Browse the repository at this point in the history
… is used (#359)
  • Loading branch information
adamltyson authored Jan 10, 2024
1 parent 8c09302 commit 2bc8000
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cellfinder/core/detect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ def calculate_parameters_in_pixels(
ball_xy_size = int(round(ball_xy_size_um / mean_in_plane_pixel_size))
ball_z_size = int(round(ball_z_size_um / float(voxel_sizes[0])))

if ball_z_size == 0:
raise ValueError(
"Ball z size has been calculated to be 0 voxels."
" This may be due to large axial spacing of your data or the "
"ball_z_size_um parameter being too small. "
"Please check input parameters are correct. "
"Note that cellfinder requires high resolution data in all "
"dimensions, so that cells can be detected in multiple "
"image planes."
)
return soma_diameter, max_cluster_size, ball_xy_size, ball_z_size


Expand Down

0 comments on commit 2bc8000

Please sign in to comment.