VivoQuant
Public Slots | Public Member Functions | List of all members
DistanceOperator Class Reference

Object to interact with the Distance/Annotation Operator when it is active. More...

Public Slots

void clear (bool quiet=false)
 Clear all the annotations. More...
 
void saveData (string filename=string())
 Save the annotations on the disk. More...
 
void loadData ()
 Load the annotations from the disk. More...
 
void saveDataIPACS (bool quiet=false)
 Save annotations to a iPACS (works only if the data was loaded from an iPACS) More...
 
string loadDataIPACS (bool quiet=false)
 Load annotations from an iPACS (works only if the data was loaded from an iPACS) More...
 
void saveProfilePlot (string filename=string())
 Save the profile plot to the disk as PDF or PNG. More...
 
void saveProfile (string filename=string(), bool quiet=false)
 Save the profile plot to the disk as a CSV file. More...
 
void addGraph (string item)
 Add any type of annotation based on a text string. More...
 

Public Member Functions

void loadData (string filename, int slice=-1, bool clearExist=true)
 Load annotations from a file. More...
 
bool loadAnnotationsFromData (Index idx, bool quiet=false)
 Load annotations from an iPACS for a given data set (works only if the data was loaded form an iPACS) More...
 
void saveAnnotationsToData (Index idx, bool quiet=false)
 Save annotations to a loaded iPACS data set (works only if the data was loaded form an iPACS) More...
 
int count ()
 Get the number of annotations in the table. More...
 
Array< int > getSliceAnnotationIds (unsigned int slice)
 Get the annotations on a particular slice. More...
 
void rescaleAnnotation (float sf)
 Rescale all annotations. More...
 
bool deleteAnnotation (unsigned int id)
 Delete the specified annotation. More...
 
bool setAnnotationVisible (unsigned int id, bool visible)
 Show / hide a specified annotation. More...
 
bool setAnnotationLabel (unsigned int id, string label)
 Change the label of the specified annotation. More...
 
bool setAnnotationColor (unsigned int id, string color)
 Change the color of the specified annotation. More...
 
bool setAnnotationFontSize (unsigned int id, int size)
 Change the size of the specified annotation. More...
 
bool setAnnotationFont (unsigned int id, string font, int size=0)
 Change the font of the specified annotation. More...
 
Object getAnnotationInfo (unsigned int id)
 Get the information for the specified annotation. More...
 
float getAnnotationIntensity (unsigned int id)
 Get the intensity of the specified annotation (circle) More...
 
void setProfilePlotDimensions (int width, int height)
 Set the dimensions of the profile plot. More...
 

Detailed Description

Object to interact with the Distance/Annotation Operator when it is active.

This object can be used to draw point, circle and line annotations. The annotations can also be saved on disk or on an iPACS.

Images are loaded in the data manager starting with the reference at 0 See also ScriptMaster::currentOp() to obtain this object and MainWin::setViewMode() to enter the Distance/Annotation Operator.

Member Function Documentation

◆ addGraph

void addGraph ( string  item)
slot

Add any type of annotation based on a text string.

Parameters
itemThe text string containing the annotation's information
Note
Expected format: shape;type;color;rawLabel;plane;linkedp;startp;endp;showAll;linked;hidden
Ex: Point;blue;myLabel;2;30.4:78.9:0
Line;1;yellow;%4dmm;2;0:0:0;10.1:2,2:0;.89.1:78.9:0;1;1;

◆ clear

void clear ( bool  quiet = false)
slot

Clear all the annotations.

Parameters
quietSet to true to avoid the confirmation message

◆ count()

int count ( )
inline

Get the number of annotations in the table.

Returns
The number of annotations

◆ deleteAnnotation()

bool deleteAnnotation ( unsigned int  id)

Delete the specified annotation.

Parameters
idThe id of the annotation to delete (0-based from the annotation table)
Returns
True if deleted, false otherwise

◆ getAnnotationInfo()

Object getAnnotationInfo ( unsigned int  id)

Get the information for the specified annotation.

Parameters
idThe id of the annotation to get the info (0-based from the annotation table)
Returns
An array of key-value pairs containing the information
Note
Possible keys: shape, color, label, plane, type, rawlabel, labelp, linked, location & hide.
Line specific: startp, endp & distance.
Circle specific: radius.

◆ getAnnotationIntensity()

float getAnnotationIntensity ( unsigned int  id)

Get the intensity of the specified annotation (circle)

Parameters
idThe id of the annotation to get the intensity (0-based from the annotation table)
Returns
The first image's average intensity inside the circle

◆ getSliceAnnotationIds()

Array<int> getSliceAnnotationIds ( unsigned int  slice)

Get the annotations on a particular slice.

Returns
The ids the annotations on that slice

◆ loadAnnotationsFromData()

bool loadAnnotationsFromData ( Index  idx,
bool  quiet = false 
)

Load annotations from an iPACS for a given data set (works only if the data was loaded form an iPACS)

Parameters
idxIndex of data (see ScriptMaster::index())
quietSet to true to avoid confirmation message
Returns
True if succeeded, false otherwise

◆ loadData() [1/2]

void loadData ( string  filename,
int  slice = -1,
bool  clearExist = true 
)

Load annotations from a file.

Parameters
filenameThe location of the file to load from
sliceThe slice to load the annotations on
clearexist annotations

◆ loadData [2/2]

void loadData ( )
slot

Load the annotations from the disk.

Parameters
quietSet to true to avoid the confirmation message

◆ loadDataIPACS

string loadDataIPACS ( bool  quiet = false)
slot

Load annotations from an iPACS (works only if the data was loaded from an iPACS)

Parameters
quietSet to true to avoid confirmation message
Returns
A string containing "OK" if the annotations were loaded sucessfully, an empty string otherwise

◆ rescaleAnnotation()

void rescaleAnnotation ( float  sf)

Rescale all annotations.

Parameters
sfThe scale factor

◆ saveAnnotationsToData()

void saveAnnotationsToData ( Index  idx,
bool  quiet = false 
)

Save annotations to a loaded iPACS data set (works only if the data was loaded form an iPACS)

Parameters
idxIndex of data (see ScriptMaster::index())
quietSet to true to avoid confirmation message

◆ saveData

void saveData ( string  filename = string())
slot

Save the annotations on the disk.

Parameters
filename(optional) The location of the file to save to. If not supplied a file browser will open

◆ saveDataIPACS

void saveDataIPACS ( bool  quiet = false)
slot

Save annotations to a iPACS (works only if the data was loaded from an iPACS)

Parameters
quietSet to true to avoid confirmation message

◆ saveProfile

void saveProfile ( string  filename = string(),
bool  quiet = false 
)
slot

Save the profile plot to the disk as a CSV file.

Parameters
filename(optional) The location and filename of the file to save to. If not supplied a file browser will open
quiet(optional) Set to true to avoid dialog to be displayed on success.

◆ saveProfilePlot

void saveProfilePlot ( string  filename = string())
slot

Save the profile plot to the disk as PDF or PNG.

Parameters
filename(optional) The location and filename of the file to save to. If not supplied a file browser will open

◆ setAnnotationColor()

bool setAnnotationColor ( unsigned int  id,
string  color 
)

Change the color of the specified annotation.

Parameters
idThe id of the annotation to set the color (0-based from the annotation table)
colorThe new color name (ie: "red", "yellow", etc.)
Returns
True if set, false otherwise

◆ setAnnotationFont()

bool setAnnotationFont ( unsigned int  id,
string  font,
int  size = 0 
)

Change the font of the specified annotation.

Parameters
idThe id of the annotation to set the font (0-based from the annotation table)
sizeThe new size (optional)
fontThe new font
Returns
True if set, false otherwise

◆ setAnnotationFontSize()

bool setAnnotationFontSize ( unsigned int  id,
int  size 
)

Change the size of the specified annotation.

Parameters
idThe id of the annotation to set the size (0-based from the annotation table)
sizeThe new size
Returns
True if set, false otherwise

◆ setAnnotationLabel()

bool setAnnotationLabel ( unsigned int  id,
string  label 
)

Change the label of the specified annotation.

Parameters
idThe id of the annotation to set the label (0-based from the annotation table)
labelThe new label
Returns
True if set, false otherwise

◆ setAnnotationVisible()

bool setAnnotationVisible ( unsigned int  id,
bool  visible 
)

Show / hide a specified annotation.

Parameters
idThe id of the annotation to set visible (0-based from the annotation table)
visibleThe visible state
Returns
True if set, false otherwise

◆ setProfilePlotDimensions()

void setProfilePlotDimensions ( int  width,
int  height 
)

Set the dimensions of the profile plot.

Parameters
widthThe width of the profile plot window
heightThe height of the profile plot window