-
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
Possible problem with reading images triggered from Las X stage navigator #19
Comments
Hi Dirk, Thanks for the detailed report! I've been meaning to learn napari for some other projects anyway, it looks extremely useful. From your pictures, I can't quite tell what's going on - but it's possible that the data is being read in an incorrect order, which might be related to #14. If you send an example, I can take a look. -Nick |
Hi Nick, Thank you for the response and the effort, it is highly appreciated. Cheers, |
Hi Nick, I have been reading up on #14 in the last couple of days and gave it a try to fix this particular issue. I've found that the data-organization in the 2 images indeed is different. In the "normal" image, the data (xy image) was organized in the following way: channel 0 (Z-stack 0) --> channel 0 (Z-stack 1) --> ... --> channel 0 (Z-stack n) --> channel 1 (Z-stack 0) --> channel 1 (Z-stack 1) --> ... --> channel 1 (Z-stack n). In the image acquired by the navigator, the data was organized like this instead: Therefore, in the navigator image, the main separator was not the channel, but the z-stack. Since I would like to start analyzing images required with the stage navigator as soon as possible, I made a local ReadLif_navigator package which is slightly changed in the get_frame function. This I will now use for these specific navigator images until a fix is included in a new release. This navigator package is changed slightly compared to the current ReadLif package in the following manner:
into this:
This adapted method takes into account the previously discussed changes in the data-organization and solve this problem. If I can help by supplying more data or something else please feel free to contact me. Thanks for all the effort so far already. Cheers, |
This bug has really eluded me for a while! I think I finally have some sense of what is different between these two captures - but I'm not sure how to fix this just yet. The nature of the issue suggests a bigger problem with some assumptions about the organizational structure of lif files in the first place. In the 'normal capture' the relevant sections in the XML are (added line breaks for clarity, 'z' is dim 3):
'navigator capture'
In the normal capture, BytesInc in Z is greater than BytesInc in the channel. This is reversed in the navigator capture. I'll test a quick if/then fix for now, but I don't think that is the best solution. |
New branch with a fix: https://github.com/nimne/readlif/tree/channel_order_navigator As I'm working on this, I suspect that this fix will solve nearly all of the common use cases. I would be curious if additional dimensions would cause an issue. Would it be possible to make a mosaic scan in the stage navigator and see if this fix still works? |
Yes that is something I can do, I will make a small example image next week and test it out. I'll also link the file in this discussion so you can test it as well. |
Hey I'm back with the test file. You can find the file here: https://we.tl/t-3ipKOus6RU When do you think this fix can be merged with the master branch? Thank you for the effort, much appreciated! |
This fix is already in the 0.6.4 release! The fix initially caused an unfortunate bug in 0.6.3, so I really appreciate the extra test files. Closing this for now as fixed. |
The 0.6.4 update is working great for my ongoing projects already, so thank you! I just started exploring another project, which requires the analysis of 4 channels, which caused me to find a similar problem as the one in this issue: the channels and z-stacks get mixed up. This was the first time I had images with 4 channels to check the package on, so that is why I only found this out after the release of 0.6.4, so sorry for that inconvenience! I think the recent changes to the the readlif package broke something that previously used to work. I added that custom readlif version and an example image here, but let me know if you need something else! A quick script to visualize what I'm describing:
As always, thank you a lot in advance. The work is really appreciated! |
Thanks for helping me check these updates and for the example! I'll take a look. |
Hi Nick, I was wondering if it would help if I provide a couple more files to try and find out the cause of this issue. Please let me know what you need and I'll make some example files for you to use. Kind regards, |
Hi Dirk, Thanks for the nudge - work has been a little overwhelming lately, but I think I will be able to carve out time to fix this soon. I think I have everything that I need to fix this already! |
Hi Nick, Thanks for the update, the work is much appreciated! |
Hi Nick, how are you doing? I was wondering if you could maybe share an update on this? Cheers, |
Hello, I have the same issue here. Channels C and slice Z offset are swapped. I can fix the issue by setting manually channel_as_second_dim to False, for example:
The error is here :
The increase in byte for all channels is not the sum of the increases. It works if there are two channels but not in general. One way to fix it would be to guess the size occupied by each channel as a multiple of the size of the first offset.
Unless there is a better way to fix it. |
Hi Nick,
First of all, thank you for all the work you have done on this awesome package, I love it! I use it every day for my image analysis, and it works exactly as it should. However, since I now try to automate my image acquisition, I run into a major issue. I have to say that I don't know if the mistake originates in the Las X software or in readlif, but I thought it was worth giving it a try.
For the automation of the image acquisition, I want to use the Las X stage navigator, which can automatically control the movement of the stage. There is not much different in the imaging protocol compared to the protocol I normally use, there really is one difference: if I want to use the stage navigator, I have to trigger the image acquisition from the stage navigator.
In the Las X software, the image is perfectly fine, and I have no problems visualizing it. However when I load the image using readlif, something strange happens. It appears that the 2 channels I currently use fuse together, making image acquisition impossible.
I added 2 images to show the differences:
Image 1: a normal image (made without the stage navigator)
Image 2: an image made using the stage navigator
Using a very nice 3d viewer called Napari, you are able to see that there is a sort of organization in the way the channels are fused: it appears that the nuclei (small) are located on top of the fat droplets (larger).
I would really appreciate if you could take a look at this. When you are able to, I'll send the example Lif file to you via twitter again, just like last time!
Cheers,
Dirk
The script I used:
The text was updated successfully, but these errors were encountered: