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

SphereTransform: center coords are not relative #42

Open
imagejan opened this issue Jun 25, 2021 · 1 comment
Open

SphereTransform: center coords are not relative #42

imagejan opened this issue Jun 25, 2021 · 1 comment

Comments

@imagejan
Copy link

The arguments to SphereTransform are called relative_center_{xyz}, but the call to ReslicePolar.reslice is performing translation in pixel units, without any normalization:

ReslicePolar.reslicePolar(clij2, pushed, result,
delta_angle_in_degrees, 0f, 0f,
relative_center_x, relative_center_y, relative_center_z,
1f, 1f, 1f,
0f, 0f, 0f,
0f, 0f, 0f);

public static boolean reslicePolar(CLIJ2 clij2, ClearCLBuffer src, ClearCLBuffer dst, Float deltaAngle, Float startInclinationDegrees, Float startAzimuthDegrees, Float centerX, Float centerY, Float centerZ, Float scaleFactorX, Float scaleFactorY, Float scaleFactorZ,
float translation_x, float translation_y, float translation_z, float rotation_x, float rotation_y, float rotation_z) {

I'd suggest to either rename the arguments to center_{xyz}, or to (re-)introduce some normalization to image dimensions before that call.

@imagejan
Copy link
Author

imagejan commented Jul 2, 2021

For completeness: when running the plugin via clij{2,x}-assistant, the arguments are indeed relative. Normalization of the relative coordinates is currently happening in two places, before calling the underlying CLIJ2 plugin with absolute coordinates:

https://github.com/clij/clij2-assistant/blob/1cef95e60735399c994c7e3186b1c2aa03059c5d/src/main/java/net/haesleinhuepf/clij2/assistant/interactive/handcrafted/SphereTransform.java#L78

https://github.com/clij/clijx-assistant/blob/6b6c719098179ee3fe6afa6317aba0b6d70d927a/src/main/java/net/haesleinhuepf/clijx/assistant/interactive/handcrafted/SphereTransform.java#L78

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