Skip to content
Snippets Groups Projects
Commit bd8df759 authored by Constantin Pape's avatar Constantin Pape
Browse files

Fix calculation of scale factors for bdv-n5

parent a0402789
No related branches found
No related tags found
No related merge requests found
...@@ -12,9 +12,6 @@ from pybdv.metadata import write_n5_metadata, get_resolution, indent_xml ...@@ -12,9 +12,6 @@ from pybdv.metadata import write_n5_metadata, get_resolution, indent_xml
def normalize_scale_factors(scale_factors, start_scale): def normalize_scale_factors(scale_factors, start_scale):
if start_scale == 0:
return scale_factors
# we expect scale_factors[0] == [1 1 1] # we expect scale_factors[0] == [1 1 1]
assert np.prod(scale_factors[0]) == 1 assert np.prod(scale_factors[0]) == 1
...@@ -25,15 +22,8 @@ def normalize_scale_factors(scale_factors, start_scale): ...@@ -25,15 +22,8 @@ def normalize_scale_factors(scale_factors, start_scale):
scale_factors[scale - 1])] scale_factors[scale - 1])]
rel_scales.append(rel_factor) rel_scales.append(rel_factor)
# start at new scale # return the relative scales starting at the new scale
new_factors = [[1, 1, 1]] + rel_scales[(start_scale + 1):] new_factors = [[1., 1., 1.]] + rel_scales[(start_scale + 1):]
# back to absolute factors
for scale in range(1, len(new_factors)):
new_factor = [sf * prev_sf for sf, prev_sf in zip(new_factors[scale],
new_factors[scale - 1])]
new_factors[scale] = new_factor
return new_factors return new_factors
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment