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

Unexpected behavior of get_frame args #39

Open
ginnocentiCST opened this issue Dec 8, 2021 · 3 comments
Open

Unexpected behavior of get_frame args #39

ginnocentiCST opened this issue Dec 8, 2021 · 3 comments

Comments

@ginnocentiCST
Copy link

Hi Nick,

Thank you for creating this! I'm not a trained programmer and I apologize if I'm simply misusing your package. Here's my issue:

Create a basic object and load the second series:

lif = './data/LIF_FILE_TWO.lif'
raw_data = LifFile(lif)
img_1 = raw_data.get_image(1)

The following should display a grayscale image of the first channel of the first z-slice in my series, and it does:
img_1.get_frame(z=0, t=0, c=0, m=0).show()

Changing c=0 to c=1 does not display the second channel. What I see is the second z-slice of the first channel.
img_1.get_frame(z=0, t=0, c=1, m=0).show()

In order to see the second channel, I need to increment the value for z=*.
img_1.get_frame(z=1, t=0, c=0, m=0).show()

I wasn't able to upload my LIF file, likely due to size, but I'd be happy to share it with you.

@ginnocentiCST
Copy link
Author

ginnocentiCST commented Dec 9, 2021

Likewise...

lif = './data/LIF_FILE_TWO.lif'
raw_data = LifFile(lif) 
img_1 = raw_data.get_image(1)

channel_list = [i for i in img_1.get_iter_c(t=0, z=0, m=0)]

for i in range(len(channel_list)):
    channel_list[i].show()

Shows four sequential z-slices of channel 0 in a four channel LIF series.

EDIT: Apologies, still learning. I should have looked at the source code; get_iter_c simply calls get_frame.

@nimne
Copy link
Contributor

nimne commented Dec 9, 2021

Thanks for the bug report! No issue on your end, but I think this is a result of the file being organized differently than expected. I'm wondering if this is the same issue described in #19. I made a workaround for that specific situation, but without more examples I didn't know how to generalize the solution.

If you wouldn't mind sharing the file, a fix could probably be made! If you don't want to share the file publicly, you can send me a twitter DM (find that in my profile).

@nimne
Copy link
Contributor

nimne commented Dec 9, 2021

To add, if you need to work on your data quickly, the python-bioformats package should be feature complete. Although the memory and install requirements are greater.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants