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

Error in scaling factor calculations #40

Open
bttsmith opened this issue Dec 4, 2022 · 1 comment
Open

Error in scaling factor calculations #40

bttsmith opened this issue Dec 4, 2022 · 1 comment

Comments

@bttsmith
Copy link

bttsmith commented Dec 4, 2022

I have a question concerning image scaling calculated starting in reader.py line 617.

On lines 628 and 632, the math is currently as follows: $[scale] = \frac{ [NumberOfElements] - 1}{[Length]}$

Why is the numerator $([NumberOfElements] - 1)$? As best I can tell, it should be only $[NumberOfElements]$.

When exporting images/videos through the Leica software, the included metadata calculates $Voxel = \frac{[Length]}{[NumberOfElements]}$, where voxel is equivalent to $1/[scale]$. There is no "-1" in the exported metadata.

The "-1" in readlif's code seems to introduce error into the scaling factors - is there something I am missing?

@ilorevilo
Copy link
Contributor

I completely agree with you and mentioned this issue in #30 (comment).
Bioformats offers the option to calculate the scale in both ways to conserve some backwards compatibility (code and PR).

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