pub struct FsSurface {
pub header: FsSurfaceHeader,
pub mesh: BrainMesh,
}
Expand description
An FsSurface object, models the contents (header and data) of a FreeSurfer surf file.
Fields§
§header: FsSurfaceHeader
§mesh: BrainMesh
Implementations§
Source§impl FsSurface
impl FsSurface
Sourcepub fn from_file<P: AsRef<Path> + Copy>(path: P) -> Result<FsSurface>
pub fn from_file<P: AsRef<Path> + Copy>(path: P) -> Result<FsSurface>
Read an FsSurface instance from a file in FreeSurfer surf format.
Sourcepub fn colors_from_curv_file<P: AsRef<Path> + Copy>(
&self,
path: P,
) -> Result<Vec<u8>>
pub fn colors_from_curv_file<P: AsRef<Path> + Copy>( &self, path: P, ) -> Result<Vec<u8>>
Generate vertex colors for this mesh from the per-vertex values in a FreeSurfer curv file. This is a convenience function that reads the curv file and generates a color vector for the mesh. It also checks that the number of colors matches the number of vertices in the mesh. Arguments:
path
- The path to the curv file. Returns a vector of colors in [r,g,b, r,g,b, …] format.
Sourcepub fn mesh_from_reader<S>(input: &mut S, hdr: &FsSurfaceHeader) -> BrainMeshwhere
S: BufRead,
pub fn mesh_from_reader<S>(input: &mut S, hdr: &FsSurfaceHeader) -> BrainMeshwhere
S: BufRead,
Read a brain mesh, i.e., the data part of an FsSurface instance, from a reader.
Trait Implementations§
impl StructuralPartialEq for FsSurface
Auto Trait Implementations§
impl Freeze for FsSurface
impl RefUnwindSafe for FsSurface
impl Send for FsSurface
impl Sync for FsSurface
impl Unpin for FsSurface
impl UnwindSafe for FsSurface
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more