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

feat: WSI Viewport - basic framework to display WSI images with annotations #944

Merged
merged 86 commits into from
Jun 12, 2024

Conversation

wayfarer3130
Copy link
Collaborator

@wayfarer3130 wayfarer3130 commented Dec 13, 2023

Context

Show whole slide imaging DICOM in a CS3D viewport.

Changes & Results

  • Added a WSI Viewport to show WSI images
  • Adding mappings to/from WSI image positioning in the get/set camera calls
  • Add notifications for viewport render to ensure annotation updates occur
  • Add pre-built deployment to the externals directory to avoid needing to checkout build
  • Added lazy load for dicom-microscopy-viewer to allow building without DMV to be included.
  • Fixed dicom-microscopy-viewer to be lazy loadable

Testing

Run wsi and wsiAnnotationTools
Basic viewing and simple annotations should be supported

Fixes for [#1090]

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:

Copy link

netlify bot commented Dec 13, 2023

Deploy Preview for cornerstone-3d-docs ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/6669e14cd210e4090b9e9cf4
😎 Deploy Preview https://deploy-preview-944--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.

@@ -45,6 +45,11 @@ module.exports = {
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import',
to: '${destPath.replace(/\\/g, '/')}',
},
{
from:
'../../../node_modules/dicom-microscopy-viewer/dist/dynamic-import/index.worker.min.worker.js',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider randomizing the UID in dicomImageLoader. This is important because conflicts may arise if another library also has index.worker.js, since we copy this to serve.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really prefer to change this to just load from a nested path, but I can't figure out the webpack mumbo jumbo to enable that. Even better would be to direct load as a script external. I THINK I know how to do that one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loads on nested path. Does not need randomization any longer.

@@ -382,24 +380,6 @@ class RenderingEngine implements IRenderingEngine {
return viewports.filter(isStackViewport) as Array<IStackViewport>;
}
Copy link
Member

@sedghi sedghi Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why you are removing video viewport

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method was unused, and I don't see a need for methods for each type when we have the generic ones.

console.log('Loaded DICOMMicroscopyViewer', DicomMicroscopyViewer);
this.frameOfReferenceUID = null;
const metadata = this.imageIds.map((imageId) => {
const imageMetadata = client.getDICOMwebMetadata(imageId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prob should go from metadata manager get eventually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but this is the required format right now internally, so getting it direct. That avoids refetching the data, which makes things noticeably faster on first render.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a lot of work to use dicom metadata manager.

}
});
// Construct viewer instance
const viewer = new DicomMicroscopyViewer.viewer.VolumeImageViewer({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't know the api for DMV has VolumeImageViewer, what is volume for WSI? the tiles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will have to look it up - it might be the fact that it actually can be a volume, with various focal depths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not adding focal depth support right now, although it is something we might want to consider.

Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good first draft

@wayfarer3130
Copy link
Collaborator Author

Added a branch ImagingDataCommons/dicom-microscopy-viewer#111 with changes required to run this basic WSI view

packages/docs/netlify.toml Outdated Show resolved Hide resolved
@wayfarer3130 wayfarer3130 requested a review from sedghi June 11, 2024 21:06
Copy link
Member

@sedghi sedghi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot

@sedghi sedghi merged commit 2822a4b into main Jun 12, 2024
10 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.

3 participants