Skip to content

test(rectangleROIThreshold+statistics): Modify rectangleStartEndROIThreshold example for threshold value + add test for testing rectangleROIThreshold with statistics result comparison with MIM #2061

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dxlin
Copy link
Contributor

@dxlin dxlin commented May 12, 2025

Context

Test to verify results are correct with comparison to output MIM software. Modification of rectangleStartEndROIThreshold was necessary to allow for percentage and absolute threshold values.

Changes & Results

Modify rectangleStartEndROIThreshold example to:
->use PT image
->allow input for threshold value
->relative to max ROI
-added addInputToToolbar for examples
-added test to check accuracy of routine relative to MIM software on same image set NOTE:

  1. Doesn't include end slice (test index for endSlice higher than should be by 1 to account)
  2. Edge slice peakValue discrepancies with MIM (ignoring for now that check)

Should the example be separated?
cachedStats.statistics worked in example but did not populate in time for playwright test, a function based on OHIF's implementation of getting max voxel value was used -> should this be made into a utility function?

Test sequence provided to test for 4 test cases:

  1. Slice 1-5 41% max SUV threshold
  2. Slice 10-15 41% max SUV threshold
  3. Slice 1-5 0.8 absolute threshold
  4. Slice 10-15 0.8 absolute threshold

Results compared to MIM output

Testing

Checklist

  1. peakValue (SUV) seems different for edge case (slice 1-5)
  2. Slice defined as "end" slice is not included in thresholding, test currently incremented by 1 to include the end slice
  3. Remaining results are pretty much spot on

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] "OS:
  • [] "Node version:
  • [] "Browser:

->use PT image
->allow input for threshold value
->relative to max ROI
-added addInputToToolbar for examples
-added test to check accuracy of routine relative to MIM software on same image set
NOTE:
1. Doesn't include end slice (test index for endSlice higher than should be by 1 to account)
2. Edge slice peakValue discrepancies with MIM (ignoring for now that check)
@sedghi
Copy link
Member

sedghi commented May 13, 2025

Thanks! is it expected that they fail?

@dxlin
Copy link
Contributor Author

dxlin commented May 14, 2025

The current code should pass, the endSlice in the testcases defined are incremented by 1 to account for endSlice not being included (I've added a comment where the endSlice are incremented).

Let me know if you'd like the offset to be removed so it can be used to test against a fix for the endSlice not being included (or if that is intended behaviour, I can remove the comments).

@sedghi
Copy link
Member

sedghi commented May 16, 2025

I'm not sure, let's just make the tests pass

@dxlin
Copy link
Contributor Author

dxlin commented May 16, 2025

Sorry, made a mistake with unit conversion and noticed a race condition for the debounce. These should be fixed now.

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.

2 participants