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

fix(getDataInTime): to consider different image spacing for reference #835

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Oct 18, 2023

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)

image

Changes & Results

calculates the voxel overlaps

Testing

Checklist

PR

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

Code

Public Documentation Updates

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

Tested Environment

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

@netlify
Copy link

netlify bot commented Oct 18, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit 9d3634c
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6530874fb7ade2000825c78d
😎 Deploy Preview https://deploy-preview-835--cornerstone-3d-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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++;
Copy link
Contributor

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

Copy link
Member Author

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);
Copy link
Contributor

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

Copy link
Member Author

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

@sedghi sedghi merged commit b71966d into main Oct 19, 2023
9 checks passed
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