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

[Bug] Threshold sphere tool is not working properly in stack viewports. #1818

Open
ashik-trenser opened this issue Feb 7, 2025 · 7 comments
Assignees
Labels
bugs Something isn't working, verified by maintainers

Comments

@ashik-trenser
Copy link

ashik-trenser commented Feb 7, 2025

Describe the Bug

The threshold sphere tool is not working as expected in stack viewports. Unable to segment using the threshold sphere tool.

Steps to Reproduce

  1. Select the threshold sphere tool.
  2. Try drawing with the threshold sphere tool.
  3. No segmentation can be viewed on the viewport.

The current behavior

While drawing with the threshold sphere tool, no segmentation is shown in the stack viewports .

The expected behavior

While drawing segmentations with the threshold sphere tool, the pixels with the given threshold should be updated with apropriate segment color while using stack viewports.

OS

Windows 11

Node version

18.19.0

Browser

Chrome

@ashik-trenser ashik-trenser changed the title [Bug] Threshold sphere tool is not working properly. [Bug] Threshold sphere tool is not working properly in stack viewports. Feb 7, 2025
@ashik-trenser
Copy link
Author

ashik-trenser commented Feb 7, 2025

@sedghi
For the stack viewport, imageVoxelManager only has the scalarData for a particular image, and when we receive the index for multiple slices for the threshold sphere tool, it is unable to find the index inside the current image's scalar data. This is making the indexes fail the isWithinBouds checking before adding it to segmentationVoxelManager, resulting in this issue.
We can update the imageVoxelManager's scalarData to have the entire volume's scalarData instead of a single image's scalarData or by correcting proper image data used for checking the threshold.

Could you please check if this would be a valid fix for the issue?

@sedghi
Copy link
Member

sedghi commented Feb 7, 2025

I know and i'm fixing it right now, stay tuned

@sedghi
Copy link
Member

sedghi commented Feb 7, 2025

@sedghi sedghi added the bugs Something isn't working, verified by maintainers label Feb 7, 2025 — with Linear
@ashik-trenser
Copy link
Author

@sedghi
I checked the branch and found some issues in the given fix. Currently, the threshold tool is behaving as a brush tool and the threshold is not being applied to the tool. The reason for this is found that in this line we are not getting the activeStrategy in the strategySpecificConfiguration. Instead, we are getting the threshold value inside a property called THRESHOLD but the activeStrategy is found as THRESHOLD_INSIDE_SPHERE. This is causing the issue.

@sedghi
Copy link
Member

sedghi commented Feb 10, 2025

Yes, that's intentional. The way the tool is used should change: you should pass the threshold within the relevant strategy. We don't have a strategy called THRESHOLD, so it was misused.

@linear linear bot assigned sedghi Feb 18, 2025
@ashik-trenser
Copy link
Author

@sedghi Could you please advise on how to address this issue in OHIF 3.9?

@sedghi
Copy link
Member

sedghi commented Feb 25, 2025

it will not be ported to 3.9, i don't see a way honestly

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

No branches or pull requests

2 participants