Skip to content

Commit

Permalink
Merge pull request #17 from haesleinhuepf/extract_slice
Browse files Browse the repository at this point in the history
Extract slice
  • Loading branch information
haesleinhuepf authored Sep 8, 2022
2 parents 25e2379 + c0dd226 commit 224996e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
19 changes: 17 additions & 2 deletions napari_segment_blobs_and_things_with_membranes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

__version__ = "0.3.2"
__version__ = "0.3.3"
__common_alias__ = "nsbatwm"

from napari_plugin_engine import napari_hook_implementation
Expand Down Expand Up @@ -57,7 +57,8 @@ def napari_experimental_provide_function():
invert_image,
skeletonize,
Manually_merge_labels,
Manually_split_labels
Manually_split_labels,
extract_slice
]


Expand Down Expand Up @@ -803,3 +804,17 @@ def butterworth(image: "napari.types.ImageData", cutoff_frequency_ratio: float =
"""
from skimage.filters import butterworth as skimage_butterworth
return skimage_butterworth(image, cutoff_frequency_ratio, high_pass, order)


@register_function(menu="Utilities > Extract slice (nsbatwm)")
@jupyter_displayable_output(library_name='nsbatwm', help_url='https://www.napari-hub.org/plugins/napari-segment-blobs-and-things-with-membranes')
@time_slicer
def extract_slice(image:"napari.types.ImageData", slice_index:int = 0, axis:int = 0) -> "napari.types.ImageData":
"""Extract (take) a slice from a stack.
See also
--------
..[0] https://numpy.org/doc/stable/reference/generated/numpy.take.html
"""
return np.take(image, slice_index, axis=axis)

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def test_something():
divide_images,\
invert_image, \
skeletonize, \
butterworth
butterworth, \
extract_slice

import numpy as np

Expand Down Expand Up @@ -69,7 +70,8 @@ def test_something():
morphological_gradient,
local_minima_seeded_watershed,
invert_image,
butterworth]:
butterworth,
extract_slice]:

print(operation)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = napari-segment-blobs-and-things-with-membranes
version = 0.3.2
version = 0.3.3
author = Robert Haase
author_email = [email protected]
url = https://github.com/haesleinhuepf/napari-segment-blobs-and-things-with-membranes
Expand Down

0 comments on commit 224996e

Please sign in to comment.