pub struct BitmaskLayerParams {
pub layer_id: String,
pub bounds: Option<MarginParams>,
pub data_unit_mode_x: UnitsMode,
pub data_unit_mode_y: UnitsMode,
pub stroke_width_unit_mode: UnitsMode,
pub pixel_offset: Option<(u32, u32)>,
pub model_matrix: Option<[f32; 16]>,
pub dimension_order: DimensionOrder,
pub shape: Vec<u32>,
pub channel_settings: Vec<BitmaskChannelSettings>,
pub opacity: f32,
pub data: NumericData,
}Expand description
Layer params struct for BitmaskLayer.
Fields§
§layer_id: String§bounds: Option<MarginParams>§data_unit_mode_x: UnitsMode§data_unit_mode_y: UnitsMode§stroke_width_unit_mode: UnitsModeHow to interpret every channel’s BitmaskChannelSettings::stroke_width.
Analogous to the same field on the stroked polygon/curve layers.
Unlike those layers there is no stroke geometry to widen – which fragments are stroked is decided from the bitmask data on the fly in the shader.
The boundary test samples such that a Pixels width renders the same number
of screen pixels thick whether the mask is coarse or fine.
pixel_offset: Option<(u32, u32)>§model_matrix: Option<[f32; 16]>§dimension_order: DimensionOrderThe order of dimensions in the flat data array.
shape: Vec<u32>The size of each dimension, in the same order as dimension_order.
For example, if dimension_order is “CYX” and the mask is 256x256
with 3 segmentation channels, then shape would be [3, 256, 256].
channel_settings: Vec<BitmaskChannelSettings>One entry per channel (i.e. one per the “C” dimension of shape),
specifying how to color that channel’s segmentation mask.
Each channel may represent a different type of objects, for instance,
the first channel may contain cell segmentations while
the second channel may contain nuclei segmentations.
opacity: f32Overall opacity multiplier applied to the layer as a whole, on top of each channel’s own opacity.
data: NumericDataFlat array of per-pixel, per-channel object ids, in the order
specified by dimension_order. A value of 0 means “no object”
(background) at that pixel; object ids are otherwise expected to be
1-based (object k is id k + 1), matching the ColorMode index each
channel resolves colors against. Supports multiple numeric dtypes (u8,
u16, u32, u64, i8, i16, i32, i64, f32, f64).
Trait Implementations§
Source§impl Clone for BitmaskLayerParams
impl Clone for BitmaskLayerParams
Source§fn clone(&self) -> BitmaskLayerParams
fn clone(&self) -> BitmaskLayerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BitmaskLayerParams
impl Debug for BitmaskLayerParams
Source§impl Default for BitmaskLayerParams
impl Default for BitmaskLayerParams
Source§fn default() -> BitmaskLayerParams
fn default() -> BitmaskLayerParams
Source§impl<'de> Deserialize<'de> for BitmaskLayerParamswhere
BitmaskLayerParams: Default,
impl<'de> Deserialize<'de> for BitmaskLayerParamswhere
BitmaskLayerParams: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BitmaskLayerParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BitmaskLayerParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for BitmaskLayerParams
impl Serialize for BitmaskLayerParams
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for BitmaskLayerParams
impl RefUnwindSafe for BitmaskLayerParams
impl Send for BitmaskLayerParams
impl Sync for BitmaskLayerParams
impl Unpin for BitmaskLayerParams
impl UnsafeUnpin for BitmaskLayerParams
impl UnwindSafe for BitmaskLayerParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.