Skip to content

Commit

Permalink
consistently use uint32 in candidate detection
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofelder committed Feb 16, 2024
1 parent 749af84 commit bb44066
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions cellfinder/core/detect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def main(
if end_plane == -1:
end_plane = len(signal_array)
signal_array = signal_array[start_plane:end_plane]
signal_array = signal_array.astype(np.uint32)

callback = callback or (lambda *args, **kwargs: None)

Expand Down
8 changes: 4 additions & 4 deletions cellfinder/core/detect/filters/volume/structure_splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ def ball_filter_imgs(
)

# FIXME: hard coded type
ball_filtered_volume = np.zeros(volume.shape, dtype=np.uint16)
ball_filtered_volume = np.zeros(volume.shape, dtype=np.uint32)
previous_plane = None
for z in range(volume.shape[2]):
bf.append(volume[:, :, z].astype(np.uint16), good_tiles_mask[:, :, z])
bf.append(volume[:, :, z].astype(np.uint32), good_tiles_mask[:, :, z])
if bf.ready:
bf.walk()
middle_plane = bf.get_middle_plane()
Expand All @@ -92,8 +92,8 @@ def iterative_ball_filter(
ns = []
centres = []

threshold_value = 65534
soma_centre_value = 65535
threshold_value = np.iinfo(volume.dtype).max() - 1
soma_centre_value = np.iinfo(volume.dtype).max()

vol = volume.copy() # TODO: check if required

Expand Down

0 comments on commit bb44066

Please sign in to comment.