Fork me on GitHub

Global

Members

(constant) G_APP_NAME

Name of the application
Source:

G_AUTO_PREVIEW_LIMIT

The number of cells in the raster grid at which auto-preview stops, for responsiveness
Source:

G_BOX_SIZE

The calculated size of each box/stage
Source:

(constant) G_GUI_Controller

The main GUI controller
Source:

(constant) G_IMG_METRICS

The list of image quality metrics supported by the application.
Source:

G_IMG_METRIC_ENABLED

Toggle value to pause/hide the image quality metric calculation of the Resulting Image / Virtual SEM view
Source:

G_INPUT_IMAGE

global variable to set the input ground truth image
Source:

G_MAIN_CONTAINER

a global reference to the main body container that holds the boxes/stages.
Source:
To Do:
  • do we still need this? Maybe remove...

G_MAIN_IMAGE_OBJ

Currently only used by ResampleFullImage
Source:
To Do:
  • Possibly, to be removed along with it.

(constant) G_PRELOADED_IMAGES

The list of default/preloaded images to use with the application.
Source:
See:

(constant) G_PRELOADED_IMAGES_ROOT

The root folder for all the preloaded images specified by G_PRELOADED_IMAGES.
Source:

G_SHOW_SUBREGION_OVERLAY

Toggle value to show/hide the subregion overlay on the Sample Ground Truth stage.
Source:

G_STAGES

The array/list of all the stages.
Source:

G_UpdateFilters

global reference to update/apply image filters
Source:

G_UpdateResampled

global reference to update the resampling steps (spot layout, sampled subregion, resulting subregion) displays, This is mainly to be called when the auto-preview is disabled/off
Source:

G_UpdateRuler

global reference to update the ruler
Source:

G_UpdateStageSettings

global reference to update stage related settings
Source:

G_UpdateVirtualSEMConfig

global reference to update the beam values for the Virtual SEM view
Source:

G_Update_GroundTruth

global reference to update the Groundtruth view
Source:

G_Update_InfoDisplays

global reference to update the Information displays
Source:

G_VSEM_PAUSED

Toggle value to pause the continously draw the Resulting Image / Virtual SEM view
Source:

G_update_ImgMetrics

global reference to update the just the Image Metrics information display
Source:

(constant) nStages

The number of stages to create
Source:

Methods

GetOptimalBoxWidth()

Calculated the size to use for each drawing box/stage. Edit the values in the functions to change the box sizing.
Source:
Returns:
The size to use.

OnImageLoaded(eImg, stages)

Called by UpdateBaseImage once the image data has been loaded, Draws and manages all the drawing stages with each their event handlers.
Parameters:
Name Type Description
eImg * The Element/Object of the loaded image.
stages * The array of stages to use for drawing.
Source:

ResampleFullImage()

Draws the full resample image given the parameters in the GUI and logs the progress in the webconsole. Very heavy and slow. Could may be optimized with an offscreenCanvas and webworkers...
Source:
To Do:
  • Maybe no longer needed and can be removed?

UpdateBaseImage()

Updates everything needed assuming that G_INPUT_IMAGE has changed, updates/draws all the stages/boxes once.
Source:

drawGroundtruthImage(stage, imageObj, subregionImage, maxSize, updateCallback)

Draws the ground truth image and the subregion bounds overlay.
Parameters:
Name Type Default Description
stage * the stage to draw on.
imageObj * the original/full-size image to draw
subregionImage * the subregion image (to get the bounds from)
maxSize number (to be removed) the maximum size (width or height) of the stage to fit the image?
updateCallback function null called when a change is made to the subregion
Source:
To Do:
  • remove maxSize if possible?
  • do we really need to return the subregionRect as well?
Returns:
an object with an update function to call for needed redraws and the subregion bounds.

drawProbeLayout(drawStage, baseImage, spotScale, beam)

Draws the probe layout.
Parameters:
Name Type Description
drawStage * The stage to draw on.
baseImage * The subregion image to draw with (cloned).
spotScale * an object to query for the spot scale X/Y.
beam * the beam/spot shape to draw with (cloned and scaled).
Source:
Returns:
an update function to call when a redraw is needed.

drawProbeLayoutSampling(drawStage, originalImage, spotScale, sBeam)

Draws the spot layout sampled image content. The image stenciled by the spot shape over a grid.
Parameters:
Name Type Description
drawStage * The stage to draw on
originalImage * The image to "stencil" / "clip" or sample.
spotScale * an object to query for the spot scale X/Y.
sBeam * the spot/beam shape to use (cloned and scaled)
Source:
Returns:
an update function to call when a redraw is needed.

drawResampled(sourceStage, destStage, originalImage, spotScale, sBeam)

Draws the sampled subregion.
Parameters:
Name Type Description
sourceStage * The source stage to sample from
destStage * The stage to draw on
originalImage * the subregion image to sample or 'stencil' over.
spotScale * an object to query for the spot scale X/Y.
sBeam * the beam to sample with (cloned and scaled)
Source:
Returns:
an update function to call when a redraw is needed

drawSpotContent(stage, sImage, sBeam, updateCallback)

Draws the spot content on the given drawing stage. The given image is draggable (pan) and zoomable (scroll).
Parameters:
Name Type Default Description
stage * the drawing stage.
sImage * the subregion image (will be cloned for the image object displayed).
sBeam * the beam/spot shape (used by reference).
updateCallback function null a function to call when a change occurs such as pan-and-zoom.
Source:
Returns:
a reference to the image object being scaled by the user => "userScaledImage".

drawSpotProfileEdit(stage, updateCallback)

Draws an node-editable ellipse shape on the given drawing stage.
Parameters:
Name Type Default Description
stage * the stage to draw on.
updateCallback function null optional callback when a change occurs in spotSize
Source:
Returns:
the spot/beam (Ellipse) object

drawSpotSignal(sourceStage, destStage, sBeam)

Draws the Spot Signal - previews the averaged signal for a given spot.
Parameters:
Name Type Description
sourceStage * the source stage to sample from.
destStage * the stage to draw on.
sBeam * the beam to sample (or "stencil") to with.
Source:
Returns:
an update function to call when a redraw is needed.

drawSubregionImage(stage, oImg, size, updateCallback)

Draws the subregion image display.
Parameters:
Name Type Default Description
stage * The stage to draw it on.
oImg * The ground truth image.
size Number (to be removed) The max size (width or height) of the image to draw.
updateCallback function null
Source:
To Do:
  • remove 'size' ... confusing and not useful.
Returns:
a reference to the subregion image object that can be panned and zoomed by the user.

drawVirtualSEM(stage, beam, subregionRect, subregionRectStage, originalImageObj, spotScale)

Draws the resulting image continously row-by-row.
Parameters:
Name Type Description
stage * the stage to draw on
beam * the beam to sample with
subregionRect * the bounds on the subregion
subregionRectStage * the stage for the gorund truth
originalImageObj * the ground truth image
spotScale * an object to query for the spot scale X/Y.
Source:
To Do:
  • do we really need both subregionRect and subregionRectStage as separate parameters? maybe the info needed can be obtained with less or more cleanly?
  • rename confusing subregionRectStage to groundTruthStage?
  • can we get rid userScaleImage / userImage throughout the source if possible, cleaner?
Returns:
an update function to call when the spot profile or the cell/pixel size changes.

↑ Top