Skip to content
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

Volume information not updated when new volume content is received #47

Open
ungi opened this issue Jul 19, 2018 · 5 comments
Open

Volume information not updated when new volume content is received #47

ungi opened this issue Jul 19, 2018 · 5 comments
Assignees

Comments

@ungi
Copy link

ungi commented Jul 19, 2018

When an image is received for the first time, mrml node is created and volume information is computed (min max scalar value). The brightness/contrast of volume display is limited by min and max scalar values.
When an image message is received with the same name, the min max scalar values are not updated. So e.g. when the updated image has brighter scalars, those are always white and grayscales cannot be visualized in that range.

How computationally expensive would it be to update the min max scalar values, to reset the thresholds on the brightness/contrast (window/level) sliders in the Volumes module every time the image content is updated by OpenIGTLink?

@Sunderlandkyl
Copy link
Contributor

Sunderlandkyl commented Jul 19, 2018

Interesting... I did some digging and it looks like this happens in the old version of OpenIGTLinkIF (in 4.8.1) as well.

I don't think that updating the scalar range and window/level would be that expensive, but is that necessarily always the desired behaviour (specifically with updating the window/level)?

@lassoan @leochan2009 Thoughts?

@lassoan
Copy link
Contributor

lassoan commented Jul 19, 2018

Updating the scalar range is considerable amount of time for volumes, but quick for single slices. Also, scalar range is only computed on request (for example, when auto WW/WL needs it or manually changing WW/WL) and cached in vtkImageData (so only recomputed when image data changes).

So, we don't need to worry about introducing performance problems by properly calling Modified() events when needed. Something like this should work: https://github.com/Slicer/Slicer/blob/3090483f8cec1e068e4a23d0e7ca3fe627a9cd54/Base/Python/slicer/util.py#L760-L769

@ungi
Copy link
Author

ungi commented Jul 19, 2018

@Sunderlandkyl you are right this was an issue in 4.8 too, we have tested that too. We were just lucky that usually ultrasound images have a bright line at the transducer rubber, so we got a full range of scalars when we started the connection. This is still a serious issue, because TGC set low on the top of the image, or cropping may result in a totally black initial image.

@leochan2009
Copy link
Contributor

Hi Tamas,

I think updating the scalar range is not always an desired behavior in OpenIGTLinkIF module, and as it is mentioned by Andras, it will be considerable amount of time for volume data.
In the case of Ultrasound images, probably you could write an python script to observe the VolumeNode Modify() event and get the Min/max range of the volume.

@lassoan
Copy link
Contributor

lassoan commented Jul 20, 2018

Scalar range is normally NOT computed. It may be computed if auto ww/wl is enabled (but then histogram is computed for as well and that takes much longer than scalar range min/max compute; so scalar range computation should not be an issue) and during manual ww/wl adjustment (you don't normally keep adjusting the ww/wl, so it should not be an issue).

@Sunderlandkyl Sunderlandkyl self-assigned this Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants