cornerstonejs / cornerstone3D

Cornerstone is a set of JavaScript libraries that can be used to build web-based medical imaging applications. It provides a framework to build radiology applications such as the OHIF Viewer.
https://cornerstonejs.org
MIT License
573 stars 292 forks source link

[Bug] Use Segmentation tools with Stack Viewport #712

Open 1isten opened 1 year ago

1isten commented 1 year ago

Describe the Bug

This documentation link is broken: https://www.cornerstonejs.org/docs/tutorials/basic-segmentation-tools/#read-more

image

https://www.cornerstonejs.org/live-examples/segmentationRendering.html

image

Steps to Reproduce

Checkout above link

The current behavior

The segmentation rendering example is broken, can't find any example of using segmentation tool for stack viewport.

The expected behavior

Please give an example of using segmentation tool for stack viewport. In my case, I render single dicom file from my local filesystem (using stack viewport like this example). But I can't figure out how to add segmentation tool then

OS

macOS 13.3

Node version

16.17.1

Browser

Chrome 115.0.5790.114

sedghi commented 1 year ago

sorry about that it is wrong. I will edit it Stack Viewport segmentation is not ready yet unfortunately but we are working on it

1isten commented 1 year ago

@sedghi So currently we can only use segmentation in volume viewport?

If that's the case, may I ask another question (sorry I'm not familiar with cornerstone...)

Can I create a volume viewport to display just a single dicom file from my local filesystem?

sedghi commented 1 year ago

yes currently only in volume viewports. I haven't tried it it might work

1isten commented 1 year ago

May I know if it is possible to load a single local dicom file such as this example: https://www.cornerstonejs.org/live-examples/local.html, but use volume viewport instead of stack viewport?

JiaBob commented 1 year ago

I also have such questions. The example shows how to load data from a server. What if I just want to load local dicom or nifti files? Could you also let me know how to create a server to provide such files? Thank you very much!

sedghi commented 1 year ago

You can look into our dicomImageLoader package for more infor on how to load.

Nifti -> still in progress PR #696

DICOM ->

see for instance example here

 const imageIds = await createImageIdsAndCacheMetaData({
    StudyInstanceUID:
      '1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
    SeriesInstanceUID:
      '1.3.6.1.4.1.14519.5.2.1.7009.2403.226151125820845824875394858561',
    wadoRsRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
  });

Then imageIds are the path to the data that is created by cornerstone3D. Read more about imageIds here

sedghi commented 1 year ago

May I know if it is possible to load a single local dicom file such as this example: cornerstonejs.org/live-examples/local.html, but use volume viewport instead of stack viewport?

You can convert stack to volumes and vice versa if you need, look at this example

sedghi commented 1 year ago

Could you also let me know how to create a server to provide such files? Thank you very much!

If you don't want to deal with all these you can look into OHIF which handles these complexities. For instance https://docs.ohif.org/configuration/dataSources/dicom-web#running-orthanc

JiaBob commented 1 year ago

Thanks for your answers! It takes time to dive into them. Let me try.

1isten commented 1 year ago

Now I've used the orthanc server to retrieve metadata and successfully created the volume viewport to render some dicoms

But I found that even if the dicomweb server is used, cornerstone's volume viewport still cannot render some dicoms (such as US dicom files) which missing below tags:

when those tags metadata is missing, creating volume viewport causes below error: image

I think the error is raised because imagePlaneModule metadata is missing some required value: image

So does that mean the volume viewport cannot be used for such dicom files or do you have any other solutions? @sedghi

Btw, may we know when Stack Viewport segmentation would be ready? Thanks

sedghi commented 1 year ago

No you are correct, if that metadata is missing you can't reconstruct a volume. We are pushing on making the stack segmentation work soon #666

sedghi commented 1 year ago

https://github.com/cornerstonejs/cornerstone3D/pull/670