Low level functions for IO on .mnc and .xfm files

Minc2.attributesMethod
attributes(h::VolumeHandle, g::String)

List attributes defined inside given group

source
Minc2.create_header_from_v2wMethod
create_header_from_v2w(
    sz, t::AffineTransform{T};
    vector_dim::Bool=false, 
    time_step::Union{Float64,Nothing}=nothing,
    time_start::Union{Float64,Nothing}=nothing)::MincHeader

Internal: Generate header from the voxel to world transform and volume size

source
Minc2.create_minc_fileMethod
create_minc_file(h::VolumeHandle, path::AbstractString)

Create empty minc file on disk, structure need to be defined in advance

source
Minc2.define_minc_fileMethod
define_minc_file(hdr::MincHeader,::Type{Store}=Float32,::Type{Repr}=Store)

Define new minc file structure, return handle

source
Minc2.empty_like_minc_volume_rawMethod
empty_like_minc_volume_raw( h::VolumeHandle,
    ::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader}

Allocate empty volume using handle return volume, storage header

source
Minc2.empty_like_minc_volume_rawMethod
empty_like_minc_volume_raw(path::String, ::Type{T}=Float32 )::
        Tuple{Array{T}, Minc2.MincHeader}

Create empty volume similar to existing file return volume, representation header,storage header

source
Minc2.empty_like_minc_volume_stdMethod
empty_like_minc_volume_std(h::VolumeHandle, 
    ::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader, Minc2.MincHeader}

Read the actual volume using handle return volume, representation header,storage header

source
Minc2.empty_like_minc_volume_stdMethod
empty_like_minc_volume_std(path::String, 
    ::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader, Minc2.MincHeader}

allocate empty volume using path as a reference return volume, representation header,storage header

source
Minc2.get_attributeMethod
get_attribute(h::VolumeHandle,g::String,a::String; default=missing)

Convenience function for reading specific attribute, return default value if not found also convert Array into the first value if it's a one-length array

source
Minc2.ndimMethod
ndim(h::VolumeHandle)::Int

Query number of dimensions in the minc file

source
Minc2.read_attributeMethod
read_attribute(h::VolumeHandle, 
    group::String,
    attribute::String)::Union{String, AbstractVector, Nothing}

Read minc2 header attribute :param group: attribute group name :param attribute: attribute name :return:

source
Minc2.read_minc_volume_rawMethod
read_minc_volume_raw(h::VolumeHandle, 
    ::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader}

Read the actual volume using handle return volume, storage header

source
Minc2.read_minc_volume_rawMethod
read_minc_volume_raw(path::String, ::Type{T}=Float32 )::
    Tuple{Array{T}, Minc2.MincHeader}

Read the actual volume using path return volume, representation header,storage header

source
Minc2.read_minc_volume_stdMethod
read_minc_volume_std(h::VolumeHandle, 
    ::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader, Minc2.MincHeader}

Read the actual volume using handle return volume, representation header,storage header

source
Minc2.read_minc_volume_stdMethod
read_minc_volume_std(path::String, ::Type{T}=Float32 )::
    Tuple{Array{T}, Minc2.MincHeader, Minc2.MincHeader}

Read the actual volume using path return volume, representation header,storage header

source
Minc2.read_minc_volume_std_historyMethod
read_minc_volume_std_history(path::String, ::Type{T}=Float32 )::
    Tuple{Array{T}, Minc2.MincHeader, Minc2.MincHeader, Union{String,Nothing}}

Read the actual volume using path return volume, representation header,storage header

source
Minc2.representation_typeMethod
store_type(h::VolumeHandle)::Type

Query representation data type of the minc file, WARNING: it doesn't nacessery mean that it's the same as store_type type

source
Minc2.store_typeMethod
store_type(h::VolumeHandle)::Type

Query storage data type of the minc file, WARNING: it doesn't nacessery mean that it's the same as representation type

source
Minc2.voxel_to_worldMethod
voxel_to_world(hdr::MincHeader)::AffineTransform{Float64}

Give AffineTransform for world to voxel transformation based on header

source
Minc2.voxel_to_worldMethod
voxel_to_world(h::VolumeHandle,ijk::Vector{Float64})::Vector{Float64}

Convert contignuous 0-based voxel indexes (I,J,K) to world coordinates (X,Y,Z) 0-based

source
Minc2.world_to_voxelMethod
world_to_voxel(hdr::MincHeader)::AffineTransform{Float64}

Give AffineTransform for voxel to world transformation

source
Minc2.world_to_voxelMethod
world_to_voxel(h::VolumeHandle, xyz::Vector{Float64})::Vector{Float64}

Convert world coordinates (X,Y,Z) to contignuous voxel indexes (I,J,K) 0-based

source
Minc2.write_attributeMethod
write_attribute(h::VolumeHandle, group::String, attribute::String, value::T)

Store attribute into minc2 file :param group: group name :param attribute: attribute name :param value: attribute value :return:

source
Minc2.write_minc_volume_rawMethod
write_minc_volume_raw(path::String, ::Type{Store}, 
    store_hdr::Union{MincHeader, Nothing}, 
    volume::Array{Repr};like::Union{String, Nothing}=nothing, 
    history::Union{String, Nothing}=nothing )

Write full volume to file, need to provide details of file structure return nothing

source
Minc2.write_minc_volume_rawMethod
write_minc_volume_raw(h::VolumeHandle, volume::Array{T} )

write full volume to file, file should be defined and created return nothing

source
Minc2.write_minc_volume_stdMethod
write_minc_volume_std(path::String, ::Type{Store}, 
    store_hdr::Union{MincHeader, Nothing}, 
    volume::Array{Repr};like::Union{String, Nothing}=nothing, 
    history::Union{String, Nothing}=nothing )

Write full volume to file, need to provide details of file structure return nothing

source
Minc2.write_minc_volume_stdMethod
write_minc_volume_std(h::VolumeHandle, volume::Array{T} )

write full volume to file, file should be defined and created return nothing

source
Minc2.MincHeaderType
MincHeader

Structure describing spatial orientation and sampling of the minc file

source
Minc2.minc2_spatialConstant

Low Level: Mapping MINC2 spatial dimensions to proper spatial dimension (should be identity for spatial dims)

source
Minc2.append_grid_transformMethod
append_grid_transform(h::TransformHandle, grid_file::String; inv::Bool=false)

Low level: Append grid transform to an open transformation handle

source
Minc2.append_linear_transformMethod
append_linear_transform(h::TransformHandle, lin::AffineTransform)

Low level: Append affine transform to an open transformation handle

source
Minc2.concat_xfmMethod
concat_xfm(h::TransformHandle, i::TransformHandle)

Low level: concatenate two transfomations

source
Minc2.get_grid_transformMethod
get_grid_transform(h::TransformHandle; n::Int64=0)

Low level: extract reference to a grid file from open handle

source
Minc2.get_linear_transformMethod
get_linear_transform(h::TransformHandle; n::Int64=0)::AffineTransform{Float64}

Low level: extract AffineTransform{Float64} from open handle

source
Minc2.get_linear_transform_paramMethod
get_linear_transform_param(h::TransformHandle;n::Int64=0,center::Union{Nothing,Vector{Float64}}=nothing)

Low level: extact transformation parameters from affine transform , returns named tuple with fields center, translations, scales, shears, rotations

source
Minc2.get_n_concatMethod
get_n_concat(h::TransformHandle)::Int64

Low level: Get number of transformations in open handle

source
Minc2.get_n_typeMethod
get_n_type(h::TransformHandle; n::Int64=0)::XFM

Low level: Get transform type for nth transform in open handle

source
Minc2.inverse_transform_pointMethod
inverse_transform_point(h::TransformHandle, xyz::Vector{Float64})::Vector{Float64}

Low level: Inverse transform point xyz using minc transform h

source
Minc2.load_transformsMethod
load_transforms(h::TransformHandle)::Vector{AnyTransform}

Low level: Load all transforms from open .XFM handle

source
Minc2.save_transformsMethod
save_transforms(fname::String, 
    xfm::Union{Vector{XFM}, XFM};
    grid_store::Type{T}=Float32 ) where {T, XFM<:AnyTransform}

Save transformations into .xfm file,

Arguments

  • fname: output file name
  • xfm: vector of transformations to save, or a single transformation
  • grid_store: type of storage for grid files (default: Float32)
source
Minc2.save_xfm_fileMethod
save_xfm_file(h::TransformHandle, path::String)

Low level: Save information into file from an open handle

source
Minc2.transform_pointMethod
transform_point(h::TransformHandle, xyz::Vector{Float64})::Vector{Float64}

Low level: Transform point xyz using minc transform h

source
Minc2.XFMType

@enum XFM

Low level: transformation types stored in .xfm file

source