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

Image View bug #94

Open
bmribler opened this issue Mar 20, 2023 · 2 comments
Open

Image View bug #94

bmribler opened this issue Mar 20, 2023 · 2 comments
Assignees
Labels
Component - HDFView Improvements to the visual interface layer Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub

Comments

@bmribler
Copy link
Collaborator

Whenever I switch to view my data in image form and move through the dataset, a random patch of white pixels will be removed throughout the image and as I go on, more appear until the majority of the image is not visible.
HDFView 3.1.4. Windows 11. Tried this on 3 systems (windows 10 and 11), with the same bug appearing.

(SUPPORT-1896)

@bmribler bmribler added Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub Component - HDFView Improvements to the visual interface layer labels Mar 20, 2023
@byrnHDF
Copy link
Collaborator

byrnHDF commented Apr 6, 2023

I have tried this with the next release, HDFView-3.3.0, which should release next week and I can't reproduce it that version.

@PinkShnack
Copy link

PinkShnack commented Aug 30, 2023

This is still present in version 3.3.1. But it isn't really a bug afaik. It is (to my knowledge) due to the IMAGE_MINMAXRANGE image attribute not being set, or not being set correctly. I had the same issue. See documentation here.

Your image data probably has the following attributes:

CLASS: "IMAGE"
IMAGE_SUBCLASS: "IMAGE_GRAYSCALE"

or perhaps IMAGE_SUBCLASS is "IMAGE_TRUECOLOR"? I think either way HDFView automatically sets the brightness range (colorbar) of the image to the min and max of the first displayed image. So if your first image has the brightness range from -2 to +5, and the next image has the brightness range of -2 to +6, then all pixels over the brightness of 5 will turn white, because the IMAGE_MINMAXRANGE was automatically set to (-2, 5) when you first opened the image series.

If you look at the brightness range (colorbar), you will see that it doesn't change as you go through the image series.

As a sidenote, you can verify this by closing the dataset view when at another image. Then reopen it, the brightness range (colorbar) will be different, and you will get different white patches.

Solution

The solution is to set the IMAGE_MINMAXRANGE attr for the image data. For example, in my case my dtype is float32, but I know my data goes from -2pi to +2pi, therefore I can set my attrs to roughly:

CLASS: "IMAGE"
IMAGE_SUBCLASS: "IMAGE_GRAYSCALE"
IMAGE_MINMAXRANGE: (-7, +7)

Now, as I move through my image series, there are no white patches appearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - HDFView Improvements to the visual interface layer Type - Bug Please report security issues to help@hdfgroup.org instead of creating an issue on GitHub
Projects
None yet
Development

No branches or pull requests

3 participants