Members
(constant) G_APP_NAME
Name of the application
G_AUTO_PREVIEW_LIMIT
The number of cells in the raster grid at which auto-preview stops, for responsiveness
G_BOX_SIZE
The calculated size of each box/stage
(constant) G_GUI_Controller
The main GUI controller
(constant) G_IMG_METRICS
The list of image quality metrics supported by the application.
G_IMG_METRIC_ENABLED
Toggle value to pause/hide the image quality metric calculation of the Resulting Image / Virtual SEM view
G_INPUT_IMAGE
global variable to set the input ground truth image
G_MAIN_CONTAINER
a global reference to the main body container that holds the boxes/stages.
G_MAIN_IMAGE_OBJ
Currently only used by
ResampleFullImage
(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
.
G_SHOW_SUBREGION_OVERLAY
Toggle value to show/hide the subregion overlay on the Sample Ground Truth stage.
G_STAGES
The array/list of all the stages.
G_UpdateFilters
global reference to update/apply image filters
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
G_UpdateRuler
global reference to update the ruler
G_UpdateStageSettings
global reference to update stage related settings
G_UpdateVirtualSEMConfig
global reference to update the beam values for the Virtual SEM view
G_Update_GroundTruth
global reference to update the Groundtruth view
G_Update_InfoDisplays
global reference to update the Information displays
G_VSEM_PAUSED
Toggle value to pause the continously draw the Resulting Image / Virtual SEM view
G_update_ImgMetrics
global reference to update the just the Image Metrics information display
(constant) nStages
The number of stages to create
Methods
GetOptimalBoxWidth()
Calculated the size to use for each drawing box/stage.
Edit the values in the functions to change the box sizing.
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. |
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...
UpdateBaseImage()
Updates everything needed assuming that
G_INPUT_IMAGE
has changed,
updates/draws all the stages/boxes once.
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.