-
Notifications
You must be signed in to change notification settings - Fork 285
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(getDataInTime): to consider different image spacing for reference #835
Conversation
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const frame = frames[i]; | ||
perFrameSum.set(frame, perFrameSum.get(frame) + value); | ||
} | ||
count++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should leave a comment here. count is representing the number of voxels of the dynamicVolume that represents one voxel in the mask, but the fact that a callback function modifying a global variable is dangerous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
values.push(averageValues); | ||
}; | ||
|
||
pointInShapeCallback(maskImageData, () => true, callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you have the nonZeroVoxelIndices array why you are not using it here, instead of using the pointInShapeCallback? In case of a CT mask in a PET you are calculationg for each CT voxel, that could be a very large number, lots of calculations that doens need to be done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. because I need the segPointLPS of each of the masks voxels, and also I have an early return in the first line of callback. My benchmark don't show any performance issue, but I added a todo
Context
when we use the mask to grab the information from a reference volume, if they are not the same properties (spacing, direction, etc.) we should consider the voxel overlaps and average (maybe we re-configure this later or maybe do weighted average based on the overlap percentage)
Changes & Results
calculates the voxel overlaps
Testing
Checklist
PR
semantic-release format and guidelines.
Code
[] My code has been well-documented (function documentation, inline comments,
etc.)
[] I have run the
yarn build:update-api
to update the API documentation, and havecommitted the changes to this PR. (Read more here https://www.cornerstonejs.org/docs/contribute/update-api)
Public Documentation Updates
additions or removals.
Tested Environment