Spectral cube viewer¶
The cube viewer (vtkWindowCube) is the workspace for any 3-D FITS spectral
cube — typically with two spatial axes (RA, Dec or l, b) and one spectral
axis (frequency, optical velocity, radio velocity, or generic). It opens
automatically when you open a FITS file that the backend classifies as a
cube dataset.
Layout¶
The window is split into two synchronised dock areas plus a side panel:
Dock |
What it shows |
|---|---|
3-D view |
Volume / isosurface rendering of the whole cube, with an orientation marker and the cutting plane indicator. |
2-D view |
The currently selected slice along the spectral axis (or a moment map, see below). |
Sidebar |
Tabs for 3-D View Settings, 2-D View Settings, Tools, Info / Stats. |
Toolbar (top) |
Dataset path pill, tag chips (resolution, mode), and the Find / Command / Export buttons. |
The bottom status bar carries three live indicators: the data state (Preview, Loading full resolution…, Full resolution), the WCS status (OK / repaired / degraded), and the Sanity badge (NaN fraction and metadata consistency).
Preview → full-resolution flow¶
When you open a cube, the backend first sends a small downsampled preview (factor 4 on each axis) so the viewer becomes interactive in a fraction of a second. In the background it then prepares the full-resolution cube and swaps it in. The transition is asynchronous: you can rotate the camera and scrub through slices while the upgrade is in flight.
You can constrain the full-resolution fetch to the viewport ROI of the 3-D camera (toggle View → Use Camera ROI). This is useful for very large cubes when you only want detail in the region you’re inspecting.
3-D rendering modes¶
Pick between two complementary 3-D views from the top-right viewer toolbar:
Volume rendering — semi-transparent rendering of the whole cube using
vtkGPUVolumeRayCastMapper. Sub-modes (View → Volume Rendering):Composite — opacity-weighted ray casting (default).
MIP (maximum intensity projection) — emphasises the brightest emission along each ray; great for finding line peaks.
MinIP (minimum intensity) — symmetric to MIP; useful on absorption.
Isosurface — extracts a closed surface at a user-given threshold (
vtkFlyingEdges3Dserver-side). Adjust the threshold with the slider in the 3-D View Settings sidebar. The compute is asynchronous; the volume stays visible until the mesh is ready.
You can switch render mode at any time. The colour map is shared between volume rendering and the slice view.
Color maps and transfer function¶
The active color map is picked from the 3-D View Settings sidebar (Inferno, Viridis, Magma, Plasma, Cividis, …).
For volume rendering, the opacity transfer function maps low values to fully transparent and high values to fully opaque. Customise it from 3-D View → Advanced… (LUT editor) — drag the control points to emphasise emission peaks or remove background.
For the slice / moment maps, the 2-D LUT editor opens from the 2-D View Settings sidebar. Both editors are non-modal: keep them open while you scrub through slices to fine-tune in real time.
Regions, PV diagrams, noise¶
These are all explained on a dedicated page: Regions, PV diagrams, noise.
WCS axes and overlays¶
View → Show WCS Axes paints sky-coordinate ticks on the 2-D slice and moment maps. Toggle between sexagesimal (HMS / DMS) and decimal with the WCS format radio in the same menu.
View → Show 3D WCS Axes draws a labelled bounding box in the 3-D view with RA / Dec / Velocity ticks derived from the cube WCS. Useful as a spatial reference when rotating the camera.
Tools → Load Catalogue Overlay lets you overlay sources from a CSV / VOTable on the slice; see Catalogues.
Beam indicator¶
When the FITS header contains BMAJ and BMIN (and optionally BPA),
the 2-D slice view draws a filled white semi-transparent ellipse in
the bottom-left corner representing the synthesised beam. The ellipse is
sized in pixels using the angular beam axes (BMAJ, BMIN in degrees)
divided by |CDELT1|, so it scales correctly with the image pixel scale.
BPA (beam position angle, degrees) controls the orientation.
If BMAJ or BMIN are absent from the header (e.g. single-dish data
without a restoring beam), the ellipse is hidden automatically — no
action needed.
Tip
The beam indicator helps you judge whether spatial structures in the slice are resolved. Any feature whose angular size is comparable to the beam ellipse is only marginally resolved — treat its morphology with caution.
Saving and exporting¶
Export in the top-right toolbar saves a PNG of the current 2-D view or a PNG snapshot of the 3-D view (camera position respected).
Moment-map results can be re-opened as a new dataset (the backend registers them in the same session); see Moment maps.
Baseline-subtracted cubes are also registered as a new
dataset_idyou can open in a fresh cube viewer; see Spectral tools.
FITS exports → Workspace¶
Two entries under Tools persist derived FITS artefacts into a backend
Workspace Exports directory (default ~/.visivo/exports/, override
with the VISIVO_EXPORTS_DIR environment variable):
Tools → Export Sub-Cube as FITS… — crop the current cube to a spatial+spectral ROI and save it as a standalone FITS. The bounds dialog defaults to the AABB of the currently-drawn region (if any), otherwise to the full cube extent. WCS is preserved:
CRPIX1/2/3is shifted so every pixel in the cropped FITS keeps its original sky / spectral coordinates. The sub-cube is also registered as a new dataset in the active session, so you can immediately open it in a new cube viewer.Tools → Export Current Channel as 2-D FITS… — save the channel that is currently displayed on the slice slider as a standalone 2-D FITS image (
NAXIS=2— the spectral axis is dropped, not kept as a degenerate dimension). Used by the Stokes / spectral index / Faraday-RM workflows in the image viewer: it gives you a single-frequency 2-D map per click. Header keepsBUNIT,OBJECT, the celestial WCS (axes 1 + 2) plusSPECVAL/SPECTYPE/SPECUNITrecording the spectral coordinate of the exported channel, so you can later look up the frequency / velocity for the spectral-index and RM dialogs.Tools → Export Moment Map as FITS… — persist the moment currently on screen as a 2-D FITS (celestial WCS,
BUNITderived from the cube). Disabled until a moment has been computed.Tools → Send Slice to Image Viewer… — send the current 2-D slice to the first open image viewer as a contour overlay. No FITS round-trip required — the data travels in memory via the
contourDataReadysignal. Useful for quick radio + optical comparisons without persisting intermediate files.
Both flows ask only for a basename (e.g. m31_m0.fits). The
backend stores the file in the Workspace Exports dir and auto-suffixes
collisions (cube.fits → cube_1.fits → …). The completion dialog
shows the chosen filename and on-disk path.
Once in the workspace, artefacts are listed in the Workspace Exports panel of the Data Hub. Per-entry actions:
Open — register the FITS as a new session dataset and open the matching viewer (cube viewer for cubes, image viewer for 2-D maps).
Download… — native Save As dialog → streams the bytes from the backend (over HTTP, so it works the same when the backend lives on a remote host) and writes to the chosen local path.
Delete — removes the FITS from the workspace (confirmation prompt; irreversible).
The panel auto-refreshes every few seconds, so new exports from any cube viewer appear without manual action.
Performance notes¶
The first full-resolution swap can take a few hundred ms because of the initial GPU texture upload; subsequent slice changes are sub-frame.
The backend reuses a multi-process worker pool. Long computations (moment, isosurface, line-width, baseline, stacking) are gated so they never starve interactive requests like slice fetches — you can keep scrolling and rotating the cube while a heavy compute is running. See the heavy-task throttle in the developer reference for the gritty details.
Camera ROI in the View menu limits the full-resolution fetch to the current viewport (recommended for cubes > ~2 GB).