preview
preview renders a PNG, JPEG or SVG picture of the data: an image plane, a channel composite or a maximum projection; a trace; a mass spectrum or a run’s chromatogram; a plate heat map, or a grid of growth curves for a kinetic plate read; or a density plot of flow cytometry events. Spectra and chromatograms get their prominent peaks labelled, and you can draw your own annotations on any of them.
openreadout preview [OPTIONS] <FILE>The kind of picture follows the file: images first, then traces, spectra and tables. The trace, spectrum and table flags pick another. Some files get the picture people read them by:
- an NMR data set shows its spectrum on a chemical-shift axis, with each multiplet labelled: the processed spectrum the vendor software stored, or else the FID processed as
analyze nmr-peaksdoes.--trace 0shows the raw FID. - a mass-spectrometry run shows its total-ion chromatogram from the scan headers, with the apex and the other prominent peaks labelled in minutes.
--spectrumor--scanshows a spectrum. - cyclic and linear sweep voltammetry shows current against potential, one loop per cycle from faint (first) to dark (last).
--channeldraws channels against time instead. - flow cytometry events show FSC-A against SSC-A.
The same request on the same file always gives the same bytes.
Flags
Output
-o,--output FILE:.png,.jpg,.svg,.tiffor.pdf;-writes the image to stdout. Default:<input stem>.preview.pngnext to the input.--format png|jpeg|svg: default from the output extension, else PNG. SVG keeps text as text and embeds image data as PNG.--dark: draw in the dark theme.--quality N: JPEG quality, 1–100. Default 90.--max-size N: longest side of the picture in pixels (16–8192), rulers included. Default 1024. An image is resampled to fill it (an area average when made smaller; a small image is enlarged by repeating its pixels), and the report’ssource_per_pixelsays exactly how picture pixels map to source pixels.--scale N: pixels per preview pixel (0.25–8). Plots are drawn again at that size; images are read again at--max-size× N, so text, marks and pixels stay sharp in print.--dpi N: print resolution, recorded in PNG, JPEG and TIFF files; SVG and PDF pages get the matching size.--overwrite: replace an existing output file.--json: print the report as JSON.
An SVG preview is layered for editing, like one from plot: the image, the rulers or axes, each series, the scale bar, the annotations and the caption are named groups that drawing programs show as layers.
Images
--image N: image index. Default 0.--select SEL: planes, such asc=1,z=4orc=0,1,z=2. Repeatable. Default: channel 0, the middle z, t 0. Several channels imply--composite.--mip z|t: maximum-intensity projection over z or t, limited to the selected range.--view axial|coronal|sagittal|orthogonal|xz|yz|native: cut a volume along another plane.axial,coronalandsagittalfollow the scanner’s axes and are shown the radiological way (patient left on the right of the picture),orthogonalputs the three side by side with lines where they cross, andxzandyzcut along the stored axes. Default: medical images in the plane they were acquired in, othersnative(as stored).--select z=Nand--mip zthen count slices of the view, and voxels that are not square are stretched to their true shape.--sum t|z: sum projection over t or z, limited to the selected range: a movie’s frames added up into its dose image (--sum t --select t=0-39). Electron-event (EER) movies add their events directly.--fft: a power-spectrum inset in the top-right corner: the averaged log power spectrum of tiles from the middle of the plane, binned to about 1.6 Å per pixel when the pixel size is known. It shows the Thon rings of a cryo-EM micrograph or the spots of a lattice.--composite: blend all (or the selected) channels in their colours.--level N: pyramid level. Default: the level nearest--max-size.--region X,Y,W,H: only this rectangle, in full-resolution pixels (or in the pixels of--levelwhen one is given).--contrast auto|min-max|percentile:LO,HI|log|log:LO,HI|raw|window:...:autostretches the 0.1–99.9 percentiles, except for medical images, which get the file’s display window (or the soft-tissue window for CT in Hounsfield units without one), and diffraction images, which getlog:90,99.95.logmaps the logarithm of the value above the low percentile (logalone: 50 and 99.9).window:CENTER,WIDTHsets a window in the image’s values,window:fileuses the file’s own, andwindow:soft-tissue,brain,subdural,stroke,bone,lung,mediastinumorliverare the usual CT presets. Defaultauto.--lut gray|inverted|channel-color: default gray for one channel (inverted, dark on light, on diffraction images), channel colours for composites.--axes rulers|grid|scale-bar|none:rulers(default) frames the picture with rulers in full-resolution pixels and a scale bar,gridadds faint grid lines at the ruler ticks,scale-barmakes a figure for people (the picture, a scale bar, and the title and caption),nonegives the bare plane.--title TEXT,--caption TEXT: a title above the picture and a caption under it, beside the scale bar. Either one picks--axes scale-barunless--axesis given. A title has at most 300 characters and a caption 2,000; a caption longer than its lines allow ends in….
Traces, spectra, plates and events
--trace N,--sweep N,--channel N: the trace, sweep and channels to draw (--channelis repeatable; default the first 8).--x-range A:B: only this window of a trace’s x axis, in its units: base positions of a Sanger read, bp of a sized electropherogram, minutes, ppm.--run N,--spectrum N,--scan N: the mass spectrum to draw, by zero-based index or instrument scan number.--centroid: draw the instrument’s centroid list instead of the profile.--table N,--column NAME: the table, and the column to draw: a plate’s value column (long layout), or the x and then the y parameter of flow cytometry events (--columnis repeatable; one parameter gives a histogram; default FSC-A against SSC-A).--marks auto|peaks|spikes|objects|lanes|rings|none: marks drawn from the data.auto(default) labels the prominent peaks of spectra and chromatograms with their position (a peak has to stand well clear of the noise around it, so a noisy baseline stays unlabelled);peaksdoes so on any trace;spikesmarks the action potentials of a current-clamp sweep (upward crossings of −20 mV, asanalyze ephys-featurescounts them);ringsdraws resolution rings and the beam centre on a diffraction image (auto does this when the image records its wavelength, distance and beam centre; the JSON lists them undermarks);objectsoutlines and numbers the nuclei, cells or spots in the area shown, with the count, asstats --objectsfinds them (at a coarser pyramid level when the view is larger than 4096 × 4096 pixels). Without--select c=Na multichannel image shows the channel the objects are counted in (for nuclei, a channel named like a DNA stain such as DAPI or Hoechst), so the outlines sit on the plane they were found in. The JSON gives the counts and the first 20 objects underobjects.lanesboxes and numbers the lanes of a gel or blot, draws each lane’s profile and marks its bands with their share of the strongest band (or their size with a ladder), asstats --lanesfinds them; saturated bands are drawn red. The JSON gives the lanes and bands underlanes.--objects JSON: with--marks objects, how objects are found, with the fields of the MCPobjectsoption:{"kind":"spots"},{"diameter_um":8}.--lanes JSON: with--marks lanes, how lanes are found, with the fields of the MCPlanesoption:{"count":10},{"ladder":{"lane":1,"sizes":[250,150,100,75,50],"unit":"kDa"}}.
Annotations
--annotate JSON: marks of your own, as a JSON object or array, inline or@FILE. See Annotations.
NMR
--process: draw FIDs as spectra processed by OpenReadout.--process-phase MODE,--process-lb HZ,--process-size N,--process-baseline MODE: processing settings. Seeanalyze nmr-peaks.
Examples
$ openreadout preview doctor.tif -o doctor.pngwrote doctor.png (47x49 png, 203 bytes, verified=true): image 0 level 0 c=[0] z=[1] t=[0] contrast percentile:0.1,99.9view it: open (or Read) doctor.png; zoom with --region X,Y,W,H in full-res px read off the rulers (now showing 0,0,16,8)openreadout preview cells.czi --select c=0,1,2 --mip z -o cells.pngopenreadout preview run.raw --scan 1200 -o scan1200.pngopenreadout preview growth.pda -o growth.svgopenreadout preview cell.abf --sweep 10 --marks spikes -o sweep10.pngZooming into large images
Image previews have rulers along the top and left edges in full-resolution pixel coordinates, even when a coarser pyramid level was drawn. Read coordinates off the picture and pass them back as --region X,Y,W,H to zoom in. preview then reads the coarsest pyramid level that still shows the region at --max-size, so zooming into any part of a whole-slide image reads only a few tiles. The JSON report maps picture pixels back to source pixels (image.plot_area, source_origin, source_per_pixel).
Kinetic plates
A plate table with readings at several time points draws as one small growth curve per well, laid out in plate positions with row letters and column numbers. Every card shares the same time and value axes, stated under the grid. Curves take the colour of their group in the plate layout the file records (a SoftMax Pro group, a sample name), with a key at the top. When whole rows belong to one group, the group’s name labels them at the left. Blank wells are drawn faint. A heat map of the last time point would hide a well that crashed and grew back; the curves show it.
Annotations
--annotate (MCP: annotations, at most 500) draws labelled marks on top of the picture, in the picture’s own coordinates: full-resolution pixels on images (the numbers on the rulers), axis units on plots, wells on plates. Each annotation has a type and the fields that type needs:
type |
fields | draws |
|---|---|---|
point |
x, y |
a ring (images) or dot (plots) |
box |
x, y, width, height |
a rectangle |
polygon, line |
points: [[x, y], ...] |
a closed outline, an open line |
arrow |
x, y (tail), x2, y2 (head) |
an arrow |
text |
x, y, label |
the label alone |
vline, hline |
x or y |
a dashed line across the plot |
vband, hband |
x, x2 or y, y2 |
a shaded band |
well |
well (B3) |
a ring around a plate well |
All types take an optional label, and color (accent, the default warm red, ink, muted, white or #RRGGBB). On a trace with several channels, channel picks the panel (default the first). On a kinetic plate grid a mark goes on every card unless well names one, and its label joins the key. Labels are placed so they do not cover each other, on a paper-coloured pill over images.
openreadout preview slide.czi --region 30000,20000,4000,3000 -o fold.png \ --annotate '[{"type":"point","x":31000,"y":21000,"label":"Purkinje cells"}, {"type":"box","x":33000,"y":20300,"width":600,"height":500,"label":"molecular layer"}]'openreadout preview growth.pda -o growth.png \ --annotate '{"type":"vband","x":7.4,"x2":8.6,"label":"came back 7.4–8.6 h"}'The JSON report lists each annotation as given, with px (its key points in picture pixels), label_px (where its label went) and outside (true when part of it lies outside what the picture shows). Plots also report panels: each panel’s rectangle in picture pixels and the data values at its edges, so a viewer can map pixels back to data.
JSON
Run openreadout preview --help for the full help of your installed version.