Skip to main content

export_current_view

Function export_current_view 

Source
pub fn export_current_view(
    inst: &Instance,
    raw: &RawImage,
    window: (f64, f64),
    invert: bool,
    annotations: &[Annotation],
    burn_annotations: bool,
    out_path: &Path,
    modality: &str,
) -> Result<()>
Expand description

Export the active cell’s image to a PNG, optionally with annotations burned in.

§Arguments

  • inst — instance metadata (needed for pixel spacing on length labels).
  • raw — pre-decoded pixel buffer.
  • window(center, width) to apply.
  • invert — user-invert toggle (XOR’d with raw.photometric_invert).
  • annotations — list to draw on top of the image.
  • burn_annotations — when true, draw the annotations; when false write a clean image.
  • out_path — destination PNG path.
  • modality — used by ROI labels to decide whether to suffix HU.

§Errors

PNG write failures.