How to get index of image in StackScrollTool to get dicom tags
See original GitHub issueWhen I scroll the viewer dicom images are chnage but i did not get index of that dicom image so that depending upon that index I can pass it another function so that I can able to get dicom tags for the respective dicom image scroll index.
const scheme = 'wadouri'
const baseUrl = 'https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/'
const series = [
'bbmri-53323851.dcm',
'bbmri-53323707.dcm',
'bbmri-53323563.dcm'
]
const imageIds = series.map(seriesImage => `${scheme}:${baseUrl}${seriesImage}`);
var element = document.querySelector('.cornerstone-element');//document.getElementById("cornerstone-element");
// Add our tool, and set it's mode
cornerstoneWebImageLoader.external.cornerstone = cornerstone;
cornerstone.registerImageLoader('http', cornerstoneWebImageLoader.loadImage)
cornerstone.registerImageLoader('https', cornerstoneWebImageLoader.loadImage)
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneTools.init();
var item1 = cornerstone.enable(element);
//define the stack
const StackScrollTool = cornerstoneTools.StackScrollTool
//define the stack
const stack = {
currentImageIdIndex: 0,
imageIds
}
// load images and set the stack
cornerstone.loadImage(imageIds[0]).then((image) => {
cornerstone.displayImage(element, image)
cornerstoneTools.addStackStateManager(element, ['stack'])
cornerstoneTools.addToolState(element, 'stack', stack)
})
cornerstoneTools.addTool(StackScrollTool)
cornerstoneTools.setToolActive('StackScroll', {mouseButtonMask: 1 })
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Creating an index of the DICOM image tags - Yohz Software
Basically, you have the power of a relational database engine to search your DICOM images based on their tag values. Let's take a...
Read more >Get Dicom image position into a sequence - Stack Overflow
Position of each slice (dicom image) into the Sequence. For the first question i know i can use tag 0020,1002 (however it is...
Read more >API Docs - Cornerstone Tools
The imageId of the image displayed on the cornerstone enabled element. ... The index of the frame to get the slice thickness for....
Read more >Image Index Attribute - DICOM Standard Browser - Innolitics
An index identifying the position of this image within a PET Series. ... Therefore, all normals are co-planar and make a single angle...
Read more >DICOM Tags
Tag VR Name
(0002,0000) UL File Meta Information Group Length
(0002,0001) OB File Meta Information Version
(0002,0002) UI Media Storage SOP Class UID
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just wanted to add to this issue - you need to place the event on the element and not on cornerstone. I spent hours putting the event on cornerstone, and wondering why it didn’t work. The following code worked after enabling cornerstone on the element.
Thanks!
@Raistlfiren, this is a good call out. This can be especially tricky if you’re dynamically enabling/destroying enabledElements. You can listen, on
cornerstone
for theelement enabled
event, then use theenabled element
in that event to attach thecornerstonenewimage
listener.It might be a worthwhile enhancement to allow listening for
cornerstonenewimage
oncornerstone
, but also include theenabled element
that emitted the event. This would likely save consumers some effort.