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

Warp seems to be off #166

Open
ChantalJuntao opened this issue Dec 8, 2023 · 1 comment
Open

Warp seems to be off #166

ChantalJuntao opened this issue Dec 8, 2023 · 1 comment

Comments

@ChantalJuntao
Copy link

I don't know if this used to be a problem too, but I'm having trouble reproducing some image transformations I had saved last month, and I found that warp doesn't seem to be making accurate rotations right now?

using ImageTransformations, TestImages, ImageView, Rotations, OffsetArrays, CoordinateTransformations

mri = centered(testimage("mri"));
tfm = AffineMap(RotXYZ(2*pi,0,0), [0, 0, 0]);
imgw = warp(mri, tfm, axes(mri));

imshow(colorview(RGB, mri.data, imgw, zeroarray));
@empet
Copy link

empet commented Dec 8, 2023

Is this the transformation you are looking for?

mri = testimage("mri")
tfm = recenter(RotXYZ(pi/4, 0, 0), center(mri))
imgw = warp(mri, tfm,  axes(mri))
imshow(colorview(RGB, mri.data, imgw, zeroarray));

with:

[150eb455] CoordinateTransformations v0.6.3
  [02fcd773] ImageTransformations v0.10.0
  [6fe1bfb0] OffsetArrays v1.12.10

Your centered is unknown:

UndefVarError: `centered` not defined  

The transformation, tfm, in my definition is an AffineMap that first rotates the image about origin, and then translates it on the direction defined by the center of the image testimage("mri").

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

2 participants