This function is used to invert an affine matrix. It is a wrapper around solve, which additionally sets appropriate attributes.

invertAffine(affine)

Arguments

affine

An existing 4x4 affine matrix.

Value

The inverted affine matrix.

See also

Author

Jon Clayden <code@clayden.org>

Examples

affine <- readAffine(system.file("extdata","affine.txt",package="RNiftyReg"))
print(affine)
#> NiftyReg affine matrix:
#>     0.997279    0.000236   -0.014852    0.345679
#>    -0.000270    0.999953   -0.017860    0.110333
#>     0.017292    0.011234    1.001145  -28.181461
#>     0.000000    0.000000    0.000000    1.000000
#> 
print(invertAffine(affine))
#> NiftyReg affine matrix:
#>    1.002470  -0.000404   0.014865   0.072417
#>   -0.000038   0.999847   0.017836   0.392337
#>   -0.017314  -0.011213   0.998400  28.143584
#>    0.000000   0.000000   0.000000   1.000000
#>