Project-MONAI / Project-MONAI/MONAI

Include ObjectID for create_test_image_2d

Open
#5,267 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Contribution wanted Feature request
Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

Is your feature request related to a problem? Please describe.
create_test_image_2d is great, but at the moment, you can get the class ID, but not the object instance ID. This means that two overlapping objects effectively become one large object (i.e. the boundary is undefined).

Describe the solution you'd like
It would be really useful if the output could include a channel for each object ID. This would allow individual objects to be discerned

Describe alternatives you've considered
For now, I have created my own class to accomplish this, but would prefer to use the Monai Core version

Additional context
This is a useful feature for testing loss when it comes to nucleus instance segmentation in histopathology, where there are frequently overlapping nuclei.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating create_test_image_2d and reading how it currently produces class IDs. Add the requested object-instance ID output so overlapping objects remain distinguishable, then verify that the generated output preserves both class and individual object information.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.