Skip to content

Commit af6ef7f

Browse files
committed
added exception handling
1 parent a4709f3 commit af6ef7f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/nanopyx/core/transform/_le_esrrf3d.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class eSRRF3D(LiquidEngine):
3434

3535
def run(self, image, magnification_xy: int = 2, magnification_z: int = 2, radius: float = 1.5, radius_z: float = 0.5, voxel_ratio: float = 4.0, sensitivity: float = 1, mode: str = "average", doIntensityWeighting: bool = True, run_type=None):
3636
# TODO: complete and check _run inputs, need to complete variables?
37+
if radius * 2 > image.shape[2] / 2 or radius * 2 > image.shape[3] / 2:
38+
raise ValueError("Radius is too big for the image. Half the radius must be smaller than both half the number of columns and half number of rows of the image.")
39+
if radius_z * 2 > image.shape[1] / 2:
40+
raise ValueError("Radius_z is too big for the image. Half the radius_z must be smaller than half of number of Z planes")
3741
if image.dtype != np.float32:
3842
image = image.astype(np.float32)
3943
if len(image.shape) == 4:

0 commit comments

Comments
 (0)