Skip to main content

Crate mrc

Crate mrc 

Source
Expand description

MRC file format library for cryo-EM and tomography

Provides iterator-centric reading and voxel-block writing with SIMD acceleration.

§Architecture

This crate implements a unified encoding/decoding pipeline:

Raw Bytes → Endian Normalization → Typed Values → Type Conversion

With zero-copy fast paths whenever possible.

Structs§

ExtHeader
ExtHeaderMut
Float32Complex
Header
Int16Complex
MmapReader
Memory-mapped MRC file reader.
MmapWriter
Packed4Bit
Reader
SlabIterConverted
Slab iterator with type conversion support.
SliceIterConverted
Slice iterator with type conversion support.
VolumeShape
Volume geometry
VoxelBlock
Universal representation of voxel chunks
Writer
WriterBuilder

Enums§

ConversionPath
Conversion path through the 4-layer pipeline.
Error
Error type
FileEndian
Endianness of MRC file data
Mode

Traits§

Convert
Trait for converting between voxel types.
EndianCodec
Bidirectional codec for endian-normalized byte conversion.
SliceAccess
Trait for writers that provide direct slice access to voxel data.
Voxel
Trait for MRC voxel types with compile-time mode tracking.

Functions§

convert_f16_slice_to_f32
Batch conversion from f16 to f32.
convert_f32_slice_to_f16
Batch conversion from f32 to f16.
convert_i8_slice_to_f32
Batch conversion from i8 to f32 using SIMD when available.
convert_i16_slice_to_f32
Batch conversion from i16 to f32 using SIMD when available.
convert_u8_slice_to_f32
Batch conversion from u8 to f32 using SIMD when available.
convert_u16_slice_to_f32
Batch conversion from u16 to f32 using SIMD when available.
create
Create a new MRC file for writing
get_conversion_path
Determine the optimal conversion path for the given parameters.
is_zero_copy
Check if zero-copy is possible for the given parameters.
open
Open an MRC file for reading
try_simd_convert
Attempt SIMD-accelerated conversion from source slice to destination type.