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

Description

Object for accessing the UI's main window functions.

This object can be used to perform toolbar related actions or to change the current view / operator (see setViewMode()).

See also VQ.mainWin() to obtain this object.

Public Slots

void signalChangeThemeMode ()
 Receives a signal from ThemeManager about a change in the Configuration UI to change the thread, or a signal from the theme monitoring thread that the system has automatically changed from Light to Dark mode.
void loadDCM (string fileArg)
 Load DICOM via file list.
void startDcmBrowser (string dir=string())
 Load DICOM browser from command line, optionally at a specific directory.
void importBrukerMR (string directory=string())
 Imports a Bruker file via dialog box.
void zoomIn ()
 Zooms in the Display.
void zoomOut ()
 Zooms out of the Display.
void normalSize ()
 Sets the slice images to their original size.
void toggleFullScreen ()
 Switches the users viewer settings so that the entire computer screen displays VivoQuant.
void toggleShowRGB (bool b)
 Toggles between 3 channel visualization and 1 channel visualization.
void enableShowROIs (bool b)
 Enables or disables the display of ROIs (Regions of Interest).
void showManual ()
 Opens the VivoQuant Manual.
void launchLogFile ()
 Opens the current VivoQuant log file.
void scaleImage (float factor)
 Scales the images in the Display to a desired size.
void enableOpt (int mod, bool enable)
 Enable VQ mainwin UI functions based on image loaded state.
void checkForUpdate (bool manualCheck=false)
 Checks if there is a newer version of VQ available.
void forceSettingsMigrationCheck ()
 Ask the user if they want to run the migration check on the next VivoQuant session and close the application.
void showMinMaxTool ()
 Displays the 'Min/Max' Tool.
void showBrainAtlasTool ()
 Displays the 'Brain Atlas' Tool.
void showWorklistTool ()
 Displays the 'Worklist' Tool.
void showHistogram ()
 Displays the 'Histogram' tool User Interface.
void bedRemoval ()
 Runs the 'Bed Removal' module.
void advancedBedRemoval ()
 Opens the 'Bed Removal' tool User Interface.
void matrixManipulationTool ()
 Opens the 'Matrix Manipulation Tool' User Interface.
void showHints ()
 Opens the 'Hints' User Interface.
void setupLayout2x2 ()
 Sets the Display layout to be 2x2.
void setupLayout1x4 ()
 Sets the Display layout to be 1x4.
void setupLayoutMIP ()
 Sets the Display layout to display only the MIP view.
void setupLayoutTrans ()
 Sets the Display layout to display only the Transversal Slice View.
void setupLayoutTransverse ()
 Sets the Display layout to display only the Transversal Slice View.
void setupLayoutSagittal ()
 Sets the Display layout to display only the Sagittal Slice View.
void setupLayoutCoronal ()
 Sets the Display layout to display only the Coronal Slice View.
void setupLayoutSlice ()
 Sets the Display to the 'Slices Only' layout.
void toggleCrosshair ()
 Toggles the Crosshair on/off.
void showConfig ()
 Opens the 'Configuration' User Interface.
void showCalibCTGeometrical ()
 Opens the 'NanoSPECT/CT Geometrical Calibration' User Interface.
void showCalibMMP ()
 Opens the 'MultiPlexing-MultiPinhole Calibration' User Interface.
void switchShowCursorInfo (bool b)
 Toggle the Cursor Info Widget to replace the standard tool tip.
void showVQDICOM ()
 Opens the VQ DICOM header User Interface.
void renameDICOM ()
 Opens the 'Rename DICOM files' User Interface.
void relabelDICOMStudies (bool quiet=false)
 Opens the 'Relabel DICOM Series' User Interface.
void anonymizeDICOM (bool quiet=false)
 Opens the 'DICOM Anonymizer' User Interface.
void closeAnonymizeDICOM ()
 Closes the 'DICOM Anonymizer' User Interface.
void closeDICOMRelabeler ()
 Closes the 'DICOM Relabeler' User Interface.
void imageToCapture ()
 Opens the 'Open Image File' User Interface.
void saveSession (string name=string(), bool quiet=false)
 Saves a VivoQuant session.
void loadSession ()
 Opens the 'Load Session' User Interface.
void loadSession (string name, bool quiet=false)
 Opens a VivoQuant session.
void exportSession ()
 Opens the 'Export Session' User Interface to export a session to the current iPACS Repository in use.
void toggleVCView ()
 Toggles on/off the 'Visual Control' tool.
void toggleMCView ()
 Toggles on/off the 'MIP Control' tool.
void toggleDMView ()
 Toggles on/off the 'Data Manager' tool.
void toggleMinMaxTool ()
 Toggles on/off the 'Min/Max' tool.
void toggleWorkflowWidget ()
 Toggles on/off the 'Workflow' tool.
void openFromIPACSDialog ()
 Opens the 'Open from iPACS Dialog' User Interface.
void undo ()
 "Un-does" the previous action completed in VivoQuant
void redo ()
 "Re-does" the previous action completed in VivoQuant
void resetView ()
 Resets the view transform for the current view.
void showMModeSegmentationTool ()
 Opens the 'M-Mode Segmentation Tool' User Interface.
void openCorthicknessTool ()
 Open Cortical Thickness Tool.
void showStopRecordingButton ()
 Shows the 'Stop Recording' button.
void removeStopRecordingButton ()
 Removes the 'Stop Recording' button.
void updateRecTime (string stopRecTime)
 Updates the time on 'Stop Recording' button.

Public Member Functions

bool setViewMode (string vm, string op=string())
 Sets the view mode and active operator.
virtual QList< QAbstractViewWidget * > getViews ()
 Get the currently active views.
void resizeWindow (int width, int height)
 Set the size of the VivoQuant window in pixels.
void updateDisplay (bool include3D)
 Rerenders the display.
Array< string > saveImage (VariantMap &options)
 Saves an image using a flexible set of options.
Array< string > saveImage (string filename, int objectType, int colBarType=0, int width=0, int height=0, float magnification=1.f, string cornerLabelTemplateName="")
 Saves an image of the specified plane.
Array< string > saveMovie (VariantMap &options)
 Saves a movie using a flexible set of options.
Array< string > saveMovie (string filename, int objectType, int colBarType=0, string cornerLabelTemplateName="")
 Saves a movie (.gif) of the desired planar or 3D view.
Array< string > saveImageSecondaryCapture (string filename, int objectType, float magnification, int size)
 Saves an image as a DICOM Secondary Capture.
Array< string > saveMovieSecondaryCapture (string filename, int objectType, int size)
 Saves an image as a DICOM Secondary Capture.
Array< string > saveSecondaryCapture (string filename, int objectType, int headerIdx, int size, AbstractDicomRepository *rep)
 Save a secondary capture of the specified data.
void toggleMIP (bool toEnable)
 Turns the MIP viewer on or off.
void installMouseRatAtlas ()
 Installs the default rodent atlas libraries.
void setMessagePattern (string pattern)
 Change the message handler output format. Format options.
bool setRGBChannelByName (string channel)
 Selects the RGB channel presentation for the primary dataset.
bool getShowROIs ()
 Returns whether the ROIs (Regions of Interest) are currently being shown.

Protected Member Functions

void openFromIPACSFile (string filename)
 Opens a file from a known iPACS repository.
void openFromIPACS (string url, bool urlFromFile=false)
 Download an ipacs file from an iPACS URL.
void openFromIPACSZipacs (string url)
 Download a zipacs file from a zipacs URL.
void showDICOMAnonymizer (int idx=-1, DataManager *dm=nullptr, bool quiet=false)
 Download DICOM files from an openin URL.

Member Function Documentation

◆ anonymizeDICOM

void anonymizeDICOM ( bool quiet = false)
slot

Opens the 'DICOM Anonymizer' User Interface.

Parameters
quietSet to true to hide all popup dialog. The anonymization will automatically be applied to all dataset.
Note
See VQ.getDicomAnonymizer() to obtain the object

◆ checkForUpdate

void checkForUpdate ( bool manualCheck = false)
slot

Checks if there is a newer version of VQ available.

Parameters
manualCheckwill launch a dialog if up to date

◆ enableOpt

void enableOpt ( int mod,
bool enable )
slot

Enable VQ mainwin UI functions based on image loaded state.

Parameters
mod
enablethe state to enable

◆ enableShowROIs

void enableShowROIs ( bool b)
slot

Enables or disables the display of ROIs (Regions of Interest).

Note
This only currently applies to the Slice View mode and to operators where it makes sense to show ROIs and don't have any other way to show them.
Parameters
btrue to show ROIs, false to hide them

◆ getShowROIs()

bool getShowROIs ( )

Returns whether the ROIs (Regions of Interest) are currently being shown.

Returns
true if ROIs are shown, false otherwise.

◆ getViews()

virtual QList< QAbstractViewWidget * > getViews ( )
virtual

Get the currently active views.

Returns
a list of the currently active views

◆ importBrukerMR

void importBrukerMR ( string directory = string())
slot

Imports a Bruker file via dialog box.

Parameters
directory(Optional) The directory of the desired file on iPACS

◆ loadDCM

void loadDCM ( string fileArg)
slot

Load DICOM via file list.

Parameters
fileArgfiles to open

◆ loadSession

void loadSession ( string name,
bool quiet = false )
slot

Opens a VivoQuant session.

Parameters
nameThe name of the VivoQuant session being loaded

◆ matrixManipulationTool

void matrixManipulationTool ( )
slot

Opens the 'Matrix Manipulation Tool' User Interface.

Note
See VQ.matrixManipulationTool() to obtain the object

◆ openFromIPACS()

void openFromIPACS ( string url,
bool urlFromFile = false )
protected

Download an ipacs file from an iPACS URL.

Parameters
urlThe web URL of the desired file on iPACS
urlFromFileWhether or not the url is from a .ipacs file

◆ openFromIPACSFile()

void openFromIPACSFile ( string filename)
protected

Opens a file from a known iPACS repository.

Parameters
filenameThe file name and path of the desired file to be opened by the function (eg: home/ipacs/projects/filename.txt)

◆ relabelDICOMStudies

void relabelDICOMStudies ( bool quiet = false)
slot

Opens the 'Relabel DICOM Series' User Interface.

Parameters
quietSet to true to hide all popup dialog. The relabeling will automatically be applied to all dataset.
Note
See VQ.getDicomRelabeler() to obtain the object

◆ resizeWindow()

void resizeWindow ( int width,
int height )

Set the size of the VivoQuant window in pixels.

Parameters
width
height

◆ saveImage() [1/2]

Array< string > saveImage ( string filename,
int objectType,
int colBarType = 0,
int width = 0,
int height = 0,
float magnification = 1.f,
string cornerLabelTemplateName = "" )

Saves an image of the specified plane.

Parameters
filenameThe location and desired name of the image you are about to save, with the file extension
objectTypeThe plane in which you would like to capture an image (eg: 0 = MIP, 1 = Sag, 2 = Cor, 3 = Tra, 4 = all separate, 5 == all together)
colBarTypeThe color bar type (eg: 0 = none, 1 = no labels, 2 = simple labels, 3 = smart labels)
widthThe requested output width, if other than zero we ignore height value and maintain aspect ratio
heightThe requested output height, if other than zero and width is zero, width will follow the aspect ratio
magnificationThe Magnification factor for the image, this is applied after any width and height adjustments
cornerLabelTemplateNameThe name of an existing corner label template ("None" to save the image without any corner label)
Returns
a list of files saved successfully

◆ saveImage() [2/2]

Array< string > saveImage ( VariantMap & options)

Saves an image using a flexible set of options.

This function allows saving an image of a specified plane or planes using a single options map. It is intended to replace the older parameter-heavy overload, while remaining compatible with JavaScript/QJSEngine usage.

The options are passed via a VariantMap, and the following keys are supported:

  • "filename" (string, required): The full path and file name to save the image, including extension.
  • "objectType" (int, optional, default=0): The type of object/plane to save:
    • 0 = MIP
    • 1 = Sagittal
    • 2 = Coronal
    • 3 = Transversal
    • 4 = All separate
    • 5 = All together
  • "colBarType" (int, optional, default=0): The type of color bar to include:
    • 0 = none
    • 1 = no labels
    • 2 = simple labels
    • 3 = smart labels
  • "width" (int, optional, default=0): Requested output width in pixels.
    • If non-zero, height will be ignored.
    • The image is scaled to this width while maintaining the aspect ratio.
    • Cropping (if any) is applied before this scaling.
  • "height" (int, optional, default=0): Requested output height in pixels.
    • Used only if width is zero.
    • The image is scaled to this height while maintaining the aspect ratio.
    • Cropping (if any) is applied before this scaling.
  • "magnification" (float, optional, default=1.0): Factor to scale the image after width/height adjustments.
  • "cornerLabelTemplateName" (string, optional, default=""): Name of an existing corner label template. Use "None" to skip labels.
  • "minX", "maxX", "minY", "maxY", "minZ", "maxZ" (int, optional, default=0): Defines a 3D crop region inside the original data.
    • The crop region will only apply to plane objectType(s), such as Sagittal, Coronal, or Transversal. It is ignored for MIP object types.
    • The crop region maps to the selected plane and is ignored for axes not relevant to that plane.
    • If the crop region is invalid (min >= max for the relevant axes), it will be ignored.

Example usage from JavaScript in QJSEngine:

let files = viewWidget.saveImage({
filename: "/tmp/output.png",
objectType: 3,
width: 0,
minX: 10,
maxX: 200,
minY: 20,
maxY: 300
});
Parameters
optionsA VariantMap containing all save options.
Returns
A Array<string> containing the full paths of the files saved successfully.
Note
If both width and height are zero, the current view dimensions are used.
Cropping arguments are only applied for SliceView images. Please request your need for them elsewhere.
See also
saveImage(string, int, int, int, int, float, string)

◆ saveImageSecondaryCapture()

Array< string > saveImageSecondaryCapture ( string filename,
int objectType,
float magnification,
int size )

Saves an image as a DICOM Secondary Capture.

Parameters
filenameThe location and desired name of the image you are about to save, with the file extension
objectTypeThe plane in which you would like to capture an image (eg: 0 = MIP, 1 = Sag, 2 = Cor, 3 = Tra, 4 = all separate, 5 == all together)
magnificationThe Magnification factor for the image
sizeThe scaling in percent
Returns
a list of files saved successfully

◆ saveMovie() [1/2]

Array< string > saveMovie ( string filename,
int objectType,
int colBarType = 0,
string cornerLabelTemplateName = "" )

Saves a movie (.gif) of the desired planar or 3D view.

Parameters
filenameThe location and desired name of the .gif file you are about to save (eg: C:/Desktop/filename.png)
objectTypeThe plane in which the movie will use for the fly-through (eg: 0 = MIP, 1 = Sag, 2 = Cor, 3 = Tra, 4 = all separate, 5 == all together, only for time series movies)
colBarTypeThe color bar type (eg: 0 = none, 1 = no labels, 2 = simple labels, 3 = smart labels), Default is 0
cornerLabelTemplateNameThe name of an existing corner label template ("None" to save the movie without any corner label), Default is an empty string
Returns
A .gif file in the specified pathway

◆ saveMovie() [2/2]

Array< string > saveMovie ( VariantMap & options)

Saves a movie using a flexible set of options.

This function allows saving a movie of a specified plane or planes using a single options map. It is intended to replace the older parameter-heavy overload, while remaining compatible with JavaScript/QJSEngine usage.

The options are passed via a VariantMap, and the following keys are supported:

  • "filename" (string, required): The full path and file name to save the image, including extension.
  • "objectType" (int, optional, default=0): The type of object/plane to save:
    • 0 = MIP
    • 1 = Sagittal
    • 2 = Coronal
    • 3 = Transversal
    • 4 = All separate
    • 5 = All together (only for time series movies)
  • "colBarType" (int, optional, default=0): The type of color bar to include:
    • 0 = none
    • 1 = no labels
    • 2 = simple labels
    • 3 = smart labels
  • "cornerLabelTemplateName" (string, optional, default=""): Name of an existing corner label template. Use "None" to skip labels.

Example usage from JavaScript in QJSEngine:

let files = viewWidget.saveMovie({
filename: "/tmp/output.gif",
objectType: 3,
width: 0,
});
Parameters
optionsA VariantMap containing all save options.
Returns
A Array<string> containing the full paths of the files saved successfully.
See also
saveMovie(string, int, int, string)

◆ saveMovieSecondaryCapture()

Array< string > saveMovieSecondaryCapture ( string filename,
int objectType,
int size )

Saves an image as a DICOM Secondary Capture.

Parameters
filenameThe location and desired name of the image you are about to save, with the file extension
objectTypeThe plane in which you would like to capture an image (eg: 0 = MIP, 1 = Sag, 2 = Cor, 3 = Tra)
sizeThe scaling in percent
Returns
a list of files saved successfully

◆ saveSecondaryCapture()

Array< string > saveSecondaryCapture ( string filename,
int objectType,
int headerIdx,
int size,
AbstractDicomRepository * rep )

Save a secondary capture of the specified data.

Parameters
filenameThe location and desired name of the image you are about to save, with the file extension
objectTypeThe plane in which you would like to capture an image (eg: 0 = MIP, 1 = Sag, 2 = Cor, 3 = Tra)
headerIdxThe index of the data in the Data Manager to use as a reference for the secondary capture.
sizeThe scaling in percent
repA DICOM repository to save to
Returns
a list of files saved successfully

◆ saveSession

void saveSession ( string name = string(),
bool quiet = false )
slot

Saves a VivoQuant session.

Parameters
nameThe desired name of the session being saved

◆ scaleImage

void scaleImage ( float factor)
slot

Scales the images in the Display to a desired size.

Parameters
factorThe scaling factor, or the quantity in which the current image dimensions will be multiplied

◆ setMessagePattern()

void setMessagePattern ( string pattern)

Change the message handler output format. Format options.

Parameters
patternThe pattern that will be used by log messages

◆ setRGBChannelByName()

bool setRGBChannelByName ( string channel)

Selects the RGB channel presentation for the primary dataset.

Derives the active scalar raster from the underlying RGB image data using the specified channel or reduction mode, then refreshes the slice view and current display to reflect the change.

Parameters
channelThe channel/reduction mode to apply. Accepted values (case-sensitive) are:
  • "R" Red channel
  • "G" Green channel
  • "B" Blue channel
  • "Average" Average of R, G, B
  • "Sum" Sum of R, G, B
  • "Max" Maximum of R, G, B
  • "Min" Minimum of R, G, B
Returns
true if the channel was recognized and applied; false if channel was invalid or no data is loaded.
Note
This method only operates on the primary dataset (index 0).
Has no effect if the active dataset does not contain RGB image data.

◆ setupLayoutTrans

void setupLayoutTrans ( )
slot

Sets the Display layout to display only the Transversal Slice View.

Deprecated
Use setupLayoutTransverse instead. New naming scheme.
Deprecated
Use setupLayoutTransverse instead. New naming scheme

◆ setViewMode()

bool setViewMode ( string vm,
string op = string() )

Sets the view mode and active operator.

Selects vm in the view mode combo box and, if given, op in the operator combo box. Both names are the texts shown in those combo boxes. Operators depend on the view mode and on the active entitlements and visibility settings. Use VQ.availableOperators() to get the operators currently available in the selected view; the table below lists the documented VQS operators. If either requested name is not found, a warning is logged and false is returned.

After switching, VQ.currentView() returns the view object and VQ.currentOp() returns the operator object.

vm VQ.currentView() returns
"Slice View" SliceViewer
"Multi View" MultiViewer
"Tile View" TileViewer
vm op VQ.currentOp() returns
"Slice View" "Navigation" NavigationOperator
"Slice View" "Reorientation/Registration" ReorientationOperator
"Slice View" "3D ROI Tool" ThreeDimROIOperator
"Slice View" "Cropping" CroppingOperator
"Slice View" "Distance/Annotation" DistanceOperator
"Slice View" "Modeling" ModelingOperator
"Slice View" "Arithmetics" ArithmeticOperator
"Slice View" "Time Series" TimeSeriesOperator
"Slice View" "Filtering" SmoothingOperator
"Slice View" "Splitting" SplittingOperator
"Multi View" "Navigation" NavigationOperator
"Multi View" "Layout" LayoutOperator
"Multi View" "Distance/Annotation" DistanceOperator
"Multi View" "Modeling" ModelingOperator
"Multi View" "Arithmetics" ArithmeticOperator
"Multi View" "Filtering" SmoothingOperator
"Multi View" "Splitting" SplittingOperator
"Tile View" "Navigation" TileViewNavigationOperator
"Tile View" "Time Series" TileViewTimeSeriesOperator
if (VQ.mainWin().setViewMode("Slice View", "Cropping")) {
var crop = VQ.currentOp(); // CroppingOperator
}
VQ.mainWin().setViewMode("Multi View"); // switch view and keep Multi View's current operator
Parameters
vmThe view mode: "Slice View", "Multi View" or "Tile View".
opThe operator to select within that view mode (see the table above). If omitted, the selected view keeps its current operator.
Returns
true if the view mode (and the operator, if given) were set, false otherwise.

◆ signalChangeThemeMode

void signalChangeThemeMode ( )
slot

Receives a signal from ThemeManager about a change in the Configuration UI to change the thread, or a signal from the theme monitoring thread that the system has automatically changed from Light to Dark mode.

This should be the main triggering to update the rest of the UI to match the intended theme.

◆ startDcmBrowser

void startDcmBrowser ( string dir = string())
slot

Load DICOM browser from command line, optionally at a specific directory.

Parameters
dira directory to open to

◆ switchShowCursorInfo

void switchShowCursorInfo ( bool b)
slot

Toggle the Cursor Info Widget to replace the standard tool tip.

Parameters
b

◆ toggleMIP()

void toggleMIP ( bool toEnable)

Turns the MIP viewer on or off.

Parameters
toEnableA true/false value to instruct the function to turn the MIP on or off (True = on, False = off)

◆ toggleShowRGB

void toggleShowRGB ( bool b)
slot

Toggles between 3 channel visualization and 1 channel visualization.

Note
This method only operates on the primary dataset (index 0).
Has no effect if the active dataset does not contain RGB image data.
Parameters
bvisualization mode

◆ updateDisplay()

void updateDisplay ( bool include3D)

Rerenders the display.

Parameters
include3D