pub struct ImagePreview {Show 27 fields
pub image: u32,
pub level: u32,
pub source_width: u32,
pub source_height: u32,
pub region: Option<Region>,
pub downsample: f64,
pub c: Vec<u32>,
pub z: Vec<u32>,
pub t: Vec<u32>,
pub projection: Option<String>,
pub composite: bool,
pub rgb: bool,
pub contrast: String,
pub lut: String,
pub channels: Vec<PreviewChannel>,
pub axes: bool,
pub grid: bool,
pub plot_area: Region,
pub source_origin: SourcePoint,
pub source_per_pixel: f64,
pub source_per_pixel_y: f64,
pub full_res_region: Region,
pub fft_inset: Option<Region>,
pub scale_bar: Option<ScaleBar>,
pub view: Option<String>,
pub crosshair: Option<[u32; 3]>,
pub view_slices: Option<u32>,
}Expand description
Details of an image preview.
PNG pixel (px, py) inside plot_area shows full-resolution source pixel
x = source_origin.x + (px - plot_area.x) * source_per_pixel,
y = source_origin.y + (py - plot_area.y) * source_per_pixel_y (left/top edges of the PNG
pixel), whatever pyramid level, downsample or region was drawn; the ruler labels use the same
numbers, so a region read off them can be passed straight back.
Fields§
§image: u32Image index.
level: u32Pyramid level read (0 = full resolution).
source_width: u32Plane size at that level.
source_height: u32Plane height at that level.
region: Option<Region>The rectangle drawn, in the pixel coordinates of level, when a region was asked for.
downsample: f64Pixels of the plane at level per drawn pixel, horizontally: above 1 when the plane was
made smaller (an area average), below 1 when it was enlarged (each source pixel drawn as
a square), 1 when drawn as is.
c: Vec<u32>Channels, z-planes and time points used.
z: Vec<u32>Z indices used.
t: Vec<u32>Time indices used.
projection: Option<String>max-z or max-t for a maximum-intensity projection, sum-z or sum-t for a sum.
composite: boolTrue when channels were blended into one colour image.
rgb: boolTrue when the planes are RGB (samples_per_pixel 3).
contrast: StringContrast rule applied (auto resolved to what it did, e.g. percentile:0.1,99.9).
lut: Stringgray, inverted, channel-color or rgb.
channels: Vec<PreviewChannel>One entry per channel drawn.
axes: boolTrue when the picture is framed by coordinate rulers (labelled in full-resolution pixels), with a scale bar when the pixel size is known.
grid: boolTrue when grid lines were drawn over the data at the ruler ticks.
plot_area: RegionThe data’s rectangle inside the PNG, in PNG pixels (the whole PNG without rulers).
source_origin: SourcePointFull-resolution source coordinate of the plot area’s top-left corner.
source_per_pixel: f64Full-resolution source pixels per PNG pixel, horizontally (pyramid level scale ×
downsample).
source_per_pixel_y: f64Full-resolution source pixels per PNG pixel, vertically (equal to source_per_pixel up
to the rounding of pyramid level sizes).
full_res_region: RegionThe full-resolution (level 0) rectangle the plot area shows: pass it, or a part of it,
back as region to zoom.
fft_inset: Option<Region>Where the power-spectrum inset is drawn (fft), in PNG pixels.
scale_bar: Option<ScaleBar>The scale bar drawn, when the physical pixel size is known.
view: Option<String>The plane of the volume shown, when it is not the stored planes: axial, coronal,
sagittal, orthogonal, xz or yz. Rulers, regions and annotations then count the
pixels of that view.
crosshair: Option<[u32; 3]>Orthogonal views: the voxel (x, y, z of the stored planes) the three planes cross at.
view_slices: Option<u32>With a view: how many slices it has (the range of z).
Implementations§
Source§impl ImagePreview
impl ImagePreview
Sourcepub fn pixel_mapping(&self) -> String
pub fn pixel_mapping(&self) -> String
How to turn a pixel of a picture without rulers into full-resolution coordinates, for
a region: its pixels are not source pixels once the plane is scaled or framed.
Trait Implementations§
Source§impl Clone for ImagePreview
impl Clone for ImagePreview
Source§impl Debug for ImagePreview
impl Debug for ImagePreview
Source§impl Default for ImagePreview
impl Default for ImagePreview
Source§impl<'de> Deserialize<'de> for ImagePreview
impl<'de> Deserialize<'de> for ImagePreview
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ImagePreview
impl JsonSchema for ImagePreview
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for ImagePreview
impl RefUnwindSafe for ImagePreview
impl Send for ImagePreview
impl Sync for ImagePreview
impl Unpin for ImagePreview
impl UnsafeUnpin for ImagePreview
impl UnwindSafe for ImagePreview
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
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>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more