VivoQuant 6.4.0
Loading...
Searching...
No Matches
ThreeDimROIOperator Class Reference

Description

Object to interact with the 3D ROI Operator when it is active.

This object can be used to interact with Regions Of Interest (ROIs) when the 3D ROI Tool Operator is loaded.

ROIs are index starting with the background at 0

Select this operator with VQ.mainWin().setViewMode(), then obtain it with VQ.currentOp().

VQ.mainWin().setViewMode("Slice View", "3D ROI Tool"); // switch to the 3D ROI operator
var roiOperator = VQ.currentOp();

Public Slots

void addDynamicLayers ()
 Opens the Manage Dynamic Layers dialog and applies the user's add/remove selections.
int addLayer (string name, bool hidden=false, int alphaSlice=127, ROILayerType type=ROILayerType::StaticLyr, unsigned int dynamicId=-1)
 Adds a new layer to the end of the current layer list.
void editLayer (int id, string name, bool hidden=false, int alphaSlice=127)
 Edits various layer properties such as name, alpha.
void deleteLayer (int id=constants::NO_LAYER, int target=constants::NO_LAYER, int targetMovePolicy=ROIDataManager::respectImmutable)
 Removes a layer from the list of layers and reassigns all its ROIs.
void deleteLayerToROI (int id, int targetROI, int targetLayer, int targetMovePolicy=ROIDataManager::respectImmutable)
 Removes a layer from the list of layers and reassigns all its ROIs.
void deleteLayers (Array< int > indices, int target=constants::NO_LAYER, int targetMovePolicy=ROIDataManager::respectImmutable)
 Delete multiple layers.
void clearLayer (int id=constants::NO_LAYER)
 Reassigns all ROIs of a layer.
void clearLayers (Array< int > indices)
 Clears multiple layers.
void syncLabelsFromLayer (int layerId, ScriptROIMetaMap &scriptMeta)
 UI-layer entry point for synchronising a layer's voxel buffer with the ROI metadata list.
void editROI (int id, string name, string colorName, bool immutable=false, bool hidden=false, int alphaSlice=127, int alphaSurface=255, string layer="")
 Edits various ROI properties such as name, color on the current active layer.
void editROI (int layerID, int id, string name, string colorName, bool immutable=false, bool hidden=false, int alphaSlice=127, int alphaSurface=255, string layer="")
 Edits various ROI properties such as name, color on the specified layer.
void deleteROI (int id=-1, int targetROI=-1, int targetLayer=constants::NO_LAYER, int movePolicy=ROIDataManager::respectImmutable)
 Removes an ROI from the ROI list and reassigns all its voxels.
void clearROI (int id=-1, int targetROI=-1, int targetLayer=constants::NO_LAYER, int movePolicy=ROIDataManager::respectImmutable)
 Reassigns all voxels of an ROI.
void clearAll ()
 Reassigns the voxels of every ROI to the background.
void clearAllROIs ()
 Deletes all ROIs and removes them from the ROI List.
void exportTable (string filename="", bool openFile=true)
 Exports a table of selected metrics for ROIs; e.g. Volume, Sum.
void showTable (bool useCachedData=false)
 Displays a table of selected metrics for ROIs that have been created; e.g. Volume, Sum.
void showHistogram ()
 Displays histogram GUI that depicts signal intensity of a given selected ROI.
void saveROI (string filename, string compression="RLE")
 Save an ROI to Disk.
void saveLayer (string filename, int layerID=constants::NO_LAYER, string compression="RLE")
 Save an ROI Layer to Disk.
bool saveROIsAsRTSTRUCT (string filename)
 Saves all ROIs in an RTSTRUCT DICOM. The DICOM will be defined with respect to the currently loaded reference image.
void setSortContourImportByVolume (bool sortByVolume)
 Sets whether ROIs imported from an RTSTRUCT file are sorted by volume.
void deleteROIs (Array< int > indices, int targetROI=-1, int targetLayer=constants::NO_LAYER, int movePolicy=ROIDataManager::respectImmutable)
 Delete multiple ROIs.
void clearROIs (Array< int > indices, int targetROI=-1, int targetLayer=constants::NO_LAYER, int movePolicy=ROIDataManager::respectImmutable)
 Clears multiple ROIs.
void exportROIs (Array< int > exportROIs)
 Exports an ROI (or group of ROIs) as a Volume in the Data Manager.
void toggleHidden (Array< int > indices)
 Toggles the hidden attribute of ROI(s).
void toggleImmutable (Array< int > indices)
 Toggles the immutable attribute of ROI(s).
void cutROI (bool bg, bool quiet=false, Array< Index > list=Array< Index >())
 Removes regions of the volumes.
void submitROI (bool quiet=false, bool allMetric=false)
 Submit the ROIs to the associated data on the iPACS.
void submitROIAsRTSTRUCTNotQuiet ()
 Submit the ROIs as RTSTRUCT to the associated data on the iPACS. If it is possible to use the coordinate space of the original image before resampling and quiet is false, the user will be asked their preference.
void submitLayer (bool quiet=false, bool allMetric=false, int layerID=constants::NO_LAYER)
 Submit the ROIs of the specified layer to the associated data on the iPACS.
void loadROIFromIPACS (bool quiet=false)
 Download the ROIs from associated data on the iPACS.
void loadLayerFromIPACS (bool quiet=false, int layerID=constants::NO_LAYER)
 Download the ROIs into the specified layer from the associated data on the iPACS.
void loadRTStructureAsROI (string filename)
 Use DicomReader to load an ROI in the RT Structure Set format specified by the Dicom standard and used by the Siemens IRW.
void loadRTStructureAsROI (DcmDataset *header)
 Use DicomReader to load an ROI in the RT Structure Set format specified by the Dicom standard and used by the Siemens IRW.
void loadVOIAsROI (string filename)
 Support for PMOD region of interest files.
void kMeansManualSeedCluster (string kmeans)
 a helper function to set the seed mean value for manual k-means segmentation
void exportToVolume ()
 Export an ROI to the DataManager as an image.
void openAutoradCalib ()
 Opens the autorad calibration tool.
void openAutoradCalib (int numStandards, bool bkg)
 Opens the autorad calibration tool with the given setup.
Object getCalibrationWidget ()
 Returns the autorad calibration object of this operator.

Public Member Functions

void loadROI (string filename, bool preserveExistingROIs=false)
 Loads a .rmha file from disk into the 3D ROI Operator.
void loadLayer (string filename, int layerID=constants::NO_LAYER)
 Loads a .rmha file from disk into the 3D ROI Operator.
string getROICenterOfMass (unsigned char id)
 Returns the geometric center of mass of an ROI.
double getROIVolume (unsigned char id)
 Returns the volume of a ROI.
double get2DROIVolumeEstimation (unsigned char id, unsigned char planeId, unsigned int px1, unsigned int py1, unsigned int px2, unsigned int py2, unsigned int sections=20)
 Returns the Modified Simpson's approach for volume estimation of a 2D ROI on a given plane.
Array< int > getROIContourPoints (unsigned char id, unsigned char planeId)
 Returns the outline points of an ROI on the current slice of a given plane.
Array< string > getSplinePath (int id, bool interpolated=false)
 Returns the current spline points when using the spline tool.
void setSplinePath (int id, Array< string > list, bool closed=false)
 Sets spline points in the spline tool.
bool canSaveRTSTRUCTAsOriginal ()
 Returns whether or not the image's original voxel sizes can be used when saving RTSTRUCTs.
int numROIs ()
 Returns the number of ROIs in the current layer.
int numTotalROIs ()
 Returns the number of ROIs currently in the operator (all layers).
int numLayers ()
 Returns the number of layers currently in the operator.
Array< string > getROIDetails (int i)
 Returns various details regarding the display of an ROI.
Array< string > getLayerDetails (int i)
 Returns various details regarding the display of a layer.
void setInputROI (int roiIdx)
 Sets the input ROI for the Segmentation Tools.
void setInputROI (int layerId, int roiIdx)
 Sets the input ROI for the Segmentation Tools.
bool setCurrentROI (int i)
 Sets the currently selected ROI in the 3D ROI Operator.
bool setCurrentLayer (int i)
 Sets the currently selected layer in the 3D ROI Operator.
void submitROIAsRTSTRUCT (bool quiet=false, bool allMetric=false)
 Submit the ROIs as RTSTRUCT to the associated data on the iPACS.
void toggleOutlineROI ()
 Toggles the ROI display between Outline mode and the previous mode.
bool setDynamicLayerTimepoints (Array< int > timepoints)
 Reconciles dynamic ROI layers on the current object to exactly match a requested set of timepoints.
int addROI (string name, string colorName, bool immutable=false, bool hidden=false, int alphaSlice=127, int alphaSurface=255)
 Adds a new ROI to the end of the current ROI list on the current active layer.
int addROI (int layerID, string name, string colorName, bool immutable=false, bool hidden=false, int alphaSlice=127, int alphaSurface=255)
 Adds a new ROI to the end of the current ROI list on the specified layer.

Protected Member Functions

void setModeSplineRecordClear (int id=-1)
 Clear the currently recorded spline points on the active layer and current ROI. This is used to reset the state of the spline tool without affecting the underlying ROI.
void setROIViewMode (string mode)
 Set ROI painting mode.
void drawSphere (int x, int y, int z, float radius, int roi_id, bool updateDisplay=true)
 Draws a ROI sphere at a given point.
void drawCircle (int plane, int x, int y, int z, float radius, int roi_id, bool updateDisplay=true)
 Draws a ROI circle at a given point.
void drawCube (int x, int y, int z, float radius, int roi_id, bool updateDisplay=true)
 Draws a ROI cube at a given point.
void drawRect (int plane, int x, int y, int z, float radius, int roi_id, bool updateDisplay=true)
 Draws a ROI square at a given point.
void drawCylinder (int plane, int x, int y, int z, float radius, float height, int roi_id, bool updateDisplay=true)
 Draws a ROI square at a given point.
void resizeROI (int layerID=constants::NO_LAYER)

Member Function Documentation

◆ addDynamicLayers

void addDynamicLayers ( )
slot

Opens the Manage Dynamic Layers dialog and applies the user's add/remove selections.

Detects the total available timepoints and the set already present as dynamic layers, presents them via DynamicLayersDialog, and applies whatever additions/removals the user confirms. Records a single undo step covering all changes.

No-op (aside from a notification) if no dynamic timepoints are found on the current object.

◆ addLayer

int addLayer ( string name,
bool hidden = false,
int alphaSlice = 127,
ROILayerType type = ROILayerType::StaticLyr,
unsigned int dynamicId = -1 )
nodiscardslot

Adds a new layer to the end of the current layer list.

Parameters
nameName of the layer
hiddenHide the layer or not
alphaSliceAlpha of the layer in the slice view (0-255)
Returns
The new layer number or constants::NO_LAYER constant value if layer can't be added

◆ addROI() [1/2]

int addROI ( int layerID,
string name,
string colorName,
bool immutable = false,
bool hidden = false,
int alphaSlice = 127,
int alphaSurface = 255 )

Adds a new ROI to the end of the current ROI list on the specified layer.

Parameters
layerIDthe layer to which the ROI should be added to
nameName of the ROI
colorNameColor of the ROI.
immutableMake the ROI Immutable or not
hiddenHide the ROI or not
alphaSliceAlpha of the ROI in the slice view (0-255)
alphaSurfaceAlpha of the ROI in the VTK viewer (0-255)
Note
Available colors can be found here: http://www.w3.org/TR/SVG/types.html#ColorKeywords

◆ addROI() [2/2]

int addROI ( string name,
string colorName,
bool immutable = false,
bool hidden = false,
int alphaSlice = 127,
int alphaSurface = 255 )

Adds a new ROI to the end of the current ROI list on the current active layer.

Parameters
nameName of the ROI
colorNameColor of the ROI.
immutableMake the ROI Immutable or not
hiddenHide the ROI or not
alphaSliceAlpha of the ROI in the slice view (0-255)
alphaSurfaceAlpha of the ROI in the VTK viewer (0-255)
Note
Available colors can be found here: http://www.w3.org/TR/SVG/types.html#ColorKeywords

◆ canSaveRTSTRUCTAsOriginal()

bool canSaveRTSTRUCTAsOriginal ( )

Returns whether or not the image's original voxel sizes can be used when saving RTSTRUCTs.

Returns
Whether or not the current ROIs can be saved in the RTSTRUCT format in the coordinate system of the image before it was resampled

◆ clearLayer

void clearLayer ( int id = constants::NO_LAYER)
slot

Reassigns all ROIs of a layer.

Parameters
idIndex of layer to clear
Note
layer id stays in the layer list

◆ clearLayers

void clearLayers ( Array< int > indices)
slot

Clears multiple layers.

Parameters
indicesArray of indicies to clear

◆ clearROI

void clearROI ( int id = -1,
int targetROI = -1,
int targetLayer = constants::NO_LAYER,
int movePolicy = ROIDataManager::respectImmutable )
slot

Reassigns all voxels of an ROI.

Parameters
idIndex of ROI to clear
targetROIIndex of ROI to recieve id's voxels
targetLayerIndex of layer to recieve id's voxels
Note
ROI id stays in the ROI list

◆ clearROIs

void clearROIs ( Array< int > indices,
int targetROI = -1,
int targetLayer = constants::NO_LAYER,
int movePolicy = ROIDataManager::respectImmutable )
slot

Clears multiple ROIs.

Parameters
indicesArray of indicies to clear
targetROIDestination ROI for voxels in indicies
targetLayerDestination layer for voxels in indicies

◆ cutROI

void cutROI ( bool bg,
bool quiet = false,
Array< Index > list = Array< Index >() )
slot

Removes regions of the volumes.

Parameters
bgIf true, removes all voxels in active volumes in the background ROI. If false, removes voxels in the current ROI
quietIf true, does not give a warning
Note
Voxels in ACTIVE volumes are rest to the minimum value set in the cache. This should be equal to the global minimum of the volume but isn't always the case
A volume MUST active (ie "turned on") for voxels to be reset

◆ deleteLayer

void deleteLayer ( int id = constants::NO_LAYER,
int target = constants::NO_LAYER,
int targetMovePolicy = ROIDataManager::respectImmutable )
slot

Removes a layer from the list of layers and reassigns all its ROIs.

Parameters
idIndex of layer to delete
targetIndex of layer to recieve id's from deleted ROIs
targetMovePolicyis 0=replace, 1=no overwrite (keep target), 2=respect immutable status of target (default), 3=make new ROIs from overlap

◆ deleteLayers

void deleteLayers ( Array< int > indices,
int target = constants::NO_LAYER,
int targetMovePolicy = ROIDataManager::respectImmutable )
slot

Delete multiple layers.

Parameters
indicesArray of indicies to delete
targetDestination layer for voxels in indicies
targetMovePolicyis 0=replace, 1=no overwrite (keep target), 2=respect immutable status of target (default), 3=make new ROIs from overlap

◆ deleteLayerToROI

void deleteLayerToROI ( int id,
int targetROI,
int targetLayer,
int targetMovePolicy = ROIDataManager::respectImmutable )
slot

Removes a layer from the list of layers and reassigns all its ROIs.

Parameters
idIndex of layer to delete
targetROIIndex of ROI to recieve id's from deleted ROIs
targetLayerIndex of layer to recieve id's
targetMovePolicyis 0=replace, 1=no overwrite (keep target), 2=respect immutable status of target (default), 3=make new ROIs from overlap

◆ deleteROI

void deleteROI ( int id = -1,
int targetROI = -1,
int targetLayer = constants::NO_LAYER,
int movePolicy = ROIDataManager::respectImmutable )
slot

Removes an ROI from the ROI list and reassigns all its voxels.

Parameters
idIndex of an ROI in the current layer to delete
targetROIIndex of an ROI to recieve id's voxels
targetLayerIndex of the layer of the target ROI

◆ deleteROIs

void deleteROIs ( Array< int > indices,
int targetROI = -1,
int targetLayer = constants::NO_LAYER,
int movePolicy = ROIDataManager::respectImmutable )
slot

Delete multiple ROIs.

Parameters
indicesArray of indicies to delete
targetROIDestination ROI for voxels in indicies
targetLayerDestination layer for voxels in indicies

◆ drawCircle()

void drawCircle ( int plane,
int x,
int y,
int z,
float radius,
int roi_id,
bool updateDisplay = true )
protected

Draws a ROI circle at a given point.

Parameters
planePlane in which to draw the circle (0=sagittal,1=coronal,2=transverse)
xCoordinate in the X (sagittal) plane of center of circle
yCoordinate in the Y (coronal) plane of center of circle
zCoordinate in the Z (transverse) plane of center of circle
radiusRadius of the circle, in voxels
roi_idIndex of ROI to update
updateDisplayIf true, will immediately update the display to show the drawn ROI
Note
If making many (>10) drawing calls, it is recommended to turn off updateDisplay until the last iteration
(x, y, z) correspond to dimensions (0, 1, 2), the same numbering as VQ.Plane (Sagittal = x, Coronal = y, Transverse = z) used by VQ.controller().getPos() and the other Slice View Controller functions.

◆ drawCube()

void drawCube ( int x,
int y,
int z,
float radius,
int roi_id,
bool updateDisplay = true )
protected

Draws a ROI cube at a given point.

Parameters
xCoordinate in the X (sagittal) plane of center of cube
yCoordinate in the Y (coronal) plane of center of cube
zCoordinate in the Z (transverse) plane of center of cube
radiusRadius of the cube, in voxels. Cube has sides of length 2*radius
roi_idIndex of ROI to update
updateDisplayIf true, will immediately update the display to show the drawn ROI
Note
If making many (>10) drawing calls, it is recommended to turn off updateDisplay until the last iteration
(x, y, z) correspond to dimensions (0, 1, 2), the same numbering as VQ.Plane (Sagittal = x, Coronal = y, Transverse = z) used by VQ.controller().getPos() and the other Slice View Controller functions.

◆ drawCylinder()

void drawCylinder ( int plane,
int x,
int y,
int z,
float radius,
float height,
int roi_id,
bool updateDisplay = true )
protected

Draws a ROI square at a given point.

Parameters
planePlane in which to draw the circle (0=sagittal,1=coronal,2=transverse)
xCoordinate in the X (sagittal) plane of center of cylinder
yCoordinate in the Y (coronal) plane of center of cylinder
zCoordinate in the Z (transverse) plane of center of cylinder
radiusRadius of the cylinder, in voxels
heightHeight of the cylinder. Height is extended to height/2 on either sides of the center point perpendicular to plane
roi_idIndex of ROI to update
updateDisplayIf true, will immediately update the display to show the drawn ROI
Note
If making many (>10) drawing calls, it is recommended to turn off updateDisplay until the last iteration
(x, y, z) correspond to dimensions (0, 1, 2), the same numbering as VQ.Plane (Sagittal = x, Coronal = y, Transverse = z) used by VQ.controller().getPos() and the other Slice View Controller functions.

◆ drawRect()

void drawRect ( int plane,
int x,
int y,
int z,
float radius,
int roi_id,
bool updateDisplay = true )
protected

Draws a ROI square at a given point.

Parameters
planePlane in which to draw the square (0=sagittal,1=coronal,2=transverse)
xCoordinate in the X (sagittal) plane of center of square
yCoordinate in the Y (coronal) plane of center of square
zCoordinate in the Z (transverse) plane of center of square
radiusRadius of the square, in voxels (square has sides of length 2*radius)
roi_idIndex of ROI to update
updateDisplayIf true, will immediately update the display to show the drawn ROI
Note
If making many (>10) drawing calls, it is recommended to turn off updateDisplay until the last iteration
(x, y, z) correspond to dimensions (0, 1, 2), the same numbering as VQ.Plane (Sagittal = x, Coronal = y, Transverse = z) used by VQ.controller().getPos() and the other Slice View Controller functions.

◆ drawSphere()

void drawSphere ( int x,
int y,
int z,
float radius,
int roi_id,
bool updateDisplay = true )
protected

Draws a ROI sphere at a given point.

Parameters
xCoordinate in the X (sagittal) plane of center of sphere
yCoordinate in the Y (coronal) plane of center of sphere
zCoordinate in the Z (transverse) plane of center of sphere
radiusRadius of the sphere, in voxels
roi_idIndex of ROI to update
updateDisplayIf true, will immediately update the display to show the drawn ROI
Note
If making many (>10) drawing calls, it is recommended to turn off updateDisplay until the last iteration
(x, y, z) correspond to dimensions (0, 1, 2), the same numbering as VQ.Plane (Sagittal = x, Coronal = y, Transverse = z) used by VQ.controller().getPos() and the other Slice View Controller functions.

◆ editLayer

void editLayer ( int id,
string name,
bool hidden = false,
int alphaSlice = 127 )
slot

Edits various layer properties such as name, alpha.

Parameters
idIndex of layer to edit
nameName of the layer
hiddenHide the layer or not
alphaSliceAlpha of the ROI in the slice view (0-255)

◆ editROI [1/2]

void editROI ( int id,
string name,
string colorName,
bool immutable = false,
bool hidden = false,
int alphaSlice = 127,
int alphaSurface = 255,
string layer = "" )
slot

Edits various ROI properties such as name, color on the current active layer.

Parameters
idIndex of ROI to edit
nameName of the ROI
colorNameColor of the ROI.
immutableMake the ROI Immutable or not
hiddenHide the ROI or not
alphaSliceAlpha of the ROI in the slice view (0-255)
alphaSurfaceAlpha of the ROI in the VTK viewer (0-255)
layerName of the layer this ROI is moved to
Note
Available colors can be found here: http://www.w3.org/TR/SVG/types.html#ColorKeywords

◆ editROI [2/2]

void editROI ( int layerID,
int id,
string name,
string colorName,
bool immutable = false,
bool hidden = false,
int alphaSlice = 127,
int alphaSurface = 255,
string layer = "" )
slot

Edits various ROI properties such as name, color on the specified layer.

Parameters
layerIDthe layer to which the ROI is on
idIndex of ROI to edit
nameName of the ROI
colorNameColor of the ROI.
immutableMake the ROI Immutable or not
hiddenHide the ROI or not
alphaSliceAlpha of the ROI in the slice view (0-255)
alphaSurfaceAlpha of the ROI in the VTK viewer (0-255)
layerName of the layer this ROI is moved to
Note
Available colors can be found here: http://www.w3.org/TR/SVG/types.html#ColorKeywords

◆ exportROIs

void exportROIs ( Array< int > exportROIs)
slot

Exports an ROI (or group of ROIs) as a Volume in the Data Manager.

Parameters
exportROIsArray of ROI indicies to export
Note
ROIs will be exported into a new volume and appended to the end of the data manager. The index number of each ROI will have that corresponding value for all its voxels

◆ exportTable

void exportTable ( string filename = "",
bool openFile = true )
slot

Exports a table of selected metrics for ROIs; e.g. Volume, Sum.

Parameters
filenameName of output file

◆ get2DROIVolumeEstimation()

double get2DROIVolumeEstimation ( unsigned char id,
unsigned char planeId,
unsigned int px1,
unsigned int py1,
unsigned int px2,
unsigned int py2,
unsigned int sections = 20 )

Returns the Modified Simpson's approach for volume estimation of a 2D ROI on a given plane.

Parameters
idIndex of ROI
planeId(0 = sagittal, 1 = coronal, 2 = transverse)
px1Long axis start point, x coordinate in the plane
py1Long axis start point, y coordinate in the plane
px2Long axis end point, x coordinate in the plane
py2Long axis end point, y coordinate in the plane
sectionsThe number of sections along the long axis
Returns
The estimated volume

◆ getCalibrationWidget

Object getCalibrationWidget ( )
slot

Returns the autorad calibration object of this operator.

Returns undefined until the tool has been opened with openAutoradCalib().

◆ getLayerDetails()

Array< string > getLayerDetails ( int i)

Returns various details regarding the display of a layer.

Parameters
iIndex of Layer to get details
Returns
A length 2 array containing the following information:
array[0]: Name of Layer
array[1]: Layer Alpha in the slice view (0-255: 0=transparent, 255=opaque)

◆ getROICenterOfMass()

string getROICenterOfMass ( unsigned char id)

Returns the geometric center of mass of an ROI.

Parameters
idIndex of ROI to load
Returns
String of containing the x,y, and z position of the center of mass of the ROI in the form "x,y,z"

◆ getROIContourPoints()

Array< int > getROIContourPoints ( unsigned char id,
unsigned char planeId )

Returns the outline points of an ROI on the current slice of a given plane.

Parameters
idIndex of ROI
planeId(0 = sagittal, 1 = coronal, 2 = transverse)
Returns
String of (x,y) coordinates in the format "x1,y1,x2,y2..." in the planeID (on the current slice) where the outline of the ROI id exists)

◆ getROIDetails()

Array< string > getROIDetails ( int i)

Returns various details regarding the display of an ROI.

Parameters
iIndex of ROI to get details
Returns
A length 6 array containing the following information:
array[0]: Name of ROI
array[1]: ROI Color
array[2]: 0 if ROI is mutable, 1 if ROI is immutable
array[3]: 0 if ROI is visible, 1 if ROI is hidden
array[4]: ROI Alpha in the slice view (0-255: 0=transparent, 255=opaque)
array[5]: ROI Alpha in the VTK Viewer (0-255: 0=transparent, 255=opaque)

◆ getROIVolume()

double getROIVolume ( unsigned char id)

Returns the volume of a ROI.

Parameters
idIndex of ROI
Returns
Double containing ROI volume (in mm^3)

◆ getSplinePath()

Array< string > getSplinePath ( int id,
bool interpolated = false )

Returns the current spline points when using the spline tool.

Parameters
idPlane (0 = sagittal , 1 = conronal, 2 = transverse) to grab spline points
interpolatedIf true, returns every point along interpolated (green) line. If false, returns just the clicked points
Returns
String of (x,y) coordinates in the format "x1,y1,x2,y2..."

◆ kMeansManualSeedCluster

void kMeansManualSeedCluster ( string kmeans)
slot

a helper function to set the seed mean value for manual k-means segmentation

Parameters
kmeansString of comma-separated double values (e.g. "1.5,20,100")

◆ loadLayer()

void loadLayer ( string filename,
int layerID = constants::NO_LAYER )

Loads a .rmha file from disk into the 3D ROI Operator.

Parameters
filenamePath to filename on disk
layerIDThe layer index to load into (if not provided, the ROIs will be loaded in the active layer)

◆ loadLayerFromIPACS

void loadLayerFromIPACS ( bool quiet = false,
int layerID = constants::NO_LAYER )
slot

Download the ROIs into the specified layer from the associated data on the iPACS.

Parameters
quietIf true, the most recent ROIs will be loaded and no dialog will be shown
layerIDThe layer ID to download the ROIs to (if not specified, the active layer will be used)

◆ loadROI()

void loadROI ( string filename,
bool preserveExistingROIs = false )

Loads a .rmha file from disk into the 3D ROI Operator.

Parameters
filenamePath to filename on disk
preserveExistingROIsIndicates if existing ROIs should be preserved

◆ loadROIFromIPACS

void loadROIFromIPACS ( bool quiet = false)
slot

Download the ROIs from associated data on the iPACS.

Parameters
quietIf true, the most recent ROIs will be loaded and no dialog will be shown

◆ loadRTStructureAsROI [1/2]

void loadRTStructureAsROI ( DcmDataset * header)
slot

Use DicomReader to load an ROI in the RT Structure Set format specified by the Dicom standard and used by the Siemens IRW.

Parameters
headerthe RTSTRUCT header

◆ loadRTStructureAsROI [2/2]

void loadRTStructureAsROI ( string filename)
slot

Use DicomReader to load an ROI in the RT Structure Set format specified by the Dicom standard and used by the Siemens IRW.

Parameters
filenamethe path to the RTSTRUCT DICOM

◆ loadVOIAsROI

void loadVOIAsROI ( string filename)
slot

Support for PMOD region of interest files.

Parameters
filenameName of file

◆ numLayers()

int numLayers ( )
inline

Returns the number of layers currently in the operator.

Returns
Number of layers in the operator

◆ numROIs()

int numROIs ( )
inline

Returns the number of ROIs in the current layer.

Returns
Number of ROIs for the current layer
Note
Background is included so the function will never return less than 1

◆ numTotalROIs()

int numTotalROIs ( )
inline

Returns the number of ROIs currently in the operator (all layers).

Returns
The sum of the number of ROIs from all the Layers
Note
A Background ROI for each layer is included in the total

◆ openAutoradCalib [1/2]

void openAutoradCalib ( )
slot

Opens the autorad calibration tool.

Must be called before getCalibrationWidget(), which returns undefined until the tool has been opened.

◆ openAutoradCalib [2/2]

void openAutoradCalib ( int numStandards,
bool bkg )
slot

Opens the autorad calibration tool with the given setup.

Parameters
numStandardsNumber of calibration standards
bkgWhether a background standard is used

◆ resizeROI()

void resizeROI ( int layerID = constants::NO_LAYER)
protected

If the dimensions of the underlying ROI object do not match that of the reference image, resize and clear the ROI object and display a notification dialog

◆ saveLayer

void saveLayer ( string filename,
int layerID = constants::NO_LAYER,
string compression = "RLE" )
slot

Save an ROI Layer to Disk.

Parameters
filenameLocal path to output (saved) rmha file
layerIDThe layerID of the ROI to be saved
compressionType of Compression to use (Use RLE in almost all cases)

◆ saveROI

void saveROI ( string filename,
string compression = "RLE" )
slot

Save an ROI to Disk.

Parameters
filenameLocal path to output (saved) rmha file
compressionType of Compression to use (Use RLE in almost all cases)

◆ saveROIsAsRTSTRUCT

bool saveROIsAsRTSTRUCT ( string filename)
slot

Saves all ROIs in an RTSTRUCT DICOM. The DICOM will be defined with respect to the currently loaded reference image.

Parameters
filenameLocal path to output (saved) RTSTRUCT DICOM
Returns
Whether or not creating the RTSTRUCT was successful

◆ setCurrentLayer()

bool setCurrentLayer ( int i)

Sets the currently selected layer in the 3D ROI Operator.

Parameters
iIndex of the layer to set as Current
Returns
Whether the argument is a valid combo box item

◆ setCurrentROI()

bool setCurrentROI ( int i)

Sets the currently selected ROI in the 3D ROI Operator.

Parameters
iIndex of the ROI to set as Current
Returns
Whether the argument is a valid combo box item

◆ setDynamicLayerTimepoints()

bool setDynamicLayerTimepoints ( Array< int > timepoints)

Reconciles dynamic ROI layers on the current object to exactly match a requested set of timepoints.

Adds a dynamic layer for each timepoint in timepoints that is not already present, and removes any existing dynamic layer whose timepoint is not in timepoints. Layers whose timepoints are already correct are left untouched.

Validation is performed before any layers are added or removed: if timepoints contains any index outside the valid range for the current object, the call fails and no changes are made (all-or-nothing).

Parameters
timepointsList of timepoint indices (0-based) that should have dynamic layers after this call returns. Order does not matter; duplicates are ignored.
Returns
true if the layers were successfully reconciled (or already matched, i.e. a no-op); false if no dynamic timepoints could be detected on the current object, or if timepoints contained an out-of-range index.
VQScript Example
// Set the ROI's dynamic layers to timepoints 0, 2, and 5, removing any others.
var roi = VQ.getActiveROI();
var ok = roi.setDynamicLayerTimepoints([0, 2, 5]);
if (!ok) {
VQ.log("Failed to set dynamic layer timepoints");
}

◆ setInputROI() [1/2]

void setInputROI ( int layerId,
int roiIdx )

Sets the input ROI for the Segmentation Tools.

Parameters
layerIdIndex of layer to set as Input
roiIdxIndex of ROI to set as Input

◆ setInputROI() [2/2]

void setInputROI ( int roiIdx)

Sets the input ROI for the Segmentation Tools.

Parameters
roiIdxIndex of ROI from the current active layer to set as Input

◆ setModeSplineRecordClear()

void setModeSplineRecordClear ( int id = -1)
protected

Clear the currently recorded spline points on the active layer and current ROI. This is used to reset the state of the spline tool without affecting the underlying ROI.

Parameters
idset the current ROI to get the spline record clear for. If -1, will use the current ROI selected in the UI.

◆ setROIViewMode()

void setROIViewMode ( string mode)
protected

Set ROI painting mode.

Parameters
modePaint mode name, should be "All Layer", "All ROI", "Current Layer", "Outline"

◆ setSortContourImportByVolume

void setSortContourImportByVolume ( bool sortByVolume)
slot

Sets whether ROIs imported from an RTSTRUCT file are sorted by volume.

Parameters
sortByVolumeIf true, sorts ROIs imported from an RTSTRUCT by volume. If false, preserves the order they appear in the RTSTRUCT file (except for overlaps)

◆ setSplinePath()

void setSplinePath ( int id,
Array< string > list,
bool closed = false )

Sets spline points in the spline tool.

Parameters
idIndex of ROI
listArray in the form [x1,y1,x2,y2,...] denoting the points of the spline
closedif True, will complete the spline interpolation

◆ showTable

void showTable ( bool useCachedData = false)
slot

Displays a table of selected metrics for ROIs that have been created; e.g. Volume, Sum.

Parameters
useCachedDataIf true, uses previously loaded ROIs instead of reloading; default = false.

◆ submitLayer

void submitLayer ( bool quiet = false,
bool allMetric = false,
int layerID = constants::NO_LAYER )
slot

Submit the ROIs of the specified layer to the associated data on the iPACS.

Parameters
quietIf true, no setting dialog is shown and latest saving parameters are used
allMetricif true, force to save all the quantification metrics
layerIDThe layer ID to save the ROIs from (if not specified, the active layer will be used)

◆ submitROI

void submitROI ( bool quiet = false,
bool allMetric = false )
slot

Submit the ROIs to the associated data on the iPACS.

Parameters
quietIf true, no setting dialog is shown and latest saving parameters are used
allMetricIf true, force to save all the quantification metrics

◆ submitROIAsRTSTRUCT()

void submitROIAsRTSTRUCT ( bool quiet = false,
bool allMetric = false )

Submit the ROIs as RTSTRUCT to the associated data on the iPACS.

Parameters
quietIf true, no setting dialog is shown and latest saving parameters are used
allMetricIf true, force to save all the quantification metrics image before any resampling that was done in VQ

◆ submitROIAsRTSTRUCTNotQuiet

void submitROIAsRTSTRUCTNotQuiet ( )
slot

Submit the ROIs as RTSTRUCT to the associated data on the iPACS. If it is possible to use the coordinate space of the original image before resampling and quiet is false, the user will be asked their preference.

Parameters
allMetricIf true, force to save all the quantification metrics

◆ syncLabelsFromLayer

void syncLabelsFromLayer ( int layerId,
ScriptROIMetaMap & scriptMeta )
slot

UI-layer entry point for synchronising a layer's voxel buffer with the ROI metadata list.

Switches the layer combo box to layerId if it is not already active, then delegates all data work to ROIDataManager::syncLabelsFromLayer(). After the manager call, any labels that were newly registered are added to the ROI combo box and table in one blocked-signal batch, the last new entry is selected, and a single undo snapshot is recorded.

Parameters
layerIdIndex of the target layer. Must be a valid index within the current ROIDataManager; logs a warning and returns early otherwise.
scriptMetaOptional per-label metadata forwarded unchanged to ROIDataManager::syncLabelsFromLayer(). See that function's documentation for key semantics.
See also
ROIDataManager::syncLabelsFromLayer()

◆ toggleHidden

void toggleHidden ( Array< int > indices)
slot

Toggles the hidden attribute of ROI(s).

Parameters
indicesArray of ROI indicies to toggle

◆ toggleImmutable

void toggleImmutable ( Array< int > indices)
slot

Toggles the immutable attribute of ROI(s).

Parameters
indicesArray of ROI indicies to toggle