Low level functions for IO on .mnc and .xfm files
Minc2.@minc2_check
— Macrominc2_check( ex )
Macro to verify the return code
Minc2._hdr_convert!
— Method_hdr_convert!(hdr::MincHeader,dd)::MincHeader
internal function
Minc2.attributes
— Methodattributes(h::VolumeHandle, g::String)
List attributes defined inside given group
Minc2.close_minc_file
— Methodclose_minc_file(h::VolumeHandle)
Close currently open minc file, commit data on disk
Minc2.copy_minc_metadata
— Methodcopy_minc_metadata(i::VolumeHandle, o::VolumeHandle)
Copy metadata from one file to another
Minc2.create_header_from_v2w
— Methodcreate_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
Minc2.create_minc_file
— Methodcreate_minc_file(h::VolumeHandle, path::AbstractString)
Create empty minc file on disk, structure need to be defined in advance
Minc2.define_minc_file
— Methoddefine_minc_file(hdr::MincHeader,::Type{Store}=Float32,::Type{Repr}=Store)
Define new minc file structure, return handle
Minc2.empty_like_minc_volume_raw
— Methodempty_like_minc_volume_raw( h::VolumeHandle,
::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader}
Allocate empty volume using handle return volume, storage header
Minc2.empty_like_minc_volume_raw
— Methodempty_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
Minc2.empty_like_minc_volume_std
— Methodempty_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
Minc2.empty_like_minc_volume_std
— Methodempty_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
Minc2.empty_like_minc_volume_std_history
— Methodempty_like_minc_volume_std_history(path::String, ::Type{T}=Float32 )
allocate empty volume using path return volume, representation header,storage header
Minc2.get_attribute
— Methodget_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
Minc2.groups
— Methodgroups(h::VolumeHandle)
List groups defined in minc2 file
Minc2.minc2_load_and_convert_complete_volume
— MethodInternal function that makes sure types are compatible
Minc2.minc2_load_and_convert_complete_volume
— MethodInternal function that makes shure types are compatible
Minc2.minc2_load_and_convert_complete_volume
— MethodInternal function that makes shure types are compatible
Minc2.ndim
— Methodndim(h::VolumeHandle)::Int
Query number of dimensions in the minc file
Minc2.open_minc_file
— Methodopen_minc_file(fname::String)::VolumeHandle
Open minc file, return handle
Minc2.read_attribute
— Methodread_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:
Minc2.read_history
— Methodread_history(i::VolumeHandle)::Union{String, Nothing}
Return history string
Minc2.read_minc_volume_raw
— Methodread_minc_volume_raw(h::VolumeHandle,
::Type{T}=Float32 )::Tuple{Array{T}, Minc2.MincHeader}
Read the actual volume using handle return volume, storage header
Minc2.read_minc_volume_raw
— Methodread_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
Minc2.read_minc_volume_raw_history
— Methodread_minc_volume_raw_history(path::String, ::Type{T}=Float32 )
Read the actual volume using path return volume, representation header,storage header
Minc2.read_minc_volume_std
— Methodread_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
Minc2.read_minc_volume_std
— Methodread_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
Minc2.read_minc_volume_std_history
— Methodread_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
Minc2.representation_header
— Methodrepresentation_header(h::VolumeHandle)::MincHeader
Return volume representation header
Minc2.representation_type
— Methodstore_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
Minc2.setup_standard_order
— Methodsetup_standard_order(h::VolumeHandle)
Prepare to read volume in standard order: [V,X,Y,Z,TIME]
Minc2.store_header
— Methodstore_header(h::VolumeHandle)::MincHeader
Return volume on-disk stucture header
Minc2.store_type
— Methodstore_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
Minc2.voxel_to_world
— Methodvoxel_to_world(hdr::MincHeader)::AffineTransform{Float64}
Give AffineTransform for world to voxel transformation based on header
Minc2.voxel_to_world
— Methodvoxel_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
Minc2.world_to_voxel
— Methodworld_to_voxel(hdr::MincHeader)::AffineTransform{Float64}
Give AffineTransform for voxel to world transformation
Minc2.world_to_voxel
— Methodworld_to_voxel(h::VolumeHandle, xyz::Vector{Float64})::Vector{Float64}
Convert world coordinates (X,Y,Z) to contignuous voxel indexes (I,J,K) 0-based
Minc2.write_attribute
— Methodwrite_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:
Minc2.write_history
— Methodwrite_history(i::VolumeHandle, history::String)
Write history string
Minc2.write_minc_volume_raw
— Methodwrite_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
Minc2.write_minc_volume_raw
— Methodwrite_minc_volume_raw(h::VolumeHandle, volume::Array{T} )
write full volume to file, file should be defined and created return nothing
Minc2.write_minc_volume_std
— Methodwrite_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
Minc2.write_minc_volume_std
— Methodwrite_minc_volume_std(h::VolumeHandle, volume::Array{T} )
write full volume to file, file should be defined and created return nothing
Minc2.DIM
— TypeLow Level: Axis types from MINC volume
Minc2.Minc2Error
— TypeMINC io exception
Minc2.MincHeader
— TypeMincHeader
Structure describing spatial orientation and sampling of the minc file
Minc2.STATUS
— TypeLow Level: minc2_simple API status
Minc2.VolumeHandle
— TypeVolumeHandle
minc2_simple volume handle
Minc2.julia_to_minc2
— ConstantLow Level: map Julia types to minc2 data types
Minc2.minc2_spatial
— ConstantLow Level: Mapping MINC2 spatial dimensions to proper spatial dimension (should be identity for spatial dims)
Minc2.minc2_to_julia
— ConstantLow Level: map MINC2 types to Julia
Minc2.append_grid_transform
— Methodappend_grid_transform(h::TransformHandle, grid_file::String; inv::Bool=false)
Low level: Append grid transform to an open transformation handle
Minc2.append_linear_transform
— Methodappend_linear_transform(h::TransformHandle, lin::AffineTransform)
Low level: Append affine transform to an open transformation handle
Minc2.concat_xfm
— Methodconcat_xfm(h::TransformHandle, i::TransformHandle)
Low level: concatenate two transfomations
Minc2.get_grid_transform
— Methodget_grid_transform(h::TransformHandle; n::Int64=0)
Low level: extract reference to a grid file from open handle
Minc2.get_linear_transform
— Methodget_linear_transform(h::TransformHandle; n::Int64=0)::AffineTransform{Float64}
Low level: extract AffineTransform{Float64} from open handle
Minc2.get_linear_transform_param
— Methodget_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
Minc2.get_n_concat
— Methodget_n_concat(h::TransformHandle)::Int64
Low level: Get number of transformations in open handle
Minc2.get_n_type
— Methodget_n_type(h::TransformHandle; n::Int64=0)::XFM
Low level: Get transform type for n
th transform in open handle
Minc2.inverse_transform_point
— Methodinverse_transform_point(h::TransformHandle, xyz::Vector{Float64})::Vector{Float64}
Low level: Inverse transform point xyz
using minc transform h
Minc2.invert_transform
— Methodinvert_transform(h::TransformHandle)
Low level: Invert minc transform h
Minc2.load_transforms
— Methodload_transforms(h::TransformHandle)::Vector{AnyTransform}
Low level: Load all transforms from open .XFM handle
Minc2.load_transforms
— Methodload_transforms(fname::String)::Vector{AnyTransform}
Load transformations from .xfm file fname
Minc2.open_xfm_file
— MethodLow level: Open transform xfm file, return handle
Minc2.read_transforms
— Methodread_transforms(fname::String)::Vector{AnyTransform}
Read transformations from .xfm file fname
Minc2.save_transforms
— Methodsave_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 namexfm
: vector of transformations to save, or a single transformationgrid_store
: type of storage for grid files (default: Float32)
Minc2.save_xfm_file
— Methodsave_xfm_file(h::TransformHandle, path::String)
Low level: Save information into file from an open handle
Minc2.transform_point
— Methodtransform_point(h::TransformHandle, xyz::Vector{Float64})::Vector{Float64}
Low level: Transform point xyz
using minc transform h
Minc2.TransformHandle
— TypeLow level: minc2_simple XFM transform handle
Minc2.XFM
— Type@enum XFM
Low level: transformation types stored in .xfm file