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

display transformed Segmentations #106

Open
martinschorb opened this issue May 17, 2023 · 3 comments
Open

display transformed Segmentations #106

martinschorb opened this issue May 17, 2023 · 3 comments

Comments

@martinschorb
Copy link
Contributor

Hi,
probably also a spec issue, but I run into this inconsistency when using MoBIE-Python.

  • I have a segmentation source
  • I transform it -> sourceNamesAfterTransform new source name
  • I transform it another time differently -> sourceNamesAfterTransform yet another source name
  • I like to show these segmentations together

The table data of the two displayed segmentations should stay the same as for the original segmentation source. Now, I run into the problem, that the "new" segmentationDisplays do no longer point to the original table, so the view is not displayed and also validation fails (as expected) with :

ValueError: The table source MSB30_4_derivedsourceblabla is not present in the source metadata.

I thought of just pointing it to the original table but then I am back to:

  File "..../mobie-utils-python/mobie/metadata/view_metadata.py", line 347, in get_view
    assert display_setting["segmentationDisplay"]["name"] == name,\
AssertionError: MSB30_4_spotIDs, MSB30_4_spotIDs_tp_44-to-48

that the names no longer match.

Now, the only solution/workaround I see at the moment is duplicating the tables and creating a new directory for each segmentationDisplay. This can easily become a pain with dozens if not hundreds of duplicate directories.

Also, if something changes in the original table, ideally all derived tables or segmentationDisplays should update accordingly.

So I think we need a thorough re-think of how to deal with these "transient" or "virtual" sources created within a view with sourceNamesAfterTransform.

Or we need to allow linking to another default table for a segmentationDisplay ( and modify these checks in get_view).

Any ideas and thoughts?

@constantinpape
Copy link
Contributor

Hi Martin,
I think I understand the issue and indeed that might be a corner case that is not supported in the python code (and maybe also not in the spec) yet. I will try to have a closer look at this later, but as this is quite complex it would help a lot to have a minimal reproducible example.

@martinschorb
Copy link
Contributor Author

The following procedure generates a view that cannot be reproduced in mobie:

  • open blobs sample image
  • threshold
  • connected components
  • create new mobie project
  • add source as segmentation
  • open mobie project
  • open source a second time
  • change LUT of one source (color by column)
  • manually transform one source (translate)
  • save view

This view "twoseg_fromMoBIE" shows both segmentations at the same position, because the transform has no sourceNamesAfterTransform.

When I manually add the sourceNamesAfterTransform ("twoseg_sourcenames"), I run into the table issue.

The project can be found in
/g/emcf/schorb/data/sourcenames

@martinschorb
Copy link
Contributor Author

  • "twoseg_fromMoBIE": validates correctly in Python, but is not displayed correctly in the viewer (duplicate view name -> transformation not applied to only one source)
  • "twoseg_sourcenames" displays correctly in the viewer. Validation fails
  File "/g/emcf/schorb/code/mobie-utils-python/mobie/validation/utils.py", line 72, in _assert_true
    raise ValueError(msg)
ValueError: The table source transformedseg is not present in the source metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants