Skip to content
New issue

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

Raise more informative error message when data with a large z-spacing is used #359

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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