-
Notifications
You must be signed in to change notification settings - Fork 141
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
Handling multichannel 3D stacks #998
Comments
What do you mean by "interpreting it wrongly"? Maybe you can provide some basic information about the image you're using? For instance,
Also, what steps you did to visualize the image channel? |
Basically what I mean is that I am unable to visualize it as in ImageJ, I cannot acces each channel and obtain the expected output.
As I am using Juno, the only step I need to visualize is to acces the array:
Only the first one returns an image with signal, i.e. not completely black. I have checked the rest of them and apparently the pixel values is 0 which should not |
Does this mean you get an all-zero channel after loading it even before visualization? Because there are multiple Image IO backends. Can you check if using TIffImages directly works? using TiffImages
TiffImages.load(filepath) If it is still the all-zero case, there might be some issues with your specific image file and TiffImages. In that case, providing an example image would be helpful to diagnose. |
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.
using TiffImages
TiffImages.load(filepath) 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 Thanks in advance! |
I suppose this is a TiffImages issue, @tlnagy can you help check this? using PyCall
using TiffImages
skimageio = pyimport("skimage.io")
cv2 = pyimport("cv2")
img_skimage = skimageio.imread("channels_24_1_R1.5.tif");
img_tiffimages = TiffImages.load("channels_24_1_R1.5.tif");
size(img_skimage) # UInt8: (84, 647, 678, 3)
size(img_tiffimages) # RGB{N0f16}: (647, 678, 252) |
What's the output of |
IFD, with tags:
Tag(SUBFILETYPE, 0)
Tag(IMAGEWIDTH, 678)
Tag(IMAGELENGTH, 647)
Tag(BITSPERSAMPLE, UInt16[16, 16, 16])
Tag(PHOTOMETRIC, 2)
Tag(IMAGEDESCRIPTION, "ImageJ=1.53c
images=...")
Tag(STRIPOFFSETS, 4186)
Tag(SAMPLESPERPIXEL, 3)
Tag(STRIPBYTECOUNTS, 438666)
Tag(COLORMAP, UInt16[0, 256, 512, 768, 1024, ...])
Tag(SAMPLEFORMAT, UInt16[1, 1, 1])
Tag(UNKNOWN(50838), UInt32[20, 48, 768, 768, 768])
Tag(UNKNOWN(50839), UInt8[73, 74, 73, 74, 114, ...]) |
Hmmm. I'll have to look into it more. Looks like What should dimensions should the image have? |
@DiegoPerezDones perhaps knows more about this. This is what I get from ImageJ, I guess that means 84 3-channel frames of size (678, 647) |
Whoa. That's bizarre, the image is claiming 16bits for both red, green, and blue channels, but ImageJ opens it as a 8bit? This issue is with TiffImages and not with Images.jl and will take some work to figure out. |
close in favor of tlnagy/TiffImages.jl#72 |
Hello evryone, I am trying to load a microgrpah composed of three channels but the native load function in the package keeps interpreting it wrongly.
When I try to visualize each of the different channels it only has signal in the first of them.
I checked with imageJ how each channel should look like and it seems that for different slices the function is loading the info from different channels.
The image is a .tif hyperstack.
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: