Skip to main content

PreviewOptions

Struct PreviewOptions 

Source
#[non_exhaustive]
pub struct PreviewOptions {
Show 30 fields pub image: Option<u32>, pub select: Vec<String>, pub mip: Option<Axis>, pub view: Option<View>, pub sum: Option<Axis>, pub fft: bool, pub composite: bool, pub level: Option<u32>, pub region: Option<Region>, pub max_size: Option<u32>, pub axes: Option<Axes>, pub title: Option<String>, pub caption: Option<String>, pub contrast: Option<String>, pub lut: Option<Lut>, pub trace: Option<u32>, pub sweep: Option<u32>, pub channels: Vec<u32>, pub x_range: Option<[f64; 2]>, pub run: Option<u32>, pub spectrum: Option<u64>, pub scan: Option<u64>, pub centroid: bool, pub table: Option<u32>, pub columns: Vec<String>, pub marks: Option<Marks>, pub objects: Option<ObjectsRequest>, pub lanes: Option<LanesRequest>, pub annotations: Vec<Annotation>, pub dark: bool,
}
Expand description

Preview options by name. Every field is optional; PreviewOptions::request fills in the defaults. The MCP tool openreadout_preview takes these fields as its arguments, so their documentation is also what an agent reads.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§image: Option<u32>

Image index (default 0).

§select: Vec<String>

Plane selection such as c=1, z=4, t=0 or combined c=0,1,z=2. Default: c=0, the middle z, t=0. Several channels imply a composite.

§mip: Option<Axis>

Maximum-intensity projection, over the selected range if any.

§view: Option<View>

Volumes: the plane to show. axial, coronal, sagittal (radiological orientation), orthogonal (all three, crossing at the middle or the selected z), xz, yz, or native (as stored). Default: medical images in their acquisition plane, others native. With a view, z and mip: z count slices of that view.

§sum: Option<Axis>

Sum projection, over the selected range if any: a movie’s frames added up (e.g. sum t, select t=0-39).

§fft: bool

Images: a power-spectrum (FFT) inset in the top-right corner: Thon rings of a cryo-EM micrograph, the spots of a lattice.

§composite: bool

Blend all (or the selected) channels additively in their colours.

§level: Option<u32>

Pyramid level to read (default: the level nearest max_size, or the level at which region renders at about max_size).

§region: Option<Region>

Zoom: only this rectangle, {x, y, width, height} in full-resolution pixels (or in the pixels of level when a level is given). Whole-slide images: look at the overview first, then at regions of it.

§max_size: Option<u32>

Longest side in pixels, rulers included (MCP: default 768, at most 2048).

§axes: Option<Axes>

Image previews: what frames the picture.

§title: Option<String>

Image previews with axes scale-bar: a title above the picture.

§caption: Option<String>

Image previews with axes scale-bar: a caption under the picture (what it shows, the stain, the sample).

§contrast: Option<String>

auto (default; the file’s display window when it has one, log:90,99.95 on diffraction images), min-max, percentile:LO,HI (e.g. percentile:1,99), log (log:50,99.9) or log:LO,HI, raw, or a display window window:CENTER,WIDTH (window:40,400), window:file, or a CT preset window:soft-tissue, brain, subdural, stroke, bone, lung, mediastinum, liver.

§lut: Option<Lut>

Colour lookup. Default: gray for one channel (inverted on diffraction images), channel colours for composites.

§trace: Option<u32>

Trace preview: trace index (see openreadout_info traces[]).

§sweep: Option<u32>

Trace preview: sweep index.

§channels: Vec<u32>

Trace preview: channel indices (default: the first 8).

§x_range: Option<[f64; 2]>

Trace preview: only this window of the x axis, [a, b] in its units (bp of a sized electropherogram, base positions of a Sanger read, minutes, ppm, …).

§run: Option<u32>

Spectrum preview: run index.

§spectrum: Option<u64>

Spectrum preview: zero-based spectrum index.

§scan: Option<u64>

Spectrum preview: instrument scan number instead of an index.

§centroid: bool

Spectrum preview: the instrument’s centroid list instead of the profile.

§table: Option<u32>

Plate or flow-cytometry preview: table index.

§columns: Vec<String>

Table columns: a plate’s value column, or the x and y parameters of a flow-cytometry density plot (one gives a histogram; default FSC-A, SSC-A).

§marks: Option<Marks>

Marks from the data. Default auto: the prominent peaks of spectra and chromatograms are labelled; diffraction images get resolution rings.

§objects: Option<ObjectsRequest>

Images: how objects are found for marks: objects (as openreadout_stats objects).

§lanes: Option<LanesRequest>

Gels and blots: how lanes are found for marks: lanes (as openreadout_stats lanes).

§annotations: Vec<Annotation>

Your own marks, drawn on top and reported back with their pixel positions. Coordinates as the picture shows them: full-resolution pixels on images (the ruler numbers), axis units on plots, wells on plates.

§dark: bool

Draw in the dark theme.

Implementations§

Source§

impl PreviewOptions

Source

pub fn from_json(text: &str) -> Result<PreviewOptions>

Parse options from JSON text; empty text gives the defaults.

Source

pub fn request( &self, default_size: u32, default_axes: Axes, ) -> Result<PreviewRequest>

The request these options describe. default_size is the max_size when none is given and default_axes the frame of image previews.

Trait Implementations§

Source§

impl Clone for PreviewOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PreviewOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PreviewOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PreviewOptions

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for PreviewOptions

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.