cornerstonejs / cornerstone

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

Reformat Axial CT Dicom Stack to Coronal / Sagittal #422

Open hubtub2 opened 4 years ago

hubtub2 commented 4 years ago

I used cornerstoneWADOImageLoader to load an axial head CT slice stack.

Is there a way to create coronal and sagittal image stacks, either using build in cornerstack functions? Or maybe acessing the raw data and transposing it manually?

dannyrb commented 4 years ago

If you don't need support for arbitrary rotation, you could use vtk.js's vtkImageReslice to create the slices and map them back to cornerstone images.

You can see a very rough implementation of that here: https://github.com/QSolutionsLLC/cornerstone-vtk-mpr

On OHIF, we've opted to switch to a "VTK Viewport" when we need support for volumes/reformatting. See react-vtkjs-viewport

hubtub2 commented 4 years ago

I tested the OHIF demo. The "VTK Viewport" does not support the cornerStoneTools anymore, so this is not a viable options for us. It feels more like a hack. In fact I started my experiments with vtk.js and switched to cornerstone, since the vtk widgets did not work well in MPR ;-)

I will try to create stacks for the coronal and sagittal views as you suggested.

However, then the next problem will be to synchronize tools (like a 2D or 3D rectangle) across the three views. I guess this is not natively supported. I am not sure anymore if cornerstone is the right library for us, since in our medical field all our data is treated as "isotropical 3D volume" and not as "stack of 2D images".

dannyrb commented 4 years ago

@hubtub2, cornerstone is great for 2D viewing, but less than ideal when you need to care about the entire volume. You can scope tool state, using a different tool state manager, to the entire stack or a frame of reference.

OHIF added support for multiple viewports largely because libraries excel in different situations. We are also not huge fans of the out of the box VTK Widgets, which is why we're working to build an abstraction on top of vtk.js akin to cornerstone-tools. We also have plans work in a MeasurementsService that allows both viewports to consume/provide/sync measurement data.

FWIW, many commercial desktop viewers support a more limited set of tools for MPR / 3D viewing. We're working to add support for the common ones, and ways to provide a more seamless/cohesive experience.