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
Incorrect VoxelSize in MetaMorph Reader #1966
Conversation
To fix the physical Z size, the difference between the absolute Z positions will need to be used. MetaMorph handler already parses the z positions. The physical z size is then calculated by subtracting the top and bottom values and dividing by the number of steps. Ticket details below: https://trac.openmicroscopy.org/ome/ticket/12977
@@ -778,6 +778,32 @@ else if (differentZs) { | |||
if (zDistances != null) { | |||
stepSize = zDistances[0]; | |||
} | |||
else { | |||
Vector<Double> zPositions = new Vector<Double>(); | |||
Vector<Double> uniqueZ = new Vector<Double>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An ArrayList
would suffice unless you need thread synchronization.
Note this PR is causing regressions on the Metamorph files of |
Note that if you configure the build parameters you can use https://ci.openmicroscopy.org/job/BIOFORMATS-5.1-merge-repository-subset/ (presumably someday DEV too) to do quick tests of these -- it does something similar to what is described on http://www.openmicroscopy.org/site/support/bio-formats5.1/developers/commit-testing.html. Often the problem is just a little bug in the code but one may sometimes legitimately need to generate adjustments for the |
Updated to use unique handlers in order to fix issues with merge tests https://ci.openmicroscopy.org/job/BIOFORMATS-5.1-merge-test_images_good/625/
The Physical Step Size is now only being calculated when each step in the z range is unique. If duplicate values appear within the range then we will not update the step size
Testing Steps:
nom1.nd
Expected physical z size for: |
Updating the physical z size calculations to use BigDecimal in order to control the precision of floating point arithmetic and remove rounding errors.
Tested using ImageJ. Everything works as expected. Please merge. |
Incorrect VoxelSize in MetaMorph Reader
To fix the physical Z size, the difference between the absolute Z
positions will need to be used.
MetaMorph handler already parses the z positions. The physical z size is
then calculated by subtracting the top and bottom values and dividing by
the number of steps.
Ticket details below:
https://trac.openmicroscopy.org/ome/ticket/12977
Splitting from #1964