This function is used to invert an affine matrix. It is a wrapper around
solve
, which additionally sets appropriate attributes.
invertAffine(affine)
affine | An existing 4x4 affine matrix. |
---|
The inverted affine matrix.
Jon Clayden <code@clayden.org>
affine <- readAffine(system.file("extdata","affine.txt",package="RNiftyReg"))
print(affine)
#> NiftyReg affine matrix:
#> 0.9972794652 0.0002360211 -0.0148521177 0.3456794620
#> -0.0002703219 0.9999528527 -0.0178595595 0.1103327721
#> 0.0172918551 0.0112342387 1.0011447668 -28.1814613342
#> 0.0000000000 0.0000000000 0.0000000000 1.0000000000
print(invertAffine(affine))
#> NiftyReg affine matrix:
#> 1.00247010956 -0.00040361536 0.01486457919 0.07241676751
#> -0.00003823826 0.99984677705 0.01783583721 0.39233730835
#> -0.01731431744 -0.01121270217 0.99839965702 28.14358366277
#> 0.00000000000 0.00000000000 0.00000000000 1.00000000000