-
Notifications
You must be signed in to change notification settings - Fork 14
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 is being incorrectly interpreted as 16bit instead of 8bit #72
Comments
First of all, thanks in advance. The image is supposed to be a 3-channel hyperstack with 84 slices, each of them of 678x647 pixels, as @johnnychen94 noticed, but each channel it's not RGB but gray-scale inteisty values. |
So I got a chance to play around with the image and this seemed to work: using TiffImages
a = TiffImages.load("channels_24_1_R1.5.tif");
# convert to Gray to discard useless green and blue channels (all info is in red)
# and reshape since the color info is intercalated in the z dimension
b = reshape(Gray.(a), size(a)[[1,2]]..., 3, :)
# construct a new color view so now green and blue have the correct info
c = colorview(RGB, [view(b, :, :, i, :) for i in 1:3]...); |
ImageMagick reports the image as
Details
|
I've opened this file with Ubuntu's Document Viewer, Mac's Preview, and Mathematica, and they all appear to interpret the data the same way as |
Exactly. Apart from that it seems to be taking the pixel values in each slice (z) from different channels randomly, meaning that in slice 21 I'd be getting the information from original channel 1 and for slice 57 for example the info from channel 3, which is at least weird.
Yeah I've tried loading with TiffImages backend and the probelm stills.
If you don't mind I can send you the image I am trying to load and I will be very grateful if you could help me.
https://drive.google.com/file/d/1JEDVJXh6yV5V5WU7qyvk_xBd4E1_rInJ/view?usp=sharing
Originally posted by @DiegoPerezDones in JuliaImages/Images.jl#998 (comment)
The text was updated successfully, but these errors were encountered: