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

Label image disappears when performing clustering on timelapse data #269

Closed
stefanhahmann opened this issue Sep 25, 2023 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@stefanhahmann
Copy link
Contributor

Steps to reproduce:

  1. Fresh installation of Napari following the instructions of https://biapol.github.io/blog/mara_lampert/getting_started_with_mambaforge_and_python/readme.html
  2. Import label_image.tif contained in label_image.zip (zip file contains file label_image.tif, which github did not allow to upload directly)

label_image_import

The same label may occur in multiple frames.

  1. Load measurements contained in
    measurements.csv using Tools > Measurements > Load from CSV

load_measurements

The same label may occur in multiple frames. However, the combination label-frame is unique.

  1. When plotting two features, e.g. Branch Sinousity and Branch displacement and making a selection, the original label image label turns black (which is unexpected) and the id layer does not really show the results.

ncp

When using the 2D-view (i.e. multiple slices per timepoint), the selection performed in the cluster plotter widget seems to be shown correct. However, the original label image is still black.

It is a bit unclear to me, if the provided data is not sufficient or if there actually is a bug in Napari Cluster Plotter

@stefanhahmann stefanhahmann added the bug Something isn't working label Sep 25, 2023
@stefanhahmann stefanhahmann changed the title Bug with 3d timelapses and 3d view Bug with 3d timelapses and 3d view? Sep 25, 2023
@zoccoler
Copy link
Collaborator

Hi @stefanhahmann !

A quick thing I could notice is that you have a label 0 in the table. The 0 usually refers to the background, so I think you should avoid having that. Maybe you have to increment all labels. This may be at least part of the problem.

To better investigate that, you could check the checkbox "Show selected" on the top-left. This should allow you to check which row of the table correspond to which object, like shown in the first gif here. I am not sure if this works with time-lapse data, but I would expect it does.

@stefanhahmann
Copy link
Contributor Author

stefanhahmann commented Sep 27, 2023

Hi @stefanhahmann !

A quick thing I could notice is that you have a label 0 in the table. The 0 usually refers to the background, so I think you should avoid having that. Maybe you have to increment all labels. This may be at least part of the problem.

Thanks for pointing this out. The label 0 caused the problem. After incrementing everything by 1 (i.e. the labels in the image and the labels in the corresponding table), it works as expected:

ncp

I created a Pull-Request to make this a bit more explicit in the readme.md: #270

However, the effect that the label image disappears after the cluster plotter has been used for the first time remains and still feels like a bug to me.

To better investigate that, you could check the checkbox "Show selected" on the top-left. This should allow you to check which row of the table correspond to which object, like shown in the first gif here. I am not sure if this works with time-lapse data, but I would expect it does.

Thanks for the hint. I can confirm that this works for timelapse data.

@stefanhahmann stefanhahmann changed the title Bug with 3d timelapses and 3d view? Label image disappears when performing clustering on timelapse data Sep 27, 2023
stefanhahmann added a commit that referenced this issue Sep 27, 2023
* This was motivated by running into unexpected behaviour when using a label image and a measurement table that used `0` as a label, cf.: #269
@stefanhahmann
Copy link
Contributor Author

I close this issue in favor of: #271

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants