clij / clij2

GPU-accelerated image processing for everyone
https://clij.github.io/clij2
Other
48 stars 14 forks source link

SphereTransform: center coords are not relative #42

Open imagejan opened 3 years ago

imagejan commented 3 years ago

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

https://github.com/clij/clij2/blob/5c716fb414c57a42617490e8135bd07d3c4044d9/src/main/java/net/haesleinhuepf/clij2/plugins/SphereTransform.java#L54-L59

https://github.com/clij/clij2/blob/5c716fb414c57a42617490e8135bd07d3c4044d9/src/main/java/net/haesleinhuepf/clij2/plugins/ReslicePolar.java#L75-L76

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

imagejan commented 3 years ago

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