22 #include <QMainWindow> 28 #include <vtkEventQtSlotConnect.h> 30 #include "milxQtImage.h" 31 #include "milxQtModel.h" 32 #include "milxQtUnifiedWindow.h" 33 #include "milxQtPluginInterface.h" 105 QString activeName();
110 QString activeNamePrefix();
118 { whiteBackground = whiteBack; }
119 inline bool isWhiteBackgroundPreferred()
120 {
return whiteBackground; }
126 { humanGlyph = human; }
127 inline bool isHumanGlyphPreferred()
128 {
return humanGlyph; }
134 { subWindowSize = winSize; }
135 inline int hasPreferredSubWindowSize()
136 {
return subWindowSize; }
142 { maxProcessors = procs; }
143 inline int hasMaximumProcessors()
144 {
return maxProcessors; }
150 { magnifyFactor = factor; }
151 inline int hasScreenshotMagnifyFactor()
152 {
return magnifyFactor; }
158 { timestamping = timestamps; }
159 inline bool isTimestampsPreferred()
160 {
return timestamping; }
166 { interpolationImages = interp; }
167 inline bool isImageInterpolationPreferred()
168 {
return interpolationImages; }
174 { orientationImages = orient; }
175 inline bool isOrientationPreferred()
176 {
return orientationImages; }
182 { interpolationModels = interp; }
183 inline bool isModelInterpolationPreferred()
184 {
return interpolationModels; }
190 { scalarBarModels = bar; }
191 inline bool isScalarBarPreferred()
192 {
return scalarBarModels; }
199 bool isRender(QWidget *win);
204 bool isActiveRender();
214 bool isImage(QWidget *win);
219 bool isActiveImage();
229 bool isModel(QWidget *win);
234 bool isActiveModel();
244 bool isPlot(QWidget *win);
259 bool isUnifiedWindow(QWidget *win);
264 bool isActiveUnifiedWindow();
274 bool isActiveWebView();
279 QWebView* activeWebView();
284 void setActiveWindow(QWidget *currentWindow);
300 void openCollection();
310 void openRecentFile();
315 void loadFiles(
const QStringList &filenames);
320 bool loadFile(
const QString &filename);
325 void setCurrentFile(
const QString &fileName);
330 void updateRecentFileActions();
335 QActionGroup* updateWindowMenu();
340 QActionGroup* updateWindowListMenu(
bool applyMapper =
true);
345 QActionGroup* updateImportFromMenu(
bool applyMapper =
false);
350 void updateWindowsWithValue(
int value);
355 void updateWindowsWithAutoLevel();
360 void updateWindowsWithRefresh();
365 void updateWindowsWithCursors();
370 void updateWindowsWithView(
int value);
375 void updateWindowsWithViewType(
int value);
380 void updateWindowsWithViewOrientation(
int value);
387 QActionGroup* windowActionList(QMenu *menuForList,
bool groupTogether =
true,
bool applyMapper =
false);
393 void save(QString filename =
"");
398 void saveScreen(QString filename =
"");
404 void setTabName(QWidget *fromWindow);
409 void setTabName(
const QString newName);
414 void closeTab(
int index);
421 qobject_cast<QWorkspace *>(workspaces->currentWidget())->closeActiveWindow();
429 qobject_cast<QWorkspace *>(workspaces->currentWidget())->closeAllWindows();
437 qobject_cast<QWorkspace *>(workspaces->currentWidget())->cascade();
445 qobject_cast<QWorkspace *>(workspaces->currentWidget())->tile();
451 void tileTabVertically();
456 void tileTabHorizontally();
482 void working(
int value);
487 void done(
int value);
510 void display(vtkImageData* img, QString nameOfImage);
520 void display(vtkPolyData* newModel, QString nameOfModel);
530 void display(vtkPolyDataCollection *modelCollection, QStringList &filenames);
558 currentUnifiedWindow->addToWindow(img);
566 currentUnifiedWindow->addToWindow(mdl);
574 display(currentUnifiedWindow);
582 return currentUnifiedWindow;
588 void cleanUpOnClose(QWidget *win);
597 return qobject_cast<QWorkspace *>(workspaces->currentWidget())->windowList();
605 return qobject_cast<QWorkspace *>(workspaces->currentWidget())->windowList().size();
611 int getNumberOfImageWindows();
616 int getNumberOfModelWindows();
623 return workspaces->count();
674 void imageToSurface(vtkSmartPointer<vtkImageData> img,
const float value = numeric_limits<float>::max());
679 void imageToPolyData(vtkSmartPointer<vtkImageData> img);
684 void imageToPseudoImage(vectorImageType::Pointer img);
689 void imageToVectorField(vectorImageType::Pointer img, floatImageType::Pointer magImg,
int subsampleFactor = 0,
float scaling = 0.0);
694 void imageToTensorField(vectorImageType::Pointer img, floatImageType::Pointer magImg,
int subsampleFactor = 0,
float scaling = 0.0);
699 void imageToStreamLines(vectorImageType::Pointer img, floatImageType::Pointer magImg,
size_t subsampleFactor = 0);
704 void imageToVolume(vtkSmartPointer<vtkImageData> img,
bool eightbit);
711 void imageToPlot(vtkSmartPointer<vtkImageData> img,
int displaceAxis = 2);
716 void tableToPlot(vtkSmartPointer<vtkTable> tbl, QString title);
721 void voxeliseSurface(vtkSmartPointer<vtkPolyData> surface);
737 void imagesBlend(QVector<float> opacities);
749 void imagesAverage();
756 void imagesSubtract();
763 void imagesMultiply();
770 void imagesConvolve();
777 void imagesMergeLabels();
789 { actionLinkWindows->setChecked(
true); }
795 { actionLinkWindows->setChecked(
false); }
805 void writeSettings();
830 { console->printError(msg); }
837 { console->printWarning(msg); }
844 { console->printDebug(msg); }
851 { console->printInfo(msg); }
861 emit windowActivated(win);
867 void transferViewToWindows(vtkObject *obj,
unsigned long,
void *client_data,
void *, vtkCommand *command);
878 qApp->processEvents();
886 void windowActivated(QWidget * win);
911 void updatedWindowListMenu(QActionGroup *);
916 void updatedWindowListMenu(QMenu *);
921 void updatedImportFromMenu(QActionGroup *);
926 void updatedImportFromMenu(QMenu *);
943 enum { MaxRecentFiles = 10 };
968 QAction* actionsRecentFile[MaxRecentFiles];
1043 void linkProgressEventOf(vtkObject * obj);
1048 void commonChildProperties(QWidget *widget);
1058 void createComboBoxes();
1063 void createToolBars();
1068 void createConnections();
1073 void createProgressBar();
1078 void setupTooltips();
1083 void contextMenuEvent(QContextMenuEvent *event);
1090 return QFileInfo(fullFileName).fileName();
1096 void dragEnterEvent(QDragEnterEvent *event);
1101 void dropEvent(QDropEvent *event);
1106 void closeEvent(QCloseEvent *event);
1112 #endif // MILXQTMAIN_H QString saveSupport
Save file extension support list, cats all known extensions.
bool humanGlyph
Prefer showing human glyph?
void cascadeTab()
Cascade all the windows in the current tab.
QString strippedName(const QString &fullFileName)
Returns the filename with the path stripped.
void addToUnifiedWindow(milxQtModel *mdl)
Adds a model to the unified window and links its results.
void preferMaximumProcessors(const int procs)
Sets number of max processors is to be used whenever possible. Default: Half of max available on CPU ...
void showUnifiedWindow()
Shows the unified window.
void preferImageInterpolation(const bool interp)
Sets whether interpolation is to be shown whenever possible for images. Default: true.
QAction * actionSave
save action
void printError(QString msg)
Error message wrapper for console.
QAction * actionSubtractImages
subtract images batch operation action
void link()
Link all windows in the current tab. Changing one window camera updates all others.
QComboBox * defaultViewBox
Box for default view.
int maxProcessors
Max processors to use.
QAction * actionAbout
Action for showing about information.
bool whiteBackground
Prefer white backgrounds?
bool scalarBarModels
Show scalar bar for models?
QList< QAction *> imageExtsActions
List of image extenstion actions loaded succesfully.
QAction * actionCascade
Cascade windows in workspace action.
QAction * actionMergeLabels
Merge labelled images batch operation action.
This class represents the MILX Qt Render Window Display object using QVTK.
vtkSmartPointer< vtkEventQtSlotConnect > Connector
VTK Events to slots convertor.
QList< QAction *> renderExtsActions
List of render window extenstion actions loaded succesfully.
QAction * actionTile
Tile windows in workspace action.
void updateQtEvents()
Update the Qt events, used to keep UI responsive.
int getNumberOfTabs()
Return the number of tabs in the main window.
QMenu * menuFile
File menu.
QMenu * menuImages
File menu.
QAction * actionControls
Action for showing about information.
void addToUnifiedWindow(milxQtImage *img)
Adds an image to the unified window and links its results.
void preferTimestamps(const bool timestamps)
Sets whether timestamps are to be shown whenever possible. Default: true.
This class represents the MILX Qt Image Display object using VTK.
int subWindowSize
Window size of child windows to use.
bool orientationImages
Prefer applying orientation to images?
QList< QAction *> modelExtsActions
List of model extenstion actions loaded succesfully.
QAction * actionTileVertically
Tile vertically windows in workspace action.
QToolBar * imageToolBar
Some actions for images, like view etc.
QToolBar * windowToolBar
Some actions from window menu, like tile, cascade etc.
QComboBox * defaultViewTypeBox
Box for default view type (1 view or scanner type/4 view)
QAction * actionPreferences
Action for showing program preferences.
bool interpolationImages
Prefer showing interpolation for images?
QSlider * imageLevelSlider
adjust window level of image display
This class represents the MILX Qt Window Display object using QVTK.
int getNumberOfWindows()
Return the number of windows in the current tab.
void printDebug(QString msg)
Debug message wrapper for console.
QPointer< milxQtUnifiedWindow > currentUnifiedWindow
Current window for multi-display.
QList< QAction *> dockActions
List of dock actions of dock widgets loaded succesfully.
QMenu * menuWindows
Windows menu.
void tileTab()
Tile all the windows in the current tab.
QAction * actionOpenCollect
open collection action
QAction * actionCompare
Action for comparing data.
QPushButton * refreshButton
window refresh button
QAction * actionContents
Action for showing contents of help.
QAction * actionImageText
toggle text annotate mode
QAction * actionTileHorizontally
Tile horizontally windows in workspace action.
QProgressBar * progressBar
Progress bar for computation.
void preferHumanGlyph(const bool human)
Sets whether human orientation glyph is to be shown whenever possible. Default: true.
This class represents the MILX Qt Model/Mesh Display object using VTK.
QAction * actionOpenSeries
open series action
void printInfo(QString msg)
Info message wrapper for console.
QAction * actionCloseAll
Close all windows in tab action.
void closeTabActiveWindow()
Close active window in the tab.
#define MILXQT_EXPORT
Define Windows DLL importing.
QSignalMapper * windowMapper
Mapper of mulit-connections.
QList< QPointer< milxQtModel > > modelWindows
List of model windows opened.
The class maintains a state and render of multiple display objects (such as a milxQtModel or milxQtIm...
void preferWhiteBackground(const bool whiteBack)
Sets whether white background is to be used whenever possible. Default: false.
QAction * actionConsole
toggle action for console
QMenu * menuWindowList
Menu for list of windows.
void preferScalarBar(const bool bar)
Sets whether scalar bar is to be show whenever possible for models. Default: false.
QAction * actionBlendImages
blend images batch operation action
QList< QPointer< milxQtPluginInterface > > plugins
List of plugins loaded succesfully.
milxQtUnifiedWindow * getUnifiedWindow()
Returns the unified window.
QMenu * importFromMenu
Menu import from data menu.
void preferOrientation(const bool orient)
Sets whether image orientation is to be applied whenever possible for images. Default: true...
bool interpolationModels
Prefer applying interpolation to models?
QMenuBar * menuBar
Menu bar for the window.
QPushButton * cursorButton
crosshairs button
QComboBox * defaultOrientationTypeBox
Box for default orientation type (radiological or neurological orientation)
QPushButton * imageLevelButton
auto level button
QAction * actionRecentFileSeparator
Pointer to separator so it can be turned on and off.
QAction * actionExit
Exit action.
QMenu * menuData
Data menu.
QWidgetList getListOfWindows()
Get a list of widgets/windows that are in the current tab.
void unlink()
Unlink all windows in the current tab.
QAction * actionConvolveImages
Convolve images batch operation action.
QToolBar * fileToolBar
Some actions from file menu.
QMenu * menuHelp
Help menu.
int windowIterator
Keep track of current window being traversed.
void preferScreenshotMagnifyFactor(const int factor)
Sets the magnify factor when saving screenshots. Default: 2.
QString openSupport
Load file extension support list, cats all known extensions.
bool timestamping
Prefer showing timestamp?
QList< QPointer< milxQtPluginInterface > > getPlugins()
Returns a list of the loaded plugins (which are assumed to be DLLs) according to the milxQtPluginInte...
bool debugMode
Debug output mode?
void initialiseWindowTraversal()
Initialise the window iterator to the first window opened.
QAction * actionAverageImages
average images batch operation action
QAction * actionCloseActive
Close active window in tab action.
QAction * actionNewTab
New Tab action.
QAction * actionLinkWindows
Using linked cameras for all windows in a tab?
void printWarning(QString msg)
Warning message wrapper for console.
This class represents the MILX Qt Main Window object using Qt.
QToolBar * defaultToolBar
Some actions from default stuff menu, like view etc.
QAction * actionMultiplyImages
multiply images batch operation action
QAction * actionAddImages
add images batch operation action
QTabWidget * workspaces
Pointer to the Workspace environment for the user.
void closeTabAllWindows()
Close all the windows in the current tab.
void preferSubWindowSize(const int winSize)
Sets number of sub-window size is to be used whenever possible. Default: double of minWindowSize (aro...
int magnifyFactor
Screenshot magnify factor.
size_t progressCallCount
Takes account of how many calls of working have been made.
void redirectWindowActivated(QWidget *win)
Redirect the workspace signal to milxQtMain object level.
QPointer< milxQtConsole > console
console docked window
QAction * actionOpen
open action
QList< QPointer< milxQtImage > > imageWindows
List of model windows opened.
void preferModelInterpolation(const bool interp)
Sets whether interpolation is to be shown whenever possible for models. Default: false.
QAction * actionSaveScreen
save action