-
Notifications
You must be signed in to change notification settings - Fork 13
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
I have problems loading a 4 channel image #44
Comments
Hey @RosalioReyes, It seems like this might be related to issue #19, where if you use a 4 channel image, it will confuse the z-stacks and the channels while reading in the pictures. Could you take a look and see if that is the case? There is an example in #19. |
Hi @DirkRemmers, Thank you very much for your prompt response. Indeed, the problem is in the way the libary read the stacks. I really like readlif. For now the quick solution I gave to the problem was to gather all the channels in an array, and then separate "the true channels". I did the following: file = LifFile(r"path \ image.lif") img0 = file.get_image(0) c1 = np.array( [ np.array(i) for i in img0.get_iter_z(t = 0, c = 0) ] ) all_channels = np.vstack( (c1,c2,c3,c4) ) realChannel_1 = [] realChannel_2 = [] realChannel_3 = [] realChannel_4 = [] But I continue with doubts about why the error only appears when the image has 4 channels, and not when it has 3. That is, when the image has 3 channels, the library detects very well the stacks corresponding to each channel. I think my solution is not pretty, but it is solving things for the moment. Best, Rosalío. |
Had the same issue. My solution was:
good to know that this is only a 4 Chanel problem. |
I just checked: and I have the same issue with 8 channel recordings. But my code suggestion also works for 8 Channels. (in casme someone runs in the same Problems) |
Dear @phigjm, Thanks a lot by your suggestion. |
I now as well believe the problem is general. I tried out 3 -8 channels so far and always had the same issue. |
Hi all, Unfortunately, I have the same issue while trying to convert with 6 channels and multiple z planes. It seems the author wanted to tell whether channel is the second dimension by compare the "byte jump" ("BytesInc" attribute of channels) to the "BytesInc" of z dimension.
Does anyone know to get to the Nick or other contributors? I really want to know if my thinking is right... Thanks a lot! |
Hi @AlanWu886 Best, |
Hey @RosalioReyes and @AlanWu886, Thanks for all the work you have been doing! I fully agree that the proposed solution would be a good one to implement after extensive testing of course. Make sure to also test the more "simple" lif files with only 1 or 2 channels, and some without any z-stacks. I also haven't heard anything from @nimne recently, so I think he might be very busy. Therefore I think the best way to tackle this is to make a working version yourself, followed by submitting a pull request. Hopefully this way, Nick will have the time to accept the pull request without having to put in too much effort and time. Thanks again for your great help! Cheers, |
Sure, I will try to fix that and have a more extensive test before I make the pull request. Alan |
Hello. I'm using readlif, and it looks like a wonderful library. However since I started uploading 4 channel images I have had problems. The problem is that when I do the maximum projection, the image does not match the one obtained by ImageJ. I am using the library as follows:
img_0 = new.get_image(0)
z_list = np.array([np.array(i) for i in img_0.get_iter_z(t=0, c=0)])
Notice that I am converting the output to a Numpy array. The maximum projection is done as follows:
max_projection = z_list.max(axis = 0)
It does not matter which channel I select (0,1,2,3), when I do the maximum projection, it does not correspond to the one thrown by ImageJ. I clarify that this does not happen if the image has less than 4 channels.
I would greatly appreciate a suggestion.
Best regards, Rosalio.
The text was updated successfully, but these errors were encountered: