Arcadia-Science / readlif

Leica Image Format (LIF) file reader for Python
GNU General Public License v3.0
32 stars 13 forks source link

[Duplicate] [Bug] Increment z jumps in channels #51

Closed phigjm closed 10 months ago

phigjm commented 10 months ago

I experienced a starting mapping for the get Frame function.

executing this code:

new = LifFile(file)
for img in new.get_iter_image():
    slice1 = img.get_frame(z=1,t=0, c=0)
    slice2 = img.get_frame(z=imgContaine.channels,t=0,c=0)

slice1 is z=0, c=1 instead of z=1. and slice2 is z=1, c=0.

I could fixed that behavior with this method:

def get_frame(imgContaine, z,c):
    i= imgContaine.channels*z+c
    z = i%imgContaine.nz
    c = i//imgContaine.nz
    return imgContaine.get_frame(z=z,t=0, c=c)

My images are recorded by Leica Microsystems LAS AS - TCS SP5. I am on readlif Version 0.6.5 installed via pip in a venv. ImageJ does open my images correct.

phigjm commented 10 months ago

Duplicate to Issue