-
Notifications
You must be signed in to change notification settings - Fork 455
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
New Tool: DICOM Overlays (C.9 Overlays) #780
Comments
bump |
It doesn't display them automatically, no. You can extract them from the DICOM object with dicomParser (or from .data after loading via the WADO Image Loader) and then create a Layer to display them on top of the image. I'd be happy to have a tool or example to do this, if you get it working! |
Thanks swederik ! Any more information on how to "create a Layer to display them on top of the image" ? |
To display DICOM overlays, you can refer example provided at: |
I've been interested in trying out cornerstone more for displaying one or more layers on top of images from the dicom web loader. Is it possible to have these overlay layer(s) constructed on the fly per index of the series (say from pixel/shape manipulation of another image) and shown as you scroll through the series? I would want to keep the overlay layers in sync with the base image (viewport). The examples I've seen so far have a specific overlay layer created first. |
What I ended up doing is modifying my image loader to include the parsed dataset in the image object along with the pixel data, then added a render listener so that when the image is rendered I can extract the overlay data and render it on top. |
jdnarvaez - can you provide a sample please ? I am really trying to make progresss with this .. thx! |
@kofifus this should get you started: https://gist.github.com/jdnarvaez/3368ac3e4f7f4eb14bc5f453f8a1ed1b the imageRendered method is what would be called from an image_rendered listener added to the element also I store the parsed data set on the image as $presentationStateDataSet so that it can be referenced and the data extracted |
Thanks for the code, @jdnarvaez 👍 I'm going to "transfer" this issue to tools. |
Thanks for the code, @jdnarvaez 👍 👍 very helpful @dannyrb, IMO this is very core - DICOM overlays are not an added tool but an integral part of the image and cornerstone should be able to show them (ideally with toggle/opacity) even without the tools package ... |
@kofifus, you may be right. I don't have the qualifications to determine that one way or another. From my perspective, the tech side, we do most of our tag parsing and usage in loaders/tools. I don't think Are @swederik, care to weigh in? |
The overlays are described by the dicom standard here - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html
Usually you want to:
So I think that core should have functions like - Then a Tool can be made to use those functions in some graphical way, as there is usually only one layer there can maybe be a single toggle tick and opacity slider etc ... (The standard also specify ROI overlays which are a bit of a different story ...) But if its not desirable for core to read tags then maybe it does not belong in core - not sure .. |
Ok I came up with something See PRs - cornerstonejs/cornerstoneWADOImageLoader#239 Basically wadouri metaDataProvider now accepts the type 'overlays' and reads and returns an array of overlays if existing in the dataset then in core drawImageSync, if the image has overlays they are added to the canvas. Each overlay has a 'fillStyle' and 'hidden' properties that can be changed to toggle overlays or color them. I have tested with single overlays, I don't have images containing multiple overlays or ROI. Perhaps someone can donate some examples. Much of the code is a rewrite of @jdnarvaez solution above thanks! Let me know what you think .. |
@kofifus, thanks for taking the time to PR these concepts! I think the If you have any helpful, anonymized, images to test this functionality with, could you pass them along? I'm curious to see what these overlays are used for in practice. I'm also curious how a viewer like Radiant or Osirix handles overlays. I'm less sure about the If we don't expose granular enough APIs to accomplish this, or if you need assistance creating a |
@kofifus I have updated the gist with the tag file. as far as examples, I suggest using the IHE test case for overlays. |
FWIW, that contains both the dicom file and the presentation state, as some overlays are read from the PR and one layer of the overlays is read from the embedded pixel data. |
sure @dannyrb Can you point out an existing tool that this is similar to and I can use as a skeleton ? I may give it a go .. On a side note, regarding your metadata repository comment, personally I don't like the multiple repositories trend, I feel Javascript offers more than enough mechanisms for encapsulation (ie modules) as is and multiple repositories just create an unnecessary overhead. Also, we should probably look at adding an equivalent to the new wadouri processing of type 'overlayPlaneModule' to imageLoader\wadors\metaData\metaDataProvider.js, I am not sure what is the purpose of wadors and how to do that, maybe someone else can chip in ... @jdnarvaez - in https://gist.github.com/jdnarvaez/3368ac3e4f7f4eb14bc5f453f8a1ed1b#file-overlays-js-L7 I don't follow that for loop .. the way I read the standard there can be up to 16 layers in even Group Numbers 6000-601E (not |
I removed the cornerstone PR (cornerstonejs/cornerstone#347) and created an overlays tool - #788 The tool is very simple having only enable and disable Hope this helps :) |
I've created a feature branch for us to iterate on the
When new code is merged, a release is cut and tagged on NPM for I have a CodeSandbox up that is using the |
@kofifus, here's an update:
Here is what I am able to see in a desktop viewer: I haven't found a viewer yet that shows all 6-lines, but I only have a few installed locally. |
Can you send me a link to download the dicom image pls ? |
It's a bit higher up in this thread. JD shared it: #780 (comment) |
Updated Sandbox: https://codesandbox.io/s/1qj7j8op0l This is the PR that fixed things up: #826 If I do a DICOM dump of the file, using I see a similar result in my local tag dumper. I'm wondering if the "6 lines of text" for the image isn't entirely accurate? |
The code i provided should read all six layers as we render all six in our viewer. I’ll try to have a look at this this week |
Possibly the missing 2 layers are in the presentation state (see #780 (comment)) which cornerstone does not support ? |
Yep, that’s the case. |
cool, I believe this can be closed :) |
@all-contributors please add @jdnarvaez for sharing his code for Overlays |
I've put up a pull request to add @jdnarvaez! 🎉 |
@jdnarvaez - in https://gist.github.com/jdnarvaez/3368ac3e4f7f4eb14bc5f453f8a1ed1b#file-graphicoverlays-js-L38 you again call setTransform after calling just above, can you pls explain what is the purpose of the second call ? Thanks! |
@kofifus the transform is first set to the coordinates of the current canvas, then it it is saved, then it is set to 1:1 scaling, then reset to the previous scaling. This allows us to draw the overlays in a uniform coordinate system, so that any transformations or scaling by the user are also applied to the overlays |
…ne layers on top of the image (#860) - Thanks @kofifus, @jdnarvaez * feat(OverlayTool): Support for rendering overlay layers on top of the image data See DICOM: http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html re #780 * Add OverlayTool exports * Add overlay tool to examples * Make sure enabledElement is defined * Capitalize data-tool; better tool toggling * lowercase first letter 👍 * Use @cornerstonejs org scope * dry run; finding tag and publishing feature/hotfix branches as tagged releases * Change workflow priority * filtering is regex * Fix bash syntax error * invoke script w/ bash * Playing w/ bash syntax in circleCI's environment * Public scoped packages * Publish a tagged package * Make sure we're not stealing a version number that can be used for master * Better RegExp to set version * Tidying up comments and formatting * Try using an alternative package version * Update OverlayTool.js * Update OverlayTool.js * Fix prettier build error * Protect against `null` viewport pixelSpacing * Remove unnecessary changes * Fix unnecessary changes * Fixes for rendering overlays Co-authored-by: Kofifus <[email protected]> Co-authored-by: Erik Ziegler <[email protected]>
Should the cornestone magnify tool work on overlay data? |
…rlays (cornerstonejs#240) * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html
…rlays (#240) * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html
…rlays (#240) * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html * DICOM Overlays Adds 'overlayPlaneModule' type returning an array of DICOM overlays. This array is then added the 'overlays' propertry of the image. This is then read by the overlays tool see - [cornerstonejs/cornerstoneTools#788](cornerstonejs/cornerstoneTools#809) see issue [cornerstonejs/cornerstoneTools#780](cornerstonejs/cornerstoneTools#780) see DICOM overlays standard - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html
Hi,
Does cornerstone supports displaying DICOM overlays ? (C.9 Overlays - http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.9.html)
It doesn't show in my tests.
Thank you!
The text was updated successfully, but these errors were encountered: