Skip to main content

SciPyCompatLayer

Struct SciPyCompatLayer 

Source
pub struct SciPyCompatLayer { /* private fields */ }
Expand description

SciPy ndimage compatibility layer

Implementations§

Source§

impl SciPyCompatLayer

Source

pub fn new(config: CompatibilityConfig) -> SciPyCompatLayer

Create a new SciPy compatibility layer

Source

pub fn default() -> SciPyCompatLayer

Create with default configuration

Source

pub fn get_warnings(&self) -> &[MigrationWarning]

Get migration warnings

Source

pub fn clear_warnings(&mut self)

Clear warnings

Source§

impl SciPyCompatLayer

SciPy-compatible filter functions

Source

pub fn gaussian_filter<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, sigma: SigmaParam, order: Option<OrderParam>, mode: Option<&str>, cval: Option<f64>, truncate: Option<f64>, ) -> Result<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, NdimageError>
where T: Float + FromPrimitive + Clone + Send + Sync,

Gaussian filter with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.gaussian_filter(input, sigma, order=0, output=None,
                              mode='reflect', cval=0.0, truncate=4.0)
Source

pub fn median_filter<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, size: Option<SizeParam>, footprint: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, mode: Option<&str>, cval: Option<f64>, origin: Option<OriginParam>, ) -> Result<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, NdimageError>
where T: Float + FromPrimitive + Debug + Clone + Send + Sync + PartialOrd + AddAssign + DivAssign + 'static,

Median filter with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.median_filter(input, size=None, footprint=None, output=None,
                            mode='reflect', cval=0.0, origin=0)
Source

pub fn uniform_filter<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, size: Option<SizeParam>, mode: Option<&str>, cval: Option<f64>, origin: Option<OriginParam>, ) -> Result<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>, NdimageError>
where T: Float + FromPrimitive + Debug + Clone + Send + Sync + AddAssign + DivAssign + 'static,

Uniform filter with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.uniform_filter(input, size=3, output=None, mode='reflect',
                             cval=0.0, origin=0)
Source§

impl SciPyCompatLayer

SciPy-compatible morphology functions

Source

pub fn binary_erosion<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, structure: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, iterations: Option<usize>, mask: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, border_value: Option<bool>, origin: Option<OriginParam>, brute_force: Option<bool>, ) -> Result<ArrayBase<OwnedRepr<bool>, Dim<[usize; 2]>>, NdimageError>

Binary erosion with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.binary_erosion(input, structure=None, iterations=1,
                             mask=None, output=None, border_value=0,
                             origin=0, brute_force=False)
Source

pub fn binary_dilation<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, structure: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, iterations: Option<usize>, mask: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, border_value: Option<bool>, origin: Option<OriginParam>, brute_force: Option<bool>, ) -> Result<ArrayBase<OwnedRepr<bool>, Dim<[usize; 2]>>, NdimageError>

Binary dilation with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.binary_dilation(input, structure=None, iterations=1,
                              mask=None, output=None, border_value=0,
                              origin=0, brute_force=False)
Source

pub fn distance_transform_edt<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, sampling: Option<SamplingParam>, return_distances: Option<bool>, return_indices: Option<bool>, ) -> Result<DistanceTransformResult<T>, NdimageError>

Distance transform with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.distance_transform_edt(input, sampling=None, return_distances=True,
                                     return_indices=False, distances=None, indices=None)
Source§

impl SciPyCompatLayer

SciPy-compatible measurement functions

Source

pub fn center_of_mass<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, labels: Option<ArrayBase<ViewRepr<&i32>, Dim<[usize; 2]>>>, index: Option<IndexParam>, ) -> Result<CenterOfMassResult, NdimageError>
where T: Float + FromPrimitive + Clone + Send + Sync + Debug + DivAssign + NumAssign + 'static,

Center of mass with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.center_of_mass(input, labels=None, index=None)
Source

pub fn label<T>( &mut self, input: ArrayBase<ViewRepr<&T>, Dim<[usize; 2]>>, structure: Option<ArrayBase<ViewRepr<&bool>, Dim<[usize; 2]>>>, ) -> Result<LabelResult, NdimageError>

Label connected components with SciPy-compatible interface

# SciPy usage:
scipy.ndimage.label(input, structure=None, output=None)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V