Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing labels #3

Merged
merged 13 commits into from
Mar 25, 2024
Merged

Editing labels #3

merged 13 commits into from
Mar 25, 2024

Conversation

ziw-liu
Copy link
Collaborator

@ziw-liu ziw-liu commented Mar 15, 2024

New widget contribution to edit labels.

image

Usage

Prequisite

The dataset must have one channel that contains labels. If this channel is not an integer type, it will be casted to uint16 before viewing and saving. Please report back if your dataset has more than 65535 instances per FOV.

Launch

  • From command line: napari -w napari-iohub "Edit labels"
  • From napari GUI: 'Plugins' -> 'napari iohub' -> 'Edit labels'

Load FOV

Click 'Browse dataset' and select the dataset with images and labels to edit. Select FOV in the drop-down menus and click 'Load'. This could take a while if loading large images.

Edit

Use napari tools to edit the labels layer.

Save

For each time point, click 'Save' to save the work. This will only save the current time point in the current FOV.

  • If the save path is the same as input, this will edit in-place. A warning will be issued. The labels will be casted to the same data type of the original array, even if it is not an integer type.
  • If the save path is a new zarr store, the unsaved timepoints and FOVs in the source dataset will not appear in the saved annotations.

@ziw-liu ziw-liu added the enhancement New feature or request label Mar 15, 2024
@ziw-liu ziw-liu linked an issue Mar 15, 2024 that may be closed by this pull request
3 tasks
@Soorya19Pradeep
Copy link

Thank you @ziw-liu for the quick iteration on this tool. I have tried it and it works great for annotation. I created an editable install of the branch in a fresh conda environment. I had to pip install Napari separately. Is the tool supposed to be pip-installed into an environment with Napari in it? Thanks again!

@mattersoflight
Copy link
Collaborator

mattersoflight commented Mar 18, 2024

I also just tested the plugin and it works well! The UI is intuitive except for a user having to set the label layer through the environment variable.
Can we add a dropdown widget for Label Layer to Edit that is populated when Load Dataset or Load FOV are clicked?

The UI is responsive when loading a single FOV from the Exp_2023_09_28_DENV_A2.zarr annotation dataset, but slow when loading a single FOV from 2024_02_07_ZIKV_DENV-Live. I expected that the first FOV will be slow to load (parsing of metadata), but subsequent FOVs will be responsive (loading the pixel data from a path). I was comparing the speeds within the same datasets.

I think this is ready to merge after above issues are handled.

Thanks @ziw-liu !

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Mar 18, 2024

Napari will be installed automatically when doing pip install -e ".[dev]". It is not required for 'user' installations following napari's contribution guidelines.

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Mar 18, 2024

The UI is responsive when loading a single FOV from the Exp_2023_09_28_DENV_A2.zarr annotation dataset, but slow when loading a single FOV from 2024_02_07_ZIKV_DENV-Live. I expected that the first FOV will be slow to load (parsing of metadata), but subsequent FOVs will be responsive (loading the pixel data from a path). I was comparing the speeds within the same datasets.

Note that we are experiencing major slow downs on the Lustre FS right now. Testing I/O lentency may not yield consistent results.

@mattersoflight
Copy link
Collaborator

mattersoflight commented Mar 18, 2024 via email

@Soorya19Pradeep
Copy link

@mattersoflight , lustre has been very slow since Friday. @biohubgriznog has updated it on #hpc-community slack channel. Maybe we can check with him when it will be back on track so that we can do a better speed test.

@mattersoflight
Copy link
Collaborator

mattersoflight commented Mar 21, 2024

@Soorya19Pradeep @ziw-liu loading 2D movies is reasonably fast! I tried the segmentations from a recent experiment /hpc/projects/intracellular_dashboard/viral-sensor/2024_02_07_ZIKV_DENV-Live/4-segment/nuclei_mask.zarr/.

@ziw-liu when the Label Channel was set to Nuclei_Mask, the layer was not cast as labels layer. Can you add that behavior?
image

@Soorya19Pradeep as we discussed, the correct training/test dataset can be derived from uninfected, high-MOI, and mid-MOI FOVs.

@ziw-liu In the process, I noticed that the nuclei in the above dataset are under-segmented.

image

Can you and Soorya figure out the movies that capture different infection conditions and are properly segmented?

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Mar 21, 2024

@mattersoflight Did you click 'Load' to load the image?

napari-iohub.mov

Also the ROI you showed is not under-segmented:

image

@mattersoflight mattersoflight self-requested a review March 21, 2024 18:34
Copy link
Collaborator

@mattersoflight mattersoflight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ziw-liu LGTM. After @Soorya19Pradeep has annotated one movie with this, the widget is ready for other teams to try.

@ziw-liu
Copy link
Collaborator Author

ziw-liu commented Mar 25, 2024

@Soorya19Pradeep Can I have your review?

@Soorya19Pradeep
Copy link

I have annotated two movies each with 48 frames using the plugin. It works well for me! Thanks @ziw-liu!

@ziw-liu ziw-liu merged commit 15f72ef into main Mar 25, 2024
7 checks passed
@ziw-liu ziw-liu deleted the fov-save branch March 25, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable proof-reading of infection state
3 participants