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

coordinateTransformations generated for 0.4 are scale-only #403

Open
d-v-b opened this issue Nov 6, 2024 · 0 comments
Open

coordinateTransformations generated for 0.4 are scale-only #403

d-v-b opened this issue Nov 6, 2024 · 0 comments

Comments

@d-v-b
Copy link

d-v-b commented Nov 6, 2024

The most common methods of image downsampling result in a translation of the downsampled image, but this code for generating coordinateTransformations metadata only returns scale transformations, which will be incorrect for almost all multiscale pyramids.

def generate_coordinate_transformations(
self, shapes: List[tuple]
) -> Optional[List[List[Dict[str, Any]]]]:
data_shape = shapes[0]
coordinate_transformations: List[List[Dict[str, Any]]] = []
# calculate minimal 'scale' transform based on pyramid dims
for shape in shapes:
assert len(shape) == len(data_shape)
scale = [full / level for full, level in zip(data_shape, shape)]
coordinate_transformations.append([{"type": "scale", "scale": scale}])
return coordinate_transformations

Suggested fix: generate translation transforms

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

1 participant