|
VivoQuant 6.3.0
|
Main VivoScript object to access other modules and perform generic actions. More...
#include <ScriptMaster.h>
Public Member Functions | |
| void | setVersion (string version) |
| Set a string representing the script version that will be used in audit log messages. | |
| string | getVersion () |
| Get the string representing the script version. | |
| 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. | |
| 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 | debug (string text) |
| Prints output to debugger and/or logfile. | |
| 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 SliceView object. | |
| Object | multiViewer () |
| Returns MultiView object. | |
| Object | controller () |
| Returns SliceView Controller object. | |
| Object | mipController () |
| Returns mipController object. | |
| Object | vtkController () |
| Returns VTK Controller object. | |
| Object | vtkViewer () |
| Returns vtkViewer 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. | |
| Object | MASTool (string libraryPath=string("")) |
| Opens Multi-Atlas Segmentation Tool, formerly known as Whole Body Atlas) | |
| 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));. | |
| 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));. | |
| 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));. | |
| 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. | |
| 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. | |
| string | counter (int c, int s) |
| Convenience function to return a 0-padded counter. | |
| void | showMessage (string msg, bool modal=true) |
| Displays dialog box with user-defined message. | |
| bool | askYesNoQuestion (string msg, bool modal=true) |
| Displays dialog box with "Yes" or "No" option. | |
| 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. | |
| VariantMap | getValues (string title, VariantMap &map, bool modal=true) |
| Displays a dialog requesting multiple user inputs in a single form. | |
| Object | getLocalPath (string caption="Select directory:", string startDir=string(".")) |
| Returns path of directory selected by user in file dialog. | |
| Object | getSavePath (string caption=string("Select output file:"), string startDir=string("."), string filter=string()) |
| Returns path to file selected by user in file dialog. | |
| Array< string > | getLocalFiles (string caption="Select files:", string startDir=string(".")) |
| Returns array of paths to files selected by user in file dialog. | |
| string | getVivoScriptDir () |
| Returns VivoScript directory. | |
| void | mkdir (string path, string subdir) |
| Creates sub-directory at specified path. | |
| bool | fileExists (string path) |
| Checks whether file at specified path exists. | |
| bool | folderExists (string path) |
| Checks whether file at specified path exists. | |
| bool | openFileExternally (string path) |
| Opens a local file in an external application. | |
| 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) | |
| 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) | |
| 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. | |
| Object | dcmRep (string text) |
| Creates and returns a DICOM repository object. | |
| 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. | |
| 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. | |
| Object | querySeries (AbstractDicomRepository *rep, string studyInstanceUID) |
| Performs query of DICOM repository for series within a given study, and returns series matching criteria. | |
| Object | queryImages (AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID) |
| Performs query of DICOM repository for images within a series, and returns images matching criteria. | |
| 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. | |
| 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. | |
| Object | downloadImages (AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string()) |
| Downloads image to cache. | |
| Object | downloadImages (string targetDir, AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string()) |
| Downloads image to a location on disk. | |
| Object | downloadImages (string targetDir, bool forceRedownload, AbstractDicomRepository *rep, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string()) |
| Downloads image to a location on disk. | |
| 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. | |
| Object | submitDataPoint (AbstractDicomRepository *rep, string uid, Object &data, string type=string()) |
| Submits datapoint to DICOM repository. | |
| 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. | |
| Object | logMessage (AbstractDicomRepository *rep, string msg, string type=string()) |
| Creates a log message on the given DICOM repository. | |
| void | auditTrailMessage (string msg, string project="/", string type=string()) |
| Creates an audit trail message on the current repository. | |
| 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. | |
| void | dicomBrowserLoad (DicomBrowser *dcmBrowser, string studyInstanceUID, string seriesInstanceUID, string sopInstanceUID=string()) |
| Downloads image(s) from DICOM repository and loads them into Data Manager. | |
| 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. | |
| void | logWidgets (Object target, bool showInteractive=true, bool showNonInteractive=true) |
| Logs the widget tree of any IDumpableWidget to the debug output. | |
| void | logOperatorWidgets (bool showInteractive=true, bool showNonInteractive=true) |
| Logs the widget tree of the current view's active operator dialog to the debug output. | |
| void | beginWidgetDumpHtml (string filePath) |
| Opens an HTML file and writes the document header for a widget dump session. | |
| void | dumpWidgetsHtml (Object target, bool showInteractive=true, bool showNonInteractive=true) |
| Dumps the widget tree of any IDumpableWidget into the active HTML session. | |
| void | dumpOperatorWidgetsHtml (bool showInteractive=true, bool showNonInteractive=true) |
| Dumps the widget tree of the current view's active operator dialog into the active HTML session. | |
| void | endWidgetDumpHtml () |
| Closes the active HTML widget dump session by writing the document footer. | |
| void | beginWidgetDumpJson (string filePath) |
| Opens a JSON widget dump session. | |
| void | dumpWidgetsJson (Object target) |
| Dumps the widget tree of any IDumpableWidget into the active JSON session. | |
| void | dumpOperatorWidgetsJson () |
| Dumps the widget tree of the current view's active operator dialog into the active JSON session. | |
| void | endWidgetDumpJson () |
| Closes the active JSON widget dump session and writes all accumulated data to disk. | |
| 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. | |
| Array< string > | availableItemsObj (Object obj) |
| Returns available items from widget with multiple options. | |
| 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) | |
| void | setOptionObj (Object obj, string opt) |
| Set widget to given option; for use with widgets with multiple options (e.g. comboboxes) | |
| string | stripCredentials (string url_string) |
| Returns URL of DICOM repository with credentials (username and password) removed. | |
| void | setConfig (string entry, Variant &val, bool force=false) |
| Sets option in VivoQuant configuration to given value. | |
| string | getConfig (string entry, string defaultValue=string()) |
| Returns current value of option in VivoQuant configuration. | |
| void | forceUpdateTheme () |
| Force the UI theme to update. | |
| 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. | |
| bool | deleteFile (string filepath) |
| Deletes file at given path. | |
| bool | copyFile (string filepath, string newpath) |
| Copies file from one path to another. | |
| bool | renameFile (string filepath, string newname) |
| Renames file at given path. | |
| bool | rmDir (string dirpath) |
| Removes directory at given path. | |
| string | preProcess (string protocol, bool showDialog=false) |
| Runs Pre-Processing Tool tool with the given protocol. | |
| Object | PreProcessingTool (bool showDialog=true) |
| Opens the Pre-Processing Tool. | |
| int | storeData (AbstractDicomRepository *rep, Index idx, DICOMImageFormat format, bool compress=false) |
| Stores DICOM data to a DICOM repository. | |
| int | storeDataByTimepoint (AbstractDicomRepository *rep, int idx, DICOMImageFormat format, bool compress=false, TimePointsSettings timepointOption=TimePointsSettings::AllTimePoints, TimepointFilesSettings timepointPerFileOption=TimepointFilesSettings::SingleFileForAllTimepoints) |
| Stores DICOM data to a DICOM repository, with the option to save by timepoint. | |
| bool | storeAsRaw (string filepath, Index idx) |
| Stores data to disk in MHD/RAW (or MHD/ZRAW) file format. | |
| int | storeAsDICOM (string filepath, Index idx, DICOMImageFormat format, bool compress=false, bool quiet=true) |
| Stores data to disk in DICOM file format. | |
| int | storeAsDICOMByTimepoint (string filepath, int idx, DICOMImageFormat format, bool compress=false, TimePointsSettings timepointOption=TimePointsSettings::AllTimePoints, TimepointFilesSettings timepointPerFileOption=TimepointFilesSettings::SingleFileForAllTimepoints) |
| Stores data to disk in DICOM file format, with the option to save by timepoint. | |
| void | saveDataViaITK4D (string filepath) |
| Stores all data in Data Manager to disk as a single ITK 4D dataset in MHD/RAW or MHD/ZRAW file format. | |
| void | saveDataViaITK (string filepath, Index idx) |
| Stores data to disk in ITK MHD/RAW or MHD/ZRAW file format. | |
| bool | writeFile (string filepath, string text) |
| Writes file to disk with given text. | |
| bool | appendFile (string filepath, string text) |
| Appends text to file on disk. | |
| Array< string > | readFile (string filepath) |
| Reads file into array of strings. | |
| 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. | |
| bool | saveScreenshot (string fileName) |
| Saves screenshot of VivoQuant. | |
| string | applicationName () |
| Returns name + version of current instance of VivoQuant. | |
| Object | zipTool () |
| Returns Zip Tool object. | |
| double | sin (double f) |
| Returns sin of angle. | |
| double | cos (double f) |
| Returns cosine of angle. | |
| void | evalDialog (string text=string()) |
| Opens VivoScript evaluation window with given text. | |
| 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. | |
| 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. | |
| int | rand () |
| Returns a random integer. | |
| int | rand (int max) |
| Returns random positive integer less than given maximum. | |
| float | frand () |
| Returns a random float. | |
| void | suspend (string message=string()) |
| Suspends script and opens a modeless "Resume" dialog. | |
| string | getHash (string key, string def=string()) |
| Returns current value of key in hash. | |
| double | getHashNum (string key, double def=0.0f) |
| Returns current numerical value of key in hash. | |
| Array< string > | getHashKeys () |
| Returns array of all keys in hash. | |
| void | setHash (string key, string val) |
| Sets value of key in hash. | |
| void | clearHash () |
| Clears all keys and values stored in hash. | |
| bool | storeHash (string fileName) |
| Stores all keys and values in hash to local file. | |
| bool | loadHash (string fileName) |
| Loads local file, containing hash keys and values, to VivoQuant's persistent hash. | |
| string | getEnv (string key, string defaultValue=string()) |
| Get the system's environment variables. | |
| string | startTool (string tool, string baseDir=".", Array< string > args=Array< string >()) |
| Start an external tool. | |
| 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. | |
| Object | getROIStats (Index idx) |
| Returns array of ROI quantification table information for given dataset and ALL ROIs. | |
| string | atlasPath () |
| Returns path where atlases are stored. | |
| 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. | |
| Object | readCSVFile (string name) |
| Parse a CSV file into arrays of values. | |
| string | getDefaultPal (string modality, int i) |
| get default palette from modality | |
| string | getOS () |
| get current Operating System name | |
Main VivoScript object to access other modules and perform generic actions.
| bool appendFile | ( | string | filepath, |
| string | text | ||
| ) |
Appends text to file on disk.
| filepath | Path of output file |
| text | Text to write to output file |
| 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.
| ask | If true, a prompt will ask the user to enter a reason if they do something that cancels the script while it is running |
| bool askYesNoQuestion | ( | string | msg, |
| bool | modal = true |
||
| ) |
Displays dialog box with "Yes" or "No" option.
| msg | Message displayed in dialog box |
| modal | Determines whether VivoQuant is inaccesible while dialog box is open (true) or accesible (false) |
| void auditTrailMessage | ( | string | msg, |
| string | project = "/", |
||
| string | type = string() |
||
| ) |
Creates an audit trail message on the current repository.
| msg | The message to be logged |
| project | The project to log the message to |
| type | Message type |
| Array< string > availableItems | ( | string | name | ) |
Returns available items from widget with multiple options.
| name | Name of widget |
| Array< string > availableItemsObj | ( | Object | obj | ) |
Returns available items from widget with multiple options.
| obj | Widget object, which can be accessed by ScriptMaster::getWidget |
| void beginWidgetDumpHtml | ( | string | filePath | ) |
Opens an HTML file and writes the document header for a widget dump session.
Must be called before any dumpWidgetsHtml or dumpOperatorWidgetsHtml calls. Close the session with endWidgetDumpHtml.
| filePath | Path to the HTML file to create. Overwrites any existing file. |
| void beginWidgetDumpJson | ( | string | filePath | ) |
Opens a JSON widget dump session.
Initialises an internal buffer that accumulates widget sections across subsequent dumpWidgetsJson or dumpOperatorWidgetsJson calls. Flush the session to disk with endWidgetDumpJson.
| filePath | Path to the JSON file to write when endWidgetDumpJson is called. |
| Object BrainAtlasTool | ( | bool | visible = true, |
| bool | quiet = false |
||
| ) |
Opens the Brain Atlas Tool.
| visible | Whether or not the tool dialog is shown upon being created |
| quiet | Whether or not the tool is in quiet mode. In quiet mode no warnings or popups will be displayed. |
| bool copyFile | ( | string | filepath, |
| string | newpath | ||
| ) |
Copies file from one path to another.
| Current | path to file |
| New | path to file |
|
inline |
Returns cosine of angle.
| f | Angle (in radians) |
|
inline |
Convenience function to return a 0-padded counter.
| c | Number to pad |
| s | Number of digits in padded output |
| Object dcmRep | ( | string | text | ) |
Creates and returns a DICOM repository object.
| text | Location 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://". |
| void debug | ( | string | text | ) |
Prints output to debugger and/or logfile.
| text | String to be printed |
| bool deleteFile | ( | string | filepath | ) |
Deletes file at given path.
| filepath | Path to file |
| bool deletePath | ( | string | path | ) |
Deletes folder and all its contents at given path.
| path | to be deleted |
| Object dicomBrowser | ( | AbstractDicomRepository * | rep | ) |
Returns VivoQuant's Data Browser object for a given DICOM repository.
| rep | DICOM repository to use with Data Browser object |
| 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.
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study in which image(s) are found |
| seriesInstanceUID | SeriesInstanceUID of series in which image(s) are found |
| append | Determines 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 |
| void dicomBrowserLoad | ( | DicomBrowser * | dcmBrowser, |
| string | studyInstanceUID, | ||
| string | seriesInstanceUID, | ||
| string | sopInstanceUID = string() |
||
| ) |
Downloads image(s) from DICOM repository and loads them into Data Manager.
| dcmBrowser | DICOM browser object |
| studyInstanceUID | StudyInstanceUID of study in which image(s) are found |
| seriesInstanceUID | SeriesInstanceUID of series in which image(s) are found |
| sopInstanceUID | SOPInstanceUID of image(s) |
| Object downloadImages | ( | AbstractDicomRepository * | rep, |
| string | studyInstanceUID, | ||
| string | seriesInstanceUID, | ||
| string | sopInstanceUID = string() |
||
| ) |
Downloads image to cache.
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study |
| seriesInstanceUID | SeriesInstanceUID of series |
| sopInstanceUID | SOPInstanceUID of image |
| Object downloadImages | ( | string | targetDir, |
| AbstractDicomRepository * | rep, | ||
| string | studyInstanceUID, | ||
| string | seriesInstanceUID, | ||
| string | sopInstanceUID = string() |
||
| ) |
Downloads image to a location on disk.
| targetDir | Desired location on disk |
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study |
| seriesInstanceUID | SeriesInstanceUID of series |
| sopInstanceUID | SOPInstanceUID of image |
| Object downloadImages | ( | string | targetDir, |
| bool | forceRedownload, | ||
| AbstractDicomRepository * | rep, | ||
| string | studyInstanceUID, | ||
| string | seriesInstanceUID, | ||
| string | sopInstanceUID = string() |
||
| ) |
Downloads image to a location on disk.
| targetDir | Desired location on disk |
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study |
| seriesInstanceUID | SeriesInstanceUID of series |
| sopInstanceUID | SOPInstanceUID of image |
| forceRedownload | whether to re-download if the image is already in the cache |
| void dumpOperatorWidgetsHtml | ( | bool | showInteractive = true, |
| bool | showNonInteractive = true |
||
| ) |
Dumps the widget tree of the current view's active operator dialog into the active HTML session.
Appends a collapsible section to the HTML file opened by beginWidgetDumpHtml. The current view and operator name are captured automatically as the section heading. Must be called between beginWidgetDumpHtml and endWidgetDumpHtml.
| showInteractive | Whether to include interactive widgets in the output. |
| showNonInteractive | Whether to include structural non-interactive named widgets. |
| void dumpOperatorWidgetsJson | ( | ) |
Dumps the widget tree of the current view's active operator dialog into the active JSON session.
Accumulates a section into the internal buffer started by beginWidgetDumpJson. The current view and operator name are captured automatically as the section context label. Must be called between beginWidgetDumpJson and endWidgetDumpJson.
| void dumpWidgetsHtml | ( | Object | target, |
| bool | showInteractive = true, |
||
| bool | showNonInteractive = true |
||
| ) |
Dumps the widget tree of any IDumpableWidget into the active HTML session.
Appends a collapsible section to the HTML file opened by beginWidgetDumpHtml. Interactive widgets are highlighted in teal, structural widgets in grey. Must be called between beginWidgetDumpHtml and endWidgetDumpHtml.
| target | A Object wrapping an object that implements IDumpableWidget. |
| showInteractive | Whether to include interactive widgets in the output. |
| showNonInteractive | Whether to include structural non-interactive named widgets. |
| void dumpWidgetsJson | ( | Object | target | ) |
Dumps the widget tree of any IDumpableWidget into the active JSON session.
Accumulates a section into the internal buffer started by beginWidgetDumpJson. Only interactive widgets are included. Must be called between beginWidgetDumpJson and endWidgetDumpJson.
| target | A Object wrapping an object that implements IDumpableWidget. |
| void endWidgetDumpHtml | ( | ) |
Closes the active HTML widget dump session by writing the document footer.
Must be called after all dumpWidgetsHtml or dumpOperatorWidgetsHtml calls to produce a valid HTML file. Clears the active session path.
| void endWidgetDumpJson | ( | ) |
Closes the active JSON widget dump session and writes all accumulated data to disk.
Produces a JSON array of sections, each containing a context label and a flat array of widgets with name, className, tooltip, interactive, and depth fields. Clears the internal buffer and session path after writing.
| void evalDialog | ( | string | text = string() | ) |
Opens VivoScript evaluation window with given text.
| text | Text to write in VivoScript evaluation window |
| bool fileExists | ( | string | path | ) |
Checks whether file at specified path exists.
| path | Full path to file |
| 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));.
| i | The first level position |
| bool folderExists | ( | string | path | ) |
Checks whether file at specified path exists.
| path | Full path to folder |
| float frand | ( | ) |
Returns a random float.
| string getConfig | ( | string | entry, |
| string | defaultValue = string() |
||
| ) |
Returns current value of option in VivoQuant configuration.
| entry | Option in VivoQuant configuration |
| 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.
| rep | DICOM repository |
| tag | DICOM tag |
| studyInstanceUID | StudyInstanceUID of study |
| seriesInstanceUID | SeriesInstanceUID of series |
| sopInstanceUID | SOPInstanceUID of image |
| string getDefaultPal | ( | string | modality, |
| int | i | ||
| ) |
get default palette from modality
| image | modality |
| index | in datamanager |
| string getEnv | ( | string | key, |
| string | defaultValue = string() |
||
| ) |
Get the system's environment variables.
| key | Name of system environment variable |
| defaultValue | The default value if they key does not exists |
| double getHalfLife | ( | string | name | ) |
Get an isotope's half life.
| name | The isotope's name |
|
inline |
Returns current value of key in hash.
| key | Key in hash |
|
inline |
Returns current numerical value of key in hash.
| Key | in hash |
| 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.
| i | The first level position |
| 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.
| i | The first level position (parent) |
| j | The second level position (child) |
| Array< string > getLocalFiles | ( | string | caption = "Select files:", |
| string | startDir = string(".") |
||
| ) |
Returns array of paths to files selected by user in file dialog.
| caption | Text in title of dialog |
| startDir | Default path at which the file dialog starts |
| Object getLocalPath | ( | string | caption = "Select directory:", |
| string | startDir = string(".") |
||
| ) |
Returns path of directory selected by user in file dialog.
| caption | Text in title of dialog |
| startDir | Default path at which file dialog starts |
| string getOS | ( | ) |
get current Operating System name
| Object getROIStats | ( | Index | idx | ) |
Returns array of ROI quantification table information for given dataset and ALL ROIs.
| idx | Index of timestamp dataset from which to calculate stats (see flatIndex()) |
| Object getROIStats | ( | Index | idx, |
| int | roiID, | ||
| int | layerID = -1 |
||
| ) |
Returns object with ROI quantification table information for given dataset and ROI.
| idx | Index of timestamp dataset from which to calculate stats (see flatIndex()) |
| roiID | Index of ROI for which to calculate stats |
| Object getSavePath | ( | string | caption = string("Select output file:"), |
| string | startDir = string("."), |
||
| string | filter = string() |
||
| ) |
Returns path to file selected by user in file dialog.
| caption | Text in title of dialog |
| startDir | Default path at which file dialog starts |
| filter | File type filter for file dialog |
| VariantMap getValues | ( | string | title, |
| VariantMap & | map, | ||
| bool | modal = true |
||
| ) |
Displays a dialog requesting multiple user inputs in a single form.
Minimal example:
Creates a modal or non-modal dialog containing one input widget per entry in map. Each map entry produces a labeled row in the form, where the key is used as the label and the value describes the input type and its parameters.
| title | Window title of the dialog. |
| map | A map from label text to an input specification. The specification may be either a string or a VariantList: |
Supported explicit input types:
All parameters are optional unless otherwise noted.
Implicit behavior:
For item inputs, the list of items must be provided.
| modal | If true, the dialog is modal and blocks interaction with the rest of the application while open. |
| string getVersion | ( | ) |
Get the string representing the script version.
| version | The version string |
| 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. Widget names can be revealed by clicking the Lookup button on the VivoScript toolbar and clicking the widget.
| name | Name of widget. |
Slice View
Reorientation/Registration | 3D ROI Tool | Cropping | Distance/Annotation | Modeling | Arithmetics | Time Series | Filtering | Splitting
Multi View
Layout | Distance/Annotation | Modeling | Arithmetics | Filtering | Splitting
Tile View
Time Series
| 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));.
| i | The first level position |
| 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));.
| i | The first level position (parent) |
| j | The second level position (child) |
| bool loadHash | ( | string | fileName | ) |
Loads local file, containing hash keys and values, to VivoQuant's persistent hash.
| fileName | Path to file |
| Object loadRepository | ( | string | name | ) |
Returns DICOM repository object from DICOM repository saved in VivoQuant.
| name | Name of DICOM repository saved in VivoQuant |
| 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.
| idx | Index where opened data should be positioned in the DataManager (see index()) |
| imgFiles | Index List of RGB image to load as a volume |
| voxX | Expected X voxel size |
| voxY | Expected Y voxel size |
| voxZ | Expected Z voxel size |
| rgbRep | Representation of RGB values (0=Red, 1=Green, 2=Blue, 3=AVG, 4=SUM, 5=MAX, 6=MIN) |
| forcePlanar | Force volume to load as planar |
| Object logMessage | ( | AbstractDicomRepository * | rep, |
| string | msg, | ||
| string | type = string() |
||
| ) |
Creates a log message on the given DICOM repository.
| rep | The DicomRepository object |
| msg | The message to be logged |
| type | Message type |
| 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.
| dataIndex | The data index (see index()) |
| msg | The message to be logged |
| noipacsTitle | Default no iPACS title for warning |
| type | Message type |
| void logOperatorWidgets | ( | bool | showInteractive = true, |
| bool | showNonInteractive = true |
||
| ) |
Logs the widget tree of the current view's active operator dialog to the debug output.
Resolves the root widget automatically from the current view and operator context. Use logWidgets for logging arbitrary IDumpableWidget targets.
| showInteractive | Whether to log interactive widgets (QComboBox, QPushButton, etc). |
| showNonInteractive | Whether to log structural non-interactive named widgets. |
| void logWidgets | ( | Object | target, |
| bool | showInteractive = true, |
||
| bool | showNonInteractive = true |
||
| ) |
Logs the widget tree of any IDumpableWidget to the debug output.
The context label and root widget are resolved automatically via IDumpableWidget::dumpContext and IDumpableWidget::getRootWidget.
| target | A Object wrapping an object that implements IDumpableWidget. |
| showInteractive | Whether to log interactive widgets (QComboBox, QPushButton, etc). |
| showNonInteractive | Whether to log structural non-interactive named widgets. |
| 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.
| dir | Directory on local disk |
| nameFilter | Expression to use to filter files. Wildcard (*) is acceptable. |
| Object MASTool | ( | string | libraryPath = string("") | ) |
Opens Multi-Atlas Segmentation Tool, formerly known as Whole Body Atlas)
| libraryPath | The path of the library to be used |
| void mkdir | ( | string | path, |
| string | subdir | ||
| ) |
Creates sub-directory at specified path.
| path | Path in which to create new subdirectory |
| subdir | Name of new subdirectory |
| bool openFileExternally | ( | string | path | ) |
Opens a local file in an external application.
| path | Full path to file |
| string preProcess | ( | string | protocol, |
| bool | showDialog = false |
||
| ) |
Runs Pre-Processing Tool tool with the given protocol.
| protocol | String with protocol |
| showDialog | Whether or not the tool dialog is shown upon being created |
| Object PreProcessingTool | ( | bool | showDialog = true | ) |
Opens the Pre-Processing Tool.
| showDialog | Whether or not the tool dialog is shown upon being created |
| 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.
| label | Text in title of dialog box |
| cancelButtonText | Text in button that cancels process |
| minimum | Minimum value progress dialog object can take |
| maxmimum | Maximum value progress dialog object can take |
| 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.
| rep | DICOM repository |
| base | endpoint 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 |
| 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.
| rep | DICOM repository |
| type | Level at which to query datapoints (e.g. project, studies, series, or images) |
| uid | UID of study, series, or image for which to query datapoints. If querying project-level datapoints, leave this field blank. |
| form | Form name of datapoint to query |
| Object queryImages | ( | AbstractDicomRepository * | rep, |
| string | studyInstanceUID, | ||
| string | seriesInstanceUID | ||
| ) |
Performs query of DICOM repository for images within a series, and returns images matching criteria.
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study |
| seriesInstanceUID | SeriesInstanceUID of series |
| Object querySeries | ( | AbstractDicomRepository * | rep, |
| string | studyInstanceUID | ||
| ) |
Performs query of DICOM repository for series within a given study, and returns series matching criteria.
| rep | DICOM repository |
| studyInstanceUID | StudyInstanceUID of study |
| 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.
| rep | DICOM repository |
| patientName | PatientsName filter |
| patientID | PatientID filter |
| dateRange | Date filter |
| studyDesc | StudyDescription filter |
| Object queryStudyPlan | ( | AbstractDicomRepository * | rep, |
| string | plan, | ||
| string | cohort, | ||
| string | group, | ||
| string | animal, | ||
| string | modality, | ||
| string | date, | ||
| string | event = "$0" |
||
| ) |
If
| event | is omitted, the first event of the day is returned |
| int rand | ( | ) |
Returns a random integer.
| int rand | ( | int | max | ) |
Returns random positive integer less than given maximum.
| max | Maximum value of random positive integer |
| Object readCSVFile | ( | string | name | ) |
Parse a CSV file into arrays of values.
| name | The CSV file to read |
| Array< string > readFile | ( | string | filepath | ) |
Reads file into array of strings.
| filepath | Path to file |
| bool renameFile | ( | string | filepath, |
| string | newname | ||
| ) |
Renames file at given path.
| Current | path to file |
| New | path to file |
| bool rmDir | ( | string | dirpath | ) |
Removes directory at given path.
| dirpath | Path to directory |
| void saveDataViaITK | ( | string | filepath, |
| Index | idx | ||
| ) |
Stores data to disk in ITK MHD/RAW or MHD/ZRAW file format.
| filepath | Path of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively. |
| idx | Index of data to save in Data Manager (see index()) |
| void saveDataViaITK4D | ( | string | filepath | ) |
Stores all data in Data Manager to disk as a single ITK 4D dataset in MHD/RAW or MHD/ZRAW file format.
| filepath | Path of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively. |
| bool saveScreenshot | ( | string | fileName | ) |
Saves screenshot of VivoQuant.
| fileName | Output path of screenshot |
| void setConfig | ( | string | entry, |
| Variant & | val, | ||
| bool | force = false |
||
| ) |
Sets option in VivoQuant configuration to given value.
| entry | Option in VivoQuant configuration |
| val | Desired 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) |
|
inline |
Sets value of key in hash.
| key | Key in hash |
| val | Value for key |
|
inline |
Sets VivoQuant to interactive (or not)
| b | Determines whether VivoQuant is interactive (1) or not (0) |
| void setOption | ( | string | cbname, |
| string | opt | ||
| ) |
Set widget to given option; for use with widgets with multiple options (e.g. comboboxes)
| cbname | Name of widget |
| opt | Name of option |
| void setOptionObj | ( | Object | obj, |
| string | opt | ||
| ) |
Set widget to given option; for use with widgets with multiple options (e.g. comboboxes)
| obj | Widget object |
| opt | Name of option |
|
inline |
Sets VivoQuant to test mode (or not)
| b | Determines whether VivoQuant is in test mode (1) or not (0) |
| void setVersion | ( | string | version | ) |
Set a string representing the script version that will be used in audit log messages.
| version | The version string |
| void showMessage | ( | string | msg, |
| bool | modal = true |
||
| ) |
Displays dialog box with user-defined message.
| msg | Message displayed in dialog box |
| modal | Determines whether VivoQuant is inaccessible while dialog box is open (true) or accessible (false) |
|
inline |
Returns sin of angle.
| f | Angle (in radians) |
| 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.
| id | Index of image in Data Manager (see index()) |
| string startTool | ( | string | tool, |
| string | baseDir = ".", |
||
| Array< string > | args = Array< string >() |
||
| ) |
Start an external tool.
| tool | The application or external script to start |
| key | baseDir The working directory for the tool |
| key | args The list of arguments for the tool |
| int storeAsDICOM | ( | string | filepath, |
| Index | idx, | ||
| DICOMImageFormat | format, | ||
| bool | compress = false, |
||
| bool | quiet = true |
||
| ) |
Stores data to disk in DICOM file format.
| filepath | Path of output file. |
| idx | Index of data to save in DataManager (see index()) |
| format | A value of VQEnum::DICOMImageFormat |
| compress | Use JPEG2000 Lossless compression |
| quiet | Hide warning, error or information dialog |
| int storeAsDICOMByTimepoint | ( | string | filepath, |
| int | idx, | ||
| DICOMImageFormat | format, | ||
| bool | compress = false, |
||
| TimePointsSettings | timepointOption = TimePointsSettings::AllTimePoints, |
||
| TimepointFilesSettings | timepointPerFileOption = TimepointFilesSettings::SingleFileForAllTimepoints |
||
| ) |
Stores data to disk in DICOM file format, with the option to save by timepoint.
| filepath | Path of output file |
| idx | Index of data to save in DataManager |
| format | A value of VQEnum::DICOMImageFormat |
| compress | Use JPEG2000 Lossless compression |
| timepointOption | Selection of timepoints from VQEnum::TimePointsSettings |
| timepointPerFileOption | Selection of output files from VQEnum::TimepointFilesSettings To save current timepoint, first move to the desired timepoint using: VQ.dataManager().setDynamicActive(VQ.index(idx), timepoint_idx); |
| bool storeAsRaw | ( | string | filepath, |
| Index | idx | ||
| ) |
Stores data to disk in MHD/RAW (or MHD/ZRAW) file format.
| filepath | Path of output file. Note: should end in .RAW or .ZRAW to output MHD/RAW or MHD/ZRAW pair, respectively. |
| idx | Index of data to save in Data Manager (see index()) |
| int storeData | ( | AbstractDicomRepository * | rep, |
| Index | idx, | ||
| DICOMImageFormat | format, | ||
| bool | compress = false |
||
| ) |
Stores DICOM data to a DICOM repository.
| rep | The DICOM repository object |
| idx | Index of data to save in DataManager (see index()) VQEnum::DICOMImageFormat |
| format | A value of VQEnum::DICOMImageFormat |
| compress | Use JPEG2000 Lossless compression |
| int storeDataByTimepoint | ( | AbstractDicomRepository * | rep, |
| int | idx, | ||
| DICOMImageFormat | format, | ||
| bool | compress = false, |
||
| TimePointsSettings | timepointOption = TimePointsSettings::AllTimePoints, |
||
| TimepointFilesSettings | timepointPerFileOption = TimepointFilesSettings::SingleFileForAllTimepoints |
||
| ) |
Stores DICOM data to a DICOM repository, with the option to save by timepoint.
| rep | The DICOM repository object |
| idx | Index of data to save in DataManager |
| format | A value of VQEnum::DICOMImageFormat |
| compress | Use JPEG2000 Lossless compression |
| timepointOption | For dynamic data, 0=Save all timepoints, 1=Save current timepoint. Ignored for static data. |
| timepointPerFileOption | For dynamic images, 0=In a single file, 1=One file per timepoint. Ignored for static data. |
| bool storeHash | ( | string | fileName | ) |
Stores all keys and values in hash to local file.
| fileName | Path to output file in which to store hash keys and values |
| string stripCredentials | ( | string | url_string | ) |
Returns URL of DICOM repository with credentials (username and password) removed.
| url_string | Full URL with credentials |
| Object submitDataPoint | ( | AbstractDicomRepository * | rep, |
| string | uid, | ||
| Object & | data, | ||
| string | type = string() |
||
| ) |
Submits datapoint to DICOM repository.
| rep | DICOM repository |
| uid | UID of study, series, or image for which to submit datapoint. If submitting project-level datapoints, leave this field blank. |
| data | Object with datapoint fields as the object keys |
| type | Level at which to submit datapoint (e.g. project, studies, series, or image) |
| void suspend | ( | string | message = string() | ) |
Suspends script and opens a modeless "Resume" dialog.
| message | String to display in dialog box |
| Object webDisk | ( | string | rep | ) |
Return IPACS WebDisk object for project in given iPACS repository.
| rep | DICOM repository, including URL/path to repository and path to WebDisk directory |
| bool writeFile | ( | string | filepath, |
| string | text | ||
| ) |
Writes file to disk with given text.
| filepath | Path to output file |
| text | Text to write to output file |