Functions for gemetric transformations

Base.lengthMethod
Base.length(tr::AnyTransform)

Length of concatenated transform

source
Base.showMethod
Base.show(io::IO, z::GridTransform{T,F,I})

Print summary information about grid transform

source
Base.showMethod
Base.show(io::IO, z::InverseGridTransform{T,F,I})

Print summary information about inverse grid transform

source
Minc2.arrayMethod
array(grid::GridTransform)

Extract underlying plain array

  • grid - GridTransform
source
Minc2.arrayMethod
array(grid::InverseGridTransform)

Extract underlying plain array

  • grid - InverseGridTransform
source
Minc2.decomposeMethod

decompose(rot, shift)

Decompose affine transform specified as rotation matrix ans shift vector into three components start, step, direction cosines

  • rot - rotation matrix (3x3)
  • shift - shift vector (3)
source
Minc2.decomposeMethod
decompose(tfm::Matrix{T})

Decompose affine transform into three components start, step, direction cosines

source
Minc2.decomposeMethod
decompose(tfm::AffineTransform{T})

Decompose affine transform into three components start, step, direction cosines

  • tfm - affine transform
source
Minc2.interpolate_fieldMethod
interpolate_field(
        v2w::AffineTransform{T},
        itp_vector_field::I, 
        p::SVector{3,T} )::SVector{3,T}

Internal support function

  • v2w - voxel to world affine transform
  • itp_vector_field - vector field
  • p - point to transform
source
Minc2.invMethod
inv(::IdentityTransform)::IdentityTransform

Invert IdentityTransform transform, does nothing

source
Minc2.invMethod
inv(t::AffineTransform{T})::AffineTransform{T}

Invert AffineTransform transform

  • t - AffineTransform
source
Minc2.invMethod
inv(t::GridTransform{T,F,VF})::InverseGridTransform{T,F,VF}

Invert GridTransform transform

  • t - GridTransform
source
Minc2.invMethod
inv(t::InverseGridTransform{T,F,VF})::GridTransform{T,F,VF}

Invert InverseGridTransform transform

  • t - InverseGridTransform
source
Minc2.invMethod
inv(t::Vector{T})::Vector{AnyTransform}

Invert concatenated transform

  • t - concatenated transform
source
Minc2.transform_pointMethod
transform_point(
        tfm::GridTransform{T,F}, p::SVector{3,T};
        _whatever...)::SVector{3,T} where {T,F}

Apply forward grid transform to a point

  • tfm - grid transform
  • p - point to transform
source
Minc2.transform_pointMethod
transform_point(
    tfm::AffineTransform{T}, 
    p::CartesianIndex{3};
    _whatever...)::SVector{3,T}

Apply inverse grid transform reimplements algorithm from MNIformats/gridtransforms.c:gridinversetransform_point

  • tfm - affine transform
  • p - point to transform
source
Minc2.transform_pointMethod
transform_point(
    tfm::AffineTransform{T}, 
    p::CartesianIndex{3};
    _whatever...)::SVector{3,T}

Apply affine transform to CartesianIndices

  • tfm - affine transform
  • p - point to transform
source
Minc2.transform_pointMethod
transform_point(
        tfm::AffineTransform{T}, 
        p::SVector{3,T};
        _whatever...)::SVector{3,T}

Apply affine transform to a point

  • tfm - affine transform
  • p - point to transform
source
Minc2.transform_pointMethod
transform_point(tfm::IdentityTransform, 
    p::SVector{3,T};
    _whatever...)
  • tfm - IdentityTransform
  • p - point to transform

Apply identity transform to a point (returns same point)

source
Minc2.transform_pointMethod
transform_point(
    tfm::Vector{XFM},
    p::SVector{3,T};
    max_iter::Int=10,
    ftol::Float64=1.0/80)::SVector{3,T}

Apply concatenated transform to a point

  • tfm - concatenated transform
  • p - point to transform
  • max_iter - maximum number of iterations for inverse transform
  • ftol - tolerance for inverse transform
source
Minc2.voxel_to_worldMethod
voxel_to_world(grid::GridTransform)

Extract voxel to world affine transform from a GridTransform

  • grid - GridTransform
source
Minc2.voxel_to_worldMethod
voxel_to_world(grid::InverseGridTransform)

Extract voxel to world affine transform from a InverseGridTransform

  • grid - InverseGridTransform
source
Minc2.world_to_voxelMethod
world_to_voxel(grid::GridTransform)

Extract world to voxel affine transform from a GridTransform

  • grid - GridTransform
source
Minc2.world_to_voxelMethod
world_to_voxel(grid::InverseGridTransform)

Extract world to voxel affine transform from a InverseGridTransform

  • grid - InverseGridTransform
source
Minc2.AffineTransformMethod
AffineTransform(rot, shift) Create affine transform from rotation and shift
  • rot - rotation matrix-like (3x3)

  • shift - shift vector-like (3)

source
Minc2.GridTransformMethod
GridTransform(
    voxel_to_world::AffineTransform{T},
    vector_field::Array{F, 4})

Construct GridTransform from voxel to world transform and a vector field

  • voxel_to_world - voxel to world affine transform
  • vector_field - vector field
source
Minc2.GridTransformMethod
GridTransform(::Type{T}=Float64,::Type{F}=Float64)

Construct empty GridTransform, which should generate identity transform

source
Minc2.InverseGridTransformMethod
InverseGridTransform(
    voxel_to_world::AffineTransform{T},
    vector_field::Array{F, 4})

Construct InverseGridTransform from voxel to world transform and a vector field

  • voxel_to_world - voxel to world affine transform
  • vector_field - vector field
source