VivoQuant
Public Member Functions | List of all members
ScriptMaster Class Reference

Main VivoScript object to access other modules and perform generic actions. More...

Public Member Functions

void setVersion (string version)
 Set a string representing the script version that will be used in audit log messages. More...
 
string getVersion ()
 Get the string representing the script version. More...
 
void askForCancelReason (bool ask)
 Set whether a prompt asks for a reason if the user cancels the script, which can be written to the audit trail. More...
 
bool isAskingForCancelReason ()
 Whether a prompt will asks for a reason if the user cancels the script, which can be written to the audit trail.
 
void setDebuggerEnabled (bool toShow)
 Enable debugger. More...
 
void debug (string text)
 Prints output to debugger and/or logfile. More...
 
Object mainWin ()
 Returns MainWin object.
 
Object bedRemovalTool ()
 Returns advanced bedremoval object.
 
Object matrixManipulationTool ()
 Returns MatrixManipulation object.
 
Object dataManager ()
 Returns Data Manager object.
 
Object dataList ()
 Returns dataList object.
 
Object sliceViewer ()
 Returns sliceViewer object.
 
Object multiViewer ()
 Returns MultiView object.
 
Object controler ()
 Returns SliceView Controller object.
 
Object mipControler ()
 Returns mipControler object.
 
Object vtkController ()
 Returns VTK Controller object.
 
Object vtkViewer ()
 Returns vtkViewer object.
 
Object eCRF ()
 Returns eCRF object.
 
Object workList ()
 Returns Worklist object.
 
Object visibilityManager ()
 Returns Visibility Manager object.
 
Object BrainAtlasTool (bool visible=true, bool quiet=false)
 Opens the Brain Atlas Tool. More...
 
Object MASTool (string libraryPath=string(""))
 Opens Multi-Atlas Segmentation Tool, formerly known as Whole Body Atlas) More...
 
bool waitForECRF (int timeout=0)
 Specifies time to wait for eCRF. More...
 
void setECRFCallback (string function)
 Add callback function to execute when eCRF is loaded. More...
 
void clearCallback ()
 Clear the currently saved callback function for eCRF refresh.
 
void eCRFCallback ()
 Run current eCRF callback function.
 
void quit ()
 Quits VivoQuant after confirmation (in interactive session) or automatically (in –script session)
 
Index index (int i)
 Get a script image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.index(1));. More...
 
Index index (int i, int j)
 Get a script image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.index(0,1));. More...
 
Index flatIndex (int i)
 Get a script flat image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.flatIndex(1));. More...
 
Object getIndexContainer (int i)
 Get a script image index container used to reference data in the Data Manager. Use .get() function of the container to access the internal index. More...
 
Object getIndexContainer (int i, int j)
 Get a script image index container used to reference data in the Data Manager. Use .get() function of the container to access the internal index. More...
 
string counter (int c, int s)
 Convenience function to return a 0-padded counter. More...
 
void showMessage (string msg, bool modal=true)
 Displays dialog box with user-defined message. More...
 
bool askYesNoQuestion (string msg, bool modal=true)
 Displays dialog box with "Yes" or "No" option. More...
 
Object progressDialog (string label, string cancelButtonText, int minimum, int maximum)
 Returns a progress dialog object, which can be used to show the current state of a longer process. More...
 
Object getDouble (string title, string label, double value=0, double min=-2147483647, double max=2147483647, int decimals=1)
 Displays input box to request double-precision value. More...
 
Object getDoubleInteractive (string title, string label, double value=0, double min=-2147483647, double max=2147483647, int decimals=1)
 Displays an input box like ScriptMaster::getDouble() and allows interaction with VivoQuant while the dialog is waiting for input. More...
 
Object getInt (string title, string label, int value=0, int min=-2147483647, int max=2147483647, int step=1)
 Displays input box to request integer value. More...
 
Object getIntInteractive (string title, string label, int value=0, int min=-2147483647, int max=2147483647, int step=1)
 Displays an input box like ScriptMaster::getInt() and allows interaction with VivoQuant while the dialog is waiting for input. More...
 
Object getItem (string title, string label, Array< string > items, int current=0)
 Displays input box to request selection from user-defined list of options. More...
 
Object getItemInteractive (string title, string label, Array< string > items, int current=0)
 Displays an input box like ScriptMaster::getItem() and allows interaction with VivoQuant while the dialog is waiting for input. More...
 
Object getText (string title, string label, string text=string(), int mode=0)
 Displays input box to request text input. More...
 
Object getTextInteractive (string title, string label, string text=string(), int mode=0)
 Displays an input box like ScriptMaster::getText() and allows interaction with VivoQuant while the dialog is waiting for input. More...
 
VariantMap getValues (string title, VariantMap &map, bool modal=true)
 Displays a dialog box to request input for multiple prompts at once. More...
 
Object getLocalPath (string caption="Select directory:", string startDir=string("."))
 Returns path of directory selected by user in file dialog. More...
 
Object getSavePath (string caption=string("Select output file:"), string startDir=string("."), string filter=string())
 Returns path to file selected by user in file dialog. More...
 
Array< string > getLocalFiles (string caption="Select files:", string startDir=string("."))
 Returns array of paths to files selected by user in file dialog. More...
 
string getVivoScriptDir ()
 Returns VivoScript directory.
 
void mkdir (string path, string subdir)
 Creates sub-directory at specified path. More...
 
bool fileExists (string path)
 Checks whether file at specified path exists. More...
 
bool folderExists (string path)
 Checks whether file at specified path exists. More...
 
bool openFileExternally (string path)
 Opens a local file in an external application. More...
 
Object minMaxTool ()
 Returns MinMax Tool object.
 
bool isInteractive ()
 Checks whether current VivoQuant session is interactive.
 
void setInteractive (bool b)
 Sets VivoQuant to interactive (or not) More...
 
void updateProcessingParameters ()
 Update the ITK and VTK thread settings based on the config.
 
bool isTestMode ()
 Checks whether current VivoQuant session is in test mode.
 
void setTestMode (bool b=true)
 Sets VivoQuant to test mode (or not) More...
 
string lumiQuantMaster ()
 Returns LumiQuant master settings file from VivoQuant directory.
 
Object dicomBrowser (AbstractDicomRepository *rep)
 Returns VivoQuant's Data Browser object for a given DICOM repository. More...
 
Object dcmRep (string text)
 Creates and returns a DICOM repository object. More...
 
Object currentDcmRep ()
 Returns the DICOM repository object corresponding to the repository that is currently active in the DICOM Browser.
 
Object loadRepository (string name)
 Returns DICOM repository object from DICOM repository saved in VivoQuant. More...
 
Object getListOfRepositories (string type=string())
 Returns array of repositories stored in VivoQuant.
 
void abort ()
 Aborts current script.
 
Object queryStudies (AbstractDicomRepository *rep, string patientName, string patientID=string(), string dateRange=string(), string studyDesc=string())
 Performs query of DICOM repository for studies matching argument criteria. More...
 
Object querySeries (AbstractDicomRepository *rep, string studyInstanceUID)
 Performs query of DICOM repository for series within a given study, and returns series matching criteria. More...
 
Object queryImages (AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID)
 Performs query of DICOM repository for images within a series, and returns images matching criteria. More...
 
Object query (AbstractDicomRepository *rep, string query, Array< string > arguments=Array< string >(), Object &fields=Object(), bool isPost=false)
 Performs custom query of DICOM repository using the iPACS API. More...
 
string getDcmString (AbstractDicomRepository *rep, string tag, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID)
 Looks up the value of the specified tag in the DICOM header of an image in the repository. More...
 
Object downloadImages (AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string())
 Downloads image to cache. More...
 
Object downloadImages (string targetDir, AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string())
 Downloads image to a location on disk. More...
 
Object downloadImages (string targetDir, bool forceRedownload, AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string())
 Downloads image to a location on disk. More...
 
Object queryDataPoints (AbstractDicomRepository *rep, string type, string uid, string form)
 Perform query of DICOM repository for datapoints at project, study, series, or image level, and returns datapoints matching criteria. More...
 
Object submitDataPoint (AbstractDicomRepository *rep, string uid, Object &data, string type=string())
 Submits datapoint to DICOM repository. More...
 
Object logMessage (Index dataIndex, string msg, string noipacsTitle=string("Get iPACS from data"), string type=string())
 Creates a log message on the given's data iPACS repository. More...
 
Object logMessage (AbstractDicomRepository *rep, string msg, string type=string())
 Creates a log message on the given DICOM repository. More...
 
void auditTrailMessage (string msg, string project="/", string type=string())
 Creates an audit trail message on the current repository. More...
 
void auditTrailGenerateNewUID ()
 Generates a new session ID for audit trail messages.
 
void dicomBrowserLoad (AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, bool append=false, bool isPlanar=false, bool force4Dto3D=false)
 Downloads image(s) from DICOM repository and loads them into the Data Manager. More...
 
void dicomBrowserLoad (DicomBrowser *dcmBrowser, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string())
 Downloads image(s) from DICOM repository and loads them into Data Manager. More...
 
Object queryStudyPlan (AbstractDicomRepository *rep, string plan, string cohort, string group, string animal, string modality, string date, string event="$0")
 
Object getWidget (string name)
 Returns an object containing functions/properties of specified widget. Widgets are UI elements (e.g. buttons, checkboxes, combo boxes, etc.) in VivoQuant. More...
 
Object currentOp ()
 Returns an object containing functions for the currently loaded operator.
 
Object currentView ()
 Returns an object containing functions for the currently loaded view mode.
 
Array< string > availableItems (string name)
 Returns available items from widget with multiple options. More...
 
Array< string > availableItemsObj (Object obj)
 Returns available items from widget with multiple options. More...
 
Array< string > availableOperators ()
 Returns list of available operators.
 
void setOption (string cbname, string opt)
 Set widget to given option; for use with widgets with multiple options (e.g. comboboxes) More...
 
void setOptionObj (Object obj, string opt)
 Set widget to given option; for use with widgets with multiple options (e.g. comboboxes) More...
 
string stripCredentials (string url_string)
 Returns URL of DICOM repository with credentials (username and password) removed. More...
 
void setConfig (string entry, Variant &val, bool force=false)
 Sets option in VivoQuant configuration to given value. More...
 
string getConfig (string entry, string defaultValue=string())
 Returns current value of option in VivoQuant configuration. More...
 
string getHome ()
 Returns VivoQuant installation directory.
 
string getCache ()
 Returns VivoQuant cache directory.
 
string getCurrentDir ()
 Returns current path.
 
string getScriptPath ()
 Returns the location of the script being executed.
 
string getTempFolder ()
 Returns Temp folder for current user.
 
bool deletePath (string path)
 Deletes folder and all its contents at given path. More...
 
bool deleteFile (string filepath)
 Deletes file at given path. More...
 
bool copyFile (string filepath, string newpath)
 Copies file from one path to another. More...
 
bool renameFile (string filepath, string newname)
 Renames file at given path. More...
 
bool rmDir (string dirpath)
 Removes directory at given path. More...
 
string preProcess (string protocol, bool showDialog=false)
 Runs Pre-Processing Tool tool with the given protocol. More...
 
Object PreProcessingTool (bool showDialog=true)
 Opens the Pre-Processing Tool. More...
 
int storeData (AbstractDicomRepository *rep, Index idx, int format=-1)
 Stores DICOM data to a DICOM repository. More...
 
bool storeAsRaw (string fn, Index idx)
 Stores data to disk in MHD/RAW (or MHD/ZRAW) file format. More...
 
int storeAsDICOM (string fn, Index idx, int format=-1, bool compress=false, bool quiet=true)
 Stores data to disk in DICOM file format. More...
 
void saveDataViaITK4D (string fn)
 Stores all data in Data Manager to disk as a single ITK 4D dataset in MHD/RAW or MHD/ZRAW file format. More...
 
void saveDataViaITK (string fn, Index idx)
 Stores data to disk in ITK MHD/RAW or MHD/ZRAW file format. More...
 
bool writeFile (string fn, string text)
 Writes file to disk with given text. More...
 
bool appendFile (string fn, string text)
 Appends text to file on disk. More...
 
Array< string > readFile (string fn)
 Reads file into array of strings. More...
 
Object brukerImporter ()
 Returns Bruker Importer object.
 
Object analyzeImporter ()
 Returns Analyze Importer object.
 
Object imgInfImporter ()
 Returns Img/Inf Importer object.
 
Object gelImporter ()
 Returns Gel Importer object.
 
Object rawImporter ()
 Returns Raw Importer object.
 
Object imgHdrImporter ()
 Returns Img/Hdr Importer object.
 
Object vevoImporter (string filename)
 Returns Vevo object.
 
void centerCursor ()
 Moves cursor to center of image in each viewport (i.e. moves each viewport to center slice)
 
Object webDisk (string rep)
 Return IPACS WebDisk object for project in given iPACS repository. More...
 
bool saveScreenshot (string fileName)
 Saves screenshot of VivoQuant. More...
 
string applicationName ()
 Returns name + version of current instance of VivoQuant.
 
Object zipTool ()
 Returns Zip Tool object.
 
double sin (double f)
 Returns sin of angle. More...
 
double cos (double f)
 Returns cosine of angle. More...
 
void evalDialog (string text=string())
 Opens VivoScript evaluation window with given text. More...
 
void splitROI2DICOM (Index idx)
 For each ROI in the 3D ROI Tool, creates a masked image of a given image in the Data Manager, where voxels outside the ROI are mapped to the given image's minimum. More...
 
Array< string > lsDir (string dir, string nameFilter=string(), int filter=QDir::AllEntries|QDir::NoDotAndDotDot, QDir::SortFlags sort=QDir::Name)
 Returns array of files in given directory on local disk. More...
 
int rand ()
 Returns a random integer. More...
 
int rand (int max)
 Returns random positive integer less than given maximum. More...
 
float frand ()
 Returns a random float. More...
 
void suspend (string message=string())
 Suspends script and opens a modeless "Resume" dialog. More...
 
string getHash (string key, string def=string())
 Returns current value of key in hash. More...
 
double getHashNum (string key, double def=0.0f)
 Returns current numerical value of key in hash. More...
 
Array< string > getHashKeys ()
 Returns array of all keys in hash.
 
void setHash (string key, string val)
 Sets value of key in hash. More...
 
void clearHash ()
 Clears all keys and values stored in hash.
 
bool storeHash (string fileName)
 Stores all keys and values in hash to local file. More...
 
bool loadHash (string fileName)
 Loads local file, containing hash keys and values, to VivoQuant's persistent hash. More...
 
string getEnv (string key, string defaultValue=string())
 Get the system's environment variables. More...
 
string startTool (string tool, string baseDir=".", Array< string > args=Array< string >())
 Start an external tool. More...
 
void bedRemoval (string bedName=string())
 Invokes CT bed removal tool. If bedName is provided, this bed will automatically be selected.
 
Object getROIStats (Index idx, int roiID, int layerID=-1)
 Returns object with ROI quantification table information for given dataset and ROI. More...
 
Object getROIStats (Index idx)
 Returns array of ROI quantification table information for given dataset and ALL ROIs. More...
 
Object getNMCTWidget (string name)
 Returns 3D Brain Atlas Tool widgets. More...
 
string atlasPath ()
 Returns path where atlases are stored.
 
void openNMCT ()
 Opens 3D Brain Atlas Tool. More...
 
void setNMCTQuietModeOn ()
 Sets 3D Brain Atlas Tool to run in Quiet Mode. Prevents output from opening automatically upon completion. More...
 
void setNMCTOutputFormat (string format)
 Sets 3D Brain Atlas Tool output format. More...
 
void runNMCT ()
 Runs 3D Brain Atlas Tool. More...
 
Object getMPRWidget ()
 Returns MPR widget.
 
void loadRGB (Index idx, Array< string > imgFiles, float voxX, float voxY, float voxZ, int rgbRep=4, bool forcePlanar=true)
 
Object getMModeSegmentationTool ()
 Returns Ultrasound M-Mode Segmentation tool object.
 
Object getDicomAnonymizer ()
 Returns DICOM Anonymizer Tool object.
 
Object getDicomRelabeler ()
 Returns DICOM Relabeler Tool object.
 
Object getCorticalThicknessTool ()
 Returns cortical thickness tool object.
 
Object getBedRemovalWidget (string name)
 Return Widget name in Bedremoval Dialog.
 
double getHalfLife (string name)
 Get an isotope's half life. More...
 
Object readCSVFile (string name)
 Parse a CSV file into arrays of values. More...
 
string getDefaultPal (string modality, int i)
 get default palette from modality More...
 
string getOS ()
 get current Operating System name More...
 

Detailed Description

Main VivoScript object to access other modules and perform generic actions.

Member Function Documentation

◆ appendFile()

bool appendFile ( string  fn,
string  text 
)

Appends text to file on disk.

Parameters
fnPath of output file
textText to write to output file

◆ askForCancelReason()

void askForCancelReason ( bool  ask)

Set whether a prompt asks for a reason if the user cancels the script, which can be written to the audit trail.

Parameters
askIf true, a prompt will ask the user to enter a reason if they do something that cancels the script while it is running

◆ askYesNoQuestion()

bool askYesNoQuestion ( string  msg,
bool  modal = true 
)

Displays dialog box with "Yes" or "No" option.

Parameters
msgMessage displayed in dialog box
modalDetermines whether VivoQuant is inaccesible while dialog box is open (true) or accesible (false)
Returns
bool true (if "Yes") or false (if "No")

◆ auditTrailMessage()

void auditTrailMessage ( string  msg,
string  project = "/",
string  type = string() 
)

Creates an audit trail message on the current repository.

Parameters
msgThe message to be logged
projectThe project to log the message to
typeMessage type

◆ availableItems()

Array<string> availableItems ( string  name)

Returns available items from widget with multiple options.

Parameters
nameName of widget

◆ availableItemsObj()

Array<string> availableItemsObj ( Object  obj)

Returns available items from widget with multiple options.

Note
Takes widget object as input (can be accessed by VQ.getWidget('widgetName')
Parameters
objWidget object, which can be accessed by ScriptMaster::getWidget

◆ BrainAtlasTool()

Object BrainAtlasTool ( bool  visible = true,
bool  quiet = false 
)

Opens the Brain Atlas Tool.

Parameters
visibleWhether or not the tool dialog is shown upon being created
quietWhether or not the tool is in quiet mode. In quiet mode no warnings or popups will be displayed.

◆ copyFile()

bool copyFile ( string  filepath,
string  newpath 
)

Copies file from one path to another.

Parameters
Currentpath to file
Newpath to file
Returns
bool True if file copied successfully, false otherwise

◆ cos()

double cos ( double  f)
inline

Returns cosine of angle.

Parameters
fAngle (in radians)

◆ counter()

string counter ( int  c,
int  s 
)
inline

Convenience function to return a 0-padded counter.

Parameters
cNumber to pad
sNumber of digits in padded output

◆ dcmRep()

Object dcmRep ( string  text)

Creates and returns a DICOM repository object.

Parameters
textLocation of DICOM repository. Can be URL, local directory, or other path to a DICOM repository. Local folders should start with "folder://" followed by the path. iPACS (R) repositories should start with "ipacss://".

◆ debug()

void debug ( string  text)

Prints output to debugger and/or logfile.

Parameters
textString to be printed

◆ deleteFile()

bool deleteFile ( string  filepath)

Deletes file at given path.

Parameters
filepathPath to file
Returns
bool True if file deleted successfully, false otherwise

◆ deletePath()

bool deletePath ( string  path)

Deletes folder and all its contents at given path.

Parameters
pathto be deleted
Returns
bool True if path deleted successfully, false otherwise

◆ dicomBrowser()

Object dicomBrowser ( AbstractDicomRepository *  rep)

Returns VivoQuant's Data Browser object for a given DICOM repository.

Parameters
repDICOM repository to use with Data Browser object

◆ dicomBrowserLoad() [1/2]

void dicomBrowserLoad ( AbstractDicomRepository *  rep,
string  studyInstanceUID,
string  seriesInstanceUID,
bool  append = false,
bool  isPlanar = false,
bool  force4Dto3D = false 
)

Downloads image(s) from DICOM repository and loads them into the Data Manager.

Parameters
repDICOM repository
studyInstanceUIDStudyInstanceUID of study in which image(s) are found
seriesInstanceUIDSeriesInstanceUID of series in which image(s) are found
appendDetermines whether incoming data is appended (1) or opened to replace data currently loaded in Data Manager (0)
isPlanar(optional) determines whether VivoQuant loads incoming data as planar (1) or not (0)
force4Dto3D(optional) determines whether VivoQuant loads incoming 4D data as 4D (1) or 3

◆ dicomBrowserLoad() [2/2]

void dicomBrowserLoad ( DicomBrowser *  dcmBrowser,
string  studyInstanceUID,
string  seriesInstanceUID,
string  sopInstanceUID = string() 
)

Downloads image(s) from DICOM repository and loads them into Data Manager.

Parameters
dcmBrowserDICOM browser object
studyInstanceUIDStudyInstanceUID of study in which image(s) are found
seriesInstanceUIDSeriesInstanceUID of series in which image(s) are found
sopInstanceUIDSOPInstanceUID of image(s)

◆ downloadImages() [1/3]

Object downloadImages ( AbstractDicomRepository *  rep,
string  studyInstanceUID,
string  seriesInstanceUID,
string  sopInstanceUID = string() 
)

Downloads image to cache.

Parameters
repDICOM repository
studyInstanceUIDStudyInstanceUID of study
seriesInstanceUIDSeriesInstanceUID of series
sopInstanceUIDSOPInstanceUID of image

◆ downloadImages() [2/3]

Object downloadImages ( string  targetDir,
AbstractDicomRepository *  rep,
string  studyInstanceUID,
string  seriesInstanceUID,
string  sopInstanceUID = string() 
)

Downloads image to a location on disk.

Parameters
targetDirDesired location on disk
repDICOM repository
studyInstanceUIDStudyInstanceUID of study
seriesInstanceUIDSeriesInstanceUID of series
sopInstanceUIDSOPInstanceUID of image

◆ downloadImages() [3/3]

Object downloadImages ( string  targetDir,
bool  forceRedownload,
AbstractDicomRepository *  rep,
string  studyInstanceUID,
string  seriesInstanceUID,
string  sopInstanceUID = string() 
)

Downloads image to a location on disk.

Parameters
targetDirDesired location on disk
repDICOM repository
studyInstanceUIDStudyInstanceUID of study
seriesInstanceUIDSeriesInstanceUID of series
sopInstanceUIDSOPInstanceUID of image
forceRedownloadwhether to re-download if the image is already in the cache

◆ evalDialog()

void evalDialog ( string  text = string())

Opens VivoScript evaluation window with given text.

Parameters
textText to write in VivoScript evaluation window

◆ fileExists()

bool fileExists ( string  path)

Checks whether file at specified path exists.

Parameters
pathFull path to file

◆ flatIndex()

Index flatIndex ( int  i)

Get a script flat image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.flatIndex(1));.

Parameters
iThe first level position
Note
A flat index is the position relative to all children element in the Data Manager For example, if the Data Manager contains two dynamic data set: 0.(T0,T1) and 1.(T0,T1,T2), to access Data 1.T2, the index 4 can be used.

◆ folderExists()

bool folderExists ( string  path)

Checks whether file at specified path exists.

Parameters
pathFull path to folder

◆ frand()

float frand ( )

Returns a random float.

Returns
a random float value

◆ getConfig()

string getConfig ( string  entry,
string  defaultValue = string() 
)

Returns current value of option in VivoQuant configuration.

Parameters
entryOption in VivoQuant configuration

◆ getDcmString()

string getDcmString ( AbstractDicomRepository *  rep,
string  tag,
string  studyInstanceUID,
string  seriesInstanceUID,
string  sopInstanceUID 
)

Looks up the value of the specified tag in the DICOM header of an image in the repository.

Parameters
repDICOM repository
tagDICOM tag
studyInstanceUIDStudyInstanceUID of study
seriesInstanceUIDSeriesInstanceUID of series
sopInstanceUIDSOPInstanceUID of image

◆ getDefaultPal()

string getDefaultPal ( string  modality,
int  i 
)

get default palette from modality

Parameters
imagemodality
indexin datamanager
Returns
palette name

◆ getDouble()

Object getDouble ( string  title,
string  label,
double  value = 0,
double  min = -2147483647,
double  max = 2147483647,
int  decimals = 1 
)

Displays input box to request double-precision value.

Parameters
titleText in title of box
labelText in body of box
valueDefault value of input
minMinimum allowed value for input
maxMaximum allowed value for input
decimalsNumber of decimal places to store for value
Deprecated:
Please see ScriptMaster::getValues.

◆ getDoubleInteractive()

Object getDoubleInteractive ( string  title,
string  label,
double  value = 0,
double  min = -2147483647,
double  max = 2147483647,
int  decimals = 1 
)

Displays an input box like ScriptMaster::getDouble() and allows interaction with VivoQuant while the dialog is waiting for input.

Deprecated:
Please see ScriptMaster::getValues.

◆ getEnv()

string getEnv ( string  key,
string  defaultValue = string() 
)

Get the system's environment variables.

Parameters
keyName of system environment variable
defaultValueThe default value if they key does not exists
Returns
The variable's value

◆ getHalfLife()

double getHalfLife ( string  name)

Get an isotope's half life.

Parameters
nameThe isotope's name

◆ getHash()

string getHash ( string  key,
string  def = string() 
)
inline

Returns current value of key in hash.

Parameters
keyKey in hash
Returns
Value of key in hash as string

◆ getHashNum()

double getHashNum ( string  key,
double  def = 0.0f 
)
inline

Returns current numerical value of key in hash.

Parameters
Keyin hash
Returns
Value of key in hash as double

◆ getIndexContainer() [1/2]

Object getIndexContainer ( int  i)

Get a script image index container used to reference data in the Data Manager. Use .get() function of the container to access the internal index.

Parameters
iThe first level position

◆ getIndexContainer() [2/2]

Object getIndexContainer ( int  i,
int  j 
)

Get a script image index container used to reference data in the Data Manager. Use .get() function of the container to access the internal index.

Parameters
iThe first level position (parent)
jThe second level position (child)

◆ getInt()

Object getInt ( string  title,
string  label,
int  value = 0,
int  min = -2147483647,
int  max = 2147483647,
int  step = 1 
)

Displays input box to request integer value.

Parameters
titleText in title of box
labelText in body of box
valueDefault value of input
minMinimum allowed value for input
maxMaximum allowed value for input
stepAmount to increment value when scrolling in input box
Deprecated:
Please see ScriptMaster::getValues.

◆ getIntInteractive()

Object getIntInteractive ( string  title,
string  label,
int  value = 0,
int  min = -2147483647,
int  max = 2147483647,
int  step = 1 
)

Displays an input box like ScriptMaster::getInt() and allows interaction with VivoQuant while the dialog is waiting for input.

Deprecated:
Please see ScriptMaster::getValues.

◆ getItem()

Object getItem ( string  title,
string  label,
Array< string >  items,
int  current = 0 
)

Displays input box to request selection from user-defined list of options.

Parameters
titleText in title of box
labelText in body of box
itemsArray of items to include as options
currentIndex of default value to display
Deprecated:
Please see ScriptMaster::getValues.

◆ getItemInteractive()

Object getItemInteractive ( string  title,
string  label,
Array< string >  items,
int  current = 0 
)

Displays an input box like ScriptMaster::getItem() and allows interaction with VivoQuant while the dialog is waiting for input.

Deprecated:
Please see ScriptMaster::getValues.

◆ getLocalFiles()

Array<string> getLocalFiles ( string  caption = "Select files:",
string  startDir = string(".") 
)

Returns array of paths to files selected by user in file dialog.

Parameters
captionText in title of dialog
startDirDefault path at which the file dialog starts

◆ getLocalPath()

Object getLocalPath ( string  caption = "Select directory:",
string  startDir = string(".") 
)

Returns path of directory selected by user in file dialog.

Parameters
captionText in title of dialog
startDirDefault path at which file dialog starts

◆ getNMCTWidget()

Object getNMCTWidget ( string  name)

Returns 3D Brain Atlas Tool widgets.

Deprecated:
Please see BrainAtlasTool() function and SegmentationServiceNMCT::getWidget

◆ getOS()

string getOS ( )

get current Operating System name

Returns
current OS name. Possible outputs are: Linux, MacOS, Windows and Other.

◆ getROIStats() [1/2]

Object getROIStats ( Index  idx)

Returns array of ROI quantification table information for given dataset and ALL ROIs.

Parameters
idxIndex of dataset from which to calculate stats (see index())

◆ getROIStats() [2/2]

Object getROIStats ( Index  idx,
int  roiID,
int  layerID = -1 
)

Returns object with ROI quantification table information for given dataset and ROI.

Parameters
idxIndex of dataset from which to calculate stats (see index())
roiIDIndex of ROI for which to calculate stats

◆ getSavePath()

Object getSavePath ( string  caption = string("Select output file:"),
string  startDir = string("."),
string  filter = string() 
)

Returns path to file selected by user in file dialog.

Parameters
captionText in title of dialog
startDirDefault path at which file dialog starts
filterFile type filter for file dialog

◆ getText()

Object getText ( string  title,
string  label,
string  text = string(),
int  mode = 0 
)

Displays input box to request text input.

Parameters
titleText in title of box
labelText in body of box
textDefault text
modeDetermines whether input is visible in box (0), hidden (1), masked (2) or initially masked but visible on edit (3)
Deprecated:
Please see ScriptMaster::getValues.

◆ getTextInteractive()

Object getTextInteractive ( string  title,
string  label,
string  text = string(),
int  mode = 0 
)

Displays an input box like ScriptMaster::getText() and allows interaction with VivoQuant while the dialog is waiting for input.

Deprecated:
Please see ScriptMaster::getValues.

◆ getValues()

VariantMap getValues ( string  title,
VariantMap &  map,
bool  modal = true 
)

Displays a dialog box to request input for multiple prompts at once.

Parameters
titleText in title of box
mapMap of label to either a string with the type of input desired (text, int, double, item) or list of input parameters. The first element of the list should be the type of data desired. Based on that type, the rest of the list contains the same arguments that can be supplied to getText(), getInt(), getDouble(), and getItem(): ['text', string default] ['int', int default, int min, int max, int step] ['double', double default, double min, double max, int decimals, double step] ['item', Array<string> items] or simply [Array<string> items] All of these arguments are optional except for the list of items that must be supplied to a prompt of type 'item'. If the first argument in the list doesn't match one of the expected types, the input type will be assumed to be 'text' for one argument and 'item' for more than one argument.
modalIf true, the dialog will not allow user interaction with the rest of VQ while it is open
Returns
Map of label to value chosen in the dialog

◆ getVersion()

string getVersion ( )

Get the string representing the script version.

Parameters
versionThe version string

◆ getWidget()

Object getWidget ( string  name)

Returns an object containing functions/properties of specified widget. Widgets are UI elements (e.g. buttons, checkboxes, combo boxes, etc.) in VivoQuant.

Parameters
nameName of widget. Names of widgets can be revealed by clicking the Lookup button on the VivoScript toolbar, and clicking the widget.

◆ index() [1/2]

Index index ( int  i)

Get a script image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.index(1));.

Parameters
iThe first level position
Note
Children element cannot be accessed with this function (see flatIndex())

◆ index() [2/2]

Index index ( int  i,
int  j 
)

Get a script image index object used to reference data in the Data Manager The index should be passed directly to function, ie: var t = op.testFunc(VQ.index(0,1));.

Parameters
iThe first level position (parent)
jThe second level position (child)

◆ loadHash()

bool loadHash ( string  fileName)

Loads local file, containing hash keys and values, to VivoQuant's persistent hash.

Note
Definitions in file should be formatted as "key1 = val1", with each definition separated by a newline. To check whether file was loaded successfully, try VQ.suspend(VQ.getHash(key1)) for a given key in your file. The dialog box that appears should display the value of the given key.
Parameters
fileNamePath to file

◆ loadRepository()

Object loadRepository ( string  name)

Returns DICOM repository object from DICOM repository saved in VivoQuant.

Parameters
nameName of DICOM repository saved in VivoQuant

◆ loadRGB()

void loadRGB ( Index  idx,
Array< string >  imgFiles,
float  voxX,
float  voxY,
float  voxZ,
int  rgbRep = 4,
bool  forcePlanar = true 
)

Load RGB data without the voxel size prompt.

Parameters
idxIndex where opened data should be positioned in the DataManager (see index())
imgFilesIndex List of RGB image to load as a volume
voxXExpected X voxel size
voxYExpected Y voxel size
voxZExpected Z voxel size
rgbRepRepresentation of RGB values (0=Red, 1=Green, 2=Blue, 3=AVG, 4=SUM, 5=MAX, 6=MIN)
forcePlanarForce volume to load as planar

◆ logMessage() [1/2]

Object logMessage ( AbstractDicomRepository *  rep,
string  msg,
string  type = string() 
)

Creates a log message on the given DICOM repository.

Parameters
repThe DicomRepository object
msgThe message to be logged
typeMessage type

◆ logMessage() [2/2]

Object logMessage ( Index  dataIndex,
string  msg,
string  noipacsTitle = string("Get iPACS from data"),
string  type = string() 
)

Creates a log message on the given's data iPACS repository.

Parameters
dataIndexThe data index (see index())
msgThe message to be logged
noipacsTitleDefault no iPACS title for warning
typeMessage type

◆ lsDir()

Array<string> lsDir ( string  dir,
string  nameFilter = string(),
int  filter = QDir::AllEntries|QDir::NoDotAndDotDot,
QDir::SortFlags  sort = QDir::Name 
)

Returns array of files in given directory on local disk.

Parameters
dirDirectory on local disk
nameFilterExpression to use to filter files. Wildcard (*) is acceptable.

◆ MASTool()

Object MASTool ( string  libraryPath = string(""))

Opens Multi-Atlas Segmentation Tool, formerly known as Whole Body Atlas)

Parameters
libraryPathThe path of the library to be used

◆ mkdir()

void mkdir ( string  path,
string  subdir 
)

Creates sub-directory at specified path.

Parameters
pathPath in which to create new subdirectory
subdirName of new subdirectory

◆ openFileExternally()

bool openFileExternally ( string  path)

Opens a local file in an external application.

Parameters
pathFull path to file
Returns
True if the request to the operating system to open the file was successfully made, false if the request failed or the file does not exist

◆ openNMCT()

void openNMCT ( )

Opens 3D Brain Atlas Tool.

Deprecated:
Please see BrainAtlasTool()

◆ preProcess()

string preProcess ( string  protocol,
bool  showDialog = false 
)

Runs Pre-Processing Tool tool with the given protocol.

Parameters
protocolString with protocol
showDialogWhether or not the tool dialog is shown upon being created

◆ PreProcessingTool()

Object PreProcessingTool ( bool  showDialog = true)

Opens the Pre-Processing Tool.

Parameters
showDialogWhether or not the tool dialog is shown upon being created

◆ progressDialog()

Object progressDialog ( string  label,
string  cancelButtonText,
int  minimum,
int  maximum 
)

Returns a progress dialog object, which can be used to show the current state of a longer process.

Note
Use method setValue(x) to set the current value of the progress dialog.
Use method hide() to hide the progress dialog
Parameters
labelText in title of dialog box
cancelButtonTextText in button that cancels process
minimumMinimum value progress dialog object can take
maxmimumMaximum value progress dialog object can take

◆ query()

Object query ( AbstractDicomRepository *  rep,
string  query,
Array< string >  arguments = Array< string >(),
Object &  fields = Object(),
bool  isPost = false 
)

Performs custom query of DICOM repository using the iPACS API.

Parameters
repDICOM repository
baseendpoint for the query
arguments(optional) additional arguments to supply to the query
fields(optional) fields to submit along with query
isPost(optional) use POST method for the query
Returns
JSON that is the result of the query or undefined if the request was invalid or the repository doesn't support the iPACS API Example: var output = query(...); if(!output) { // query failed } else { // query was successful and output is an object containing the json result of the query }

◆ queryDataPoints()

Object queryDataPoints ( AbstractDicomRepository *  rep,
string  type,
string  uid,
string  form 
)

Perform query of DICOM repository for datapoints at project, study, series, or image level, and returns datapoints matching criteria.

Note
Example: VQ.queryDataPoints(rep,'study','1.2.3.4.5','annotation') queries study-level annotation datapoints on study with StudyInstanceUID 1.2.3.4.5
Parameters
repDICOM repository
typeLevel at which to query datapoints (e.g. project, studies, series, or images)
uidUID of study, series, or image for which to query datapoints. If querying project-level datapoints, leave this field blank.
formForm name of datapoint to query

◆ queryImages()

Object queryImages ( AbstractDicomRepository *  rep,
string  studyInstanceUID,
string  seriesInstanceUID 
)

Performs query of DICOM repository for images within a series, and returns images matching criteria.

Parameters
repDICOM repository
studyInstanceUIDStudyInstanceUID of study
seriesInstanceUIDSeriesInstanceUID of series

◆ querySeries()

Object querySeries ( AbstractDicomRepository *  rep,
string  studyInstanceUID 
)

Performs query of DICOM repository for series within a given study, and returns series matching criteria.

Parameters
repDICOM repository
studyInstanceUIDStudyInstanceUID of study

◆ queryStudies()

Object queryStudies ( AbstractDicomRepository *  rep,
string  patientName,
string  patientID = string(),
string  dateRange = string(),
string  studyDesc = string() 
)

Performs query of DICOM repository for studies matching argument criteria.

Parameters
repDICOM repository
patientNamePatientsName filter
patientIDPatientID filter
dateRangeDate filter
studyDescStudyDescription filter

◆ queryStudyPlan()

Object queryStudyPlan ( AbstractDicomRepository *  rep,
string  plan,
string  cohort,
string  group,
string  animal,
string  modality,
string  date,
string  event = "$0" 
)

If

Parameters
eventis omitted, the first event of the day is returned

◆ rand() [1/2]

int rand ( )

Returns a random integer.

Returns

◆ rand() [2/2]

int rand ( int  max)

Returns random positive integer less than given maximum.

Parameters
maxMaximum value of random positive integer

◆ readCSVFile()

Object readCSVFile ( string  name)

Parse a CSV file into arrays of values.

Parameters
nameThe CSV file to read
Returns
A 2D arrays containing the values in the file

◆ readFile()

Array<string> readFile ( string  fn)

Reads file into array of strings.

Parameters
fnPath to file

◆ renameFile()

bool renameFile ( string  filepath,
string  newname 
)

Renames file at given path.

Parameters
Currentpath to file
Newpath to file
Returns
bool True if file renamed successfully, false otherwise

◆ rmDir()

bool rmDir ( string  dirpath)

Removes directory at given path.

Parameters
dirpathPath to directory
Returns
bool True if directory removed successfully, false otherwise

◆ runNMCT()

void runNMCT ( )

Runs 3D Brain Atlas Tool.

Deprecated:
Please see BrainAtlasTool()

◆ saveDataViaITK()

void saveDataViaITK ( string  fn,
Index  idx 
)

Stores data to disk in ITK MHD/RAW or MHD/ZRAW file format.

Parameters
fnPath of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively.
idxIndex of data to save in Data Manager (see index())

◆ saveDataViaITK4D()

void saveDataViaITK4D ( string  fn)

Stores all data in Data Manager to disk as a single ITK 4D dataset in MHD/RAW or MHD/ZRAW file format.

Parameters
fnPath of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively.
Deprecated:
Please see DataManager::mergeData.

◆ saveScreenshot()

bool saveScreenshot ( string  fileName)

Saves screenshot of VivoQuant.

Parameters
fileNameOutput path of screenshot

◆ setConfig()

void setConfig ( string  entry,
Variant &  val,
bool  force = false 
)

Sets option in VivoQuant configuration to given value.

Parameters
entryOption in VivoQuant configuration
valDesired value
force(optional) If val is not a recognized value for the entry, determines whether the entry will be forced to take on the value (1) or not (0)

◆ setDebuggerEnabled()

void setDebuggerEnabled ( bool  toShow)

Enable debugger.

Parameters
toShowBoolean (1 = enabled, 0 = disabled0)

◆ setECRFCallback()

void setECRFCallback ( string  function)

Add callback function to execute when eCRF is loaded.

Parameters
functionText containing callback function to execute

◆ setHash()

void setHash ( string  key,
string  val 
)
inline

Sets value of key in hash.

Parameters
keyKey in hash
valValue for key

◆ setInteractive()

void setInteractive ( bool  b)
inline

Sets VivoQuant to interactive (or not)

Parameters
bDetermines whether VivoQuant is interactive (1) or not (0)

◆ setNMCTOutputFormat()

void setNMCTOutputFormat ( string  format)

Sets 3D Brain Atlas Tool output format.

Deprecated:
Please see BrainAtlasTool() and SegmentationServiceNMCT::setOutputFormat
Parameters
format"Standard" or "Master"

◆ setNMCTQuietModeOn()

void setNMCTQuietModeOn ( )

Sets 3D Brain Atlas Tool to run in Quiet Mode. Prevents output from opening automatically upon completion.

Deprecated:
Please see BrainAtlasTool() and SegmentationServiceNMCT::setQuietMode

◆ setOption()

void setOption ( string  cbname,
string  opt 
)

Set widget to given option; for use with widgets with multiple options (e.g. comboboxes)

Parameters
cbnameName of widget
optName of option

◆ setOptionObj()

void setOptionObj ( Object  obj,
string  opt 
)

Set widget to given option; for use with widgets with multiple options (e.g. comboboxes)

Note
Takes widget object as input (can be accessed by VQ.getWidget('widgetName'))
Parameters
objWidget object
optName of option

◆ setTestMode()

void setTestMode ( bool  b = true)
inline

Sets VivoQuant to test mode (or not)

Parameters
bDetermines whether VivoQuant is in test mode (1) or not (0)

◆ setVersion()

void setVersion ( string  version)

Set a string representing the script version that will be used in audit log messages.

Parameters
versionThe version string

◆ showMessage()

void showMessage ( string  msg,
bool  modal = true 
)

Displays dialog box with user-defined message.

Parameters
msgMessage displayed in dialog box
modalDetermines whether VivoQuant is inaccessible while dialog box is open (true) or accessible (false)

◆ sin()

double sin ( double  f)
inline

Returns sin of angle.

Parameters
fAngle (in radians)

◆ splitROI2DICOM()

void splitROI2DICOM ( Index  idx)

For each ROI in the 3D ROI Tool, creates a masked image of a given image in the Data Manager, where voxels outside the ROI are mapped to the given image's minimum.

Note
Example: Brain and Heart ROIs in the 3D ROI Tool. splitROI2DICOM(0) will create a masked image of the Reference image where all but the Brain ROI is masked out, and a masked image of the Reference image where all but the Heart ROI is masked out
Parameters
idIndex of image in Data Manager (see index())

◆ startTool()

string startTool ( string  tool,
string  baseDir = ".",
Array< string >  args = Array< string >() 
)

Start an external tool.

Parameters
toolThe application or external script to start
keybaseDir The working directory for the tool
keyargs The list of arguments for the tool
Returns
A string containing the status of the tool

◆ storeAsDICOM()

int storeAsDICOM ( string  fn,
Index  idx,
int  format = -1,
bool  compress = false,
bool  quiet = true 
)

Stores data to disk in DICOM file format.

Parameters
fnPath of output file.
idxIndex of data to save in Data Manager (see index())
formatThe format (equals to an index in the DICOM Save Dialog)
compressUse JPEG2000 Lossless compression
quietHide warning, error or information dialog
Note
Regarding format: 0=Multi-Frame, 1=Multi-Frame Functional Group, 2=Single Frames

◆ storeAsRaw()

bool storeAsRaw ( string  fn,
Index  idx 
)

Stores data to disk in MHD/RAW (or MHD/ZRAW) file format.

Parameters
fnPath of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively.
idxIndex of data to save in Data Manager (see index())

◆ storeData()

int storeData ( AbstractDicomRepository *  rep,
Index  idx,
int  format = -1 
)

Stores DICOM data to a DICOM repository.

Parameters
repThe DICOM repository object
idxIndex of data to save in Data Manager (see index())
formatThe format (equals to an index in the DICOM Save Dialog)
Note
Regarding format: 0=Multi-Frame, 1=Multi-Frame Functional Group, 2=Single Frames

◆ storeHash()

bool storeHash ( string  fileName)

Stores all keys and values in hash to local file.

Parameters
fileNamePath to output file in which to store hash keys and values

◆ stripCredentials()

string stripCredentials ( string  url_string)

Returns URL of DICOM repository with credentials (username and password) removed.

Parameters
url_stringFull URL with credentials

◆ submitDataPoint()

Object submitDataPoint ( AbstractDicomRepository *  rep,
string  uid,
Object &  data,
string  type = string() 
)

Submits datapoint to DICOM repository.

Note
Example: VQ.submitDataPoint(rep,'1.2.3.4.5',{text: 'This is a datapoint!'},'annotation') submits an annotation datapoint to the study with StudyInstanceUID 1.2.3.4.5 in the DICOM repository rep with text 'This is a datapoint!'
Parameters
repDICOM repository
uidUID of study, series, or image for which to submit datapoint. If submitting project-level datapoints, leave this field blank.
dataObject with datapoint fields as the object keys
typeLevel at which to submit datapoint (e.g. project, studies, series, or image)

◆ suspend()

void suspend ( string  message = string())

Suspends script and opens a modeless "Resume" dialog.

Parameters
messageString to display in dialog box

◆ waitForECRF()

bool waitForECRF ( int  timeout = 0)

Specifies time to wait for eCRF.

Parameters
timeoutTime to wait (in milliseconds)
Returns
True if the eCRF was submitted, closed or had already been submitted, False if an error occurred or if the eCRF timed out.

◆ webDisk()

Object webDisk ( string  rep)

Return IPACS WebDisk object for project in given iPACS repository.

Parameters
repDICOM repository, including URL/path to repository and path to WebDisk directory

◆ writeFile()

bool writeFile ( string  fn,
string  text 
)

Writes file to disk with given text.

Note
If file exists, will overwrite file.
Parameters
fnPath to output file
textText to write to output file