Skip to main content
Version: 4.1.0

Image properties

Actions for modifying various properties of the image. In the following examples, we assume that an image is loaded as

const file = await app.openFile("my_image.fits");

Changing field of view

The field of view can be adjusted using various functions within FrameStore.

setCenter and setCenterWcs set the center of the image.

// image coordinate
file.setCenter([x position], [y position]);

// world coordinate
file.setCenterWcs("[x position, ex: 0:00:00.0615838925]", "[y position, ex: 29:59:59.1999990820]");

fitZoom zooms the image to fit the widget size.

file.fitZoom();

zoomToSize... functions zoom the image to a specific scale.

// image coordinate
file.zoomToSizeX([size in x direction]);
file.zoomToSizeY([size in y direction]);

// world coordinate
file.zoomToSizeXWcs('[size in x direction, ex: 2.56"]');
file.zoomToSizeYWcs('[size in y direction, ex: 2.56"]');

Changing the channel and Stokes

setChannel changes the channel of the image.

file.setChannel([channel]);

setStokes and setStokesByIndex change the stokes of the image using POLARIZATIONS enum or the index.

file.setStokes(2); // Stokes Q
file.setStokesByIndex(2); // The third polarization shown in the animator widget

Changing render configuration

Render configuration can be modified using renderConfig within FrameStore.

setCustomScale and setPercentileRank change the rendering range.

file.renderConfig.setCustomScale([clip min], [clip max]);
file.renderConfig.setPercentileRank(90); // Change to 90%

setScaling changes the scaling functions using FrameScaling enum.

file.renderConfig.setScaling(1); // Log

setColorMap changes the color map using options in COLOR_MAPS_ALL list, and setInverted inverts the color map.

file.renderConfig.setColorMap("gray");
file.renderConfig.setInverted(true);