Skip to content

Comments

Add instance segmentation mask support#541

Open
aranega wants to merge 34 commits intochanzuckerberg:mainfrom
MetaCell:feature/CC-429
Open

Add instance segmentation mask support#541
aranega wants to merge 34 commits intochanzuckerberg:mainfrom
MetaCell:feature/CC-429

Conversation

@aranega
Copy link
Contributor

@aranega aranega commented Oct 31, 2025

Relates to

Description

This PR introduces the notion of InstanceSegmentationMask for the DB ingestion. We followed the recommendation and steps listed in this link.

The following screenshot and JSON fragment shows the resulting instance segmentation mask included in neuroglancer, and the related state configuration.

screen
{
	"layers": {
      "type": "segmentation",
      "source": {
        "url": "precomputed://http://localhost:9000/10442/24aug01b_Position_33_5/Reconstructions/VoxelSpacing5.006/NeuroglancerPrecompute/100-intracellular_anatomical_structure-1.0_instancesegmentationmask",
        "transform": {
          "outputDimensions": {
            "x": [
              5.006e-10,
              "m"
            ],
            "y": [
              5.006e-10,
              "m"
            ],
            "z": [
              5.006e-10,
              "m"
            ]
          },
          "inputDimensions": {
            "x": [
              5.006e-10,
              "m"
            ],
            "y": [
              5.006e-10,
              "m"
            ],
            "z": [
              5.006e-10,
              "m"
            ]
          }
        },
        "subsources": {
          "default": true,
          "mesh": true
        },
        "enableDefaultSubsources": false
      },
      "pick": false,
      "tab": "rendering",
      "selectedAlpha": 1,
      "hoverHighlight": false,
      "meshRenderScale": 2,
      "segments": [
        "1",
        "2",
        "3",
        "4",
        "5"
      ],
      "segmentColors": {
        "1": "#ff00ff",
        "2": "#800000",
        "3": "#1063ff",
        "4": "#f7bb01",
        "5": "#36fad8"
      },
      "name": "100 intracellular anatomical structure instancesegmentation"
    }
}

Note

As note/question, we unsure about the tests we introduced for the db-ingestion. We followed the same pattern than the one for annotations in general we modified:

  • foo-1.0.json for 30001/RUN1 to introduce new files;
  • conftest.py to align the file_size with the new size of foo-1.0.json;
  • test_db_annotation.py to add the injected files as part of the assertions.

The tests are passing, but we are not sure if we need to tests the db-import differently or add something else.

aranega and others added 30 commits August 15, 2025 10:52
this was causing all data to be one singular label
@kaloster
Copy link
Contributor

@aranega the test coverage here looks good and comprehensive to me and follows the existing pattern 🚀

@aranega aranega marked this pull request as ready for review December 11, 2025 12:29
@daniel-ji daniel-ji self-requested a review February 12, 2026 23:34
Copy link
Contributor

@daniel-ji daniel-ji left a comment

Choose a reason for hiding this comment

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

@uermel I've gone ahead and resolved merge conflict issues and opened a PR (#602) with those fixes (I can't actually resolve merge conflicts on this branch since I have no write permissions), not sure if MetaCell is still working on this, if not, I'm happy to carry this to the finish line; if MetaCell is still working on this, I can move my comments from the #602 PR here and also PR my changes into the MetaCell branch. The largest issue I see is no source/standardized/shared S3 validation of the instance segmentation mask files. If this out of scope of the PR, happy to re-review and approve. I also have left more detailed comments in the PR at #602. Thanks!

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.

4 participants