cornerstone3D icon indicating copy to clipboard operation
cornerstone3D copied to clipboard

feat: added support for sigmoid voiLUTFunction for StackViewport and VolumeViewport

Open Ouwen opened this issue 1 year ago • 10 comments

  • CPU fallback is unimplemented
  • Volume streaming auto fallbacks to LINEAR mode.

Ouwen avatar Sep 22 '22 19:09 Ouwen

Deploy Preview for cornerstone-3d-docs ready!

Name Link
Latest commit 348409a58bf48d4ee9d80fe0f8a68ffb4f06e96e
Latest deploy log https://app.netlify.com/sites/cornerstone-3d-docs/deploys/63e992456260f70008faeb5e
Deploy Preview https://deploy-preview-224--cornerstone-3d-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Sep 22 '22 19:09 netlify[bot]

@sedghi

Ouwen avatar Sep 22 '22 19:09 Ouwen

@sedghi added VOI type as an enum and added documentation

Ouwen avatar Oct 02 '22 21:10 Ouwen

All looks good, two last things

  1. This only adds it for StackViewport right? maybe we rename the PR to include such information?
  2. Can you please post here a before/after image for LINEAR vs SIGMOID voi for reference (since we are not adding new docs)

Thanks

sedghi avatar Oct 03 '22 13:10 sedghi

Sure thing, I think I can also try implementing this in the volume viewer

Ouwen avatar Oct 03 '22 20:10 Ouwen

Linear Screen Shot 2022-10-07 at 9 07 54 PM

Sigmoid Screen Shot 2022-10-07 at 9 05 50 PM

Ouwen avatar Oct 07 '22 19:10 Ouwen

@sedghi I've added the changes you suggested. Also scaffolding for the VolumeViewport. One thing that came to mind while looking at the volume viewport is if the voiLUTfunction should exist at the viewportInput level vs setVOI in the stackviewport as well as volume viewport

Thoughts?

Ouwen avatar Oct 07 '22 19:10 Ouwen

I noticed that we have the following:

voiLUTFunction: seems to refer to cornerstoneWADO image object/metadata properties voiLutFunction: property of viewports VOILUTFunction: dcmjs naming convention

Is this intentional?

Ouwen avatar Oct 10 '22 21:10 Ouwen

I hate this a lot and didn't notice it, good catch

voiLUTFunction: seems to refer to cornerstoneWADO image object/metadata properties
voiLutFunction: property of viewports
VOILUTFunction: dcmjs naming convention

Can we remove voiLutFunction and use either of those? I think we can live with the dcmjs one only

Were you able to run the example i added? It seems to be not working as I expected

cd packages/core
yarn run example voiSigmoid

sedghi avatar Oct 10 '22 22:10 sedghi

@sedghi this PR requires making this change to vtkjs (https://github.com/gradienthealth/vtk-js/commit/623f5ec9841b207d5d91b754f259872e81b4d249)

VOILUTFunction should be supported in volumes and stack viewport now.

There is some setProperties logic that I believe is still TODO from previous commits, but I think it might be beyond scope of this PR.

Ouwen avatar Oct 14 '22 22:10 Ouwen

pending https://github.com/Kitware/vtk-js/pull/2603

Ouwen avatar Oct 20 '22 04:10 Ouwen

@sedghi seems like the vtk.js version would need to be bumped to latest v25.10.1.

Would this have consequences for other related libraries (OHIF/Viewer)?

Ouwen avatar Oct 29 '22 06:10 Ouwen

That will break a lot of tests, I have fixed them in my other branch, can we wait for my branch (not create PR yet) to be merged before this?

sedghi avatar Oct 31 '22 22:10 sedghi

Sure, no rush

Ouwen avatar Nov 01 '22 13:11 Ouwen

https://github.com/Kitware/vtk-js/pull/2610, heads up the full fix requires vtk.js 25.11.1

Ouwen avatar Nov 02 '22 14:11 Ouwen

@sedghi hmmm unsure why these doc issues are popping up. As far as I know, I ran yarn run build:update-api nvm it is from the examples, I know the fix...

Ouwen avatar Feb 03 '23 18:02 Ouwen

@sedghi ready for review

Ouwen avatar Feb 04 '23 02:02 Ouwen

@sedghi just another ping since there are a lot of branches flying around...

Ouwen avatar Feb 07 '23 05:02 Ouwen

@sedghi this is ready for review. Instead of moving the triggerEvent function outside of the createVolumeActor I decide to remove the need for this.voiRange instead this is something that can be derived from the volume actor's look up table. The logic for this is in the getProperties section.

Ouwen avatar Feb 13 '23 01:02 Ouwen