Skip to content

Commit

Permalink
make it work with the input images from the czi plugin which technial…
Browse files Browse the repository at this point in the history
…ly have 4 dimensions
  • Loading branch information
volker-baecker committed Dec 11, 2024
1 parent 148f4ad commit b931d9e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/napari_bigfish/_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,19 @@ def addDetectedSpots(self, data):


def detectSpots(self):
self.model.setData(self.data)
self.model.detectSpots(tuple(self.scale))
data = self.data
if len(data.shape) > 3:
data = np.squeeze(data)
if np.amax(data) > 1:
data = data / np.amax(data)
scale = self.scale
if len(scale) > 3:
scale = scale[1:len(scale)]
self.model.setData(data)
self.model.detectSpots(tuple(scale))
result = self.model.getSpots()
if len(result.shape) < len(data.shape):
return np.hstack((np.zeros((len(result), 1), dtype=result.dtype), result))
return result


Expand Down

0 comments on commit b931d9e

Please sign in to comment.