-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix(Segmentation): Support only one frame #395
base: master
Are you sure you want to change the base?
fix(Segmentation): Support only one frame #395
Conversation
✅ Deploy Preview for dcmjs2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks for investigating this and providing the PR with a link to the cornerstone issue. While that link is helpful, please make your contribution here self-contained and describe in your commit message, and in code comments as needed, specifically, please clarify:
It would also be great to have a unit test that illustrates this. That is, a test that demonstrates a valid use-case that fails without this change but works with the change. Also, see the guidelines for commit messages and correct your commit as indicated: I don't mean to be super-picky here, but this repo is used by a lot of people and subtle bugs can occur if we aren't careful. I want to be sure someone who sees your contribution in the future fully understands it. |
When testing just one frame for example: Cornerstone3D.Segmentation.generateSegmentation([cacheImage], labelmapData, metaData); and shows the results of errors. First Errorlet distance1 = distanceDatasetPairs[1][0]; So I created a new variable, // If the frame is one, it is zero
let distance1 = 0;
if (ds.NumberOfFrames > 1) {
distance1 = distanceDatasetPairs[1][0];
} Second Errorif (ds.NumberOfFrames === 1)
ds.PerFrameFunctionalGroupsSequence = [
ds.PerFrameFunctionalGroupsSequence
]; I removed this code and it works similar to two or more frames. But I don't know what it does, I have little knowledge of segmentation in dicom. The result: |
There is another way without using this pull request or change. How does just one frame work: Cornerstone3D.Segmentation.generateSegmentation(
[cacheImage, cacheImage],
labelmapData,
metaData
);
|
Fix: cornerstonejs/cornerstone3D#1059 (comment)