cornerstonejs / cornerstone

JavaScript library to display interactive medical images including but not limited to DICOM
https://docs.cornerstonejs.org/
MIT License
2.04k stars 598 forks source link

AddLayer Multiple Images #560

Closed ArturRod closed 2 years ago

ArturRod commented 2 years ago

Hello, I wanted to know if it is possible to add multiple images to a layer, since I want to perform the CT / PET fusion, like this example: https://rawgit.com/cornerstonejs/cornerstone/master/example/layers/index.html

The thing is, this only allows a single image, and I would like to add a stack of data. let layer1 = cornerstone.addLayer( element, imagesLayer1, layer1Options.options );

I tried to get it to work but the addLayer method does not allow multiple images, any ideas or solutions?

shanebenlolo commented 2 years ago

Is there a reason you need to perform fusion in the cornerstone viewport? If not, you can perform fusion using react-vtkjs-viewport. See this example for details https://react-vtkjs-viewport.netlify.app/fusion

ArturRod commented 2 years ago

Hi @shanebenlolo. The problem with this is that it generates the views in 3D, I was trying to find something like this: http://www.dvisionlab.com/Larvitar/examples/layers.html

shanebenlolo commented 2 years ago

You may have an easier time duplicating the MPR view offered in OHIF:

91012743-ef3cac80-e629-11ea-9843-7707fb60ebf8

but have it render only one vtk viewport (the left view) rather than three. You can also remove the crosshairs if you wish. This should give a 2D view that you are looking for. This code will probably be much easier to write than the code required to get the layers api to work for this task.

ArturRod commented 2 years ago

Hi @shanebenlolo ! Thank you very much, the truth had not occurred to me to do it like that, I'm going to see how it turns out.

shanebenlolo commented 2 years ago

Glad I could help :)