diff --git a/benchmarks/filter_3d.py b/benchmarks/filter_3d.py index 83626bee..3f03fc2c 100644 --- a/benchmarks/filter_3d.py +++ b/benchmarks/filter_3d.py @@ -31,7 +31,7 @@ def gen_signal_array(ny, nx): ) # Use random data for mask data -mask = np.random.randint(low=0, high=2, size=(42, 32), dtype=np.uint8) +mask = np.random.randint(low=0, high=2, size=(42, 32), dtype=bool) # Fill up the 3D filter with planes for plane in signal_array: diff --git a/src/cellfinder_core/detect/filters/plane/plane_filter.py b/src/cellfinder_core/detect/filters/plane/plane_filter.py index c5be0338..c2389602 100644 --- a/src/cellfinder_core/detect/filters/plane/plane_filter.py +++ b/src/cellfinder_core/detect/filters/plane/plane_filter.py @@ -61,7 +61,7 @@ def get_tile_mask(self, plane: da.array) -> Tuple[np.ndarray, np.ndarray]: # Get tiles that are within the brain walker = TileWalker(plane, self.soma_diameter) walker.mark_bright_tiles() - inside_brain_tiles = walker.bright_tiles_mask.astype(np.uint8) + inside_brain_tiles = walker.bright_tiles_mask # Threshold the image thresholded_img = enhance_peaks( diff --git a/src/cellfinder_core/detect/filters/volume/ball_filter.py b/src/cellfinder_core/detect/filters/volume/ball_filter.py index a79900e2..a73f754f 100644 --- a/src/cellfinder_core/detect/filters/volume/ball_filter.py +++ b/src/cellfinder_core/detect/filters/volume/ball_filter.py @@ -116,7 +116,7 @@ def __init__( int(np.ceil(plane_height / tile_step_height)), ball_z_size, ), - dtype=np.uint8, + dtype=bool, ) # Stores the z-index in volume at which new planes are inserted when # append() is called diff --git a/src/cellfinder_core/detect/filters/volume/structure_splitting.py b/src/cellfinder_core/detect/filters/volume/structure_splitting.py index 00610c38..2f553153 100644 --- a/src/cellfinder_core/detect/filters/volume/structure_splitting.py +++ b/src/cellfinder_core/detect/filters/volume/structure_splitting.py @@ -50,7 +50,7 @@ def ball_filter_imgs( ) -> Tuple[np.ndarray, List[Point]]: # OPTIMISE: reuse ball filter instance - good_tiles_mask = np.ones((1, 1, volume.shape[2]), dtype=np.uint8) + good_tiles_mask = np.ones((1, 1, volume.shape[2]), dtype=bool) plane_width, plane_height = volume.shape[:2]