-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(voi): added support for sigmoid voiLUTFunction for StackViewport and VolumeViewport #224
feat(voi): added support for sigmoid voiLUTFunction for StackViewport and VolumeViewport #224
Conversation
Ouwen
commented
Sep 22, 2022
•
edited
Loading
edited
- CPU fallback is unimplemented
✅ Deploy Preview for cornerstone-3d-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
packages/core/src/utilities/createSigmoidRGBTransferFunction.ts
Outdated
Show resolved
Hide resolved
packages/core/src/utilities/createSigmoidRGBTransferFunction.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great contribution as always, please see my comments
4e89d65
to
de3155c
Compare
@sedghi added VOI type as an enum and added documentation |
All looks good, two last things
Thanks |
Sure thing, I think I can also try implementing this in the volume viewer |
de3155c
to
df36464
Compare
@sedghi Thoughts? |
df36464
to
c904e30
Compare
packages/streaming-image-volume-loader/src/helpers/makeVolumeMetadata.ts
Outdated
Show resolved
Hide resolved
I noticed that we have the following:
Is this intentional? |
I hate this a lot and didn't notice it, good catch
Can we remove Were you able to run the example i added? It seems to be not working as I expected
|
@sedghi this PR requires making this change to vtkjs 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. |
baf2aac
to
d22d1b1
Compare
pending Kitware/vtk-js#2603 |
d22d1b1
to
4cf652c
Compare
79c6e6a
to
e1d8637
Compare
… more consistent (#224) * fix(dcmjs): Add a set of accessors to the sequence list so the API is more consistent. * fix(dcmjs): Added documentation on the addAccessors as requested
98962a4
to
9d70fbe
Compare
@sedghi hmmm unsure why these doc issues are popping up. As far as I know, I ran |
c396e93
to
f9e5dd2
Compare
@sedghi ready for review |
07be113
to
804ac5c
Compare
@sedghi just another ping since there are a lot of branches flying around... |
const voiRange = actor | ||
.getProperty() | ||
.getRGBTransferFunction(0) | ||
// @ts-ignore: vtk d ts problem | ||
.getRange(); | ||
this.voiRange = { | ||
lower: voiRange[0], | ||
upper: voiRange[1], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we basically do this inside createVolumeActor
, how is it different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the voiRange is saved to the volume anywhere, here we set the voiRange on the BaseVolumeViewport
instance. I guess this could be moved into create volume actor, but it would require passing this
into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess one way to do this is to have BaseVolumeViewport implement a getter for voiRange
. This getter takes in an index for the volume actor of interest with default being 0. A VOIRange object is returned.
Thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say let's take out the triggerVOIModified
from inside the createVolumeActor, and put it inside the base
@@ -78,6 +80,7 @@ interface ImagePixelModule { | |||
pixelRepresentation: string; | |||
windowWidth: number; | |||
windowCenter: number; | |||
voiLUTFunction: VOILUTFunctionType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please change this to be at least the same as the volume viewport? VOILUTFunction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or this is different? i'm confused again :()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is coming from cswil?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the same, I try to keep the same convention as the surrounding code. The voiLUTFunction
is from cswil. Probably makes sense to change the other vars
pixelRepresentation => PixelRepresentation ;
windowWidth: number; => I think this is derived dicom tag from voi
windowCenter: number; => I think this is derived dicom tag from voi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok good
} | ||
|
||
// make sure the VOI LUT function is valid in the VOILUTFunctionType which is enum | ||
if (Object.values(VOILUTFunctionType).indexOf(voiLUTFunction) === -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is used 3 times Object.values(VOILUTFunctionType).indexOf(voiLUTFunction)
maybe refactor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check can probably be removed actually since the VOILUTFunctionType
is forced in the function signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other places are due to CSWIL passing in a string which needs to be properly checked. Once we convert to typed CSWIL these logic can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about the if (i === 0 && !this.voiRange) {
f0f45bf
to
a899143
Compare
@sedghi this is ready for review. Instead of moving the triggerEvent function outside of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution as always :D