Struct swc_neuron::SwcNeuron
source · pub struct SwcNeuron<S: StructureIdentifier, H: Header> {
pub samples: Vec<SwcSample<S>>,
pub header: Option<H>,
}Expand description
Struct representing a neuron skeleton as a tree of SwcSamples.
Fields§
§samples: Vec<SwcSample<S>>§header: Option<H>Implementations§
source§impl<S: StructureIdentifier, H: Header> SwcNeuron<S, H>
impl<S: StructureIdentifier, H: Header> SwcNeuron<S, H>
sourcepub fn sort_index(self) -> Self
pub fn sort_index(self) -> Self
Sort the neuron’s samples by their index.
sourcepub fn reindex(self) -> Result<Self, MissingSampleError>
pub fn reindex(self) -> Result<Self, MissingSampleError>
Re-index the neuron’s samples in order of occurrence, starting at 1. Returns error if the SWC is missing a parent sample
sourcepub fn sort_topo(self, reindex: bool) -> Result<Self, InconsistentNeuronError>
pub fn sort_topo(self, reindex: bool) -> Result<Self, InconsistentNeuronError>
Re-order its samples in pre-order depth first search. Children are visited in the order of their original sample number.
Returns an error if the neuron is not a self-consistent tree.
sourcepub fn validate(
&self,
ignore_order: bool
) -> Result<(), InconsistentNeuronError>
pub fn validate( &self, ignore_order: bool ) -> Result<(), InconsistentNeuronError>
Ensure that SwcNeuron is a self-consistent tree.
If ignore_order is true, samples’ parents must be defined before they are.
sourcepub fn from_reader<R: Read>(reader: R) -> Result<Self, SwcParseError>
pub fn from_reader<R: Read>(reader: R) -> Result<Self, SwcParseError>
sourcepub fn replace_header(&mut self, header: Option<H>) -> Option<H>
pub fn replace_header(&mut self, header: Option<H>) -> Option<H>
Replace the existing header with a new one, returning the existing.
Trait Implementations§
source§impl<S: StructureIdentifier, H: Header> FromIterator<SwcSample<S>> for SwcNeuron<S, H>
impl<S: StructureIdentifier, H: Header> FromIterator<SwcSample<S>> for SwcNeuron<S, H>
Auto Trait Implementations§
impl<S, H> RefUnwindSafe for SwcNeuron<S, H>where H: RefUnwindSafe, S: RefUnwindSafe,
impl<S, H> Send for SwcNeuron<S, H>where H: Send, S: Send,
impl<S, H> Sync for SwcNeuron<S, H>where H: Sync, S: Sync,
impl<S, H> Unpin for SwcNeuron<S, H>where H: Unpin, S: Unpin,
impl<S, H> UnwindSafe for SwcNeuron<S, H>where H: UnwindSafe, S: UnwindSafe,
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