diff --git a/setup.cfg b/setup.cfg index 0990e71..ac7d340 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = vollseg-napari-mtrack -version = attr: vollseg-napari-mtrack._version.__version__ +version = attr: vollseg_napari_mtrack._version.__version__ description = Segment kymographs of microtubules, actin filaments and perform Ransac based fits to compute dynamic instability parameters for individual kymographs and also in batch long_description = file: README.md long_description_content_type = text/markdown diff --git a/src/vollseg_napari_mtrack/__init__.py b/src/vollseg_napari_mtrack/__init__.py index d76e1d0..ce4a9b1 100644 --- a/src/vollseg_napari_mtrack/__init__.py +++ b/src/vollseg_napari_mtrack/__init__.py @@ -4,16 +4,13 @@ __version__ = "unknown" from ._reader import napari_get_reader -from ._sample_data import make_sample_data +from ._sample_data import get_microtubule_test_data from ._temporal_plots import TemporalStatistics from ._widget import plugin_wrapper_mtrack -from ._writer import write_multiple, write_single_image __all__ = ( "napari_get_reader", - "write_single_image", - "write_multiple", - "make_sample_data", + "get_microtubule_test_data", "plugin_wrapper_mtrack", "MTrackTable", "TemporalStatistics", diff --git a/src/vollseg_napari_mtrack/_sample_data.py b/src/vollseg_napari_mtrack/_sample_data.py index 453db51..1ff78d8 100644 --- a/src/vollseg_napari_mtrack/_sample_data.py +++ b/src/vollseg_napari_mtrack/_sample_data.py @@ -1,21 +1,9 @@ -""" -This module is an example of a barebones sample data provider for napari. +from ._reader import reader_function +from vollseg import test_microtubule_kymographs -It implements the "sample data" specification. -see: https://napari.org/stable/plugins/guides.html?#sample-data -Replace code below according to your needs. -""" -from __future__ import annotations +def get_microtubule_test_data(): -import numpy - - -def make_sample_data(): - """Generates an image""" - # Return list of tuples - # [(data1, add_image_kwargs1), (data2, add_image_kwargs2)] - # Check the documentation for more information about the - # add_image_kwargs - # https://napari.org/stable/api/napari.Viewer.html#napari.Viewer.add_image - return [(numpy.random.rand(512, 512), {})] + extracted_folder = test_microtubule_kymographs() + image = reader_function(extracted_folder)[0][0] + return [(image, {"name": "microtubule_kymographs"})] diff --git a/src/vollseg_napari_mtrack/_version.py b/src/vollseg_napari_mtrack/_version.py index fcdc575..9ca2128 100644 --- a/src/vollseg_napari_mtrack/_version.py +++ b/src/vollseg_napari_mtrack/_version.py @@ -1,3 +1,2 @@ - -__version__ = version = '1.4.3' -__version_tuple__ = version_tuple = (1, 4, 3) +__version__ = version = "1.4.4" +__version_tuple__ = version_tuple = (1, 4, 4) diff --git a/src/vollseg_napari_mtrack/_writer.py b/src/vollseg_napari_mtrack/_writer.py deleted file mode 100644 index 2812baa..0000000 --- a/src/vollseg_napari_mtrack/_writer.py +++ /dev/null @@ -1,33 +0,0 @@ -""" -This module is an example of a barebones writer plugin for napari. - -It implements the Writer specification. -see: https://napari.org/stable/plugins/guides.html?#writers - -Replace code below according to your needs. -""" -from __future__ import annotations - -from typing import TYPE_CHECKING, Any, List, Sequence, Tuple, Union - -if TYPE_CHECKING: - DataType = Union[Any, Sequence[Any]] - FullLayerData = Tuple[DataType, dict, str] - - -def write_single_image(path: str, data: Any, meta: dict) -> List[str]: - """Writes a single image layer""" - - # implement your writer logic here ... - - # return path to any file(s) that were successfully written - return [path] - - -def write_multiple(path: str, data: List[FullLayerData]) -> List[str]: - """Writes multiple layers of different types.""" - - # implement your writer logic here ... - - # return path to any file(s) that were successfully written - return [path] diff --git a/src/vollseg_napari_mtrack/napari.yaml b/src/vollseg_napari_mtrack/napari.yaml index 50425e5..27d1127 100644 --- a/src/vollseg_napari_mtrack/napari.yaml +++ b/src/vollseg_napari_mtrack/napari.yaml @@ -5,14 +5,8 @@ contributions: - id: vollseg-napari-mtrack.get_reader python_name: vollseg_napari_mtrack._reader:napari_get_reader title: Open data with VollSeg Napari MTrack Plugin - - id: vollseg-napari-mtrack.write_multiple - python_name: vollseg_napari_mtrack._writer:write_multiple - title: Save multi-layer data with VollSeg Napari MTrack Plugin - - id: vollseg-napari-mtrack.write_single_image - python_name: vollseg_napari_mtrack._writer:write_single_image - title: Save image data with VollSeg Napari MTrack Plugin - - id: vollseg-napari-mtrack.make_sample_data - python_name: vollseg_napari_mtrack._sample_data:make_sample_data + - id: vollseg-napari-mtrack.get_microtubule_test_data + python_name: vollseg_napari_mtrack._sample_data:get_microtubule_test_data title: Load sample data from VollSeg Napari MTrack Plugin - id: vollseg-napari-mtrack.widget python_name: vollseg_napari_mtrack._widget:plugin_wrapper_mtrack @@ -22,17 +16,11 @@ contributions: - command: vollseg-napari-mtrack.get_reader accepts_directories: true filename_patterns: [] - writers: - - command: vollseg-napari-mtrack.write_multiple - layer_types: ['image*','labels*'] - filename_extensions: [] - - command: vollseg-napari-mtrack.write_single_image - layer_types: ['image'] - filename_extensions: ['.tif'] + sample_data: - - command: vollseg-napari-mtrack.make_sample_data - display_name: VollSeg Napari MTrack Plugin - key: unique_id.1 + - key: get_microtubule_test_data + display_name: Test Microtubule Kymographs + command: vollseg-napari-mtrack.get_microtubule_test_data widgets: - command: vollseg-napari-mtrack.widget display_name: MTrack