Skip to content

Conversation

andsild
Copy link
Collaborator

@andsild andsild commented Jun 4, 2025

This PR could maybe be divided into multiple PRs. Let me know if you want to. In summary, the changes are:

  1. Allow a flag called overlappingSuperpixels in the attribute part of annotation files. If this is true (default is false) then masks for the filmstrip and review cards are removed. This is for AML, where bounding boxes for cells often overlap, which means part of the thumbnails will be missing. I defined it in the attributes to avoid having to change all the JSON validation schemas in girder.

  2. Support for ignoring background pixels. This is to enable sparse pixelmaps to be defined, where there is empty space between superpixels (in my case, space between white blood cells). Right now it is implemented with a 1 pixel bounding box in the top left corner. If this is found at index 0, then the UI will ignore this (and other clicks in empty areas).
    I tried using a cleaner approach where I told the UI to ignore all pixelmap-values which had 0. But this requires changes to several parts of the code, including changes to large_image and histomicstk. I could start working on this, but for now I just wanted to start simple. In my current commit, the downside is that the background superpixel with a 1 pixel bounding box will show up in the filmstrip and review card, which may confuse the user. I tried hiding it from the UI, but this also requires changes in multiple locations, so I wanted to hear any reviewer's thoughts first.

  3. a simple log to the console to fix getJobXmlUrl exception is eaten by framework #185

  4. Potential error fixes in cases with few superpixels

andsild added 4 commits June 4, 2025 10:57
In our AML case, some bounding boxes for cells overlap. Thus, masks
don't look good since a good chunk of the bounding box for a cells may
be masked away.

This commit adds an option to remove the mask altogether.
Even though an error is raised, it never makes it to the console.
See issue on github for more details
If there are fewer superpixels than what you can show on a single page,
the following code would yield -1
@cooperlab
Copy link

I endorse 1. Not all applications will have masks for the regions (for example, a grid tiling).

Regarding 2 - I could see a flag set at the entry screen, or metadata added to the 'Data' folder to modify app and CLI behavior. What are the specific issues with large_image and histomicstk?

@andsild
Copy link
Collaborator Author

andsild commented Jun 4, 2025

there are several calls to viewerWidget.drawAnnotation(annotation) which assumes pixelmaps are 0-indexed, so that would have to be changed in large_image / girder. Maybe also the annotationModel.

histomicstk by default generates superpixels with index value 0. It's a smaller, trivial fix to add an optional parameter first_index or starting_value = 0

It might be smaller fixes but I didn't want to touch it right away util we've had a discussion or two about it 😄

@cooperlab
Copy link

In this repo, we have documented the data formats for people who generate data offline and import. Will need to document the additional indices variable stored in the h5. This could be a mandatory variable or optional.

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

Successfully merging this pull request may close these issues.

getJobXmlUrl exception is eaten by framework
2 participants