diff --git a/src/napari_segment/_widget.py b/src/napari_segment/_widget.py index 204e25f61e72ff01af439d2bfea0662955be2fb0..9872ff9ed3635daf33e0fba93f25861cb8d2f3a5 100644 --- a/src/napari_segment/_widget.py +++ b/src/napari_segment/_widget.py @@ -75,7 +75,6 @@ def save_values(val): ) def segment_organoid( BF_layer: "napari.layers.Image", - fluo_layer: "napari.layers.Image", thr: float = 0.3, erode: int = 10, min_diam=150, @@ -84,8 +83,13 @@ def segment_organoid( show_detections=True, ) -> napari.types.LayerDataTuple: # frame = napari.current_viewer().cursor.position[0] - kwargs = {} + kwargs = {"scale": BF_layer.scale} + print(kwargs) ddata = BF_layer.data + if isinstance(ddata, np.ndarray): + chunksize = np.ones(ddata.ndims) + chunksize[-2:] = ddata.shape[-2:] # xy full size + ddata = dask.array.from_array(ddata, chunksize=chunksize) smooth_gradient = ddata.map_blocks( partial(get_gradient), dtype=ddata.dtype ) @@ -151,6 +155,7 @@ def get_gradient(bf_data: np.ndarray, smooth=10): applies gaussian filter Returns SegmentedImage object """ + print(bf_data.shape) assert ( bf_data[0].ndim == 2 ), f"expected 2D shape, got shape {bf_data[0].shape}"