#[repr(C)]pub struct CHeader {Show 23 fields
pub id_string: [u8; 6],
pub dim: [i16; 3],
pub voxel_size: [f32; 3],
pub origin: [f32; 3],
pub n_scalars: i16,
pub scalar_name: [u8; 200],
pub n_properties: i16,
pub property_name: [u8; 200],
pub vox_to_ras: [f32; 16],
pub reserved: [u8; 444],
pub voxel_order: [u8; 4],
pub pad2: [u8; 4],
pub image_orientation_patient: [f32; 6],
pub pad1: [u8; 2],
pub invert_x: u8,
pub invert_y: u8,
pub invert_z: u8,
pub swap_x: u8,
pub swap_y: u8,
pub swap_z: u8,
pub n_count: i32,
pub version: i32,
pub hdr_size: i32,
}
Fields§
§id_string: [u8; 6]
§dim: [i16; 3]
§voxel_size: [f32; 3]
§origin: [f32; 3]
§n_scalars: i16
§scalar_name: [u8; 200]
§n_properties: i16
§property_name: [u8; 200]
§vox_to_ras: [f32; 16]
§reserved: [u8; 444]
§voxel_order: [u8; 4]
§pad2: [u8; 4]
§image_orientation_patient: [f32; 6]
§pad1: [u8; 2]
§invert_x: u8
§invert_y: u8
§invert_z: u8
§swap_x: u8
§swap_y: u8
§swap_z: u8
§n_count: i32
§version: i32
§hdr_size: i32
Implementations§
source§impl CHeader
impl CHeader
pub fn seek_n_count_field(f: &mut BufWriter<File>) -> Result<()>
pub fn clear_scalars(&mut self)
pub fn add_scalar(&mut self, name: &str) -> Result<()>
pub fn get_scalars_name(&self) -> Vec<String>
pub fn clear_properties(&mut self)
pub fn add_property(&mut self, name: &str) -> Result<()>
pub fn get_properties_name(&self) -> Vec<String>
sourcepub fn get_affine_to_rasmm(&self) -> Affine4
pub fn get_affine_to_rasmm(&self) -> Affine4
Get affine mapping trackvis voxelmm space to RAS+ mm space
The streamlines in a trackvis file are in ‘voxelmm’ space, where the coordinates refer to the corner of the voxel.
Compute the affine matrix that will bring them back to RAS+ mm space, where the coordinates refer to the center of the voxel.
pub fn read(reader: &mut BufReader<File>) -> Result<(CHeader, Endianness)>
pub fn write<W: WriteBytesExt>(&self, writer: &mut W) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for CHeader
impl Send for CHeader
impl Sync for CHeader
impl Unpin for CHeader
impl UnwindSafe for CHeader
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.