GithubHelp home page GithubHelp logo

allencell / napari-allencell-segmenter Goto Github PK

View Code? Open in Web Editor NEW
16.0 11.0 6.0 861 KB

A plugin that enables image segmentation provided by Allen Institute for Cell Science

License: BSD 3-Clause "New" or "Revised" License

Python 99.57% Makefile 0.43%
napari-plugin napari napari-allencell-segmenter

napari-allencell-segmenter's Introduction

napari-allencell-segmenter

License PyPI Python Version Anaconda tests codecov

A plugin that enables 3D image segmentation provided by Allen Institute for Cell Science

The Allen Cell & Structure Segmenter plugin for napari provides an intuitive graphical user interface to access the powerful segmentation capabilities of an open source 3D segmentation software package developed and maintained by the Allen Institute for Cell Science (classic workflows only with v1.0). โ€‹The Allen Cell & Structure Segmenter is a Python-based open source toolkit developed at the Allen Institute for Cell Science for 3D segmentation of intracellular structures in fluorescence microscope images. This toolkit brings together classic image segmentation and iterative deep learning workflows first to generate initial high-quality 3D intracellular structure segmentations and then to easily curate these results to generate the ground truths for building robust and accurate deep learning models. The toolkit takes advantage of the high replicate 3D live cell image data collected at the Allen Institute for Cell Science of over 30 endogenous fluorescently tagged human induced pluripotent stem cell (hiPSC) lines. Each cell line represents a different intracellular structure with one or more distinct localization patterns within undifferentiated hiPS cells and hiPSC-derived cardiomyocytes.

More details about Segmenter can be found at https://allencell.org/segmenter


This napari plugin was generated with Cookiecutter using with @napari's cookiecutter-napari-plugin template.

Installation

Option 1 (recommended):

After you installed the lastest version of napari, you can go to "Plugins" --> "Install/Uninstall Package(s)". Then, you will be able to see all available napari plugins and you can find us by name napari-allencell-segmenter. Just click the "install" button to install the Segmenter plugin.

Option 2:

You can also install napari-allencell-segmenter via pip:

pip install napari-allencell-segmenter

Quick Start

In the current version, there are two parts in the plugin: workflow editor and batch processing. The workflow editor allows users adjusting parameters in all the existing workflows in the lookup table, so that the workflow can be optimized on users' data. The adjusted workflow can be saved and then applied to a large batch of files using the batch processing part of the plugin.

  1. Open a file in napari (the plugin is able to support multi-dimensional data in .tiff, .tif. ome.tif, .ome.tiff, .czi)
  2. Start the plugin (open napari, go to "Plugins" --> "napari-allencell-segmenter" --> "workflow editor")
  3. Select the image and channel to work on
  4. Select a workflow based on the example image and target segmentation based on user's data. Ideally, it is recommend to start with the example with very similar morphology as user's data.
  5. Click "Run All" to execute the whole workflow on the sample data.
  6. Adjust the parameters of steps, based on the intermediate results. For instruction on the details on each function and the effect of each parameter, click the tooltip button. A complete list of all functions can be found here
  7. Click "Run All" again after adjusting the parameters and repeat step 6 and 7 until the result is satisfactory.
  8. Save the workflow
  9. Close the plugin and open the batch processing part by (go to "Plugins" --> "napari-allencell-segmenter" --> "batch processing")
  10. Load the customized workflow (or an off-the-shelf workflow) json file
  11. Load the folder with all the images to process
  12. Click "Run"

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the BSD-3 license, "napari-allencell-segmenter" is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

napari-allencell-segmenter's People

Contributors

aerendel avatar heeler avatar jxchen01 avatar lynwilhelm avatar neuromusic avatar schoinh avatar tlambert03 avatar yrkim98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

napari-allencell-segmenter's Issues

Installation how-to video

Updated for the release of new features in the classic plugin as of June 2022.

Need discussion.

Documentation

Content for the video tutorials is documented here:
https://docs.google.com/document/d/1ZGBgXEb60hJpV02QH6ORydbaNmWG7Ub2kAddbtyEG1k/edit?usp=sharing

Use Case

Especially for users not familiar with a terminal and/or napari, it would be helpful to provide a video showing how to install the plugin as part of our docs. Inspiration: https://www.sciencedirect.com/science/article/pii/S0006349520300357#mmc1

This will expand to include videos showing new/existing features of the plugin and how to use them.

Alternatives

Just having text instructions with/without screenshot images.

Segmenter engine - Support workflow function categories

Story
As an plugin developer, I want to have a way of representing, displaying and executing classic Segmenter workflow functions so that I can write maintainable and extensible code

A/C
I know this is done when...

  • Using the object representation of a workflow and its steps, I can identify the processing category of a given workflow function related to the workflow (ie. Preprocessing, Core, Post-processing, etc.)

Details

  • We need to know if a function is Pre-processing, Core or Post-processing
  • This should be tagged in the json configuration, and available in the object model

Workflow steps - Pin Run all and Close workflow buttons to bottom

Use Case

When a workflow is lengthy, the buttons at the bottom of the second page of the Workflow Editor plugin get pushed to the bottom, and the user has to scroll down to see/find the buttons.

Solution

It would be nice if the buttons such as "Run all" and "Close workflow" were pinned to the bottom of the plugin window, and was always visible regardless of window size or the number of steps in a workflow.

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them

Run Gaussian blur

Story:
As an engineer, I want to prototype the use of the aicssegmentation code from a Napari plugin so that I can identify potential engineering road blocks

A/C
I know this is done when...

  • When I open the Segmenter plugin, I can see a description and button for a Gaussian blur function (per Wireframe)
  • Given I have an single channel image loaded in Napari
    When I click on the button
    Then I can see a new Napari layer containing the blurred version of the image
  • Given I do not have any image loaded in Napari
    When I click on the button
    I am prompted to load an image first

Details

  • We need to run the Gaussian blur function from aicssegmentation on the image and save the result into a new Napari layer (these are like Photoshop layers)
  • Function for Gaussian blur:
from aicssegmentation.core.pre_processing_utils import image_smoothing_gaussian_3d
img_smooth = image_smoothing_gaussian_3d(img, sigma=3.0)
  • The Gaussian blur should be hard coded to run with a kernel size parameter of 3.0
  • This will require importing and using code from aicssegmentation
  • We only need to worry about single channel images for now (no channel selection yet). For multi-channel images, just use the first channel.
  • Test files from Jianxu: https://drive.google.com/drive/folders/1bYVFWaLqDFDq3tlopBv0iK42OPt2EosS?usp=sharing
  • Consider looking at magicgui as a replacement for dealing directly with QT for UI components

Add GH-Action to run a linting test

Use Case

Please provide a use case to help us understand your request in context
To maintain code readability we should lint our code to make sure it's consistent with the PEP standards.

Solution

Please describe your ideal solution
Github-Action running flake8

Alternatives

Please describe any alternatives you've considered, even if you've dismissed them
make it part of tox and trigger tox from GH-Actions

Unit test coverage pass 1

First pass at increasing coverage / add missing unit tests

Details

  • Add missing unit tests for uncovered. Aim at taking coverage back up to > 90%

Workflow selection - Image channel selection

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have an image layer selected in the plugin
    Then I can see all available image channels for the selected layer in a selectable list

  • Given I am on the "Select workflow" screen
    And I select a different image layer
    Then the channel list is updated to reflect the new selected layer

  • Given I am on the "Select workflow" screen
    And I do NOT have an image layer selected in the plugin
    Then I can see an empty channel list (only header is visible)
    And the channel list is disabled for selection

Details

  • Display available channels for the layer selected previously selected
  • Channels should be displayed in the proper order as ordered in the image
  • Channel names should be prefixed with the channel index (ex: Ch0 - Brightfield, Ch1 - 498nm)
  • Channel list should have a "header" item such as "Select a channel" (refer to wireframes for exact text)
  • "Default" state for the list should show the header
  • "Disabled" state for the list should show the header and be grayed out, and no ability to interact with the list
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for UI/UX details

Workflow selection - Show available workflows

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have selected an image layer
    And I have selected an image channel
    Then I can see all available Segmenter workflows in a grid
    And interaction with the grid is enabled

  • Given I am on the "Select workflow" screen
    And I have not selected an image layer
    Then I can see all available Segmenter workflows in a grid
    And the grid is disabled for interaction

  • Given I am on the "Select workflow" screen
    And I have not selected an image channel
    Then I can see all available Segmenter workflows in a grid
    And the grid is disabled for interaction

Details

  • Display available workflows as a selectable grid
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for wireframes
  • Structure thumbnail images are provided by the Segmenter engine. This story should mainly be hooking up the UI to the segmenter engine.
  • Remember to handle state changes and enable / disable the grid in response to user deselecting layer / channel or those selections being reset for any other reason

[Segmenter-core] json workflow support

Goal:

  1. Each workflow can be defined and implemented as a json file
  2. A workflow defined by a json file can be easily applied on an image to generate segmentation
  3. Automatically pull all available workflows
  4. Provide a comprehensive definition of all functions needed for json workflows, including module name, parameter definition (data type, widget type, data range, etc..)

NOTE:
JSON is not the only way to define a workflow. Advanced users still have the power to implement any workflow in python and used inside Segmenter. To make a workflow available in the plugin as a JSON config file, all functions used in this workflow have to be "streamlinable", which may require implementation of new wrappers. Here, our goal is to make all current workflows in look-up-table available as JSON file, which will require new wrappers or adjusting current wrappers.

Styling adjustments for workflow selection window

Use Case

As a user, I don't want disabled workflow selection steps to be visually prominent and distracting.

Solution

  • Make the down-arrow color on a disabled dropdown dimmer
  • Make the workflow images on disabled workflow selection buttons dimmer

Provide fully compatible test images for end to end testing

Story
As a stakeholder, I want to make sure the plugin is 100% compatible with the data we release to the public

A/C
I know this is done when...

  • I have access to a full set of fully vetted test images that pass metadata validation

Details:

  • We want at least 1 image for each available Segmenter workflow (JianXu to select)
  • Ensure images can properly load in Napari
  • Image(s) should be of similar nature to the ones released on CFE
  • Provide enough test images to cover different scenarios as needed

Close / Hide plugin window

Story
As a Napari user, I want to access the AICS Segmenter plugin so that I can run segmentations

A/C
I know this is done when...

  • I can close / hide the Segmenter plugin from Napari using the [X] (Close) button
  • (I can close / hide the Segmenter plugin from Napari using an interactive menu)
  • (I can close / hide the Segmenter plugin from Napari using a keyboard shortcut)

Details

Napari UI widgets demo plugin

Story
As a UX designer, I want code examples of all available UI widgets so that I can produce a UI design that is compatible and looks good in Napari

A/C
I know this is done when...

  • I can view an example of all relevant UI widgets in a single Napari plugin window
  • We have selected the underlying UI library that will be used

Details

  • Goal is to showcase the available standard UI widgets in a single plugin window so that Thao can 1) review the look and feel of all of them and 2) build her own UI prototypes using python code instead of Powerpoint. This will allow to design a more precise and accurate UI and will result in less development work.
  • As part of this work, we should identify whether we want to use QT or magicgui (whichever seems easier to use and/or prettier). If there is no obvious choice right at the beginning, consider building 2 versions of this demo - one for each library.
  • See https://allencellscience.slack.com/archives/C01L7L5M29H/p1613777279189500

List of possible widgets to include (non-exhaustive):

  • Textbox
  • Drop down list
  • Slide bar
  • Checkbox
  • Button
  • Progress bar
  • Labels
  • Fieldset / Form group
  • Expander (expand / collapse form group)

Workflow selection - Layer selection

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have one or more 3D images loaded in Napari
    Then I can see all available 3D image layers in a selectable list
    And the current "active layer" is pre-selected

  • Given I am on the "Select workflow" screen
    And I do not have any 3D image loaded in Napari
    Then I can see a warning message prompting to open a 3D image
    And the layer selection is disabled

  • Given I am on the "Select workflow" screen
    And I have one or more 3D images loaded in Napari
    When I add or delete a layer in the Napari viewer
    Then the layer selection list is updated to reflect the new state

Details

Segmenter engine - Support default parameter values

Story
As an plugin developer, I want to have a way of representing, displaying and executing classic Segmenter workflow functions so that I can write maintainable and extensible code

A/C
I know this is done when...

  • Using the object representation of a workflow function and its parameters, I can access the default recommended value for each parameter

Details

  • Add support for default recommended value for workflow functions to workflow engine
  • Default recommended parameter values should live in the json config and accessible through the object model

Workflow selection - Layer selection

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have an image loaded in Napari
    Then I can see all available layers in a selectable list
  • Given I am on the "Select workflow" screen
    And I have an image loaded in Napari
    When I add or remove a layer in the Napari viewer
    Then the layer list is updated to reflect the state of the viewer

Details

Setup CICD

Story
As a developer, I want my code to always be verified and ready to deploy so that I can deliver new features as fast as possible

A/C
I know this is done when...

  • I can build, package, version and deploy (to Pypi) the plugin project with a single automated process
  • When code is pushed to a branch open for pull request, build and unit tests are ran automatically
  • When I try to merge code into main, the branch must have a successful build, otherwise I cannot merge
  • When code is pushed to a branch open for pull request, code coverage report is generated and checked against coverage treshold

Details

  • Use github actions
  • Jackson's or Napari's cookiecutter should have a lot of that already in place
  • Might need to setup an access key or something for publishing to public Pypi
  • Setup automatic build / testing on push to branch, and successful build status checks on merges
  • Versioning should be as straightforward as possible and well documented

Workflow selection - Display channel names if available

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • The channel selection list shows the actual channel names if they are available

Details

  • Update channel list to use the actual channel name if available.
  • Channel names will come from the metadata if available so we will need to use aicsimageio to open the original image and get needed the information. This is dependent on Napari exposing channel source or metadata information.
  • Channel names should be prefixed with the channel index (ex: Ch0 - Brightfield, Ch1 - 498nm)

Hard-coded UI for page 6

Story
As a designer, I want access to UI prototypes viewable in Napari so that I can fine tune the design

A/C
I know this is done when...

  • Hard-coded version of the "Segmenter Workflow Selection" view displayable in Napari

Details

Create pypi repository

Story
As the Institute, I want to distribute the plugin to users under a recognizable name so that people know where it's coming from

A/C

  • Repository created in pypi and owned by AICS

Details

  • Package name = napari-allencell-segmenter
  • Make sure we use the proper AICS pypi account

UI - Build collapsable box Widget

Story
As a Segmenter plugin developer, I want reusable UI components so that I can develop more efficiently

A/C
I know this is done when...

  • I have access to a custom "Expand / Collapse" box PyQT Widget
  • The widget allows me to collapse (hide) the contents of the box manually and programmatically
  • The widget allows me to expand (show) the contents of the box manually and programmatically

Details

Segmenter workflow engine - Support user parameter inputs

Story
As an plugin developer, I want to have a way of representing, displaying and executing classic Segmenter workflow functions so that I can write maintainable and extensible code

A/C
I know this is done when...

  • I can specify / override parameter values when running a workflow using the aicssegmentation workflow engine

Details

  • Currently the engine uses the parameter defaults defined in the config. Design mechanism / helper functions to allow programmatic override of parameter values for a workflow step. The goal is to make it easy and safe to use from the plugin's perspective.

Setup MVC-like code structure

Story
As a plugin developer, I want to follow specific code patterns that decouple UI from logic so that I can develop faster and write maintainable and testable code

A/C
I know this is done when...

  • MPP has been refactored to showcase a code structure where UI, flow and core logic are decoupled (ex: any flavor of MVC)

Details

  • Implement simple MVC-like pattern using the MPP to set a good example for developing the rest of the project
  • Pattern should be easily understandable, decouple UI definition from control flow and core logic and enable easy unit testing of flow and logic
  • This is not a huge project (even though it will grow) so careful about over-engineering this.

Dynamic workflow engine for classic Segmenter

Story
As an plugin developer, I want to have a way of representing, displaying and executing classic Segmenter workflow functions so that I can write maintainable and extensible code

A/C
I know this is done when...

  • I can represent Classic Segmenter workflows, function and function parameters through Python objects
  • I can convert/serialize these workflow/function objects into a non binary (human readable) format such as JSON or YAML
  • I can dynamically execute Classic Segmenter workflows or individual functions from their object representations
  • All available workflows can be successfully run through this engine

Details

  • Build an engine and necessary API for representing and executing Segmenter workflows so that we do not have to hard-code anything.
  • Goal 1 is to lay the necessary foundation to support planned APP features such as users Creating, Saving and Loading custom workflows
  • Goal 2 is to decouple the plugin code from the Segmenter code as much as possible. When breaking code changes happen in Segmenter (ex: functions get renamed, parameters get added or changed, etc.), we do not want to make the same code changes in two different locations
  • Goal 3 is to provide maximum flexibility for Segmenter and the plugin to evolve. For example, minimizing the amount of development required to add new functions to existing workflows, or to add entirely new workflows
  • This is foundational / core functionality that could be reused outside of the Napari plugin so it most likely should live in the aicssegmentation code base
  • Initially put huge focus on the API (how we interact with the Segmenter code from the plugin)

Workflow selection - Show tooltips for workflows

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • I can see the workflow name displayed as a tooltip when I hover over a workflow in the workflow selection grid

Details:

  • Display workflow name as tooltip on workflow grid when user hovers

Workflow steps - Run all

Story
As a segmenter plugin user, I want to access and run Segmenter workflow processing steps so that I can produce Segmentations

A/C
I know this is done when...

  • Given I have a selected Workflow
    And I am on the Workflow Steps screen
    When I click on "Run all"
    Then I can see the results of the segmentation as a new Napari image layer for each workflow step
    And only the most recent layer (ie. result of last processing step) has its visibility turned on in the Napari viewer*

Details

  • Process the full segmentation workflow and display the results in new Napari layers
  • For now, the results of each step should be saved as a new "intermediate" layer for each step. So if there are 4 workflow steps we should see 4 new layers in the Napari viewer
    • We want to "hide" all other available layers in the Napari viewer and only have the result of the last step be set to "Visible" in the viewer (see wireframe for example). This means the little eye icon in Napari viewer should be disabled for all layers except the most recent one we produced.
  • Naming format for result layers: {step_number}. {step_name} ex: 1. Intensity Normalization
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for latest UI/UX details.
  • For this story, displaying/updating progress bars and warnings for lengthy processing are out of scope

Make plugin discoverable as "available plugin"

Story
As a Napari user, I want to see the AllenCell segmenter plugin in the list of available Napari plugins so that I can install it from Napari

A/C
I know this is done when...

  • I can see the AllenCell segmenter plugin in the list of available plugins under Napari > Plugins > Install/Remove plugins
  • I can install the plugin automatically from the Install/Remove plugins UI

Details

  • Figure out what needs to be done to have our segmenter plugin show up under "available plugins" under the Plugins > Install/Remove plugins menu
  • If functionality available through Napari, make sure the plugin can be updated from there as well when we release a new version

UI - Build reusable slider/spinbox combo widget

Use Case

As a plugin developer, I need a reusable custom widget that contains a slider and a spinbox that are synced to each other. Qt's QSlider widget only supports integer values, so it needs to be adapted to work with float input and outputs as well.

Notes

  • AGAVE has a similar Qt widget (in C++) we could use for inspiration / borrow from.
  • MagicGUI has a FloatSlider we could potentially use if it integrates nicely with rest of our Qt code

Alternatives

  • If we are very short on time, for the FPP, we could consider using a QDoubleSpinBox only instead of a slider + spinbox combo.

@Aerendel FYI

Segmenter plugin - provide structure thumbnails

Story
As an plugin developer, I want to have a way of representing, displaying and executing classic Segmenter workflows so that I can write maintainable and extensible code

A/C
I know this is done when...

  • Using the workflow engine, I can access and load image thumbnails representative of each type of cellular structure associated to each workflow

Details

  • we want the Segmenter to be hosting the actual structure thumbnails instead of the plugin
  • figure out how to embed those in then Segmenter package + good pattern for linking to them
  • should be available through the Segmenter workflow engine object model

Refactor pass 1

First pass of refactoring

Details:

  • Review and address all #TODO items that can be addressed

MPP1.6 - Run LaminB1 full workflow

Story
As a stakeholder, I want to see a complex workflow running in Napari so that I can identify any potential issues

A/C:

  • I can run a full Lamin B1 interphase workflow on an image loaded in Napari

Details:

  • Similar to MPP1.5 which has a full workflow for SEC61B - implement the same for LaminB1 interphase.
  • This can be done in a new branch to make things easier and just replace SEC61B to avoid having to create extra screens

Workflow steps - Close workflow - Keep layers

Story
As a segmenter plugin user, I want to access and run Segmenter workflow processing steps so that I can produce Segmentations

A/C
I know this is done when...

  • Given I am on the Workflow Steps screen
    When I click on the "Close workflow" button
    Then I see a confirmation modal window
    And I can no longer interact with the Segmenter plugin or with the Napari viewer

  • Given I am on the Workflow Steps screen
    And the "Close workflow" confirmation modal window is displayed
    When I click on "Cancel"
    Then the modal window disappears
    And I can interact with the Segmenter plugin and the Napari viewer

  • Given I am on the Workflow Steps screen
    And the "Close workflow" confirmation modal window is displayed
    When I click on "Close & keep"
    Then the modal window disappears
    And I am taken back to the "Workflow selection" screen
    And all my previous selections have been reset to the default state

Details

  • We need a modal window for this (ie. everything else on the screen should be disabled while the modal is visible). This should be available using QDialog.setModal() but needs to be tested
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for confirmation window UI/UX specs
  • For this story we are only implementing the "Close & Keep layers" functionality in order to limit scope. The "Close & Delete layers" will be implemented in a separate story.
  • Closing the workflow should completely reset the state of the plugin / model, equivalent to loading the plugin for the first time after opening Napari.

Hard-coded UI page 7 - LAMINB1 Interphase

Story
As a designer, I want access to UI prototypes viewable in Napari so that I can fine tune the design

A/C
I know this is done when...

  • Hard-coded version of the "Segmenter Workflow Steps" view displayable in Napari for the LAMINB1 workflow

Details

  • Implement a hard-coded UI only version of the "Workflow steps" page. See latest wireframes for UI reference: https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg
  • For this page, show the exact text and parameter controls that would be displayed for LAMINB1 workflow (get full spec from Jianxu)
  • The goal is to have a starting point for Thao and us to fine-tune the UI.
  • This should have no working functionality - only the UI.
  • Start a new branch for this type of work (ex: feature/pg7-lamnb1-ui)
  • This can be the second view displayed when you open the plugin (accessible by a button, or by clicking on a workflow)

Workflow steps - Run all - Track execution in progress bar

Story
As a segmenter plugin user, I want to access and run Segmenter workflow processing steps so that I can produce Segmentations

A/C
I know this is done when...

  • When using Run All, the progress bar gets updated incrementally for workflow each step that has been completed

Results

  • Implement simple version of progress bar: if a workflow has 4 steps, then increment 4 times.

Workflow selection - Handle deletion of active layer

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have an image layer selected in the plugin
    When I delete the layer that was selected
    Then the layer list is updated to reflect the new state
    And the layer list is reset to its default state
    And the channel list is disabled for selection
    And the workflow selection is disabled for selection

Details

  • Handle what happens when users Delete the active layer. The effect should basically be to reset the whole page to its default state with no layer selected and everything else disabled.
  • This will require to subscribe to Napari viewer Layer list events

Workflow selection - UI breaks after closing a workflow

Expected behavior:
After closing a workflow on page2, page1 should function properly again

Actual behavior:
After closing a workflow on page 2, when I click on a workflow in the workflow grid, I see the following error:
RuntimeError: wrapped C/C++ object of type QComboBox has been deleted

Hard-coded UI for page 7 - SEC61B

Story
As a designer, I want access to UI prototypes viewable in Napari so that I can fine tune the design

A/C
I know this is done when...

  • Hard-coded version of the "Segmenter Workflow Steps" view displayable in Napari for the SEC61B workflow

Details

  • Implement a hard-coded UI only version of the "Workflow steps" page. See latest wireframes for UI reference: https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg
  • For this page, show the exact text and parameter controls that would be displayed for SEC61B workflow (get full spec from Jianxu)
  • The goal is to have a starting point for Thao and us to fine-tune the UI.
  • This should have no working functionality - only the UI.
  • Start a new branch for this work (ex: feature/workflow-steps-ui)

Workflow selection - Warn user when no 3D image is loaded

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And no image is loaded in Napari (ie. no layers available)
    Then I can see a warning message asking me to load a 3D image

  • Given I am on the "Select workflow" screen
    And I have an image loaded 2D Napari (ie. less than 3 dimensions)
    Then I can see a warning message asking me to load a 3D image

  • Given I am on the "Select workflow" screen
    When I remove all layers from the Napari viewer
    Then I can see a warning message asking me to load a 3D image

Details

  • We want to detect missing or incompatible images and warn the user. The plugin requires at least one 3 dimensional image (meaning at least 3 dimensions X, Y and Z available) to be loaded.
  • Warning should be displayed at the top of the plugin widget
  • Might be worth looking into designing/styling a standard "Warning label" widget that we can reuse
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for wireframes

Setup repository

Story
As a developer, I want a dedicated and properly structured code repository for the Napari Segmenter plugin so that I can contribute to the project

A/C
I know this is done when...

  • Project repository exists in Github in the proper organization
  • All main contributors have read and write access to the repository
  • Dev / Engineering leads have administrative access to the repository
  • Repository is visible to the public
  • main branch exists and is protected against deletion and forced pushes
  • Pushes to the main branch can only happen through pull requests approved by at least 2 reviewers

Details

  • Setup as private repository for now, in AllenCell organization
  • Scope for this story is only repository setup - setting up python packaging or CICD is out of scope

Setup Napari plugin project

Story
As a developer, I want a dedicated and properly structured code repository for the Napari Segmenter plugin so that I can contribute to the project

A/C
I know this is done when...

  • I have a complete and working Python project structure for the Napari segmenter plugin
  • I can install the project from source, using pip
  • I can run unit tests using pytest
  • I can see a Readme with basic instructions on how to run the project locally and contribute
  • I can run my project in Napari as a "Hello World" plugin or as any template / example provided by Napari

Details

  • Scope is to properly setup the Python project so that we can start development. CICD and versioning is out of scope.
  • Recommendation is to setup the project using the Napari Cookiecutter or the AICS Python Cookiecutter or a combination of both. Project must include everything it needs to be installed from source, tested and run in Napari.
  • Cookiecutter for Napari plugin development: https://github.com/napari/cookiecutter-napari-plugin

Workflow steps - Display selected workflow steps

Story
As a segmenter plugin user, I want to access and run Segmenter workflow processing steps so that I can produce Segmentations

A/C
I know this is done when...

  • Given I have a selected Workflow
    And I am on the Workflow Steps screen
    Then I can see all processing steps for the selected Workflow
    And steps are ordered by processing order
    And steps are categorized
    And I can see input controls for the parameters of each workflow step
    And input values are pre-populated with the step's default recommended parameter values

Details

  • Dynamically display workflow steps for the selected workflow
  • Steps should have number, a title, editable input parameters, be properly ordered and be properly categorized (pre-processing, core or post-processing). See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for latest UI/UX details.
  • Since number and step details varies depending on the workflow - this will be better achieved with a reusable "Workflow step" widget. This story depends on completion of such a widget (covered in issue #43 )
  • Input values should be defaulted to the recommended defaults provided by the workflow engine

Open / Show plugin window

Story
As a Napari user, I want to access the AICS Segmenter plugin so that I can run segmentations

A/C
I know this is done when...

  • I can open / display the Segmenter plugin from Napari using an interactive menu
  • (I can open / display the Segmenter plugin from Napari using a keyboard shortcut)
  • The Segmenter plugin window is clearly identifiable by its title / label

Details

  • Plugin name / identifier should be "Allen Cell Structure Segmenter"
  • Menu path: Plugin > Allen Cell Segmenter
  • This work is mostly about plugin registration / configuration within Napari. This captures any work needed to have the plugin show in Napari once installed, with proper name and access paths. This will probably be minimal dev work and mostly testing, depending on the quality of Napari's plugin architecture.
  • Make sure all UI plugin access paths are covered if relevant, per Napari's UI plugin guidelines (ex: keyboard shortcut / dropdown menus, etc.)

Workflow selection - Select workflow from available workflows

Story
As a segmenter plugin user, I want to have access to available image channels and segmenter workflows so that I can start processing my data

A/C
I know this is done when...

  • Given I am on the "Select workflow" screen
    And I have selected an image layer
    And I have selected an image channel
    When I click on a workflow
    Then I am taken to the "Workflow steps" screen
    And I can see the name of the workflow I selected
    And I can see a new Layer in the Napari viewer which is a copy of the selected layer

Details

  • Navigate to "Workflow steps" screen when a workflow is selected
  • For now, just display the name of the workflow. Displaying the full workflow steps will be handled in another story
  • In addition, we want to create a new layer based on the selected image channel. This new Layer will have a distinctive name following a format such as Layer 0 - image name: channel index - channel name. Refer to wireframes for exact naming format spec
  • See https://docs.google.com/presentation/d/1zQ41ih3b3CzFrYqbT96phuEGq5Y8mrzo_MDHkLfE7Dg for wireframes

Workflow steps - Execute workflow with user provided parameters

Story
As a user, I want to be able to adjust the function parameters and run a workflow with those adjusted parameters.

A/C

  • When the user adjusts parameters on the workflow steps page and then clicks "Run all", the workflow is executed with the adjusted parameters that are displayed in the UI, instead of the default parameters.

Details

  • Figure out how to gather all inputs from the workflow step widgets and pass them to the executable workflow.
  • This story depends on #57

Workflow steps - Display information workflow chart

Story
As a segmenter plugin user, I want to access and run Segmenter workflow processing steps so that I can produce Segmentations

A/C

  • Given I have a selected Workflow
    And I am on the Workflow Steps screen
    When I click on the information icon
    I can see a visual representation of the workflow

Details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.