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

mirror should work for image data #265

Closed
jefferis opened this issue Oct 30, 2015 · 1 comment
Closed

mirror should work for image data #265

jefferis opened this issue Oct 30, 2015 · 1 comment

Comments

@jefferis
Copy link
Collaborator

Originally because I wanted a mirror_brain for images (see natverse/nat.templatebrains#18).

In this snippet from nat::mirror

    mirrormat = diag(4)
    mirrormat[mirrorAxis, 4] = mirrorAxisSize
    mirrormat[mirrorAxis, mirrorAxis] = -1
    if (is.null(warpfile) || transform == "flip") {
        xform(x, reg = mirrormat, ...)
    }
    else {
        xyzmatrix(x) = xformpoints(xyzmatrix(x), reg = mirrormat)
        xform(x, reg = warpfile, transformtype = transform, ...)
    }

If we converted mirrormat to a cmtk registration and then passed both of them to xform, then it should all work magically!

@jefferis
Copy link
Collaborator Author

Need to check behaviour when target image has non-zero origin since CMTK does not consider the origin of an image when registering or reformatting. See this question and answer on the CMTK forum. Essentially any image data will always be considered to have a non-zero origin and this goes for calculating a mirroring registration as well.

Therefore if the target space has a non-zero origin, points will have to be physically translated to account for this before and after applying the (image-based) mirroring registration. The same would apply for xform operations between different template spaces where the original origin would need be removed and the new one added. This is not a very satisfactory state of affairs since the assumption is that a bridging registration should be identical regardless of the kind of data being transformed (though in practice we already need to select either a forward or inverse direction depending on whether we are dealing with points or image data).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant