From 2a21d987d1536977c1772b3b00b60985f0a27e16 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Mon, 9 Apr 2018 09:28:06 +0200 Subject: [PATCH 1/9] started adding base class API for widgetInterface (on mouse events, slice change, etc.) added basic fix/hack to copy plugins to bundle on osx --- Core/BranchItem.h | 3 +- Core/Contour.h | 2 +- Core/FeatureExtractor.h | 3 +- Core/ImageForestingTransform.h | 3 +- Core/LoadPlugin.cpp | 2 + Core/Mark.h | 3 +- Core/Outline.h | 6 ++- Core/UndoElem.h | 5 ++- Core/addLine.h | 2 +- {Core => Plugin}/DataSelection.h | 0 Plugin/Plugin.h | 1 + {Core => Plugin}/Point.h | 0 Plugin/WidgetInterface.h | 37 ++++++++++++++++--- Plugins/BiasCorrection/CMakeLists.txt | 2 + Plugins/CMakeLists.txt | 2 + Plugins/ConfidenceConnected/CMakeLists.txt | 2 + Plugins/ConfidenceConnected/Confidence.h | 12 +++++- Plugins/GraphCut/CMakeLists.txt | 2 + Plugins/Levelset/CMakeLists.txt | 2 + iSeg/AtlasViewer.h | 7 +--- iSeg/AtlasWidget.h | 3 +- iSeg/CMakeLists.txt | 16 ++++++++ iSeg/DicomReader.h | 3 +- iSeg/EdgeWidget.cpp | 2 +- iSeg/EdgeWidget.h | 5 +-- iSeg/FastmarchingFuzzyWidget.h | 8 +--- iSeg/HystereticGrowingWidget.cpp | 1 - iSeg/HystereticGrowingWidget.h | 4 +- ...ageForestingTransformRegionGrowingWidget.h | 11 ++---- iSeg/InterpolationWidget.h | 4 +- iSeg/MainWindow.h | 4 +- iSeg/MorphologyWidget.cpp | 2 +- iSeg/OutlineCorrectionWidget.cpp | 3 +- iSeg/OutlineCorrectionWidget.h | 2 - iSeg/SaveOutlinesWidget.h | 2 +- iSeg/SliceViewerWidget.cpp | 1 - iSeg/SliceViewerWidget.h | 2 +- iSeg/SmoothingWidget.cpp | 2 - iSeg/ThresholdWidget.cpp | 3 -- iSeg/VesselWidget.cpp | 3 -- iSeg/bmpshower.cpp | 3 +- iSeg/bmpshower.h | 1 - iSeg/featurewidget.cpp | 1 - iSeg/featurewidget.h | 5 ++- iSeg/levelset.h | 3 +- iSeg/livewirewidget.cpp | 1 - iSeg/livewirewidget.h | 1 - iSeg/loaderwidgets.cpp | 2 +- iSeg/loaderwidgets.h | 4 +- iSeg/main.cpp | 1 - iSeg/measurementwidget.cpp | 3 +- iSeg/pickerwidget.cpp | 1 - iSeg/pickerwidget.h | 2 - iSeg/transformwidget.cpp | 2 - iSeg/transformwidget.h | 7 +--- iSeg/watershedwidget.cpp | 2 - iSeg/watershedwidget.h | 6 +-- iSeg/widgetcollection.cpp | 2 - iSeg/widgetcollection.h | 5 ++- 59 files changed, 128 insertions(+), 101 deletions(-) rename {Core => Plugin}/DataSelection.h (100%) rename {Core => Plugin}/Point.h (100%) diff --git a/Core/BranchItem.h b/Core/BranchItem.h index 274f47da..a82d76fe 100755 --- a/Core/BranchItem.h +++ b/Core/BranchItem.h @@ -11,9 +11,10 @@ #include "iSegCore.h" -#include "Point.h" #include "Vec3.h" +#include "Plugin/Point.h" + #include #include #include diff --git a/Core/Contour.h b/Core/Contour.h index 3e4634af..a669c12b 100755 --- a/Core/Contour.h +++ b/Core/Contour.h @@ -11,7 +11,7 @@ #include "iSegCore.h" -#include "Point.h" +#include "Plugin/Point.h" #include #include diff --git a/Core/FeatureExtractor.h b/Core/FeatureExtractor.h index c5397978..d2214a70 100755 --- a/Core/FeatureExtractor.h +++ b/Core/FeatureExtractor.h @@ -12,7 +12,8 @@ #include "iSegCore.h" #include "Pair.h" -#include "Point.h" + +#include "Plugin/Point.h" namespace iseg { diff --git a/Core/ImageForestingTransform.h b/Core/ImageForestingTransform.h index 15669634..5551015d 100755 --- a/Core/ImageForestingTransform.h +++ b/Core/ImageForestingTransform.h @@ -9,8 +9,9 @@ */ #pragma once +#include "Plugin/Point.h" + #include "Core/IndexPriorityQueue.h" -#include "Core/Point.h" #include #include diff --git a/Core/LoadPlugin.cpp b/Core/LoadPlugin.cpp index df1771a3..4a264a00 100755 --- a/Core/LoadPlugin.cpp +++ b/Core/LoadPlugin.cpp @@ -179,6 +179,8 @@ bool LoadPlugin(const std::string& plugin_file_path) bool LoadPlugins(const std::string& directory_path) { + std::cerr << "LoadPlugins: " << directory_path << std::endl; + bool ok = true; try { diff --git a/Core/Mark.h b/Core/Mark.h index 6be0fc0d..9e43e8ef 100755 --- a/Core/Mark.h +++ b/Core/Mark.h @@ -11,7 +11,8 @@ #include "iSegCore.h" -#include "Point.h" +#include "Plugin/Point.h" + #include namespace iseg { diff --git a/Core/Outline.h b/Core/Outline.h index 6a440977..4a5dca46 100755 --- a/Core/Outline.h +++ b/Core/Outline.h @@ -9,10 +9,12 @@ */ #pragma once +#include "iSegCore.h" + #include "Pair.h" -#include "Point.h" #include "Types.h" -#include "iSegCore.h" + +#include "Plugin/Point.h" #include #include diff --git a/Core/UndoElem.h b/Core/UndoElem.h index c9909d89..c2a1c72b 100755 --- a/Core/UndoElem.h +++ b/Core/UndoElem.h @@ -11,11 +11,12 @@ #include "iSegCore.h" -#include "DataSelection.h" #include "Mark.h" -#include "Point.h" #include "Types.h" +#include "Plugin/Point.h" +#include "Plugin/DataSelection.h" + #include namespace iseg { diff --git a/Core/addLine.h b/Core/addLine.h index d4db7d00..cae1665e 100755 --- a/Core/addLine.h +++ b/Core/addLine.h @@ -11,7 +11,7 @@ #include "iSegCore.h" -#include "Point.h" +#include "Plugin/Point.h" #include diff --git a/Core/DataSelection.h b/Plugin/DataSelection.h similarity index 100% rename from Core/DataSelection.h rename to Plugin/DataSelection.h diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h index 9cccdd67..f87ac3d5 100755 --- a/Plugin/Plugin.h +++ b/Plugin/Plugin.h @@ -48,4 +48,5 @@ class ISEG_PLUGIN_API PluginRegistry public: static std::vector registered_plugins(); }; + }} // namespace iseg::plugin diff --git a/Core/Point.h b/Plugin/Point.h similarity index 100% rename from Core/Point.h rename to Plugin/Point.h diff --git a/Plugin/WidgetInterface.h b/Plugin/WidgetInterface.h index 61721704..4264c73a 100755 --- a/Plugin/WidgetInterface.h +++ b/Plugin/WidgetInterface.h @@ -11,6 +11,9 @@ #include "PluginApi.h" +#include "DataSelection.h" +#include "Point.h" + #include #include #include @@ -28,10 +31,9 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget : QWidget(parent, name, wFlags) { m_cursor = new QCursor(Qt::CrossCursor); - }; + } virtual void init() {} virtual void newloaded() {} - QCursor* m_cursor; virtual FILE* SaveParams(FILE* fp, int version) { UNREFERENCED_PARAMETER(version); @@ -48,11 +50,36 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget virtual std::string GetName() { return std::string(""); } virtual QIcon GetIcon(QDir picdir) = 0; -protected: - static bool hideparams; + virtual void on_tissuenr_changed(int i) {} + virtual void on_slicenr_changed() {} + + virtual void on_mouse_clicked(Point p) {} + virtual void on_mouse_released(Point p) {} + virtual void on_mouse_moved(Point p) {} + +public: + QCursor* m_cursor; + + +signals: + void begin_datachange(iseg::DataSelection& dataSelection, + QWidget* sender = NULL, bool beginUndo = true); + void end_datachange(QWidget* sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); + +private slots: + void tissuenr_changed(int i) { on_tissuenr_changed(i); } + //TODOvoid slicenr_changed() { on_slicenr_changed(); } + + void mouse_clicked(Point p) { on_mouse_clicked(p); } + void mouse_released(Point p) { on_mouse_released(p); } + void mouse_moved(Point p) { on_mouse_moved(p); } public slots: - virtual void slicenr_changed(){}; + virtual void slicenr_changed(){} // BL TODO + +protected: + static bool hideparams; }; } // namespace iseg diff --git a/Plugins/BiasCorrection/CMakeLists.txt b/Plugins/BiasCorrection/CMakeLists.txt index 12391048..f96ee724 100755 --- a/Plugins/BiasCorrection/CMakeLists.txt +++ b/Plugins/BiasCorrection/CMakeLists.txt @@ -24,4 +24,6 @@ IF(PLUGIN_BIAS) ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(BiasCorrection.ext "Plugins") + + SET(PLUGIN_NAMES ${PLUGIN_NAMES};BiasCorrection.ext CACHE INTERNAL "") ENDIF() \ No newline at end of file diff --git a/Plugins/CMakeLists.txt b/Plugins/CMakeLists.txt index 1136f372..9ecf1a2a 100755 --- a/Plugins/CMakeLists.txt +++ b/Plugins/CMakeLists.txt @@ -14,6 +14,8 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/iSeg) USE_QT4() USE_ITK() +SET(PLUGIN_NAMES "" CACHE INTERNAL "") + FOREACH(dir ${subdirs}) ADD_SUBDIRECTORY(${dir}) ENDFOREACH() diff --git a/Plugins/ConfidenceConnected/CMakeLists.txt b/Plugins/ConfidenceConnected/CMakeLists.txt index 686e9ad0..4af1688c 100755 --- a/Plugins/ConfidenceConnected/CMakeLists.txt +++ b/Plugins/ConfidenceConnected/CMakeLists.txt @@ -24,4 +24,6 @@ IF(PLUGIN_CONFIDENCE) ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(Confidence.ext "Plugins") + + SET(PLUGIN_NAMES ${PLUGIN_NAMES};Confidence.ext CACHE INTERNAL "") ENDIF() \ No newline at end of file diff --git a/Plugins/ConfidenceConnected/Confidence.h b/Plugins/ConfidenceConnected/Confidence.h index 54fef9c9..6882bbe6 100755 --- a/Plugins/ConfidenceConnected/Confidence.h +++ b/Plugins/ConfidenceConnected/Confidence.h @@ -28,11 +28,19 @@ class ConfidenceWidget : public iseg::WidgetInterface QSize sizeHint() const; void init(); void newloaded(); - std::string GetName() { return std::string("ConfidenceFilter"); }; + std::string GetName() { return std::string("ConfidenceFilter"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("Confidence.png")).ascii()); - }; + } + +protected: + virtual void on_tissuenr_changed(int i) { std::cerr << "tissue " << i << std::endl; } + virtual void on_slicenr_changed() { std::cerr << "slice changed " << std::endl; } + + virtual void on_mouse_clicked(iseg::Point p) { std::cerr << "on_mouse_clicked" << std::endl; } + virtual void on_mouse_released(iseg::Point p) { std::cerr << "on_mouse_released" << std::endl; } + virtual void on_mouse_moved(iseg::Point p) { std::cerr << "on_mouse_moved" << std::endl; } private: unsigned int* usp; diff --git a/Plugins/GraphCut/CMakeLists.txt b/Plugins/GraphCut/CMakeLists.txt index 7a9005f8..208e8e1d 100755 --- a/Plugins/GraphCut/CMakeLists.txt +++ b/Plugins/GraphCut/CMakeLists.txt @@ -36,4 +36,6 @@ IF(PLUGIN_GRAPHCUT) ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(GraphCut.ext "Plugins") + + SET(PLUGIN_NAMES ${PLUGIN_NAMES};GraphCut.ext CACHE INTERNAL "") ENDIF() diff --git a/Plugins/Levelset/CMakeLists.txt b/Plugins/Levelset/CMakeLists.txt index 3d97c486..cde721a7 100755 --- a/Plugins/Levelset/CMakeLists.txt +++ b/Plugins/Levelset/CMakeLists.txt @@ -24,4 +24,6 @@ IF(PLUGIN_LEVELSET) ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(Levelset.ext "Plugins") + + SET(PLUGIN_NAMES ${PLUGIN_NAMES};Levelset.ext CACHE INTERNAL "") ENDIF() \ No newline at end of file diff --git a/iSeg/AtlasViewer.h b/iSeg/AtlasViewer.h index df835b94..8e2cdedd 100755 --- a/iSeg/AtlasViewer.h +++ b/iSeg/AtlasViewer.h @@ -7,13 +7,11 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef ATLAS_VIEWER -#define ATLAS_VIEWER +#pragma once -#include "Plugin/WidgetInterface.h" +#include "Plugin/Point.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/Types.h" #include @@ -98,4 +96,3 @@ public slots: }; } // namespace iseg -#endif //ATLAS_VIEWER diff --git a/iSeg/AtlasWidget.h b/iSeg/AtlasWidget.h index 17b72bcf..506dde9f 100755 --- a/iSeg/AtlasWidget.h +++ b/iSeg/AtlasWidget.h @@ -12,8 +12,9 @@ #include "WidgetCollection.h" +#include "Plugin/Point.h" + #include "Core/Pair.h" -#include "Core/Point.h" #include #include diff --git a/iSeg/CMakeLists.txt b/iSeg/CMakeLists.txt index eb11dd14..dd1c08a3 100755 --- a/iSeg/CMakeLists.txt +++ b/iSeg/CMakeLists.txt @@ -190,3 +190,19 @@ IF(ISEG_BUILD_PRECOMPILED_HEADER) ENDFOREACH() ENDIF() ENDIF() + + +IF(APPLE) + # copy plugins to bundle + FOREACH(plugin ${PLUGIN_NAMES}) + LIST(APPEND PLUGIN_FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/lib${plugin}.dylib) + ADD_DEPENDENCIES(iSeg ${plugin}) + ENDFOREACH() + + ADD_CUSTOM_COMMAND( + TARGET iSeg + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${PLUGIN_FILES} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/iSeg.app/Contents/MacOS + ) +ENDIF() \ No newline at end of file diff --git a/iSeg/DicomReader.h b/iSeg/DicomReader.h index 593a509a..0bc49d79 100755 --- a/iSeg/DicomReader.h +++ b/iSeg/DicomReader.h @@ -10,8 +10,9 @@ #ifndef dicomread_22Juli05 #define dicomread_22Juli05 +#include "Plugin/Point.h" + #include "Core/Pair.h" -#include "Core/Point.h" #include #include diff --git a/iSeg/EdgeWidget.cpp b/iSeg/EdgeWidget.cpp index 8c1ac3be..0a9461a0 100755 --- a/iSeg/EdgeWidget.cpp +++ b/iSeg/EdgeWidget.cpp @@ -14,7 +14,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Core/Point.h" +#include "Plugin/Point.h" #include #include diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index f9f7d7c1..cc33993f 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -45,12 +45,11 @@ class EdgeWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("Edge"); }; - //virtual QIcon GetIcon() {return QIcon("images/edge.png");}; + std::string GetName() { return std::string("Edge"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("edge.png")).ascii()); - }; + } private: bmphandler* bmphand; diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index c4ef7c88..785418c1 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -7,14 +7,10 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef FMF_31March05 -#define FMF_31March05 +#pragma once #include "Plugin/WidgetInterface.h" -#include "Core/DataSelection.h" -#include "Core/Point.h" - #include #include #include @@ -133,5 +129,3 @@ private slots: }; } // namespace iseg - -#endif diff --git a/iSeg/HystereticGrowingWidget.cpp b/iSeg/HystereticGrowingWidget.cpp index cd75e12d..51475ff8 100755 --- a/iSeg/HystereticGrowingWidget.cpp +++ b/iSeg/HystereticGrowingWidget.cpp @@ -15,7 +15,6 @@ #include "bmp_read_1.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/addLine.h" #include diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index d30a3575..1960ca24 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -7,8 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef THRESHWIDGET_14March05 -#define THRESHWIDGET_14March05 +#pragma once #include "SlicesHandler.h" #include "bmp_read_1.h" @@ -142,4 +141,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.h b/iSeg/ImageForestingTransformRegionGrowingWidget.h index 2d4a4891..6d065db9 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.h +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.h @@ -7,17 +7,13 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef IFTRG_29March05 -#define IFTRG_29March05 +#pragma once #include "SlicesHandler.h" #include "bmp_read_1.h" #include "Plugin/WidgetInterface.h" -#include "Core/DataSelection.h" -#include "Core/Point.h" - #include #include #include @@ -47,11 +43,11 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("IFT"); }; + std::string GetName() { return std::string("IFT"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("iftrg.png")).ascii()); - }; + } private: void init1(); @@ -110,4 +106,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/InterpolationWidget.h b/iSeg/InterpolationWidget.h index 6496a514..7d18fa44 100755 --- a/iSeg/InterpolationWidget.h +++ b/iSeg/InterpolationWidget.h @@ -7,8 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef Interpolate_20April05 -#define Interpolate_20April05 +#pragma once #include "SlicesHandler.h" #include "bmp_read_1.h" @@ -106,4 +105,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/MainWindow.h b/iSeg/MainWindow.h index a8be699f..485e8b9a 100755 --- a/iSeg/MainWindow.h +++ b/iSeg/MainWindow.h @@ -12,8 +12,8 @@ #include "Atlas.h" #include "Project.h" -#include "Core/DataSelection.h" -#include "Core/Point.h" +#include "Plugin/DataSelection.h" +#include "Plugin/Point.h" #include #include diff --git a/iSeg/MorphologyWidget.cpp b/iSeg/MorphologyWidget.cpp index 7d789580..fdadeba1 100755 --- a/iSeg/MorphologyWidget.cpp +++ b/iSeg/MorphologyWidget.cpp @@ -14,7 +14,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Core/Point.h" +#include "Plugin/Point.h" #include #include diff --git a/iSeg/OutlineCorrectionWidget.cpp b/iSeg/OutlineCorrectionWidget.cpp index cd01bf3d..2381504d 100755 --- a/iSeg/OutlineCorrectionWidget.cpp +++ b/iSeg/OutlineCorrectionWidget.cpp @@ -14,7 +14,8 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Core/Point.h" +#include "Plugin/Point.h" + #include "Core/addLine.h" #include diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index 3429af00..ade864d4 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -13,8 +13,6 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Core/Point.h" - #include "Plugin/WidgetInterface.h" #include diff --git a/iSeg/SaveOutlinesWidget.h b/iSeg/SaveOutlinesWidget.h index 327c8985..dd14c456 100755 --- a/iSeg/SaveOutlinesWidget.h +++ b/iSeg/SaveOutlinesWidget.h @@ -10,9 +10,9 @@ #ifndef SOW_19April05 #define SOW_19April05 -#include "Core/Point.h" #include "SlicesHandler.h" #include "bmp_read_1.h" + #include #include #include diff --git a/iSeg/SliceViewerWidget.cpp b/iSeg/SliceViewerWidget.cpp index d6a6aa6a..2acea1c8 100755 --- a/iSeg/SliceViewerWidget.cpp +++ b/iSeg/SliceViewerWidget.cpp @@ -13,7 +13,6 @@ #include "SlicesHandler.h" #include "TissueInfos.h" -#include "Core/Point.h" #include #include diff --git a/iSeg/SliceViewerWidget.h b/iSeg/SliceViewerWidget.h index b85b690d..e0da3923 100755 --- a/iSeg/SliceViewerWidget.h +++ b/iSeg/SliceViewerWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" -#include "Core/Point.h" +#include "Plugin/Point.h" #include #include diff --git a/iSeg/SmoothingWidget.cpp b/iSeg/SmoothingWidget.cpp index 33c1c3e2..c9399d4a 100755 --- a/iSeg/SmoothingWidget.cpp +++ b/iSeg/SmoothingWidget.cpp @@ -14,8 +14,6 @@ #include "SmoothingWidget.h" #include "bmp_read_1.h" -#include "Core/Point.h" - #include #include #include diff --git a/iSeg/ThresholdWidget.cpp b/iSeg/ThresholdWidget.cpp index fed47dae..113dabea 100755 --- a/iSeg/ThresholdWidget.cpp +++ b/iSeg/ThresholdWidget.cpp @@ -15,9 +15,6 @@ #include "bmp_read_1.h" #include "Core/Pair.h" -#include "Core/Point.h" - -#include "Plugin/WidgetInterface.h" #include #include diff --git a/iSeg/VesselWidget.cpp b/iSeg/VesselWidget.cpp index 44e0fdfb..07bb6a31 100755 --- a/iSeg/VesselWidget.cpp +++ b/iSeg/VesselWidget.cpp @@ -12,10 +12,7 @@ #include "SlicesHandler.h" #include "VesselWidget.h" -#include "Plugin/WidgetInterface.h" - #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/Vec3.h" #include diff --git a/iSeg/bmpshower.cpp b/iSeg/bmpshower.cpp index 0dde63fc..3ec11084 100755 --- a/iSeg/bmpshower.cpp +++ b/iSeg/bmpshower.cpp @@ -14,8 +14,9 @@ #include "bmpshower.h" #include "TissueInfos.h" +#include "Plugin/Point.h" + #include "Core/ColorLookupTable.h" -#include "Core/Point.h" #include #include diff --git a/iSeg/bmpshower.h b/iSeg/bmpshower.h index 607aa19c..c4c9ba13 100755 --- a/iSeg/bmpshower.h +++ b/iSeg/bmpshower.h @@ -12,7 +12,6 @@ #include "Core/Mark.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/Types.h" #include diff --git a/iSeg/featurewidget.cpp b/iSeg/featurewidget.cpp index e552b2b9..57408008 100755 --- a/iSeg/featurewidget.cpp +++ b/iSeg/featurewidget.cpp @@ -17,7 +17,6 @@ #include "Core/ImageForestingTransform.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/addLine.h" #include diff --git a/iSeg/featurewidget.h b/iSeg/featurewidget.h index cc211752..86f11061 100755 --- a/iSeg/featurewidget.h +++ b/iSeg/featurewidget.h @@ -10,6 +10,7 @@ #pragma once #include "Plugin/WidgetInterface.h" + #include "SlicesHandler.h" #include "bmp_read_1.h" @@ -46,11 +47,11 @@ class FeatureWidget : public WidgetInterface void init(); void newloaded(); QSize sizeHint() const; - std::string GetName() { return std::string("Feature"); }; + std::string GetName() { return std::string("Feature"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("feature.png")).ascii()); - }; + } private: bool selecting; diff --git a/iSeg/levelset.h b/iSeg/levelset.h index f7b15e9c..d88ddb21 100755 --- a/iSeg/levelset.h +++ b/iSeg/levelset.h @@ -9,7 +9,8 @@ */ #pragma once -#include "Core/Point.h" +#include "Plugin/Point.h" + #include "Core/SliceProvider.h" #include diff --git a/iSeg/livewirewidget.cpp b/iSeg/livewirewidget.cpp index e3c17d8c..3df1f41d 100755 --- a/iSeg/livewirewidget.cpp +++ b/iSeg/livewirewidget.cpp @@ -16,7 +16,6 @@ #include "Core/ImageForestingTransform.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/addLine.h" #include diff --git a/iSeg/livewirewidget.h b/iSeg/livewirewidget.h index 7a257b11..b32cbc69 100755 --- a/iSeg/livewirewidget.h +++ b/iSeg/livewirewidget.h @@ -15,7 +15,6 @@ #include "Plugin/WidgetInterface.h" -#include "Core/DataSelection.h" #include "Core/ImageForestingTransform.h" #include diff --git a/iSeg/loaderwidgets.cpp b/iSeg/loaderwidgets.cpp index 68824601..8424ff98 100755 --- a/iSeg/loaderwidgets.cpp +++ b/iSeg/loaderwidgets.cpp @@ -13,7 +13,7 @@ #include "CImg.h" #include "LoaderWidgets.h" -#include "Core/Point.h" +#include "Plugin/Point.h" #include #include diff --git a/iSeg/loaderwidgets.h b/iSeg/loaderwidgets.h index 3922593a..a80b1761 100755 --- a/iSeg/loaderwidgets.h +++ b/iSeg/loaderwidgets.h @@ -10,9 +10,11 @@ #ifndef LOADERWIDGET #define LOADERWIDGET -#include "Core/Point.h" #include "SlicesHandler.h" #include "bmp_read_1.h" + +#include "Plugin/Point.h" + #include #include #include diff --git a/iSeg/main.cpp b/iSeg/main.cpp index 21cc0bee..9a1f77d7 100755 --- a/iSeg/main.cpp +++ b/iSeg/main.cpp @@ -20,7 +20,6 @@ #include "Core/BranchItem.h" #include "Core/Log.h" #include "Core/Pair.h" -#include "Core/Point.h" #include #include diff --git a/iSeg/measurementwidget.cpp b/iSeg/measurementwidget.cpp index 5bff4241..f6f2f04a 100755 --- a/iSeg/measurementwidget.cpp +++ b/iSeg/measurementwidget.cpp @@ -15,8 +15,9 @@ #include "TissueInfos.h" #include "bmp_read_1.h" +#include "Plugin/Point.h" + #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/addLine.h" #include diff --git a/iSeg/pickerwidget.cpp b/iSeg/pickerwidget.cpp index dbaa12c9..70c83aec 100755 --- a/iSeg/pickerwidget.cpp +++ b/iSeg/pickerwidget.cpp @@ -15,7 +15,6 @@ #include "bmp_read_1.h" #include "Core/Pair.h" -#include "Core/Point.h" #include "Core/addLine.h" #include diff --git a/iSeg/pickerwidget.h b/iSeg/pickerwidget.h index 9c0e8420..acac0c62 100755 --- a/iSeg/pickerwidget.h +++ b/iSeg/pickerwidget.h @@ -15,8 +15,6 @@ #include "Plugin/WidgetInterface.h" -#include "Core/DataSelection.h" - #include #include #include diff --git a/iSeg/transformwidget.cpp b/iSeg/transformwidget.cpp index f3ed6340..02e76cb7 100755 --- a/iSeg/transformwidget.cpp +++ b/iSeg/transformwidget.cpp @@ -13,8 +13,6 @@ #include "SlicesHandler.h" #include "TransformWidget.h" -#include "Core/Point.h" - #include #include #include diff --git a/iSeg/transformwidget.h b/iSeg/transformwidget.h index b9d62ab1..38c4fff8 100755 --- a/iSeg/transformwidget.h +++ b/iSeg/transformwidget.h @@ -7,14 +7,10 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef TRANSFORM_17NOV11 -#define TRANSFORM_17NOV11 +#pragma once #include "SliceTransform.h" -#include "Core/DataSelection.h" -#include "Core/Point.h" - #include "Plugin/WidgetInterface.h" #include @@ -161,4 +157,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/watershedwidget.cpp b/iSeg/watershedwidget.cpp index 34ba1ebb..467ff7d5 100755 --- a/iSeg/watershedwidget.cpp +++ b/iSeg/watershedwidget.cpp @@ -14,8 +14,6 @@ #include "WatershedWidget.h" #include "bmp_read_1.h" -#include "Core/Point.h" - #include #include #include diff --git a/iSeg/watershedwidget.h b/iSeg/watershedwidget.h index 30e0145d..9a05f905 100755 --- a/iSeg/watershedwidget.h +++ b/iSeg/watershedwidget.h @@ -7,13 +7,10 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef WATERSHED_8MARCH05 -#define WATERSHED_8MARCH05 +#pragma once #include "Plugin/WidgetInterface.h" -#include "Core/DataSelection.h" - #include #include #include @@ -92,4 +89,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/widgetcollection.cpp b/iSeg/widgetcollection.cpp index 52be14fd..d4567edc 100755 --- a/iSeg/widgetcollection.cpp +++ b/iSeg/widgetcollection.cpp @@ -17,8 +17,6 @@ #include "bmp_read_1.h" #include "config.h" -#include "Core/Point.h" - #include #include #include diff --git a/iSeg/widgetcollection.h b/iSeg/widgetcollection.h index 9ea1d079..dac9c4a9 100755 --- a/iSeg/widgetcollection.h +++ b/iSeg/widgetcollection.h @@ -10,8 +10,9 @@ #ifndef WIDGETCOLLECTION #define WIDGETCOLLECTION -#include "Core/DataSelection.h" -#include "Core/Point.h" +#include "Plugin/DataSelection.h" +#include "Plugin/Point.h" + #include "Core/Types.h" #include From 4f85c9f9b0da2c7c975932b2321e2fe4db1d2e6f Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Mon, 9 Apr 2018 17:39:36 +0200 Subject: [PATCH 2/9] major refactoring: - added signals and slots to base widget class - replaced pt_clicked by mouse_clicked (moved/released) - simplified connection/disconnection of slots in Mainwindow - added todos - biggest worry is currently: on_tissuenr_changed -> what is meaning of index passed to callback, how is it used (offset -1 all over the code makes things really confusing) --- Plugin/WidgetInterface.h | 12 +- iSeg/EdgeWidget.h | 6 - iSeg/FastmarchingFuzzyWidget.cpp | 6 +- iSeg/FastmarchingFuzzyWidget.h | 19 +- iSeg/HystereticGrowingWidget.cpp | 6 +- iSeg/HystereticGrowingWidget.h | 15 +- ...eForestingTransformRegionGrowingWidget.cpp | 12 +- ...ageForestingTransformRegionGrowingWidget.h | 26 +- iSeg/InterpolationWidget.cpp | 4 +- iSeg/InterpolationWidget.h | 15 +- iSeg/MainWindow.cpp | 3430 +++++++---------- iSeg/MainWindow.h | 4 +- iSeg/MorphologyWidget.h | 6 - iSeg/OutlineCorrectionWidget.cpp | 14 +- iSeg/OutlineCorrectionWidget.h | 27 +- iSeg/RadiotherapyStructureSetImporter.h | 1 - iSeg/SmoothingWidget.h | 10 +- iSeg/ThresholdWidget.cpp | 6 +- iSeg/ThresholdWidget.h | 19 +- iSeg/featurewidget.cpp | 6 +- iSeg/featurewidget.h | 9 +- iSeg/livewirewidget.cpp | 6 +- iSeg/livewirewidget.h | 15 +- iSeg/measurementwidget.cpp | 22 +- iSeg/measurementwidget.h | 9 +- iSeg/pickerwidget.cpp | 2 +- iSeg/pickerwidget.h | 15 +- iSeg/transformwidget.cpp | 2 +- iSeg/transformwidget.h | 13 +- iSeg/watershedwidget.h | 14 +- 30 files changed, 1550 insertions(+), 2201 deletions(-) diff --git a/Plugin/WidgetInterface.h b/Plugin/WidgetInterface.h index 4264c73a..25eb949c 100755 --- a/Plugin/WidgetInterface.h +++ b/Plugin/WidgetInterface.h @@ -50,8 +50,8 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget virtual std::string GetName() { return std::string(""); } virtual QIcon GetIcon(QDir picdir) = 0; - virtual void on_tissuenr_changed(int i) {} - virtual void on_slicenr_changed() {} + virtual void on_tissuenr_changed(int i) {}//BL todo + virtual void on_slicenr_changed() {} //BL todo virtual void on_mouse_clicked(Point p) {} virtual void on_mouse_released(Point p) {} @@ -67,17 +67,15 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget void end_datachange(QWidget* sender = NULL, iseg::EndUndoAction undoAction = iseg::EndUndo); -private slots: +private slots : void tissuenr_changed(int i) { on_tissuenr_changed(i); } - //TODOvoid slicenr_changed() { on_slicenr_changed(); } + void slicenr_changed() { on_slicenr_changed(); } + // \todo duplicate slots (and connections) and pass argument source_or_target to callbacks void mouse_clicked(Point p) { on_mouse_clicked(p); } void mouse_released(Point p) { on_mouse_released(p); } void mouse_moved(Point p) { on_mouse_moved(p); } -public slots: - virtual void slicenr_changed(){} // BL TODO - protected: static bool hideparams; }; diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index cc33993f..1372788e 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -80,12 +80,6 @@ class EdgeWidget : public WidgetInterface QRadioButton* rb_laplacianzero; QButtonGroup* modegroup; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: void slicenr_changed(); diff --git a/iSeg/FastmarchingFuzzyWidget.cpp b/iSeg/FastmarchingFuzzyWidget.cpp index 8f05d15e..9c466c3f 100755 --- a/iSeg/FastmarchingFuzzyWidget.cpp +++ b/iSeg/FastmarchingFuzzyWidget.cpp @@ -304,7 +304,7 @@ void FastmarchingFuzzyWidget::getrange() return; } -void FastmarchingFuzzyWidget::mouse_clicked(Point p) +void FastmarchingFuzzyWidget::on_mouse_clicked(Point p) { if (rb_fastmarch->isOn()) { @@ -355,7 +355,7 @@ void FastmarchingFuzzyWidget::mouse_clicked(Point p) } } -void FastmarchingFuzzyWidget::mouse_released(Point p) +void FastmarchingFuzzyWidget::on_mouse_released(Point p) { if (rb_drag->isOn()) { @@ -377,7 +377,7 @@ void FastmarchingFuzzyWidget::mouse_released(Point p) } } -void FastmarchingFuzzyWidget::mouse_moved(Point p) +void FastmarchingFuzzyWidget::on_mouse_moved(Point p) { if (rb_drag->isOn()) { diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index 785418c1..f0626f32 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -48,11 +48,16 @@ class FastmarchingFuzzyWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("Fuzzy"); }; + std::string GetName() { return std::string("Fuzzy"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("fuzzy.png")).ascii()); - }; + } + +protected: + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_released(Point p) override; + virtual void on_mouse_moved(Point p) override; private: float* map; @@ -105,19 +110,15 @@ class FastmarchingFuzzyWidget : public WidgetInterface signals: void vpdyn_changed(std::vector* vpdyn_arg); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void slicenr_changed(); private slots: void bmphand_changed(bmphandler* bmph); - void mouse_clicked(Point p); - void mouse_released(Point p); - void mouse_moved(Point p); + //void mouse_clicked(Point p); + //void mouse_released(Point p); + //void mouse_moved(Point p); void slextend_changed(int i); void slextend_pressed(); void slextend_released(); diff --git a/iSeg/HystereticGrowingWidget.cpp b/iSeg/HystereticGrowingWidget.cpp index 51475ff8..64715e5a 100755 --- a/iSeg/HystereticGrowingWidget.cpp +++ b/iSeg/HystereticGrowingWidget.cpp @@ -185,7 +185,7 @@ void HystereticGrowingWidget::bmphand_changed(bmphandler* bmph) return; } -void HystereticGrowingWidget::pt_clicked(Point p) +void HystereticGrowingWidget::on_mouse_clicked(Point p) { if (limitdrawing) { @@ -461,7 +461,7 @@ void HystereticGrowingWidget::clean_up() return; } -void HystereticGrowingWidget::pt_moved(Point p) +void HystereticGrowingWidget::on_mouse_moved(Point p) { if (limitdrawing) { @@ -471,7 +471,7 @@ void HystereticGrowingWidget::pt_moved(Point p) } } -void HystereticGrowingWidget::pt_released(Point p) +void HystereticGrowingWidget::on_mouse_released(Point p) { if (limitdrawing) { diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index 1960ca24..fbad1a4b 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -51,13 +51,17 @@ class HystereticGrowingWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("Growing"); }; + std::string GetName() { return std::string("Growing"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("growing.png")).ascii()); - }; + } private: + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_moved(Point p) override; + virtual void on_mouse_released(Point p) override; + void init1(); Point p1; Point last_pt; @@ -109,19 +113,12 @@ class HystereticGrowingWidget : public WidgetInterface void vp1_changed(std::vector* vp1_arg); void vp1dyn_changed(std::vector* vp1_arg, std::vector* vpdyn_arg); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void slicenr_changed(); private slots: void bmphand_changed(bmphandler* bmph); - void pt_clicked(Point p); - void pt_moved(Point p); - void pt_released(Point p); void auto_toggled(); void update_visible(); void execute(); diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.cpp b/iSeg/ImageForestingTransformRegionGrowingWidget.cpp index d5c81298..38fb895c 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.cpp +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.cpp @@ -179,13 +179,15 @@ void ImageForestingTransformRegionGrowingWidget::cleanup() emit vm_changed(&vmempty); } -void ImageForestingTransformRegionGrowingWidget::tissuenr_changed(int i) +void ImageForestingTransformRegionGrowingWidget::on_tissuenr_changed(int i) { + // \todo B + cerr << "ImageForestingTransformRegionGrowingWidget: tissuenr = " << i << std::endl; tissuenr = (unsigned)i + 1; return; } -void ImageForestingTransformRegionGrowingWidget::mouse_clicked(Point p) +void ImageForestingTransformRegionGrowingWidget::on_mouse_clicked(Point p) { last_pt = p; if (pushremove->isOn()) @@ -194,7 +196,7 @@ void ImageForestingTransformRegionGrowingWidget::mouse_clicked(Point p) } } -void ImageForestingTransformRegionGrowingWidget::mouse_moved(Point p) +void ImageForestingTransformRegionGrowingWidget::on_mouse_moved(Point p) { if (!pushremove->isOn()) { @@ -204,7 +206,7 @@ void ImageForestingTransformRegionGrowingWidget::mouse_moved(Point p) } } -void ImageForestingTransformRegionGrowingWidget::mouse_released(Point p) +void ImageForestingTransformRegionGrowingWidget::on_mouse_released(Point p) { if (!pushremove->isOn()) { @@ -309,7 +311,7 @@ void ImageForestingTransformRegionGrowingWidget::bmp_changed() init1(); } -void ImageForestingTransformRegionGrowingWidget::slicenr_changed() +void ImageForestingTransformRegionGrowingWidget::on_slicenr_changed() { // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.h b/iSeg/ImageForestingTransformRegionGrowingWidget.h index 6d065db9..6f9ea840 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.h +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.h @@ -49,9 +49,19 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface return QIcon(picdir.absFilePath(QString("iftrg.png")).ascii()); } +protected: + virtual void on_tissuenr_changed(int i) override; + virtual void on_slicenr_changed() override; + + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_released(Point p) override; + virtual void on_mouse_moved(Point p) override; + private: void init1(); void removemarks(Point p); + void getrange(); + float* lbmap; ImageForestingTransformRegionGrowing* IFTrg; Point last_pt; @@ -66,38 +76,22 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface QPushButton* pushexec; QPushButton* pushclear; QPushButton* pushremove; - void getrange(); unsigned tissuenr; - // unsigned maxim; float thresh; float maxthresh; std::vector vm; std::vector vmempty; std::vector vmdyn; - // std::vector > vvm; unsigned area; signals: void vm_changed(std::vector* vm1); void vmdyn_changed(std::vector* vmdyn1); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - -public slots: - void tissuenr_changed(int i); - void slicenr_changed(); private slots: void bmphand_changed(bmphandler* bmph); - // void tissuenr_changed(int i); - void mouse_clicked(Point p); - void mouse_released(Point p); - void mouse_moved(Point p); void execute(); void clearmarks(); - // void removepressed(); void slider_changed(int i); void slider_pressed(); void slider_released(); diff --git a/iSeg/InterpolationWidget.cpp b/iSeg/InterpolationWidget.cpp index 77674ab8..8ccea63f 100755 --- a/iSeg/InterpolationWidget.cpp +++ b/iSeg/InterpolationWidget.cpp @@ -179,9 +179,9 @@ void InterpolationWidget::init() void InterpolationWidget::newloaded() {} -void InterpolationWidget::slicenr_changed() {} +void InterpolationWidget::on_slicenr_changed() {} -void InterpolationWidget::tissuenr_changed(int tissuetype) +void InterpolationWidget::on_tissuenr_changed(int tissuetype) { tissuenr = (tissues_size_t)tissuetype + 1; } diff --git a/iSeg/InterpolationWidget.h b/iSeg/InterpolationWidget.h index 7d18fa44..c179e20b 100755 --- a/iSeg/InterpolationWidget.h +++ b/iSeg/InterpolationWidget.h @@ -47,13 +47,16 @@ class InterpolationWidget : public WidgetInterface void newloaded(); FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); - std::string GetName() { return std::string("Interpol"); }; + std::string GetName() { return std::string("Interpol"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("interpolate.png")).ascii()); - }; + } private: + virtual void on_tissuenr_changed(int i) override; + virtual void on_slicenr_changed() override; + SlicesHandler* handler3D; Q3HBox* hboxoverall; Q3VBox* vboxmethods; @@ -85,15 +88,7 @@ class InterpolationWidget : public WidgetInterface unsigned short nrslices; unsigned short tissuenr; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: - void slicenr_changed(); - void tissuenr_changed(int tissuetype); void handler3D_changed(); private slots: diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 02d14635..117e39f1 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -1,9 +1,9 @@ /* * Copyright (c) 2018 The Foundation for Research on Information Technologies in Society (IT'IS). - * + * * This file is part of iSEG * (see https://github.com/ITISFoundation/osparc-iseg). - * + * * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ @@ -80,7 +80,7 @@ int importSurfacePos = -1; int importRTstructPos = -1; } // namespace -int bmpimgnr(QString* s) +int bmpimgnr(QString *s) { int result = 0; uint pos; @@ -106,7 +106,7 @@ int bmpimgnr(QString* s) return result; } -int pngimgnr(QString* s) +int pngimgnr(QString *s) { int result = 0; uint pos; @@ -132,7 +132,7 @@ int pngimgnr(QString* s) return result; } -int jpgimgnr(QString* s) +int jpgimgnr(QString *s) { int result = 0; uint pos; @@ -172,10 +172,10 @@ QString TruncateFileName(QString str) return str; } -bool read_grouptissues(const char* filename, vector& olds, - vector& news) +bool read_grouptissues(const char *filename, vector &olds, + vector &news) { - FILE* fp; + FILE *fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -194,11 +194,11 @@ bool read_grouptissues(const char* filename, vector& olds, } } -bool read_grouptissuescapped(const char* filename, vector& olds, - vector& news, - bool fail_on_unknown_tissue) +bool read_grouptissuescapped(const char *filename, vector &olds, + vector &news, + bool fail_on_unknown_tissue) { - FILE* fp; + FILE *fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -223,7 +223,7 @@ bool read_grouptissuescapped(const char* filename, vector& olds, // Read input as tissue indices type2 = (tissues_size_t)QString(name2).toUInt(&readIndices); if (type1 > 0 && type1 <= tissueCount && type2 > 0 && - type2 <= tissueCount) + type2 <= tissueCount) { olds.push_back(type1); news.push_back(type2); @@ -237,7 +237,7 @@ bool read_grouptissuescapped(const char* filename, vector& olds, type1 = (tissues_size_t)tmp1; type2 = (tissues_size_t)tmp2; if (type1 > 0 && type1 <= tissueCount && type2 > 0 && - type2 <= tissueCount) + type2 <= tissueCount) { olds.push_back(type1); news.push_back(type2); @@ -252,7 +252,7 @@ bool read_grouptissuescapped(const char* filename, vector& olds, type1 = TissueInfos::GetTissueType(QString(name1)); type2 = TissueInfos::GetTissueType(QString(name2)); if (type1 > 0 && type1 <= tissueCount && type2 > 0 && - type2 <= tissueCount) + type2 <= tissueCount) { olds.push_back(type1); news.push_back(type2); @@ -273,7 +273,7 @@ bool read_grouptissuescapped(const char* filename, vector& olds, type1 = TissueInfos::GetTissueType(QString(name1)); type2 = TissueInfos::GetTissueType(QString(name2)); if (type1 > 0 && type1 <= tissueCount && type2 > 0 && - type2 <= tissueCount) + type2 <= tissueCount) { olds.push_back(type1); news.push_back(type2); @@ -282,11 +282,9 @@ bool read_grouptissuescapped(const char* filename, vector& olds, { ok = false; if (type1 == 0 || type1 > tissueCount) - std::cerr << "old: " << name1 - << " not in tissue list\n"; + std::cerr << "old: " << name1 << " not in tissue list\n"; if (type2 == 0 || type2 > tissueCount) - std::cerr << "new: " << name2 - << " not in tissue list\n"; + std::cerr << "new: " << name2 << " not in tissue list\n"; } memset(name1, 0, 1000); @@ -300,9 +298,9 @@ bool read_grouptissuescapped(const char* filename, vector& olds, } } -bool read_tissues(const char* filename, std::vector& types) +bool read_tissues(const char *filename, std::vector &types) { - FILE* fp; + FILE *fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -331,14 +329,14 @@ bool read_tissues(const char* filename, std::vector& types) return ok; } -void style_dockwidget(QDockWidget* dockwidg) +void style_dockwidget(QDockWidget *dockwidg) { //dockwidg->setStyleSheet("QDockWidget { color: black; } QDockWidget::title { background: gray; padding-left: 5px; padding-top: 3px; color: darkgray} QDockWidget::close-button, QDockWidget::float-button { background: gray; }"); } -bool MenuWTT::event(QEvent* e) +bool MenuWTT::event(QEvent *e) { - const QHelpEvent* helpEvent = static_cast(e); + const QHelpEvent *helpEvent = static_cast(e); if (helpEvent->type() == QEvent::ToolTip) { // call QToolTip::showText on that QAction's tooltip. @@ -360,11 +358,11 @@ bool MenuWTT::event(QEvent* e) return QMenu::event(e); } -MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, - QDir picpath, QDir tmppath, bool editingmode, - QWidget* parent, const char* name, - Qt::WindowFlags wFlags, char** argv) - : QMainWindow(parent, name, wFlags) +MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, + QDir picpath, QDir tmppath, bool editingmode, + QWidget *parent, const char *name, + Qt::WindowFlags wFlags, char **argv) + : QMainWindow(parent, name, wFlags) { setObjectName("MainWindow"); @@ -375,7 +373,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, m_editingmode = editingmode; tab_old = nullptr; - setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + QString(" - No Filename")); + setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + + QString(" - No Filename")); QIcon isegicon(m_picpath.absFilePath(QString("isegicon.png")).ascii()); setWindowIcon(isegicon); m_locationstring = locationstring; @@ -403,7 +402,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, cb_workpicturevisible->setChecked(true); bmp_show = new bmptissuemarklineshower( - this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); + this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); lb_source = new QLabel("Source", this); lb_target = new QLabel("Target", this); bmp_scroller = new Q3ScrollView(this); @@ -413,8 +412,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, sl_brightnessbmp->setRange(0, 100); lb_contrastbmp = new QLabel("C:", this); lb_contrastbmp->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) + .pixmap()); le_contrastbmp_val = new QLineEdit(this); le_contrastbmp_val->setAlignment(Qt::AlignRight); le_contrastbmp_val->setText(QString("%1").arg(9999.99, 6, 'f', 2)); @@ -425,8 +424,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, lb_contrastbmp_val = new QLabel("x", this); lb_brightnessbmp = new QLabel("B:", this); lb_brightnessbmp->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) + .pixmap()); le_brightnessbmp_val = new QLineEdit(this); le_brightnessbmp_val->setAlignment(Qt::AlignRight); le_brightnessbmp_val->setText(QString("%1").arg(9999, 3)); @@ -443,29 +442,28 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, bmp_show->update(); toworkBtn = new QPushButton( - QIcon(m_picpath.absFilePath(QString("next.png")).ascii()), "", this); + QIcon(m_picpath.absFilePath(QString("next.png")).ascii()), "", this); toworkBtn->setFixedWidth(50); tobmpBtn = new QPushButton( - QIcon(m_picpath.absFilePath(QString("previous.png")).ascii()), "", - this); + QIcon(m_picpath.absFilePath(QString("previous.png")).ascii()), "", this); tobmpBtn->setFixedWidth(50); swapBtn = new QPushButton( - QIcon(m_picpath.absFilePath(QString("swap.png")).ascii()), "", this); + QIcon(m_picpath.absFilePath(QString("swap.png")).ascii()), "", this); swapBtn->setFixedWidth(50); swapAllBtn = new QPushButton( - QIcon(m_picpath.absFilePath(QString("swap.png")).ascii()), "3D", this); + QIcon(m_picpath.absFilePath(QString("swap.png")).ascii()), "3D", this); swapAllBtn->setFixedWidth(50); work_show = new bmptissuemarklineshower( - this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); + this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); sl_contrastwork = new QSlider(Qt::Horizontal, this); sl_contrastwork->setRange(0, 100); sl_brightnesswork = new QSlider(Qt::Horizontal, this); sl_brightnesswork->setRange(0, 100); lb_contrastwork = new QLabel(this); lb_contrastwork->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) + .pixmap()); le_contrastwork_val = new QLineEdit(this); le_contrastwork_val->setAlignment(Qt::AlignRight); le_contrastwork_val->setText(QString("%1").arg(9999.99, 6, 'f', 2)); @@ -476,8 +474,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, lb_contrastwork_val = new QLabel("x", this); lb_brightnesswork = new QLabel(this); lb_brightnesswork->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) + .pixmap()); le_brightnesswork_val = new QLineEdit(this); le_brightnesswork_val->setAlignment(Qt::AlignRight); le_brightnesswork_val->setText(QString("%1").arg(9999, 3)); @@ -498,7 +496,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, zoom_widget = new zoomer_widget(1.0, m_picpath, this); tissueTreeWidget = - new TissueTreeWidget(handler3D->get_tissue_hierachy(), m_picpath, this); + new TissueTreeWidget(handler3D->get_tissue_hierachy(), m_picpath, this); tissueTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); tissueFilter = new QLineEdit(this); tissueFilter->setMargin(1); @@ -506,7 +504,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, tissueTreeWidget->update_tree_widget(); // Reload hierarchy cb_tissuelock = new QCheckBox(this); cb_tissuelock->setPixmap( - QIcon(m_picpath.absFilePath(QString("lock.png")).ascii()).pixmap()); + QIcon(m_picpath.absFilePath(QString("lock.png")).ascii()).pixmap()); cb_tissuelock->setChecked(false); lockTissues = new QPushButton("All", this); lockTissues->setToggleButton(true); @@ -516,69 +514,68 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, //xxxb addTissue->setFixedWidth(110); modifyTissueFolder = new QPushButton("Mod. Tissue/Folder", this); modifyTissueFolder->setToolTip( - Format("Edit the selected tissue or folder properties.")); + Format("Edit the selected tissue or folder properties.")); //xxxb modifyTissue->setFixedWidth(110); removeTissueFolder = new QPushButton("Del. Tissue/Folder", this); removeTissueFolder->setToolTip( - Format("Remove the selected tissues or folders.")); + Format("Remove the selected tissues or folders.")); removeTissueFolderAll = new QPushButton("All", this); removeTissueFolderAll->setFixedWidth(30); //xxxb removeTissue->setFixedWidth(110); tissue3Dopt = new QCheckBox("3D", this); tissue3Dopt->setChecked(false); tissue3Dopt->setToolTip( - Format("'Get Tissue' is applied in 3D or current slice only.")); + Format("'Get Tissue' is applied in 3D or current slice only.")); getTissue = new QPushButton("Get Tissue", this); getTissue->setToolTip(Format("Get tissue creates a mask in the Target from " - "the currently selected Tissue.")); + "the currently selected Tissue.")); getTissueAll = new QPushButton("All", this); getTissueAll->setFixedWidth(30); - getTissueAll->setToolTip( - Format("Get all tissue creates a mask in the Target " - "from all Tissue excluding the background.")); + getTissueAll->setToolTip(Format("Get all tissue creates a mask in the Target " + "from all Tissue excluding the background.")); //xxxb getTissue->setFixedWidth(110); clearTissue = new QPushButton("Clear Tissue", this); clearTissue->setToolTip( - Format("Clears the currently selected tissue (use '3D' option to clear " - "whole tissue or just the current slice).")); + Format("Clears the currently selected tissue (use '3D' option to clear " + "whole tissue or just the current slice).")); //xxxb clearTissue->setFixedWidth(110); clearTissues = new QPushButton("All", this); clearTissues->setFixedWidth(30); clearTissues->setToolTip( - Format("Clears all tissues (use '3D' option to clear the entire " - "segmentation or just the current slice).")); + Format("Clears all tissues (use '3D' option to clear the entire " + "segmentation or just the current slice).")); //xxxb clearTissues->setFixedWidth(110); cb_addsub3d = new QCheckBox("3D", this); cb_addsub3d->setToolTip( - Format("Apply add/remove actions in 3D or current slice only.")); + Format("Apply add/remove actions in 3D or current slice only.")); cb_addsuboverride = new QCheckBox("Override", this); cb_addsuboverride->setToolTip( - Format("If override is off, Tissue voxels which are already assigned " - "will not be modified. Override allows to change these voxels, " - "unless they are locked.")); + Format("If override is off, Tissue voxels which are already assigned " + "will not be modified. Override allows to change these voxels, " + "unless they are locked.")); cb_addsubconn = new QCheckBox("Connected", this); cb_addsubconn->setToolTip( - Format("Only the connected image region is added/removed.")); + Format("Only the connected image region is added/removed.")); // vboxtissueadder2->addStretch(); pb_add = new QPushButton("+", this); pb_add->setToggleButton(true); pb_add->setToolTip(Format( - "Adds next selected/picked Target image region to current tissue.")); + "Adds next selected/picked Target image region to current tissue.")); pb_sub = new QPushButton("-", this); pb_sub->setToggleButton(true); pb_sub->setToolTip(Format("Removes next selected/picked Target image " - "region from current tissue.")); + "region from current tissue.")); pb_addhold = new QPushButton("++", this); pb_addhold->setToggleButton(true); pb_addhold->setToolTip( - Format("Adds selected/picked Target image regions to current tissue.")); + Format("Adds selected/picked Target image regions to current tissue.")); // pb_stophold=new QPushButton(".",this); // vboxtissueadder2->addWidget(pb_stophold); pb_subhold = new QPushButton("--", this); pb_subhold->setToggleButton(true); pb_subhold->setToolTip(Format( - "Removes selected/picked Target image regions from current tissue.")); + "Removes selected/picked Target image regions from current tissue.")); /* pb_add3D=new QPushButton("+3D",this); vboxtissueadder1->addWidget(pb_add3D); pb_addconn=new QPushButton("+Conn",this); @@ -596,15 +593,15 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, unsigned short slicenr = handler3D->get_activeslice() + 1; pb_first = new QPushButton("|<<", this); scb_slicenr = new QScrollBar(1, (int)handler3D->return_nrslices(), 1, 5, 1, - Qt::Horizontal, this); + Qt::Horizontal, this); scb_slicenr->setFixedWidth(500); scb_slicenr->setValue(int(slicenr)); pb_last = new QPushButton(">>|", this); sb_slicenr = new QSpinBox(1, (int)handler3D->return_nrslices(), 1, this); sb_slicenr->setValue(slicenr); lb_slicenr = new QLabel( - QString(" of ") + QString::number((int)handler3D->return_nrslices()), - this); + QString(" of ") + QString::number((int)handler3D->return_nrslices()), + this); // lb_inactivewarning=new QLabel(QSimpleRichText(QString(" 3D Inactive Slice!"),this->font()),this); lb_inactivewarning = new QLabel(" 3D Inactive Slice! ", this); lb_inactivewarning->setPaletteForegroundColor(QColor(255, 0, 0)); @@ -612,68 +609,69 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, lb_slicethick = new QLabel("Slice Thickness (mm): ", this); le_slicethick = - new QLineEdit(QString::number(handler3D->get_slicethickness()), this); + new QLineEdit(QString::number(handler3D->get_slicethickness()), this); le_slicethick->setFixedWidth(80); threshold_widget = - new ThresholdWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new ThresholdWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(threshold_widget); - hyst_widget = new HystereticGrowingWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + hyst_widget = + new HystereticGrowingWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(hyst_widget); lw_widget = new livewire_widget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(lw_widget); - iftrg_widget = new ImageForestingTransformRegionGrowingWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + iftrg_widget = new ImageForestingTransformRegionGrowingWidget( + handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(iftrg_widget); FMF_widget = - new FastmarchingFuzzyWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new FastmarchingFuzzyWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(FMF_widget); wshed_widget = - new WatershedWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new WatershedWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(wshed_widget); OutlineCorrect_widget = - new OutlineCorrectionWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new OutlineCorrectionWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(OutlineCorrect_widget); interpolwidget = - new InterpolationWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new InterpolationWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(interpolwidget); smoothing_widget = - new SmoothingWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new SmoothingWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(smoothing_widget); morph_widget = - new MorphologyWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new MorphologyWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(morph_widget); edge_widg = new EdgeWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(edge_widg); feature_widget = - new FeatureWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new FeatureWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(feature_widget); measurement_widget = - new MeasurementWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new MeasurementWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(measurement_widget); vesselextr_widget = - new VesselWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new VesselWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(vesselextr_widget); - pickerwidget = - new PickerWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + pickerwidget = new PickerWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(pickerwidget); transfrmWidget = - new TransformWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new TransformWidget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(transfrmWidget); boost::filesystem::path this_exe(argv[0]); @@ -686,7 +684,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, { a->install_slice_handler(handler3D); tabwidgets.push_back(a->create_widget( - this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase)); + this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase)); } nrtabbuttons = (unsigned short)tabwidgets.size(); @@ -724,15 +722,15 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, methodTab->raiseWidget(tabwidgets[posi]); } - tab_changed((WidgetInterface*)methodTab->visibleWidget()); + tab_changed((WidgetInterface *)methodTab->visibleWidget()); // tab_old=(QWidget1 *)methodTab->visibleWidget(); updateTabvisibility(); int height_max = 0; QSize qs; //,qsmax; - // qsmax.setHeight(0); - // qsmax.setWidth(0); + // qsmax.setHeight(0); + // qsmax.setWidth(0); for (size_t i = 0; i < tabwidgets.size(); i++) { qs = tabwidgets[i]->sizeHint(); @@ -754,22 +752,21 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, } scalewidget = new ScaleWork(handler3D, m_picpath, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); imagemathwidget = new ImageMath(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); imageoverlaywidget = - new ImageOverlay(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new ImageOverlay(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); - bitstack_widget = - new bits_stack(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + bitstack_widget = new bits_stack(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); overlay_widget = - new extoverlay_widget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new extoverlay_widget(handler3D, this, "new window", + Qt::WDestructiveClose | Qt::WResizeNoErase); m_MultiDataset_widget = - new MultiDataset_widget(handler3D, this, "multi dataset window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + new MultiDataset_widget(handler3D, this, "multi dataset window", + Qt::WDestructiveClose | Qt::WResizeNoErase); int height_max1 = height_max; // methodTab->setFixedHeight(height_max1); // bitstack_widget->setFixedHeight(height_max1); @@ -785,7 +782,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, VV3Dbmp = NULL; if (handler3D->return_startslice() >= slicenr || - handler3D->return_endslice() + 1 <= slicenr) + handler3D->return_endslice() + 1 <= slicenr) { lb_inactivewarning->setText(QString(" 3D Inactive Slice! ")); lb_inactivewarning->setPaletteBackgroundColor(QColor(0, 255, 0)); @@ -794,35 +791,35 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, { lb_inactivewarning->setText(QString(" ")); lb_inactivewarning->setPaletteBackgroundColor( - this->paletteBackgroundColor()); + this->paletteBackgroundColor()); } - QWidget* hbox2w = new QWidget; + QWidget *hbox2w = new QWidget; setCentralWidget(hbox2w); - QWidget* vbox2w = new QWidget; - QWidget* rightvboxw = new QWidget; - QWidget* hbox1w = new QWidget; - QWidget* hboxslicew = new QWidget; - QWidget* hboxslicenrw = new QWidget; - QWidget* hboxslicethickw = new QWidget; + QWidget *vbox2w = new QWidget; + QWidget *rightvboxw = new QWidget; + QWidget *hbox1w = new QWidget; + QWidget *hboxslicew = new QWidget; + QWidget *hboxslicenrw = new QWidget; + QWidget *hboxslicethickw = new QWidget; vboxbmpw = new QWidget; vboxworkw = new QWidget; - QWidget* vbox1w = new QWidget; - QWidget* hboxbmpw = new QWidget; - QWidget* hboxworkw = new QWidget; - QWidget* hboxbmp1w = new QWidget; - QWidget* hboxwork1w = new QWidget; - QWidget* vboxtissuew = new QWidget; - QWidget* hboxlockw = new QWidget; - QWidget* hboxtissueadderw = new QWidget; - QWidget* vboxtissueadder1w = new QWidget; - QWidget* vboxtissueadder2w = new QWidget; - QWidget* hboxtabsw = new QWidget; - QWidget* vboxtabs1w = new QWidget; - QWidget* vboxtabs2w = new QWidget; - - QHBoxLayout* hboxbmp1 = new QHBoxLayout; + QWidget *vbox1w = new QWidget; + QWidget *hboxbmpw = new QWidget; + QWidget *hboxworkw = new QWidget; + QWidget *hboxbmp1w = new QWidget; + QWidget *hboxwork1w = new QWidget; + QWidget *vboxtissuew = new QWidget; + QWidget *hboxlockw = new QWidget; + QWidget *hboxtissueadderw = new QWidget; + QWidget *vboxtissueadder1w = new QWidget; + QWidget *vboxtissueadder2w = new QWidget; + QWidget *hboxtabsw = new QWidget; + QWidget *vboxtabs1w = new QWidget; + QWidget *vboxtabs2w = new QWidget; + + QHBoxLayout *hboxbmp1 = new QHBoxLayout; hboxbmp1->setSpacing(0); hboxbmp1->setMargin(0); hboxbmp1->addWidget(lb_contrastbmp); @@ -835,7 +832,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxbmp1->addWidget(sl_brightnessbmp); hboxbmp1w->setLayout(hboxbmp1); - QHBoxLayout* hboxbmp = new QHBoxLayout; + QHBoxLayout *hboxbmp = new QHBoxLayout; hboxbmp->setSpacing(0); hboxbmp->setMargin(0); hboxbmp->addWidget(cb_bmptissuevisible); @@ -843,7 +840,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxbmp->addWidget(cb_bmpoutlinevisible); hboxbmpw->setLayout(hboxbmp); - QVBoxLayout* vboxbmp = new QVBoxLayout; + QVBoxLayout *vboxbmp = new QVBoxLayout; vboxbmp->setSpacing(0); vboxbmp->setMargin(0); vboxbmp->addWidget(lb_source); @@ -852,7 +849,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vboxbmp->addWidget(hboxbmpw); vboxbmpw->setLayout(vboxbmp); - QVBoxLayout* vbox1 = new QVBoxLayout; + QVBoxLayout *vbox1 = new QVBoxLayout; vbox1->setSpacing(0); vbox1->setMargin(0); vbox1->addWidget(toworkBtn); @@ -861,7 +858,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vbox1->addWidget(swapAllBtn); vbox1w->setLayout(vbox1); - QHBoxLayout* hboxwork1 = new QHBoxLayout; + QHBoxLayout *hboxwork1 = new QHBoxLayout; hboxwork1->setSpacing(0); hboxwork1->setMargin(0); hboxwork1->addWidget(lb_contrastwork); @@ -874,7 +871,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxwork1->addWidget(sl_brightnesswork); hboxwork1w->setLayout(hboxwork1); - QHBoxLayout* hboxwork = new QHBoxLayout; + QHBoxLayout *hboxwork = new QHBoxLayout; hboxwork->setSpacing(0); hboxwork->setMargin(0); hboxwork->addWidget(cb_worktissuevisible); @@ -883,7 +880,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxworkw->setLayout(hboxwork); // vboxworkw->setSizePolicy(QSizePolicy::Ignored); - QVBoxLayout* vboxwork = new QVBoxLayout; + QVBoxLayout *vboxwork = new QVBoxLayout; vboxwork->setSpacing(0); vboxwork->setMargin(0); vboxwork->addWidget(lb_target); @@ -895,7 +892,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, // vboxbmpw->setSizePolicy(QSizePolicy::Ignore,QSizePolicy::Ignore); // vboxworkw->setSizePolicy(QSizePolicy::Ignore,QSizePolicy::Ignore); - QHBoxLayout* hbox1 = new QHBoxLayout; + QHBoxLayout *hbox1 = new QHBoxLayout; hbox1->setSpacing(0); hbox1->setMargin(0); hbox1->addWidget(vboxbmpw); @@ -903,14 +900,14 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hbox1->addWidget(vboxworkw); hbox1w->setLayout(hbox1); - QHBoxLayout* hboxslicethick = new QHBoxLayout; + QHBoxLayout *hboxslicethick = new QHBoxLayout; hboxslicethick->setSpacing(0); hboxslicethick->setMargin(0); hboxslicethick->addWidget(lb_slicethick); hboxslicethick->addWidget(le_slicethick); hboxslicethickw->setLayout(hboxslicethick); - QHBoxLayout* hboxslicenr = new QHBoxLayout; + QHBoxLayout *hboxslicenr = new QHBoxLayout; hboxslicenr->setSpacing(0); hboxslicenr->setMargin(0); hboxslicenr->addWidget(pb_first); @@ -921,7 +918,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxslicenr->addWidget(lb_inactivewarning); hboxslicenrw->setLayout(hboxslicenr); - QHBoxLayout* hboxslice = new QHBoxLayout; + QHBoxLayout *hboxslice = new QHBoxLayout; hboxslice->setSpacing(0); hboxslice->setMargin(0); hboxslice->addWidget(hboxslicenrw); @@ -929,8 +926,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxslice->addWidget(hboxslicethickw); hboxslicew->setLayout(hboxslice); - auto add_widget_filter = [this](QVBoxLayout* vbox, QPushButton* pb, - unsigned short i) { + auto add_widget_filter = [this](QVBoxLayout *vbox, QPushButton *pb, + unsigned short i) { #ifdef PLUGIN_VESSEL_WIDGET vbox->addWidget(pb); #else @@ -941,7 +938,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, #endif }; - QVBoxLayout* vboxtabs1 = new QVBoxLayout; + QVBoxLayout *vboxtabs1 = new QVBoxLayout; vboxtabs1->setSpacing(0); vboxtabs1->setMargin(0); for (unsigned short i = 0; i < (nrtabbuttons + 1) / 2; i++) @@ -949,7 +946,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, add_widget_filter(vboxtabs1, pb_tab[i], i); } vboxtabs1w->setLayout(vboxtabs1); - QVBoxLayout* vboxtabs2 = new QVBoxLayout; + QVBoxLayout *vboxtabs2 = new QVBoxLayout; vboxtabs2->setSpacing(0); vboxtabs2->setMargin(0); for (unsigned short i = (nrtabbuttons + 1) / 2; i < nrtabbuttons; i++) @@ -968,7 +965,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vboxtabs2w->setMaximumHeight(height_max1); } - QHBoxLayout* hboxtabs = new QHBoxLayout; + QHBoxLayout *hboxtabs = new QHBoxLayout; hboxtabs->setSpacing(0); hboxtabs->setMargin(0); hboxtabs->addWidget(vboxtabs1w); @@ -976,69 +973,67 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxtabsw->setLayout(hboxtabs); hboxtabsw->setFixedWidth(hboxtabs->sizeHint().width()); - QDockWidget* tabswdock = new QDockWidget(tr("Methods"), this); + QDockWidget *tabswdock = new QDockWidget(tr("Methods"), this); style_dockwidget(tabswdock); tabswdock->setObjectName("Methods"); - tabswdock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + tabswdock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); tabswdock->setWidget(hboxtabsw); addDockWidget(Qt::BottomDockWidgetArea, tabswdock); - QDockWidget* methodTabdock = new QDockWidget(tr("Parameters"), this); + QDockWidget *methodTabdock = new QDockWidget(tr("Parameters"), this); style_dockwidget(methodTabdock); methodTabdock->setObjectName("Parameters"); methodTabdock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::BottomDockWidgetArea); // Q3ScrollView *tab_scroller=new Q3ScrollView(this);xxxa // tab_scroller->addChild(methodTab); // methodTabdock->setWidget(tab_scroller); methodTabdock->setWidget(methodTab); addDockWidget(Qt::BottomDockWidgetArea, methodTabdock); - QVBoxLayout* vboxnotes = new QVBoxLayout; + QVBoxLayout *vboxnotes = new QVBoxLayout; vboxnotes->setSpacing(0); vboxnotes->setMargin(0); - QDockWidget* notesdock = new QDockWidget(tr("Notes"), this); + QDockWidget *notesdock = new QDockWidget(tr("Notes"), this); style_dockwidget(notesdock); notesdock->setObjectName("Notes"); - notesdock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + notesdock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); notesdock->setWidget(m_notes); addDockWidget(Qt::BottomDockWidgetArea, notesdock); - QDockWidget* bitstackdock = new QDockWidget(tr("Img Clipboard"), this); + QDockWidget *bitstackdock = new QDockWidget(tr("Img Clipboard"), this); style_dockwidget(bitstackdock); bitstackdock->setObjectName("Clipboard"); bitstackdock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::BottomDockWidgetArea); bitstackdock->setWidget(bitstack_widget); addDockWidget(Qt::BottomDockWidgetArea, bitstackdock); - QDockWidget* multiDatasetDock = new QDockWidget(tr("Multi Dataset"), this); + QDockWidget *multiDatasetDock = new QDockWidget(tr("Multi Dataset"), this); style_dockwidget(multiDatasetDock); multiDatasetDock->setObjectName("Multi Dataset"); multiDatasetDock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::BottomDockWidgetArea); multiDatasetDock->setWidget(m_MultiDataset_widget); addDockWidget(Qt::BottomDockWidgetArea, multiDatasetDock); - QDockWidget* overlaydock = new QDockWidget(tr("Overlay"), this); + QDockWidget *overlaydock = new QDockWidget(tr("Overlay"), this); style_dockwidget(overlaydock); overlaydock->setObjectName("Overlay"); overlaydock->setAllowedAreas(Qt::TopDockWidgetArea | - Qt::BottomDockWidgetArea); + Qt::BottomDockWidgetArea); overlaydock->setWidget(overlay_widget); addDockWidget(Qt::BottomDockWidgetArea, overlaydock); - QVBoxLayout* vbox2 = new QVBoxLayout; + QVBoxLayout *vbox2 = new QVBoxLayout; vbox2->setSpacing(0); vbox2->setMargin(0); vbox2->addWidget(hbox1w); vbox2->addWidget(hboxslicew); vbox2w->setLayout(vbox2); - QHBoxLayout* hboxlock = new QHBoxLayout; + QHBoxLayout *hboxlock = new QHBoxLayout; hboxlock->setSpacing(0); hboxlock->setMargin(0); hboxlock->addWidget(cb_tissuelock); @@ -1046,7 +1041,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxlock->addStretch(); hboxlockw->setLayout(hboxlock); - QVBoxLayout* vboxtissue = new QVBoxLayout; + QVBoxLayout *vboxtissue = new QVBoxLayout; vboxtissue->setSpacing(0); vboxtissue->setMargin(0); vboxtissue->addWidget(tissueFilter); @@ -1056,23 +1051,23 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vboxtissue->addWidget(addFolder); vboxtissue->addWidget(modifyTissueFolder); - QHBoxLayout* hboxtissueremove = new QHBoxLayout; + QHBoxLayout *hboxtissueremove = new QHBoxLayout; hboxtissueremove->addWidget(removeTissueFolder); hboxtissueremove->addWidget(removeTissueFolderAll); vboxtissue->addLayout(hboxtissueremove); vboxtissue->addWidget(tissue3Dopt); - QHBoxLayout* hboxtissueget = new QHBoxLayout; + QHBoxLayout *hboxtissueget = new QHBoxLayout; hboxtissueget->addWidget(getTissue); hboxtissueget->addWidget(getTissueAll); vboxtissue->addLayout(hboxtissueget); - QHBoxLayout* hboxtissueclear = new QHBoxLayout; + QHBoxLayout *hboxtissueclear = new QHBoxLayout; hboxtissueclear->addWidget(clearTissue); hboxtissueclear->addWidget(clearTissues); vboxtissue->addLayout(hboxtissueclear); vboxtissuew->setLayout(vboxtissue); //xxxb vboxtissuew->setFixedHeight(vboxtissue->sizeHint().height()); - QVBoxLayout* vboxtissueadder1 = new QVBoxLayout; + QVBoxLayout *vboxtissueadder1 = new QVBoxLayout; vboxtissueadder1->setSpacing(0); vboxtissueadder1->setMargin(0); vboxtissueadder1->addWidget(cb_addsub3d); @@ -1082,7 +1077,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vboxtissueadder1w->setLayout(vboxtissueadder1); vboxtissueadder1w->setFixedHeight(vboxtissueadder1->sizeHint().height()); - QVBoxLayout* vboxtissueadder2 = new QVBoxLayout; + QVBoxLayout *vboxtissueadder2 = new QVBoxLayout; vboxtissueadder2->setSpacing(0); vboxtissueadder2->setMargin(0); vboxtissueadder2->addWidget(cb_addsubconn); @@ -1092,7 +1087,7 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, vboxtissueadder2w->setLayout(vboxtissueadder2); vboxtissueadder2w->setFixedHeight(vboxtissueadder1->sizeHint().height()); - QHBoxLayout* hboxtissueadder = new QHBoxLayout; + QHBoxLayout *hboxtissueadder = new QHBoxLayout; hboxtissueadder->setSpacing(0); hboxtissueadder->setMargin(0); hboxtissueadder->addWidget(vboxtissueadder1w); @@ -1101,50 +1096,49 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hboxtissueadderw->setFixedHeight(hboxtissueadder->sizeHint().height()); //xxxb hboxtissueadderw->setFixedWidth(vboxtissue->sizeHint().width()); - QDockWidget* zoomdock = new QDockWidget(tr("Zoom"), this); + QDockWidget *zoomdock = new QDockWidget(tr("Zoom"), this); style_dockwidget(zoomdock); zoomdock->setObjectName("Zoom"); zoomdock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); zoomdock->setWidget(zoom_widget); addDockWidget(Qt::RightDockWidgetArea, zoomdock); - QDockWidget* tissuewdock = new QDockWidget(tr("Tissues"), this); + QDockWidget *tissuewdock = new QDockWidget(tr("Tissues"), this); style_dockwidget(tissuewdock); tissuewdock->setObjectName("Tissues"); tissuewdock->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); + Qt::RightDockWidgetArea); tissuewdock->setWidget(vboxtissuew); addDockWidget(Qt::RightDockWidgetArea, tissuewdock); - QDockWidget* tissuehierarchydock = - new QDockWidget(tr("Tissue Hierarchy"), this); + QDockWidget *tissuehierarchydock = + new QDockWidget(tr("Tissue Hierarchy"), this); style_dockwidget(tissuehierarchydock); tissuehierarchydock->setToolTip( - Format("The tissue hierarchy allows to group and organize complex " - "segmentations into a hierarchy.")); + Format("The tissue hierarchy allows to group and organize complex " + "segmentations into a hierarchy.")); tissuehierarchydock->setObjectName("Tissue Hierarchy"); tissuehierarchydock->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); + Qt::RightDockWidgetArea); tissuehierarchydock->setWidget(tissueHierarchyWidget); addDockWidget(Qt::RightDockWidgetArea, tissuehierarchydock); - QDockWidget* tissueadddock = new QDockWidget(tr("Adder"), this); + QDockWidget *tissueadddock = new QDockWidget(tr("Adder"), this); style_dockwidget(tissueadddock); - tissueadddock->setToolTip( - Format("The tissue adder provides functionality " - "to add/remove an object selected/picked in " - "the Target to/from the selected tissue." - "Note: Only one tissue can be selected.")); + tissueadddock->setToolTip(Format("The tissue adder provides functionality " + "to add/remove an object selected/picked in " + "the Target to/from the selected tissue." + "Note: Only one tissue can be selected.")); tissueadddock->setObjectName("Adder"); tissueadddock->setAllowedAreas(Qt::LeftDockWidgetArea | - Qt::RightDockWidgetArea); + Qt::RightDockWidgetArea); tissueadddock->setWidget(hboxtissueadderw); addDockWidget(Qt::RightDockWidgetArea, tissueadddock); hboxslice->addStretch(); hboxslice->addStretch(); - QHBoxLayout* hbox2 = new QHBoxLayout; + QHBoxLayout *hbox2 = new QHBoxLayout; hbox2->setSpacing(0); hbox2->setMargin(0); hbox2->addWidget(vbox2w); @@ -1161,8 +1155,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, if (!m_editingmode) { file->insertItem( - QIcon(m_picpath.absFilePath(QString("filenew.png")).ascii()), - "&New...", this, SLOT(execute_new())); + QIcon(m_picpath.absFilePath(QString("filenew.png")).ascii()), "&New...", + this, SLOT(execute_new())); loadmenu = new Q3PopupMenu(this, "loadmenu"); loadmenu->insertItem("Open .dcm...", this, SLOT(execute_loaddicom())); loadmenu->insertItem("Open .bmp...", this, SLOT(execute_loadbmp())); @@ -1171,30 +1165,26 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, loadmenu->insertItem("Open .raw...", this, SLOT(execute_loadraw())); loadmenu->insertItem("Open .mhd...", this, SLOT(execute_loadmhd())); loadmenu->insertItem("Open .avw...", this, SLOT(execute_loadavw())); - loadmenu->insertItem("Open .vti/.vtk...", this, - SLOT(execute_loadvtk())); + loadmenu->insertItem("Open .vti/.vtk...", this, SLOT(execute_loadvtk())); loadmenu->insertItem("Open NIfTI...", this, SLOT(execute_loadnifti())); #ifndef NORTDOSESUPPORT - loadmenu->insertItem("Open RTdose...", this, - SLOT(execute_loadrtdose())); + loadmenu->insertItem("Open RTdose...", this, SLOT(execute_loadrtdose())); #endif file->insertItem("&Open", loadmenu); } reloadmenu = new Q3PopupMenu( - this, "reloadmenu"); //xxxa add reload function for s4llink data later - reloadmenu->insertItem("Reopen .dc&m...", this, - SLOT(execute_reloaddicom())); + this, "reloadmenu"); //xxxa add reload function for s4llink data later + reloadmenu->insertItem("Reopen .dc&m...", this, SLOT(execute_reloaddicom())); reloadmenu->insertItem("Reopen .&bmp...", this, SLOT(execute_reloadbmp())); reloadmenu->insertItem("Reopen .raw...", this, SLOT(execute_reloadraw())); reloadmenu->insertItem("Reopen .mhd...", this, SLOT(execute_reloadmhd())); reloadmenu->insertItem("Reopen .avw...", this, SLOT(execute_reloadavw())); reloadmenu->insertItem("Reopen .vti/.vtk...", this, - SLOT(execute_reloadvtk())); - reloadmenu->insertItem("Reopen NIfTI...", this, - SLOT(execute_reloadnifti())); + SLOT(execute_reloadvtk())); + reloadmenu->insertItem("Reopen NIfTI...", this, SLOT(execute_reloadnifti())); #ifndef NORTDOSESUPPORT reloadmenu->insertItem("Reopen RTdose...", this, - SLOT(execute_reloadrtdose())); + SLOT(execute_reloadrtdose())); #endif file->insertItem("&Reopen", reloadmenu); #ifndef NORTSTRUCTSUPPORT @@ -1202,93 +1192,89 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, if (!m_editingmode) { openS4LLinkPos = file->actions().size(); - QAction* importS4LLink = file->addAction("Import S4L link (h5)..."); + QAction *importS4LLink = file->addAction("Import S4L link (h5)..."); connect(importS4LLink, SIGNAL(triggered()), this, - SLOT(execute_loads4llivelink())); - importS4LLink->setToolTip( - "Loads a Sim4Life live link file (the h5 file, " - "which is part of an iSEG project)."); + SLOT(execute_loads4llivelink())); + importS4LLink->setToolTip("Loads a Sim4Life live link file (the h5 file, " + "which is part of an iSEG project)."); importS4LLink->setEnabled(true); } importSurfacePos = file->actions().size(); - QAction* importSurface = file->addAction("Import Surface..."); + QAction *importSurface = file->addAction("Import Surface..."); connect(importSurface, SIGNAL(triggered()), this, - SLOT(execute_loadsurface())); + SLOT(execute_loadsurface())); importSurface->setToolTip("Some data must be opened first to load the " - "surface on top of the existing project."); + "surface on top of the existing project."); importSurface->setEnabled(true); importRTstructPos = file->actions().size(); - QAction* importRTAction = file->addAction("Import RTstruct..."); + QAction *importRTAction = file->addAction("Import RTstruct..."); connect(importRTAction, SIGNAL(triggered()), this, - SLOT(execute_loadrtstruct())); + SLOT(execute_loadrtstruct())); importRTAction->setToolTip( - "Some data must be opened first to import its RTStruct file"); + "Some data must be opened first to import its RTStruct file"); importRTAction->setEnabled(false); #endif file->insertItem("&Export Image(s)...", this, SLOT(execute_saveimg())); file->insertItem("Export &Contour...", this, SLOT(execute_saveContours())); exportmenu = new Q3PopupMenu(this, "exportmenu"); exportmenu->insertItem("Export &Labelfield...(am)", this, - SLOT(execute_exportlabelfield())); + SLOT(execute_exportlabelfield())); exportmenu->insertItem("Export vtk-ascii...(vti/vtk)", this, - SLOT(execute_exportvtkascii())); + SLOT(execute_exportvtkascii())); exportmenu->insertItem("Export vtk-binary...(vti/vtk)", this, - SLOT(execute_exportvtkbinary())); + SLOT(execute_exportvtkbinary())); exportmenu->insertItem("Export vtk-compressed-ascii...(vti)", this, - SLOT(execute_exportvtkcompressedascii())); + SLOT(execute_exportvtkcompressedascii())); exportmenu->insertItem("Export vtk-compressed-binary...(vti)", this, - SLOT(execute_exportvtkcompressedbinary())); + SLOT(execute_exportvtkcompressedbinary())); exportmenu->insertItem("Export Matlab...(mat)", this, - SLOT(execute_exportmat())); - exportmenu->insertItem("Export hdf...(h5)", this, - SLOT(execute_exporthdf())); + SLOT(execute_exportmat())); + exportmenu->insertItem("Export hdf...(h5)", this, SLOT(execute_exporthdf())); exportmenu->insertItem("Export xml-extent index...(xml)", this, - SLOT(execute_exportxmlregionextent())); + SLOT(execute_exportxmlregionextent())); exportmenu->insertItem("Export tissue index...(txt)", this, - SLOT(execute_exporttissueindex())); + SLOT(execute_exporttissueindex())); file->insertItem("Export Tissue Distr.", exportmenu); file->insertSeparator(); if (!m_editingmode) - file->insertItem("Save &Project as...", this, - SLOT(execute_saveprojas())); + file->insertItem("Save &Project as...", this, SLOT(execute_saveprojas())); else file->insertItem("Save &Project-Copy as...", this, - SLOT(execute_savecopyas())); + SLOT(execute_savecopyas())); file->insertItem( - QIcon(m_picpath.absFilePath(QString("filesave.png")).ascii()), - "Save Pro&ject", this, SLOT(execute_saveproj()), - QKeySequence("Ctrl+S")); + QIcon(m_picpath.absFilePath(QString("filesave.png")).ascii()), + "Save Pro&ject", this, SLOT(execute_saveproj()), QKeySequence("Ctrl+S")); file->insertItem("Save Active Slices...", this, - SLOT(execute_saveactiveslicesas())); + SLOT(execute_saveactiveslicesas())); if (!m_editingmode) file->insertItem( - QIcon(m_picpath.absFilePath(QString("fileopen.png")).ascii()), - "Open P&roject...", this, SLOT(execute_loadproj())); + QIcon(m_picpath.absFilePath(QString("fileopen.png")).ascii()), + "Open P&roject...", this, SLOT(execute_loadproj())); file->insertSeparator(); file->insertItem("Save &Tissuelist...", this, SLOT(execute_savetissues())); file->insertItem("Open T&issuelist...", this, SLOT(execute_loadtissues())); file->insertItem("Set Tissuelist as Default", this, - SLOT(execute_settissuesasdef())); + SLOT(execute_settissuesasdef())); file->insertItem("Remove Default Tissuelist", this, - SLOT(execute_removedeftissues())); + SLOT(execute_removedeftissues())); #ifndef NOSURFACEGENERATIONTOOLSUPPORT file->insertItem("Export Surface Generation Tool XML...", this, - SLOT(execute_exportsurfacegenerationtoolxml())); + SLOT(execute_exportsurfacegenerationtoolxml())); #endif file->insertSeparator(); if (!m_editingmode) { m_loadprojfilename.lpf1nr = - file->insertItem("", this, SLOT(execute_loadproj1())); + file->insertItem("", this, SLOT(execute_loadproj1())); m_loadprojfilename.lpf2nr = - file->insertItem("", this, SLOT(execute_loadproj2())); + file->insertItem("", this, SLOT(execute_loadproj2())); m_loadprojfilename.lpf3nr = - file->insertItem("", this, SLOT(execute_loadproj3())); + file->insertItem("", this, SLOT(execute_loadproj3())); m_loadprojfilename.lpf4nr = - file->insertItem("", this, SLOT(execute_loadproj4())); + file->insertItem("", this, SLOT(execute_loadproj4())); m_loadprojfilename.separatornr = file->insertSeparator(); file->setItemVisible(m_loadprojfilename.lpf1nr, false); file->setItemVisible(m_loadprojfilename.lpf2nr, false); @@ -1309,8 +1295,8 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, imagemenu->insertItem("Crop...", this, SLOT(execute_crop())); } imagemenu->insertItem( - QIcon(m_picpath.absFilePath(QString("histo.png")).ascii()), - "&Histogram...", this, SLOT(execute_histo())); + QIcon(m_picpath.absFilePath(QString("histo.png")).ascii()), + "&Histogram...", this, SLOT(execute_histo())); imagemenu->insertItem("&Contr./Bright. ...", this, SLOT(execute_scale())); imagemenu->insertItem("&Image Math. ...", this, SLOT(execute_imagemath())); imagemenu->insertItem("Unwrap", this, SLOT(execute_unwrap())); @@ -1319,13 +1305,13 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, imagemenu->insertItem("&x Sliced", this, SLOT(execute_xslice())); imagemenu->insertItem("&y Sliced", this, SLOT(execute_yslice())); imagemenu->insertItem("3D surface view", this, - SLOT(execute_3Dsurfaceviewer())); + SLOT(execute_3Dsurfaceviewer())); imagemenu->insertItem("3D isosurface view", this, - SLOT(execute_3Dsurfaceviewerbmp())); + SLOT(execute_3Dsurfaceviewerbmp())); imagemenu->insertItem("3D volume view source", this, - SLOT(execute_3Dvolumeviewerbmp())); + SLOT(execute_3Dvolumeviewerbmp())); imagemenu->insertItem("3D volume view tissue", this, - SLOT(execute_3Dvolumeviewertissue())); + SLOT(execute_3Dvolumeviewertissue())); if (!m_editingmode) { //xxxa; @@ -1337,15 +1323,15 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, editmenu = menuBar()->addMenu(tr("E&dit")); undonr = editmenu->insertItem( - QIcon(m_picpath.absFilePath(QString("undo.png")).ascii()), "&Undo", - this, SLOT(execute_undo())); + QIcon(m_picpath.absFilePath(QString("undo.png")).ascii()), "&Undo", this, + SLOT(execute_undo())); redonr = editmenu->insertItem( - QIcon(m_picpath.absFilePath(QString("redo.png")).ascii()), "Redo", this, - SLOT(execute_redo())); + QIcon(m_picpath.absFilePath(QString("redo.png")).ascii()), "Redo", this, + SLOT(execute_redo())); editmenu->insertSeparator(); editmenu->insertItem("&Configure Undo...", this, SLOT(execute_undoconf())); editmenu->insertItem("&Active Slices...", this, - SLOT(execute_activeslicesconf())); + SLOT(execute_activeslicesconf())); editmenu->setItemEnabled(undonr, false); editmenu->setItemEnabled(redonr, false); editmenu->insertItem("&Settings...", this, SLOT(execute_settings())); @@ -1368,110 +1354,108 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, hidecontrastbright->setToggleAction(true); hidecontrastbright->setOn(true); connect(hidecontrastbright, SIGNAL(toggled(bool)), this, - SLOT(execute_hidecontrastbright(bool))); + SLOT(execute_hidecontrastbright(bool))); hidecontrastbright->addTo(hidemenu); hidesource = new Q3Action("Source", 0, this); hidesource->setToggleAction(true); hidesource->setOn(true); connect(hidesource, SIGNAL(toggled(bool)), this, - SLOT(execute_hidesource(bool))); + SLOT(execute_hidesource(bool))); hidesource->addTo(hidemenu); hidetarget = new Q3Action("Target", 0, this); hidetarget->setToggleAction(true); hidetarget->setOn(true); connect(hidetarget, SIGNAL(toggled(bool)), this, - SLOT(execute_hidetarget(bool))); + SLOT(execute_hidetarget(bool))); hidetarget->addTo(hidemenu); hidecopyswap = new Q3Action("Copy/Swap", 0, this); hidecopyswap->setToggleAction(true); hidecopyswap->setOn(true); connect(hidecopyswap, SIGNAL(toggled(bool)), this, - SLOT(execute_hidecopyswap(bool))); + SLOT(execute_hidecopyswap(bool))); hidecopyswap->addTo(hidemenu); for (unsigned short i = 0; i < nrtabbuttons; i++) { //showtab_action[i]=new Q3Action((std::string("Show ")+tabwidgets[i]->GetName()).c_str(),0,this); - showtab_action[i] = - new Q3Action(tabwidgets[i]->GetName().c_str(), 0, this); + showtab_action[i] = new Q3Action(tabwidgets[i]->GetName().c_str(), 0, this); showtab_action[i]->setToggleAction(true); showtab_action[i]->setOn(showpb_tab[i]); connect(showtab_action[i], SIGNAL(toggled(bool)), this, - SLOT(execute_showtabtoggled(bool))); + SLOT(execute_showtabtoggled(bool))); showtab_action[i]->addTo(hidesubmenu); } hideparameters = new Q3Action("Simplified", 0, this); hideparameters->setToggleAction(true); hideparameters->setOn(WidgetInterface::get_hideparams()); connect(hideparameters, SIGNAL(toggled(bool)), this, - SLOT(execute_hideparameters(bool))); + SLOT(execute_hideparameters(bool))); hidesubmenu->insertSeparator(); hideparameters->addTo(hidesubmenu); viewmenu->insertItem("&Toolbars", hidemenu); viewmenu->insertItem("Methods", hidesubmenu); toolmenu = menuBar()->addMenu(tr("T&ools")); - toolmenu->insertItem("&Group Tissues...", this, - SLOT(execute_grouptissues())); + toolmenu->insertItem("&Group Tissues...", this, SLOT(execute_grouptissues())); toolmenu->insertItem("Remove Tissues...", this, - SLOT(execute_removetissues())); + SLOT(execute_removetissues())); toolmenu->insertItem("Target->Tissue", this, SLOT(do_work2tissue())); toolmenu->insertItem("Target->Tissue grouped...", this, - SLOT(do_work2tissue_grouped())); + SLOT(do_work2tissue_grouped())); toolmenu->insertItem("Tissue->Target", this, SLOT(do_tissue2work())); toolmenu->insertItem("In&verse Slice Order", this, - SLOT(execute_inversesliceorder())); + SLOT(execute_inversesliceorder())); toolmenu->insertItem("Clean Up", this, SLOT(execute_cleanup())); toolmenu->insertItem("Smooth Steps", this, SLOT(execute_smoothsteps())); // toolmenu->insertItem( "Smooth Tissues", this, SLOT(execute_smoothtissues())); if (!m_editingmode) toolmenu->insertItem("Merge Projects...", this, - SLOT(execute_mergeprojects())); + SLOT(execute_mergeprojects())); toolmenu->insertItem("Check Bone Connectivity", this, - SLOT(execute_boneconnectivity())); + SLOT(execute_boneconnectivity())); atlasmenu = menuBar()->addMenu(tr("Atlas")); // todo: make atlas method generic, i.e. for loop // see e.g. https://stackoverflow.com/questions/9187538/how-to-add-a-list-of-qactions-to-a-qmenu-and-handle-them-with-a-single-slot m_atlasfilename.atlasnr[0] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas0())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas0())); m_atlasfilename.atlasnr[1] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas1())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas1())); m_atlasfilename.atlasnr[2] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas2())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas2())); m_atlasfilename.atlasnr[3] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas3())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas3())); m_atlasfilename.atlasnr[4] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas4())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas4())); m_atlasfilename.atlasnr[5] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas5())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas5())); m_atlasfilename.atlasnr[6] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas6())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas6())); m_atlasfilename.atlasnr[7] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas7())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas7())); m_atlasfilename.atlasnr[8] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas8())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas8())); m_atlasfilename.atlasnr[9] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas9())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas9())); m_atlasfilename.atlasnr[10] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas10())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas10())); m_atlasfilename.atlasnr[11] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas11())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas11())); m_atlasfilename.atlasnr[12] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas12())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas12())); m_atlasfilename.atlasnr[13] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas13())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas13())); m_atlasfilename.atlasnr[14] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas14())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas14())); m_atlasfilename.atlasnr[15] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas15())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas15())); m_atlasfilename.atlasnr[16] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas16())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas16())); m_atlasfilename.atlasnr[17] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas17())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas17())); m_atlasfilename.atlasnr[18] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas18())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas18())); m_atlasfilename.atlasnr[19] = - atlasmenu->insertItem("", this, SLOT(execute_loadatlas19())); + atlasmenu->insertItem("", this, SLOT(execute_loadatlas19())); m_atlasfilename.separatornr = atlasmenu->insertSeparator(); atlasmenu->insertItem("Create Atlas...", this, SLOT(execute_createatlas())); atlasmenu->insertItem("Update Menu", this, SLOT(execute_reloadatlases())); @@ -1499,430 +1483,410 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, helpmenu = menuBar()->addMenu(tr("Help")); helpmenu->insertItem( - QIcon(m_picpath.absFilePath(QString("help.png")).ascii()), "About", - this, SLOT(execute_about())); + QIcon(m_picpath.absFilePath(QString("help.png")).ascii()), "About", this, + SLOT(execute_about())); QObject::connect(toworkBtn, SIGNAL(clicked()), this, - SLOT(execute_bmp2work())); - QObject::connect(tobmpBtn, SIGNAL(clicked()), this, - SLOT(execute_work2bmp())); + SLOT(execute_bmp2work())); + QObject::connect(tobmpBtn, SIGNAL(clicked()), this, SLOT(execute_work2bmp())); QObject::connect(swapBtn, SIGNAL(clicked()), this, - SLOT(execute_swap_bmpwork())); + SLOT(execute_swap_bmpwork())); QObject::connect(swapAllBtn, SIGNAL(clicked()), this, - SLOT(execute_swap_bmpworkall())); + SLOT(execute_swap_bmpworkall())); QObject::connect(this, SIGNAL(bmp_changed()), this, SLOT(update_bmp())); QObject::connect(this, SIGNAL(work_changed()), this, SLOT(update_work())); QObject::connect(this, SIGNAL(work_changed()), bmp_show, - SLOT(workborder_changed())); + SLOT(workborder_changed())); QObject::connect(this, SIGNAL(marks_changed()), bmp_show, - SLOT(mark_changed())); + SLOT(mark_changed())); QObject::connect(this, SIGNAL(marks_changed()), work_show, - SLOT(mark_changed())); + SLOT(mark_changed())); QObject::connect(this, SIGNAL(tissues_changed()), this, - SLOT(update_tissue())); + SLOT(update_tissue())); QObject::connect(bmp_show, SIGNAL(addmark_sign(Point)), this, - SLOT(add_mark(Point))); + SLOT(add_mark(Point))); QObject::connect(bmp_show, SIGNAL(addlabel_sign(Point, std::string)), this, - SLOT(add_label(Point, std::string))); + SLOT(add_label(Point, std::string))); QObject::connect(bmp_show, SIGNAL(clearmarks_sign()), this, - SLOT(clear_marks())); + SLOT(clear_marks())); QObject::connect(bmp_show, SIGNAL(removemark_sign(Point)), this, - SLOT(remove_mark(Point))); + SLOT(remove_mark(Point))); QObject::connect(bmp_show, SIGNAL(addtissue_sign(Point)), this, - SLOT(add_tissue(Point))); + SLOT(add_tissue(Point))); QObject::connect(bmp_show, SIGNAL(addtissueconnected_sign(Point)), this, - SLOT(add_tissue_connected(Point))); + SLOT(add_tissue_connected(Point))); QObject::connect(bmp_show, SIGNAL(subtissue_sign(Point)), this, - SLOT(subtract_tissue(Point))); + SLOT(subtract_tissue(Point))); QObject::connect(bmp_show, SIGNAL(addtissue3D_sign(Point)), this, - SLOT(add_tissue_3D(Point))); + SLOT(add_tissue_3D(Point))); QObject::connect(bmp_show, SIGNAL(addtissuelarger_sign(Point)), this, - SLOT(add_tissuelarger(Point))); + SLOT(add_tissuelarger(Point))); QObject::connect(bmp_show, SIGNAL(selecttissue_sign(Point)), this, - SLOT(select_tissue(Point))); + SLOT(select_tissue(Point))); QObject::connect(work_show, SIGNAL(addmark_sign(Point)), this, - SLOT(add_mark(Point))); + SLOT(add_mark(Point))); QObject::connect(work_show, SIGNAL(addlabel_sign(Point, std::string)), this, - SLOT(add_label(Point, std::string))); + SLOT(add_label(Point, std::string))); QObject::connect(work_show, SIGNAL(clearmarks_sign()), this, - SLOT(clear_marks())); + SLOT(clear_marks())); QObject::connect(work_show, SIGNAL(removemark_sign(Point)), this, - SLOT(remove_mark(Point))); + SLOT(remove_mark(Point))); QObject::connect(work_show, SIGNAL(addtissue_sign(Point)), this, - SLOT(add_tissue(Point))); + SLOT(add_tissue(Point))); QObject::connect(work_show, SIGNAL(addtissueconnected_sign(Point)), this, - SLOT(add_tissue_connected(Point))); + SLOT(add_tissue_connected(Point))); QObject::connect(work_show, SIGNAL(subtissue_sign(Point)), this, - SLOT(subtract_tissue(Point))); + SLOT(subtract_tissue(Point))); QObject::connect(work_show, SIGNAL(addtissue3D_sign(Point)), this, - SLOT(add_tissue_3D(Point))); + SLOT(add_tissue_3D(Point))); QObject::connect(work_show, SIGNAL(addtissuelarger_sign(Point)), this, - SLOT(add_tissuelarger(Point))); + SLOT(add_tissuelarger(Point))); QObject::connect(work_show, SIGNAL(selecttissue_sign(Point)), this, - SLOT(select_tissue(Point))); - QObject::connect(tissueFilter, SIGNAL(textChanged(const QString&)), this, - SLOT(tissueFilterChanged(const QString&))); + SLOT(select_tissue(Point))); + QObject::connect(tissueFilter, SIGNAL(textChanged(const QString &)), this, + SLOT(tissueFilterChanged(const QString &))); QObject::connect(lockTissues, SIGNAL(clicked()), this, - SLOT(lockAllTissues())); + SLOT(lockAllTissues())); QObject::connect(addTissue, SIGNAL(clicked()), this, - SLOT(newTissuePressed())); + SLOT(newTissuePressed())); QObject::connect(addFolder, SIGNAL(clicked()), this, - SLOT(newFolderPressed())); + SLOT(newFolderPressed())); QObject::connect(modifyTissueFolder, SIGNAL(clicked()), this, - SLOT(modifTissueFolderPressed())); + SLOT(modifTissueFolderPressed())); QObject::connect(removeTissueFolder, SIGNAL(clicked()), this, - SLOT(removeTissueFolderPressed())); + SLOT(removeTissueFolderPressed())); QObject::connect(removeTissueFolderAll, SIGNAL(clicked()), this, - SLOT(removeTissueFolderAllPressed())); + SLOT(removeTissueFolderAllPressed())); QObject::connect(getTissue, SIGNAL(clicked()), this, - SLOT(selectedtissue2work())); + SLOT(selectedtissue2work())); QObject::connect(getTissueAll, SIGNAL(clicked()), this, - SLOT(tissue2workall())); - QObject::connect(clearTissue, SIGNAL(clicked()), this, - SLOT(clearselected())); - QObject::connect(clearTissues, SIGNAL(clicked()), this, - SLOT(cleartissues())); + SLOT(tissue2workall())); + QObject::connect(clearTissue, SIGNAL(clicked()), this, SLOT(clearselected())); + QObject::connect(clearTissues, SIGNAL(clicked()), this, SLOT(cleartissues())); - QObject::connect(methodTab, SIGNAL(aboutToShow(QWidget*)), this, - SLOT(tab_changed(QWidget*))); + QObject::connect(methodTab, SIGNAL(aboutToShow(QWidget *)), this, + SLOT(tab_changed(QWidget *))); tissueTreeWidget->setSelectionMode( - QAbstractItemView::SelectionMode::ExtendedSelection); + QAbstractItemView::SelectionMode::ExtendedSelection); QObject::connect(tissueTreeWidget, SIGNAL(itemSelectionChanged()), this, - SLOT(tissue_selection_changed())); + SLOT(tissue_selection_changed())); QObject::connect(tissueTreeWidget, - SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, - SLOT(tree_widget_doubleclicked(QTreeWidgetItem*, int))); + SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, + SLOT(tree_widget_doubleclicked(QTreeWidgetItem *, int))); QObject::connect(tissueTreeWidget, - SIGNAL(customContextMenuRequested(const QPoint&)), this, - SLOT(tree_widget_contextmenu(const QPoint&))); + SIGNAL(customContextMenuRequested(const QPoint &)), this, + SLOT(tree_widget_contextmenu(const QPoint &))); tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); bmp_show->color_changed(currTissueType - 1); work_show->color_changed(currTissueType - 1); QObject::connect(cb_bmptissuevisible, SIGNAL(clicked()), this, - SLOT(bmptissuevisible_changed())); + SLOT(bmptissuevisible_changed())); QObject::connect(cb_bmpcrosshairvisible, SIGNAL(clicked()), this, - SLOT(bmpcrosshairvisible_changed())); + SLOT(bmpcrosshairvisible_changed())); QObject::connect(cb_bmpoutlinevisible, SIGNAL(clicked()), this, - SLOT(bmpoutlinevisible_changed())); + SLOT(bmpoutlinevisible_changed())); QObject::connect(cb_worktissuevisible, SIGNAL(clicked()), this, - SLOT(worktissuevisible_changed())); + SLOT(worktissuevisible_changed())); QObject::connect(cb_workcrosshairvisible, SIGNAL(clicked()), this, - SLOT(workcrosshairvisible_changed())); + SLOT(workcrosshairvisible_changed())); QObject::connect(cb_workpicturevisible, SIGNAL(clicked()), this, - SLOT(workpicturevisible_changed())); + SLOT(workpicturevisible_changed())); - QObject::connect(pb_first, SIGNAL(clicked()), this, - SLOT(pb_first_pressed())); + QObject::connect(pb_first, SIGNAL(clicked()), this, SLOT(pb_first_pressed())); QObject::connect(pb_last, SIGNAL(clicked()), this, SLOT(pb_last_pressed())); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); - // QObject::connect(le_slicethick,SIGNAL(returnPressed()),this,SLOT(slicethickness_changed())); - QObject::connect(le_slicethick, SIGNAL(textChanged(const QString&)), this, - SLOT(slicethickness_changed())); + QObject::connect(le_slicethick, SIGNAL(textChanged(const QString &)), this, + SLOT(slicethickness_changed())); - QObject::connect(pb_add, SIGNAL(clicked()), this, - SLOT(add_tissue_pushed())); + QObject::connect(pb_add, SIGNAL(clicked()), this, SLOT(add_tissue_pushed())); QObject::connect(pb_sub, SIGNAL(clicked()), this, - SLOT(subtract_tissue_pushed())); + SLOT(subtract_tissue_pushed())); QObject::connect(pb_addhold, SIGNAL(clicked()), this, - SLOT(addhold_tissue_pushed())); - // QObject::connect(pb_stophold,SIGNAL(clicked()),this,SLOT(stophold_tissue_pushed())); + SLOT(addhold_tissue_pushed())); QObject::connect(pb_subhold, SIGNAL(clicked()), this, - SLOT(subtracthold_tissue_pushed())); - // QObject::connect(pb_addconn,SIGNAL(clicked()),this,SLOT(add_tissue_connected_pushed())); - // QObject::connect(pb_add3D,SIGNAL(clicked()),this,SLOT(add_tissue_3D_pushed())); - - /*if(xsliceshower) - QObject::connect(xsliceshower,SIGNAL(hasbeenclosed()),this,SLOT(xslice_closed())); - if(ysliceshower) - QObject::connect(ysliceshower,SIGNAL(hasbeenclosed()),this,SLOT(yslice_closed()));*/ + SLOT(subtracthold_tissue_pushed())); + QObject::connect(bmp_scroller, SIGNAL(contentsMoving(int, int)), this, - SLOT(setWorkContentsPos(int, int))); + SLOT(setWorkContentsPos(int, int))); QObject::connect(work_scroller, SIGNAL(contentsMoving(int, int)), this, - SLOT(setBmpContentsPos(int, int))); + SLOT(setBmpContentsPos(int, int))); QObject::connect(bmp_show, SIGNAL(setcenter_sign(int, int)), bmp_scroller, - SLOT(center(int, int))); + SLOT(center(int, int))); QObject::connect(work_show, SIGNAL(setcenter_sign(int, int)), work_scroller, - SLOT(center(int, int))); + SLOT(center(int, int))); tomove_scroller = true; - interpolwidget->tissuenr_changed(currTissueType - 1); - QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), bmp_show, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), work_show, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::connect( - this, SIGNAL(begin_dataexport(iseg::DataSelection&, QWidget*)), this, - SLOT(handle_begin_dataexport(iseg::DataSelection&, QWidget*))); - QObject::connect(this, SIGNAL(end_dataexport(QWidget*)), this, - SLOT(handle_end_dataexport(QWidget*))); + this, SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, + SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); + QObject::connect(this, SIGNAL(end_dataexport(QWidget *)), this, + SLOT(handle_end_dataexport(QWidget *))); QObject::connect( - this, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - this, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - threshold_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - threshold_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - OutlineCorrect_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + this, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(this, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + QObject::connect( - OutlineCorrect_widget, - SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + threshold_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(threshold_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - OutlineCorrect_widget, - SIGNAL(end_datachange(QRect, QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QRect, QWidget*, iseg::EndUndoAction))); + OutlineCorrect_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(OutlineCorrect_widget, - SIGNAL(signal_request_selected_tissue_TS()), this, - SLOT(provide_selected_tissue_TS())); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(OutlineCorrect_widget, - SIGNAL(signal_request_selected_tissue_BG()), this, - SLOT(provide_selected_tissue_BG())); - QObject::connect( - smoothing_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - smoothing_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - edge_widg, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - edge_widg, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - morph_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - morph_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - wshed_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - wshed_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - lw_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - lw_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - iftrg_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - iftrg_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - FMF_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - FMF_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); - QObject::connect( - interpolwidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + SIGNAL(signal_request_selected_tissue_TS()), this, + SLOT(provide_selected_tissue_TS())); + QObject::connect(OutlineCorrect_widget, + SIGNAL(signal_request_selected_tissue_BG()), this, + SLOT(provide_selected_tissue_BG())); QObject::connect( - interpolwidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + smoothing_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(smoothing_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - scalewidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + edge_widg, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(edge_widg, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - scalewidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + morph_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(morph_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - imagemathwidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + wshed_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(wshed_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - imagemathwidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + lw_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(lw_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - imageoverlaywidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + iftrg_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(iftrg_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - imageoverlaywidget, - SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + FMF_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(FMF_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - bitstack_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + interpolwidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(interpolwidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - bitstack_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + scalewidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(scalewidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - bitstack_widget, - SIGNAL(begin_dataexport(iseg::DataSelection&, QWidget*)), this, - SLOT(handle_begin_dataexport(iseg::DataSelection&, QWidget*))); - QObject::connect(bitstack_widget, SIGNAL(end_dataexport(QWidget*)), this, - SLOT(handle_end_dataexport(QWidget*))); + imagemathwidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(imagemathwidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - hyst_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + imageoverlaywidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(imageoverlaywidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - hyst_widget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + bitstack_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(bitstack_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - pickerwidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + bitstack_widget, + SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, + SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); + QObject::connect(bitstack_widget, SIGNAL(end_dataexport(QWidget *)), this, + SLOT(handle_end_dataexport(QWidget *))); QObject::connect( - pickerwidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + hyst_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(hyst_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + pickerwidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(pickerwidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( - transfrmWidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + transfrmWidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(transfrmWidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), bmp_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), work_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(overlay_widget, SIGNAL(overlayalpha_changed(float)), - bmp_show, SLOT(set_overlayalpha(float))); + bmp_show, SLOT(set_overlayalpha(float))); QObject::connect(overlay_widget, SIGNAL(overlayalpha_changed(float)), - work_show, SLOT(set_overlayalpha(float))); + work_show, SLOT(set_overlayalpha(float))); QObject::connect(overlay_widget, SIGNAL(bmpoverlayvisible_changed(bool)), - bmp_show, SLOT(set_overlayvisible(bool))); + bmp_show, SLOT(set_overlayvisible(bool))); QObject::connect(overlay_widget, SIGNAL(workoverlayvisible_changed(bool)), - work_show, SLOT(set_overlayvisible(bool))); + work_show, SLOT(set_overlayvisible(bool))); QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), bmp_show, - SLOT(overlay_changed())); - QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), - work_show, SLOT(overlay_changed())); + SLOT(overlay_changed())); + QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), work_show, + SLOT(overlay_changed())); QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), this, - SLOT(DatasetChanged())); - QObject::connect( - m_MultiDataset_widget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + SLOT(DatasetChanged())); QObject::connect( - m_MultiDataset_widget, - SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + m_MultiDataset_widget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(m_MultiDataset_widget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(cb_tissuelock, SIGNAL(clicked()), this, - SLOT(tissuelock_toggled())); + SLOT(tissuelock_toggled())); QObject::connect(sl_contrastbmp, SIGNAL(valueChanged(int)), this, - SLOT(sl_contrastbmp_moved(int))); + SLOT(sl_contrastbmp_moved(int))); QObject::connect(sl_contrastwork, SIGNAL(valueChanged(int)), this, - SLOT(sl_contrastwork_moved(int))); + SLOT(sl_contrastwork_moved(int))); QObject::connect(sl_brightnessbmp, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightnessbmp_moved(int))); + SLOT(sl_brightnessbmp_moved(int))); QObject::connect(sl_brightnesswork, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightnesswork_moved(int))); + SLOT(sl_brightnesswork_moved(int))); QObject::connect(le_contrastbmp_val, SIGNAL(editingFinished()), this, - SLOT(le_contrastbmp_val_edited())); + SLOT(le_contrastbmp_val_edited())); QObject::connect(le_contrastwork_val, SIGNAL(editingFinished()), this, - SLOT(le_contrastwork_val_edited())); + SLOT(le_contrastwork_val_edited())); QObject::connect(le_brightnessbmp_val, SIGNAL(editingFinished()), this, - SLOT(le_brightnessbmp_val_edited())); + SLOT(le_brightnessbmp_val_edited())); QObject::connect(le_brightnesswork_val, SIGNAL(editingFinished()), this, - SLOT(le_brightnesswork_val_edited())); + SLOT(le_brightnesswork_val_edited())); + + // \todo BL add generic connections here, e.g. begin/end_datachange m_widget_signal_mapper = new QSignalMapper(this); for (int i = 0; i < nrtabbuttons; ++i) { QObject::connect(pb_tab[i], SIGNAL(clicked()), m_widget_signal_mapper, - SLOT(map())); + SLOT(map())); m_widget_signal_mapper->setMapping(pb_tab[i], i); QObject::connect(m_widget_signal_mapper, SIGNAL(mapped(int)), this, - SLOT(pb_tab_pressed(int))); + SLOT(pb_tab_pressed(int))); } QObject::connect(bmp_show, SIGNAL(wheelrotatedctrl_sign(int)), this, - SLOT(wheelrotated(int))); + SLOT(wheelrotated(int))); QObject::connect(work_show, SIGNAL(wheelrotatedctrl_sign(int)), this, - SLOT(wheelrotated(int))); + SLOT(wheelrotated(int))); QObject::connect(bmp_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(QPoint))); QObject::connect(work_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(QPoint))); // QObject::connect(pb_work2tissue,SIGNAL(clicked()),this,SLOT(do_work2tissue())); m_acc_sliceup = new Q3Accel(this); m_acc_sliceup->connectItem( - m_acc_sliceup->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Right)), this, - SLOT(slicenr_up())); + m_acc_sliceup->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Right)), this, + SLOT(slicenr_up())); m_acc_slicedown = new Q3Accel(this); m_acc_slicedown->connectItem( - m_acc_slicedown->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Left)), - this, SLOT(slicenr_down())); + m_acc_slicedown->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Left)), this, + SLOT(slicenr_down())); m_acc_sliceup1 = new Q3Accel(this); m_acc_sliceup->connectItem( - m_acc_sliceup->insertItem(QKeySequence(Qt::Key_Next)), this, - SLOT(slicenr_up())); + m_acc_sliceup->insertItem(QKeySequence(Qt::Key_Next)), this, + SLOT(slicenr_up())); m_acc_slicedown1 = new Q3Accel(this); m_acc_slicedown->connectItem( - m_acc_slicedown->insertItem(QKeySequence(Qt::Key_Prior)), this, - SLOT(slicenr_down())); + m_acc_slicedown->insertItem(QKeySequence(Qt::Key_Prior)), this, + SLOT(slicenr_down())); m_acc_zoomin = new Q3Accel(this); m_acc_zoomin->connectItem( - m_acc_zoomin->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Up)), this, - SLOT(zoom_in())); + m_acc_zoomin->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Up)), this, + SLOT(zoom_in())); m_acc_zoomout = new Q3Accel(this); m_acc_zoomout->connectItem( - m_acc_zoomout->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Down)), this, - SLOT(zoom_out())); + m_acc_zoomout->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Down)), this, + SLOT(zoom_out())); m_acc_add = new Q3Accel(this); m_acc_add->connectItem( - m_acc_add->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Plus)), this, - SLOT(add_tissue_shortkey())); + m_acc_add->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Plus)), this, + SLOT(add_tissue_shortkey())); m_acc_sub = new Q3Accel(this); m_acc_sub->connectItem( - m_acc_sub->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Minus)), this, - SLOT(subtract_tissue_shortkey())); + m_acc_sub->insertItem(QKeySequence(Qt::CTRL + Qt::Key_Minus)), this, + SLOT(subtract_tissue_shortkey())); m_acc_undo = new Q3Accel(this); - m_acc_undo->connectItem( - m_acc_undo->insertItem(QKeySequence(Qt::Key_Escape)), this, - SLOT(execute_undo())); + m_acc_undo->connectItem(m_acc_undo->insertItem(QKeySequence(Qt::Key_Escape)), + this, SLOT(execute_undo())); m_acc_undo2 = new Q3Accel(this); m_acc_undo2->connectItem(m_acc_undo2->insertItem(QKeySequence("Ctrl+Z")), - this, SLOT(execute_undo())); + this, SLOT(execute_undo())); m_acc_redo = new Q3Accel(this); - m_acc_redo->connectItem(m_acc_redo->insertItem(QKeySequence("Ctrl+Y")), - this, SLOT(execute_redo())); + m_acc_redo->connectItem(m_acc_redo->insertItem(QKeySequence("Ctrl+Y")), this, + SLOT(execute_redo())); // setCentralWidget(hbox); // vbox->insertChild(hbox2); @@ -1940,175 +1904,72 @@ MainWindow::MainWindow(SlicesHandler* hand3D, QString locationstring, return; } -MainWindow::~MainWindow() -{ - //delete vboxtotal; - //delete file; - //delete loadmenu; - //delete reloadmenu; - //delete exportmenu; - //delete imagemenu; - //delete editmenu; - //delete toolmenu; - //delete helpmenu; - //delete hidemenu; - //delete hidesubmenu; - //delete menubar; - //delete menubarspacer; - //delete cb_bmptissuevisible; - //delete cb_bmpcrosshairvisible; - //delete cb_bmpoutlinevisible; - //delete cb_worktissuevisible; - //delete cb_workcrosshairvisible; - //delete cb_workpicturevisible; - //delete bmp_show; - //delete lb_source; - //delete lb_target; - //delete bmp_scroller; - //delete sl_contrastbmp; - //delete sl_brightnessbmp; - //delete lb_contrastbmp; - //delete lb_brightnessbmp; - //delete toworkBtn; - //delete tobmpBtn; - //delete swapBtn; - //delete swapAllBtn; - //delete zoom_widget; - //delete work_show; - //delete sl_contrastwork; - //delete sl_brightnesswork; - //delete lb_contrastwork; - //delete lb_brightnesswork; - //delete work_scroller; - //delete scalewidget; - //delete imagemathwidget; - //delete tissueTreeWidget; - //delete cb_tissuelock; - //delete lockTissues; - //delete addTissue; - //delete modifyTissue; - //delete removeTissue; - //delete tissue3Dopt; - //delete getTissue; - //delete clearTissue; - //delete clearTissues; - //delete cb_addsub3d; - //delete cb_addsuboverride; - //delete cb_addsubconn; - //delete pb_add; - //delete pb_sub; - //delete pb_addhold; - //delete pb_subhold; - //delete pb_first; - //delete scb_slicenr; - //delete pb_last; - //delete sb_slicenr; - //delete lb_slicenr; - //delete lb_inactivewarning; - //delete lb_slicethick; - //delete le_slicethick; - //delete methodTab; - //delete bitstack_widget; - //delete m_acc_sliceup; - //delete m_acc_slicedown; - //delete m_acc_sliceup1; - //delete m_acc_slicedown1; - //delete m_acc_zoomin; - //delete m_acc_zoomout; - //delete m_acc_add; - //delete m_acc_sub; - //delete m_acc_undo; - //for(unsigned short i=0;iclose(); - QObject::disconnect( - bmp_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); - QObject::disconnect( - work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(bmp_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(work_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); - QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), - xsliceshower, SLOT(set_zoom(double))); + SLOT(xshower_slicechanged())); + QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, + SLOT(set_zoom(double))); QObject::disconnect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); delete xsliceshower; } if (ysliceshower != NULL) { ysliceshower->close(); - QObject::disconnect( - bmp_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); - QObject::disconnect( - work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(bmp_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(work_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); - QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), - ysliceshower, SLOT(set_zoom(double))); + SLOT(yshower_slicechanged())); + QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, + SLOT(set_zoom(double))); QObject::disconnect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); delete ysliceshower; } if (SV3D != NULL) { SV3D->close(); QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3D_closed())); + SLOT(SV3D_closed())); delete SV3D; } if (SV3Dbmp != NULL) { SV3Dbmp->close(); QObject::disconnect(SV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); delete SV3Dbmp; } if (VV3D != NULL) { VV3D->close(); QObject::disconnect(VV3D, SIGNAL(hasbeenclosed()), this, - SLOT(VV3D_closed())); + SLOT(VV3D_closed())); delete VV3D; } if (VV3Dbmp != NULL) { VV3Dbmp->close(); QObject::disconnect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); delete VV3Dbmp; } @@ -2127,9 +1988,9 @@ bool MainWindow::maybeSafe() if (modified()) { int ret = QMessageBox::warning( - this, "iSeg", "Do you want to save your changes?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you want to save your changes?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { // Handle tissue hierarchy changes @@ -2138,7 +1999,7 @@ bool MainWindow::maybeSafe() return false; } if ((!m_editingmode && !m_saveprojfilename.isEmpty()) || - (m_editingmode && !m_S4Lcommunicationfilename.isEmpty())) + (m_editingmode && !m_S4Lcommunicationfilename.isEmpty())) { execute_saveproj(); } @@ -2163,32 +2024,32 @@ void MainWindow::provide_selected_tissue_BG() if (TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type())) { QMessageBox::warning(this, "iSeg", - "Error: Unable to get " + - tissueTreeWidget->get_current_name() + - " because it is locked.\nPlease, unlock it.", - QMessageBox::Ok | QMessageBox::Default); + "Error: Unable to get " + + tissueTreeWidget->get_current_name() + + " because it is locked.\nPlease, unlock it.", + QMessageBox::Ok | QMessageBox::Default); return; } OutlineCorrect_widget->Select_selected_tissue_BG( - tissueTreeWidget->get_current_name(), - tissueTreeWidget->get_current_type()); + tissueTreeWidget->get_current_name(), + tissueTreeWidget->get_current_type()); } void MainWindow::provide_selected_tissue_TS() { if (TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type())) { QMessageBox::warning(this, "iSeg", - "Error: Unable to get " + - tissueTreeWidget->get_current_name() + - " because it is locked.\nPlease, unlock it.", - QMessageBox::Ok | QMessageBox::Default); + "Error: Unable to get " + + tissueTreeWidget->get_current_name() + + " because it is locked.\nPlease, unlock it.", + QMessageBox::Ok | QMessageBox::Default); return; } OutlineCorrect_widget->Select_selected_tissue_TS( - tissueTreeWidget->get_current_name(), - tissueTreeWidget->get_current_type()); + tissueTreeWidget->get_current_name(), + tissueTreeWidget->get_current_type()); } void MainWindow::execute_bmp2work() @@ -2201,8 +2062,6 @@ void MainWindow::execute_bmp2work() handler3D->bmp2work(); emit end_datachange(this); - // work_show->update(); - return; } void MainWindow::execute_work2bmp() @@ -2215,8 +2074,6 @@ void MainWindow::execute_work2bmp() handler3D->work2bmp(); emit end_datachange(this); - // bmp_show->update(); - return; } void MainWindow::execute_swap_bmpwork() @@ -2230,9 +2087,6 @@ void MainWindow::execute_swap_bmpwork() handler3D->swap_bmpwork(); emit end_datachange(this); - // work_show->update(); - // bmp_show->update(); - return; } void MainWindow::execute_swap_bmpworkall() @@ -2246,9 +2100,6 @@ void MainWindow::execute_swap_bmpworkall() handler3D->swap_bmpworkall(); emit end_datachange(this); - // work_show->update(); - // bmp_show->update(); - return; } void MainWindow::execute_saveContours() @@ -2279,14 +2130,8 @@ void MainWindow::execute_loadbmp1() LB.move(QCursor::pos()); LB.exec(); - // work_show->update();//(bmphand->return_width(),bmphand->return_height()); - // bmp_show->update();//(bmphand->return_width(),bmphand->return_height()); - // bmp_show->workborder_changed(); - emit end_datachange(this, iseg::ClearUndo); - // hbox1->setFixedSize(bmphand->return_width()*2+vbox1->sizeHint().width(),bmphand->return_height()); - reset_brightnesscontrast(); } @@ -2316,44 +2161,40 @@ void MainWindow::execute_swapxy() if (!m_MultiDataset_widget->IsActive(i)) { std::string tempFileName = - "bmp_float_eds_" + std::to_string(i) + ".raw"; + "bmp_float_eds_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_xy_swapped( - str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, - h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, h, + nrslices) != 0) ok = false; tempFileName = "work_float_eds_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_xy_swapped( - str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), - w, h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), w, h, + nrslices) != 0) ok = false; if (ok) { - tempFileName = - "work_float_eds_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + tempFileName = "work_float_eds_" + std::to_string(i) + ".raw"; + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); str1 = QDir::temp().absFilePath(QString("work_float.raw")); m_MultiDataset_widget->SetWorkingData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } if (ok) { - tempFileName = - "bmp_float_eds_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + tempFileName = "bmp_float_eds_" + std::to_string(i) + ".raw"; + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); str1 = QDir::temp().absFilePath(QString("bmp_float.raw")); m_MultiDataset_widget->SetBmpData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } } } @@ -2396,41 +2237,38 @@ void MainWindow::execute_swapxz() // Swap all but the active one if (!m_MultiDataset_widget->IsActive(i)) { - std::string tempFileName = - "bmp_float_" + std::to_string(i) + ".raw"; + std::string tempFileName = "bmp_float_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_xz_swapped( - str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, - h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, h, + nrslices) != 0) ok = false; tempFileName = "work_float_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_xz_swapped( - str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), - w, h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), w, h, + nrslices) != 0) ok = false; if (ok) { tempFileName = "work_float_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); m_MultiDataset_widget->SetWorkingData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } if (ok) { tempFileName = "bmp_float_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); m_MultiDataset_widget->SetBmpData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } } } @@ -2477,41 +2315,38 @@ void MainWindow::execute_swapyz() // Swap all but the active one if (!m_MultiDataset_widget->IsActive(i)) { - std::string tempFileName = - "bmp_float_" + std::to_string(i) + ".raw"; + std::string tempFileName = "bmp_float_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_yz_swapped( - str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, - h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetBmpData(i), w, h, + nrslices) != 0) ok = false; tempFileName = "work_float_" + std::to_string(i) + ".raw"; str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); if (SlicesHandler::SaveRaw_yz_swapped( - str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), - w, h, nrslices) != 0) + str1.ascii(), m_MultiDataset_widget->GetWorkingData(i), w, h, + nrslices) != 0) ok = false; if (ok) { tempFileName = "work_float_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); m_MultiDataset_widget->SetWorkingData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } if (ok) { tempFileName = "bmp_float_" + std::to_string(i) + ".raw"; - str1 = - QDir::temp().absFilePath(QString(tempFileName.c_str())); + str1 = QDir::temp().absFilePath(QString(tempFileName.c_str())); m_MultiDataset_widget->SetBmpData( - i, SlicesHandler::LoadRawFloat( - str1.ascii(), handler3D->return_startslice(), - handler3D->return_endslice(), 0, w * h)); + i, SlicesHandler::LoadRawFloat( + str1.ascii(), handler3D->return_startslice(), + handler3D->return_endslice(), 0, w * h)); } } } @@ -2541,8 +2376,8 @@ void MainWindow::execute_resize(int resizetype) dataSelection.tissues = true; emit begin_datachange(dataSelection, this, false); - ResizeDialog RD(handler3D, - static_cast(resizetype), this); + ResizeDialog RD(handler3D, static_cast(resizetype), + this); RD.move(QCursor::pos()); if (!RD.exec()) { @@ -2561,22 +2396,22 @@ void MainWindow::execute_resize(int resizetype) bool ok = true; str1 = QDir::temp().absFilePath(QString("bmp_float.raw")); if (handler3D->SaveRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, dzp, - false) != 0) + false) != 0) ok = false; str1 = QDir::temp().absFilePath(QString("work_float.raw")); if (handler3D->SaveRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, dzp, - true) != 0) + true) != 0) ok = false; str1 = QDir::temp().absFilePath(QString("tissues.raw")); if (handler3D->SaveTissuesRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, - dzp) != 0) + dzp) != 0) ok = false; if (ok) { str1 = QDir::temp().absFilePath(QString("work_float.raw")); - if (handler3D->ReadRawFloat(str1.ascii(), w + dxm + dxp, h + dym + dyp, - 0, nrslices + dzm + dzp) != 1) + if (handler3D->ReadRawFloat(str1.ascii(), w + dxm + dxp, h + dym + dyp, 0, + nrslices + dzm + dzp) != 1) ok = false; } if (ok) @@ -2588,8 +2423,8 @@ void MainWindow::execute_resize(int resizetype) if (ok) { str1 = QDir::temp().absFilePath(QString("tissues.raw")); - if (handler3D->ReloadRawTissues(str1.ascii(), - sizeof(tissues_size_t) * 8, 0) != 1) + if (handler3D->ReloadRawTissues(str1.ascii(), sizeof(tissues_size_t) * 8, + 0) != 1) ok = false; } @@ -2644,7 +2479,7 @@ void MainWindow::sl_brightnessbmp_moved(int i) // Update line edit le_brightnessbmp_val->setText( - QString("%1").arg(sl_brightnessbmp->value() - 50, 3)); + QString("%1").arg(sl_brightnessbmp->value() - 50, 3)); // Update display update_brightnesscontrast(true); @@ -2656,7 +2491,7 @@ void MainWindow::sl_brightnesswork_moved(int i) // Update line edit le_brightnesswork_val->setText( - QString("%1").arg(sl_brightnesswork->value() - 50, 3)); + QString("%1").arg(sl_brightnesswork->value() - 50, 3)); // Update display update_brightnesscontrast(false); @@ -2666,14 +2501,14 @@ void MainWindow::le_contrastbmp_val_edited() { // Clamp to range and round to precision float contrast = - max(0.01f, min(le_contrastbmp_val->text().toFloat(), 100.0f)); + max(0.01f, min(le_contrastbmp_val->text().toFloat(), 100.0f)); le_contrastbmp_val->setText(QString("%1").arg(contrast, 6, 'f', 2)); // Update slider int sliderValue = std::floor( - 100.0f * (std::log10(le_contrastbmp_val->text().toFloat()) + 2.0f) / - 4.0f + - 0.5f); + 100.0f * (std::log10(le_contrastbmp_val->text().toFloat()) + 2.0f) / + 4.0f + + 0.5f); sl_contrastbmp->setValue(sliderValue); // Update display @@ -2684,14 +2519,14 @@ void MainWindow::le_contrastwork_val_edited() { // Clamp to range and round to precision float contrast = - max(0.01f, min(le_contrastwork_val->text().toFloat(), 100.0f)); + max(0.01f, min(le_contrastwork_val->text().toFloat(), 100.0f)); le_contrastwork_val->setText(QString("%1").arg(contrast, 6, 'f', 2)); // Update slider int sliderValue = std::floor( - 100.0f * (std::log10(le_contrastwork_val->text().toFloat()) + 2.0f) / - 4.0f + - 0.5f); + 100.0f * (std::log10(le_contrastwork_val->text().toFloat()) + 2.0f) / + 4.0f + + 0.5f); sl_contrastwork->setValue(sliderValue); // Update display @@ -2702,8 +2537,8 @@ void MainWindow::le_brightnessbmp_val_edited() { // Clamp to range and round to precision int brightness = (int)max( - -50.0f, - min(std::floor(le_brightnessbmp_val->text().toFloat() + 0.5f), 50.0f)); + -50.0f, + min(std::floor(le_brightnessbmp_val->text().toFloat() + 0.5f), 50.0f)); le_brightnessbmp_val->setText(QString("%1").arg(brightness, 3)); // Update slider @@ -2717,8 +2552,8 @@ void MainWindow::le_brightnesswork_val_edited() { // Clamp to range and round to precision int brightness = (int)max( - -50.0f, - min(std::floor(le_brightnesswork_val->text().toFloat() + 0.5f), 50.0f)); + -50.0f, + min(std::floor(le_brightnesswork_val->text().toFloat() + 0.5f), 50.0f)); le_brightnesswork_val->setText(QString("%1").arg(brightness, 3)); // Update slider @@ -2755,8 +2590,7 @@ void MainWindow::update_brightnesscontrast(bool bmporwork, bool paint) { // Get values from line edits float contrast = le_contrastbmp_val->text().toFloat(); - float brightness = - (le_brightnessbmp_val->text().toFloat() + 50.0f) * 0.01f; + float brightness = (le_brightnessbmp_val->text().toFloat() + 50.0f) * 0.01f; // Update bmp shower bmp_show->set_brightnesscontrast(brightness, contrast, paint); @@ -2766,7 +2600,7 @@ void MainWindow::update_brightnesscontrast(bool bmporwork, bool paint) // Get values from sliders float contrast = le_contrastwork_val->text().toFloat(); float brightness = - (le_brightnesswork_val->text().toFloat() + 50.0f) * 0.01f; + (le_brightnesswork_val->text().toFloat() + 50.0f) * 0.01f; // Update work shower work_show->set_brightnesscontrast(brightness, contrast, paint); @@ -2794,10 +2628,10 @@ void MainWindow::execute_loadbmp() maybeSafe(); QStringList files = - Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2831,7 +2665,7 @@ void MainWindow::execute_loadbmp() } }*/ - std::vector vfilenames; + std::vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -2865,10 +2699,10 @@ void MainWindow::execute_loadpng() maybeSafe(); QStringList files = - Q3FileDialog::getOpenFileNames("Images (*.png)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + Q3FileDialog::getOpenFileNames("Images (*.png)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2884,7 +2718,7 @@ void MainWindow::execute_loadpng() vi.push_back(pngimgnr(&files[i])); } - std::vector vfilenames; + std::vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -2916,10 +2750,10 @@ void MainWindow::execute_loadjpg() maybeSafe(); QStringList files = - Q3FileDialog::getOpenFileNames("Images (*.jpg)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + Q3FileDialog::getOpenFileNames("Images (*.jpg)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2950,7 +2784,7 @@ void MainWindow::execute_loadjpg() } }*/ - vector vfilenames; + vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -2984,10 +2818,10 @@ void MainWindow::execute_loaddicom() maybeSafe(); QStringList files = - Q3FileDialog::getOpenFileNames("Images (*.dcm *.dicom)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + Q3FileDialog::getOpenFileNames("Images (*.dcm *.dicom)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -3025,8 +2859,8 @@ void MainWindow::execute_loaddicom() void MainWindow::execute_reloaddicom() { QStringList files = Q3FileDialog::getOpenFileNames( - "Images (*.dcm *.dicom)", QString::null, this, "open files dialog", - "Select one or more files to open"); + "Images (*.dcm *.dicom)", QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -3099,10 +2933,10 @@ void MainWindow::execute_loadmhd() emit begin_datachange(dataSelection, this, false); QString loadfilename = - Q3FileDialog::getOpenFileName(QString::null, - "Metaheader (*.mhd *.mha)\n" - "All(*.*)", - this); + Q3FileDialog::getOpenFileName(QString::null, + "Metaheader (*.mhd *.mha)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadImage(loadfilename.ascii()); @@ -3130,9 +2964,9 @@ void MainWindow::execute_loadvtk() bool res = true; QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "VTK (*.vti *.vtk)\n" - "All(*.*)", - this); + "VTK (*.vti *.vtk)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { res = handler3D->ReadImage(loadfilename.ascii()); @@ -3148,9 +2982,9 @@ void MainWindow::execute_loadvtk() if (!res) { - QMessageBox::warning( - this, "iSeg", "Error: Could not load file\n" + loadfilename + "\n", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::warning(this, "iSeg", + "Error: Could not load file\n" + loadfilename + "\n", + QMessageBox::Ok | QMessageBox::Default); } } @@ -3166,10 +3000,10 @@ void MainWindow::execute_loadnifti() emit begin_datachange(dataSelection, this, false); QString loadfilename = - Q3FileDialog::getOpenFileName(QString::null, - "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" - "All(*.*)", - this); + Q3FileDialog::getOpenFileName(QString::null, + "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadImage(loadfilename.ascii()); @@ -3196,9 +3030,9 @@ void MainWindow::execute_loadavw() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "AnalzyeAVW (*.avw)\n" - "All(*.*)", - this); + "AnalzyeAVW (*.avw)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadAvw(loadfilename.ascii()); @@ -3216,14 +3050,14 @@ void MainWindow::execute_loadavw() void MainWindow::execute_reloadbmp() { QStringList files = - Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if ((unsigned short)files.size() == handler3D->return_nrslices() || - (unsigned short)files.size() == - (handler3D->return_endslice() - handler3D->return_startslice())) + (unsigned short)files.size() == + (handler3D->return_endslice() - handler3D->return_startslice())) { sort(files.begin(), files.end()); @@ -3252,7 +3086,7 @@ void MainWindow::execute_reloadbmp() } }*/ - vector vfilenames; + vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -3283,8 +3117,8 @@ void MainWindow::execute_reloadbmp() if (!files.empty()) { QMessageBox::information( - this, "Segm. Tool", - "You have to select the same number of slices.\n"); + this, "Segm. Tool", + "You have to select the same number of slices.\n"); } } @@ -3324,13 +3158,12 @@ void MainWindow::execute_reloadavw() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "AnalzyeAVW (*.avw)\n" - "All(*.*)", - this); + "AnalzyeAVW (*.avw)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { - handler3D->ReloadAVW(loadfilename.ascii(), - handler3D->return_startslice()); + handler3D->ReloadAVW(loadfilename.ascii(), handler3D->return_startslice()); reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3348,14 +3181,14 @@ void MainWindow::execute_reloadmhd() emit begin_datachange(dataSelection, this, false); QString loadfilename = - Q3FileDialog::getOpenFileName(QString::null, - "Metaheader (*.mhd *.mha)\n" - "All(*.*)", - this); + Q3FileDialog::getOpenFileName(QString::null, + "Metaheader (*.mhd *.mha)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage(loadfilename.ascii(), - handler3D->return_startslice()); + handler3D->return_startslice()); reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3373,13 +3206,13 @@ void MainWindow::execute_reloadvtk() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "VTK (*.vti *.vtk)\n" - "All(*.*)", - this); + "VTK (*.vti *.vtk)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage(loadfilename.ascii(), - handler3D->return_startslice()); + handler3D->return_startslice()); reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3397,15 +3230,15 @@ void MainWindow::execute_reloadnifti() emit begin_datachange(dataSelection, this, false); QString loadfilename = - Q3FileDialog::getOpenFileName(QString::null, - "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" - "All(*.*)", - this); + Q3FileDialog::getOpenFileName(QString::null, + "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage( - loadfilename.ascii(), - handler3D->return_startslice()); // TODO: handle failure + loadfilename.ascii(), + handler3D->return_startslice()); // TODO: handle failure reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3505,17 +3338,16 @@ void MainWindow::execute_loadsurface() bool ok = true; QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "STL (*.stl)\n" - "All(*.*)", - this); + "STL (*.stl)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { QMessageBox msgBox; msgBox.setWindowTitle("Import Surface"); - msgBox.setText( - "What would you like to do what with the imported surface?"); + msgBox.setText("What would you like to do what with the imported surface?"); msgBox.addButton("Overwrite", QMessageBox::YesRole); //==0 - msgBox.addButton("Add", QMessageBox::NoRole); //==1 + msgBox.addButton("Add", QMessageBox::NoRole); //==1 msgBox.addButton("Cancel", QMessageBox::RejectRole); //==2 int overwrite = msgBox.exec(); @@ -3530,8 +3362,8 @@ void MainWindow::execute_loadsurface() if (!ok) { QMessageBox::warning(this, "iSeg", - "Error: Surface does not overlap with image", - QMessageBox::Ok | QMessageBox::Default); + "Error: Surface does not overlap with image", + QMessageBox::Ok | QMessageBox::Default); } } @@ -3539,9 +3371,9 @@ void MainWindow::execute_loadrtstruct() { #ifndef NORTSTRUCTSUPPORT QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTstruct (*.dcm)\n" - "All(*.*)", - this); //, filename); + "RTstruct (*.dcm)\n" + "All(*.*)", + this); //, filename); if (loadfilename.isEmpty()) { @@ -3551,12 +3383,12 @@ void MainWindow::execute_loadrtstruct() RadiotherapyStructureSetImporter RI(loadfilename, handler3D, this); QObject::connect( - &RI, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - &RI, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &RI, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(&RI, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); RI.move(QCursor::pos()); RI.exec(); @@ -3565,12 +3397,12 @@ void MainWindow::execute_loadrtstruct() tissuenr_changed(tissueTreeWidget->get_current_type() - 1); QObject::disconnect( - &RI, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + &RI, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::disconnect( - &RI, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &RI, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); reset_brightnesscontrast(); #endif @@ -3590,9 +3422,9 @@ void MainWindow::execute_loadrtdose() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTdose (*.dcm)\n" - "All(*.*)", - this); + "RTdose (*.dcm)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadRTdose(loadfilename.ascii()); @@ -3619,14 +3451,14 @@ void MainWindow::execute_reloadrtdose() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTdose (*.dcm)\n" - "All(*.*)", - this); + "RTdose (*.dcm)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadRTdose( - loadfilename.ascii(), - handler3D->return_startslice()); // TODO: handle failure + loadfilename.ascii(), + handler3D->return_startslice()); // TODO: handle failure reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3638,9 +3470,9 @@ void MainWindow::execute_reloadrtdose() void MainWindow::execute_loads4llivelink() { QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "S4L Link (*.h5)\n" - "All(*.*)", - this); + "S4L Link (*.h5)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { loadS4Llink(loadfilename); @@ -3698,12 +3530,11 @@ void MainWindow::execute_saveprojas() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Projects (*.prj)\n", this); //, filename); + QString::null, "Projects (*.prj)\n", this); //, filename); if (!savefilename.isEmpty()) { - if (savefilename.length() <= 4 || - !savefilename.endsWith(QString(".prj"))) + if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); m_saveprojfilename = savefilename; @@ -3712,9 +3543,9 @@ void MainWindow::execute_saveprojas() QString tempFileName = QString(savefilename); int afterDot = tempFileName.lastIndexOf('.'); if (afterDot != 0) - tempFileName = tempFileName.remove(afterDot, tempFileName.length() - - afterDot) + - "Temp.prj"; + tempFileName = + tempFileName.remove(afterDot, tempFileName.length() - afterDot) + + "Temp.prj"; else tempFileName = tempFileName + "Temp.prj"; @@ -3730,25 +3561,25 @@ void MainWindow::execute_saveprojas() int numTasks = 3; QProgressDialog progress("Save in progress...", "Cancel", 0, numTasks, - this); + this); progress.show(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); progress.setWindowModality(Qt::WindowModal); progress.setModal(true); progress.setValue(1); - setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + QString(" - ") + - TruncateFileName(savefilename)); + setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + + QString(" - ") + TruncateFileName(savefilename)); //m_saveprojfilename = tempFileName; //AddLoadProj(tempFileName); AddLoadProj(m_saveprojfilename); - FILE* fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); + FILE *fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); /*for(size_t i=0;iSaveParams(fp,saveProjVersion); @@ -3779,17 +3610,17 @@ void MainWindow::execute_saveprojas() if (QFile::exists(sourceFileNameWithoutExtension + ".xmf")) QFile::remove(sourceFileNameWithoutExtension + ".xmf"); QFile::rename(tempFileNameWithoutExtension + ".xmf", - sourceFileNameWithoutExtension + ".xmf"); + sourceFileNameWithoutExtension + ".xmf"); if (QFile::exists(sourceFileNameWithoutExtension + ".prj")) QFile::remove(sourceFileNameWithoutExtension + ".prj"); QFile::rename(tempFileNameWithoutExtension + ".prj", - sourceFileNameWithoutExtension + ".prj"); + sourceFileNameWithoutExtension + ".prj"); if (QFile::exists(sourceFileNameWithoutExtension + ".h5")) QFile::remove(sourceFileNameWithoutExtension + ".h5"); QFile::rename(tempFileNameWithoutExtension + ".h5", - sourceFileNameWithoutExtension + ".h5"); + sourceFileNameWithoutExtension + ".h5"); progress.setValue(numTasks); } @@ -3806,20 +3637,19 @@ void MainWindow::execute_savecopyas() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Projects (*.prj)\n", this); //, filename); + QString::null, "Projects (*.prj)\n", this); //, filename); if (!savefilename.isEmpty()) { - if (savefilename.length() <= 4 || - !savefilename.endsWith(QString(".prj"))) + if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); - FILE* fp = handler3D->SaveProject(savefilename.ascii(), "xmf"); + FILE *fp = handler3D->SaveProject(savefilename.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); /*for(size_t i=0;iSaveParams(fp,saveProjVersion); @@ -3850,12 +3680,12 @@ void MainWindow::execute_savecopyas() void MainWindow::SaveSettings() { - FILE* fp = fopen(settingsfile.c_str(), "wb"); + FILE *fp = fopen(settingsfile.c_str(), "wb"); if (fp == NULL) return; unsigned short saveProjVersion = 12; unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); bool flag; flag = WidgetInterface::get_hideparams(); @@ -3901,26 +3731,24 @@ void MainWindow::SaveSettings() fclose(fp); - QSettings settings(QSettings::IniFormat, QSettings::UserScope, "ZMT", - "iSeg"); + QSettings settings(QSettings::IniFormat, QSettings::UserScope, "ZMT", "iSeg"); settings.beginGroup("MainWindow"); settings.setValue("geometry", saveGeometry()); settings.setValue("state", saveState()); settings.setValue("NumberOfUndoSteps", - this->handler3D->GetNumberOfUndoSteps()); + this->handler3D->GetNumberOfUndoSteps()); settings.setValue("NumberOfUndoArrays", - this->handler3D->GetNumberOfUndoArrays()); + this->handler3D->GetNumberOfUndoArrays()); settings.setValue("Compression", this->handler3D->GetCompression()); - settings.setValue("ContiguousMemory", - this->handler3D->GetContiguousMemory()); + settings.setValue("ContiguousMemory", this->handler3D->GetContiguousMemory()); settings.endGroup(); settings.sync(); } -void MainWindow::LoadSettings(const char* loadfilename) +void MainWindow::LoadSettings(const char *loadfilename) { settingsfile = loadfilename; - FILE* fp; + FILE *fp; if ((fp = fopen(loadfilename, "rb")) == NULL) { return; @@ -3934,7 +3762,7 @@ void MainWindow::LoadSettings(const char* loadfilename) } int loadProjVersion, tissuesVersion; iseg::ExtractTissuesVersion((int)combinedVersion, loadProjVersion, - tissuesVersion); + tissuesVersion); iseg::DataSelection dataSelection; dataSelection.allSlices = true; @@ -3994,9 +3822,9 @@ void MainWindow::LoadSettings(const char* loadfilename) execute_showtabtoggled(flag); fp = TissueInfos::LoadTissues(fp, tissuesVersion); - const char* defaultTissuesFilename = - m_tmppath.absFilePath(QString("def_tissues.txt")); - FILE* fpTmp = fopen(defaultTissuesFilename, "r"); + const char *defaultTissuesFilename = + m_tmppath.absFilePath(QString("def_tissues.txt")); + FILE *fpTmp = fopen(defaultTissuesFilename, "r"); if (fpTmp != NULL || TissueInfos::GetTissueCount() <= 0) { if (fpTmp != NULL) @@ -4032,25 +3860,24 @@ void MainWindow::LoadSettings(const char* loadfilename) { cerr << "LoadSettings() : restoring values..." << endl; QSettings settings(QSettings::IniFormat, QSettings::UserScope, "ZMT", - "iSeg"); + "iSeg"); settings.beginGroup("MainWindow"); restoreGeometry(settings.value("geometry").toByteArray()); restoreState(settings.value("state").toByteArray()); this->handler3D->SetNumberOfUndoSteps( - settings.value("NumberOfUndoSteps", 50).toUInt()); - cerr << "NumberOfUndoSteps = " - << this->handler3D->GetNumberOfUndoSteps() << endl; + settings.value("NumberOfUndoSteps", 50).toUInt()); + cerr << "NumberOfUndoSteps = " << this->handler3D->GetNumberOfUndoSteps() + << endl; this->handler3D->SetNumberOfUndoArrays( - settings.value("NumberOfUndoArrays", 20).toUInt()); - cerr << "NumberOfUndoArrays = " - << this->handler3D->GetNumberOfUndoArrays() << endl; - this->handler3D->SetCompression( - settings.value("Compression", 0).toInt()); + settings.value("NumberOfUndoArrays", 20).toUInt()); + cerr << "NumberOfUndoArrays = " << this->handler3D->GetNumberOfUndoArrays() + << endl; + this->handler3D->SetCompression(settings.value("Compression", 0).toInt()); cerr << "Compression = " << this->handler3D->GetCompression() << endl; this->handler3D->SetContiguousMemory( - settings.value("ContiguousMemory", true).toBool()); + settings.value("ContiguousMemory", true).toBool()); cerr << "ContiguousMemory = " << this->handler3D->GetContiguousMemory() - << endl; + << endl; settings.endGroup(); if (this->handler3D->return_nrundo() == 0) @@ -4070,19 +3897,19 @@ void MainWindow::execute_saveactiveslicesas() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Projects (*.prj)\n", this); //, filename); + QString::null, "Projects (*.prj)\n", this); //, filename); if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); if (!savefilename.isEmpty()) { - FILE* fp = handler3D->SaveActiveSlices(savefilename.ascii(), "xmf"); + FILE *fp = handler3D->SaveActiveSlices(savefilename.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); /*for(size_t i=0;iSaveParams(fp,saveProjVersion); @@ -4124,8 +3951,7 @@ void MainWindow::execute_saveproj() { if (!m_S4Lcommunicationfilename.isEmpty()) { - handler3D->SaveCommunicationFile( - m_S4Lcommunicationfilename.ascii()); + handler3D->SaveCommunicationFile(m_S4Lcommunicationfilename.ascii()); } } else @@ -4136,9 +3962,9 @@ void MainWindow::execute_saveproj() QString tempFileName = QString(m_saveprojfilename); int afterDot = tempFileName.lastIndexOf('.'); if (afterDot != 0) - tempFileName = tempFileName.remove( - afterDot, tempFileName.length() - afterDot) + - "Temp.prj"; + tempFileName = + tempFileName.remove(afterDot, tempFileName.length() - afterDot) + + "Temp.prj"; else tempFileName = tempFileName + "Temp.prj"; @@ -4147,8 +3973,7 @@ void MainWindow::execute_saveproj() QString sourceFileNameWithoutExtension; afterDot = m_saveprojfilename.lastIndexOf('.'); if (afterDot != -1) - sourceFileNameWithoutExtension = - m_saveprojfilename.mid(0, afterDot); + sourceFileNameWithoutExtension = m_saveprojfilename.mid(0, afterDot); QString tempFileNameWithoutExtension; afterDot = tempFileName.lastIndexOf('.'); @@ -4156,26 +3981,26 @@ void MainWindow::execute_saveproj() tempFileNameWithoutExtension = tempFileName.mid(0, afterDot); int numTasks = 3; - QProgressDialog progress("Save in progress...", "Cancel", 0, - numTasks, this); + QProgressDialog progress("Save in progress...", "Cancel", 0, numTasks, + this); progress.show(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); progress.setWindowModality(Qt::WindowModal); progress.setModal(true); progress.setValue(1); - setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + QString(" - ") + - TruncateFileName(m_saveprojfilename)); + setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + + QString(" - ") + TruncateFileName(m_saveprojfilename)); m_saveprojfilename = tempFileName; //FILE *fp=handler3D->SaveProject(m_saveprojfilename.ascii(),"xmf"); - FILE* fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); + FILE *fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); /*for(size_t i=0;iSaveParams(fp,saveProjVersion); @@ -4205,17 +4030,16 @@ void MainWindow::execute_saveproj() QMessageBox mBox; mBox.setWindowTitle("Saving project"); - mBox.setText( - "The project you are trying to save is open somewhere else. " - "Please, close it before continuing and press OK or press " - "Cancel to stop saving process."); + mBox.setText("The project you are trying to save is open somewhere else. " + "Please, close it before continuing and press OK or press " + "Cancel to stop saving process."); mBox.addButton(QMessageBox::Ok); mBox.addButton(QMessageBox::Cancel); if (QFile::exists(sourceFileNameWithoutExtension + ".xmf")) { bool removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".xmf"); + QFile::remove(sourceFileNameWithoutExtension + ".xmf"); while (!removeSuccess) { int ret = mBox.exec(); @@ -4223,16 +4047,16 @@ void MainWindow::execute_saveproj() return; removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".xmf"); + QFile::remove(sourceFileNameWithoutExtension + ".xmf"); } } QFile::rename(tempFileNameWithoutExtension + ".xmf", - sourceFileNameWithoutExtension + ".xmf"); + sourceFileNameWithoutExtension + ".xmf"); if (QFile::exists(sourceFileNameWithoutExtension + ".prj")) { bool removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".prj"); + QFile::remove(sourceFileNameWithoutExtension + ".prj"); while (!removeSuccess) { int ret = mBox.exec(); @@ -4240,28 +4064,27 @@ void MainWindow::execute_saveproj() return; removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".prj"); + QFile::remove(sourceFileNameWithoutExtension + ".prj"); } } QFile::rename(tempFileNameWithoutExtension + ".prj", - sourceFileNameWithoutExtension + ".prj"); + sourceFileNameWithoutExtension + ".prj"); if (QFile::exists(sourceFileNameWithoutExtension + ".h5")) { bool removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".h5"); + QFile::remove(sourceFileNameWithoutExtension + ".h5"); while (!removeSuccess) { int ret = mBox.exec(); if (ret == QMessageBox::Cancel) return; - removeSuccess = - QFile::remove(sourceFileNameWithoutExtension + ".h5"); + removeSuccess = QFile::remove(sourceFileNameWithoutExtension + ".h5"); } } QFile::rename(tempFileNameWithoutExtension + ".h5", - sourceFileNameWithoutExtension + ".h5"); + sourceFileNameWithoutExtension + ".h5"); m_saveprojfilename = sourceFileNameWithoutExtension + ".prj"; @@ -4278,9 +4101,9 @@ void MainWindow::execute_saveproj() emit end_dataexport(this); } -void MainWindow::loadproj(const QString& loadfilename) +void MainWindow::loadproj(const QString &loadfilename) { - FILE* fp; + FILE *fp; if ((fp = fopen(loadfilename.ascii(), "r")) == NULL) { return; @@ -4301,8 +4124,8 @@ void MainWindow::loadproj(const QString& loadfilename) if (!loadfilename.isEmpty()) { m_saveprojfilename = loadfilename; - setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + QString(" - ") + - TruncateFileName(loadfilename)); + setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + + QString(" - ") + TruncateFileName(loadfilename)); AddLoadProj(m_saveprojfilename); int tissuesVersion = 0; fp = handler3D->LoadProject(loadfilename.ascii(), tissuesVersion); @@ -4330,7 +4153,7 @@ void MainWindow::loadproj(const QString& loadfilename) { int loadProjVersion, tissuesVersion; iseg::ExtractTissuesVersion((int)combinedVersion, loadProjVersion, - tissuesVersion); + tissuesVersion); /*for(size_t i=0;iLoadParams(fp,version); }*/ @@ -4354,10 +4177,9 @@ void MainWindow::loadproj(const QString& loadfilename) if (loadProjVersion >= 3) { fp = TissueInfos::LoadTissueLocks(fp); - tissues_size_t currTissueType = - tissueTreeWidget->get_current_type(); + tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); cb_tissuelock->setChecked( - TissueInfos::GetTissueLocked(currTissueType + 1)); + TissueInfos::GetTissueLocked(currTissueType + 1)); tissueTreeWidget->update_tissue_icons(); tissueTreeWidget->update_folder_icons(); } @@ -4375,7 +4197,7 @@ void MainWindow::loadproj(const QString& loadfilename) //m_S4Lcommunicationfilename=QString("F:\\applications\\bifurcation\\bifurcation2.h5");xxxa } -void MainWindow::loadS4Llink(const QString& loadfilename) +void MainWindow::loadS4Llink(const QString &loadfilename) { bool stillopen = false; @@ -4435,30 +4257,28 @@ void MainWindow::execute_mergeprojects() // Get save file name QString savefilename = - Q3FileDialog::getSaveFileName(QString::null, "Projects (*.prj)", this, - "iSeg", "Save merged project as"); + Q3FileDialog::getSaveFileName(QString::null, "Projects (*.prj)", this, + "iSeg", "Save merged project as"); if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); if (!savefilename.isEmpty() && mergefilenames.size() > 0) { - FILE* fp = - handler3D->MergeProjects(savefilename.ascii(), mergefilenames); + FILE *fp = handler3D->MergeProjects(savefilename.ascii(), mergefilenames); if (!fp) { - QMessageBox::warning( - this, "iSeg", - "Merge projects failed.\n\nPlease make sure that " - "all projects have the same xy extents\nand their " - "image data is contained in a .h5 and .xmf file.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::warning(this, "iSeg", + "Merge projects failed.\n\nPlease make sure that " + "all projects have the same xy extents\nand their " + "image data is contained in a .h5 and .xmf file.", + QMessageBox::Ok | QMessageBox::Default); return; } fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); unsigned short combinedVersion = - (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); + (unsigned short)iseg::CombineTissuesVersion(saveProjVersion, 1); fwrite(&combinedVersion, 1, sizeof(unsigned short), fp); /*for(size_t i=0;iSaveParams(fp,saveProjVersion); @@ -4486,9 +4306,9 @@ void MainWindow::execute_mergeprojects() // Load merged project if (QMessageBox::question(this, "iSeg", - "Would you like to load the merged project?", - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No) == QMessageBox::Yes) + "Would you like to load the merged project?", + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No) == QMessageBox::Yes) { loadproj(savefilename); } @@ -4499,9 +4319,9 @@ void MainWindow::execute_mergeprojects() void MainWindow::execute_boneconnectivity() { boneConnectivityDialog = new CheckBoneConnectivityDialog( - handler3D, "Bone Connectivity", this, Qt::Window); + handler3D, "Bone Connectivity", this, Qt::Window); QObject::connect(boneConnectivityDialog, SIGNAL(slice_changed()), this, - SLOT(update_slice())); + SLOT(update_slice())); boneConnectivityDialog->show(); boneConnectivityDialog->raise(); @@ -4516,9 +4336,9 @@ void MainWindow::execute_loadproj() maybeSafe(); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "Projects (*.prj)\n" - "All(*.*)", - this); //, filename); + "Projects (*.prj)\n" + "All(*.*)", + this); //, filename); if (!loadfilename.isEmpty()) { @@ -4576,11 +4396,10 @@ void MainWindow::execute_loadproj4() void MainWindow::execute_loadatlas(int i) { - AtlasWidget* AW = - new AtlasWidget(m_atlasfilename.m_atlasdir - .absFilePath(m_atlasfilename.m_atlasfilename[i]) - .ascii(), - m_picpath); + AtlasWidget *AW = new AtlasWidget( + m_atlasfilename.m_atlasdir.absFilePath(m_atlasfilename.m_atlasfilename[i]) + .ascii(), + m_picpath); if (AW->isOK) { AW->show(); @@ -4707,7 +4526,7 @@ void MainWindow::execute_createatlas() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Atlas file (*.atl)", this); //, filename); + QString::null, "Atlas file (*.atl)", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".atl"))) savefilename.append(".atl"); @@ -4729,7 +4548,7 @@ void MainWindow::execute_reloadatlases() void MainWindow::execute_savetissues() { QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, QString::null, this); //, filename); + QString::null, QString::null, this); //, filename); if (!savefilename.isEmpty()) { @@ -4741,7 +4560,7 @@ void MainWindow::execute_savetissues() void MainWindow::execute_exportsurfacegenerationtoolxml() { QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, QString::null, this); //, filename); + QString::null, QString::null, this); //, filename); if (!savefilename.isEmpty()) { @@ -4756,7 +4575,7 @@ void MainWindow::execute_exportlabelfield() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "AmiraMesh Ascii (*.am)", this); //, filename); + QString::null, "AmiraMesh Ascii (*.am)", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".am"))) savefilename.append(".am"); @@ -4778,7 +4597,7 @@ void MainWindow::execute_exportmat() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Matlab (*.mat)", this); //, filename); + QString::null, "Matlab (*.mat)", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".mat"))) savefilename.append(".mat"); @@ -4800,7 +4619,7 @@ void MainWindow::execute_exporthdf() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "HDF (*.h5)", this); //, filename); + QString::null, "HDF (*.h5)", this); //, filename); if (savefilename.length() > 3 && !savefilename.endsWith(QString(".h5"))) savefilename.append(".h5"); @@ -4820,10 +4639,10 @@ void MainWindow::execute_exportvtkascii() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "VTK Ascii (*.vti *.vtk)", this); //, filename); + QString::null, "VTK Ascii (*.vti *.vtk)", this); //, filename); if (savefilename.length() > 4 && !(savefilename.endsWith(QString(".vti")) || - savefilename.endsWith(QString(".vtk")))) + savefilename.endsWith(QString(".vtk")))) savefilename.append(".vti"); if (!savefilename.isEmpty()) @@ -4841,10 +4660,10 @@ void MainWindow::execute_exportvtkbinary() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "VTK bin (*.vti *.vtk)", this); //, filename); + QString::null, "VTK bin (*.vti *.vtk)", this); //, filename); if (savefilename.length() > 4 && !(savefilename.endsWith(QString(".vti")) || - savefilename.endsWith(QString(".vtk")))) + savefilename.endsWith(QString(".vtk")))) savefilename.append(".vti"); if (!savefilename.isEmpty()) @@ -4862,7 +4681,7 @@ void MainWindow::execute_exportvtkcompressedascii() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "VTK comp (*.vti)", this); //, filename); + QString::null, "VTK comp (*.vti)", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".vti"))) savefilename.append(".vti"); @@ -4882,7 +4701,7 @@ void MainWindow::execute_exportvtkcompressedbinary() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "VTK comp (*.vti)", this); //, filename); + QString::null, "VTK comp (*.vti)", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".vti"))) savefilename.append(".vti"); @@ -4901,16 +4720,16 @@ void MainWindow::execute_exportxmlregionextent() dataSelection.tissues = true; emit begin_dataexport(dataSelection, this); - QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "XML extent (*.xml)", this); + QString savefilename = + Q3FileDialog::getSaveFileName(QString::null, "XML extent (*.xml)", this); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".xml"))) savefilename.append(".xml"); QString relfilename = QString(""); if (!m_saveprojfilename.isEmpty()) - relfilename = m_saveprojfilename.right( - m_saveprojfilename.length() - m_saveprojfilename.findRev("/") - 1); + relfilename = m_saveprojfilename.right(m_saveprojfilename.length() - + m_saveprojfilename.findRev("/") - 1); if (!savefilename.isEmpty()) { @@ -4918,7 +4737,7 @@ void MainWindow::execute_exportxmlregionextent() handler3D->print_xmlregionextent(savefilename.ascii(), true); else handler3D->print_xmlregionextent(savefilename.ascii(), true, - relfilename.ascii()); + relfilename.ascii()); } emit end_dataexport(this); @@ -4930,15 +4749,15 @@ void MainWindow::execute_exporttissueindex() emit begin_dataexport(dataSelection, this); QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "tissue index (*.txt)", this); + QString::null, "tissue index (*.txt)", this); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".txt"))) savefilename.append(".txt"); QString relfilename = QString(""); if (!m_saveprojfilename.isEmpty()) - relfilename = m_saveprojfilename.right( - m_saveprojfilename.length() - m_saveprojfilename.findRev("/") - 1); + relfilename = m_saveprojfilename.right(m_saveprojfilename.length() - + m_saveprojfilename.findRev("/") - 1); if (!savefilename.isEmpty()) { @@ -4946,7 +4765,7 @@ void MainWindow::execute_exporttissueindex() handler3D->print_tissueindex(savefilename.ascii(), true); else handler3D->print_tissueindex(savefilename.ascii(), true, - relfilename.ascii()); + relfilename.ascii()); } emit end_dataexport(this); @@ -4955,18 +4774,18 @@ void MainWindow::execute_exporttissueindex() void MainWindow::execute_loadtissues() { QString loadfilename = Q3FileDialog::getOpenFileName( - QString::null, QString::null, this); //, filename); + QString::null, QString::null, this); //, filename); if (!loadfilename.isEmpty()) { QMessageBox msgBox; msgBox.setText("Do you want to append the new tissues or to replace " - "the old tissues?"); - QPushButton* appendButton = - msgBox.addButton(tr("Append"), QMessageBox::AcceptRole); - QPushButton* replaceButton = - msgBox.addButton(tr("Replace"), QMessageBox::AcceptRole); - QPushButton* abortButton = msgBox.addButton(QMessageBox::Abort); + "the old tissues?"); + QPushButton *appendButton = + msgBox.addButton(tr("Append"), QMessageBox::AcceptRole); + QPushButton *replaceButton = + msgBox.addButton(tr("Replace"), QMessageBox::AcceptRole); + QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort); msgBox.setIcon(QMessageBox::Question); msgBox.exec(); @@ -4975,12 +4794,11 @@ void MainWindow::execute_loadtissues() if (msgBox.clickedButton() == appendButton) { TissueInfos::LoadTissuesReadable(loadfilename.ascii(), handler3D, - removeTissuesRange); + removeTissuesRange); int nr = tissueTreeWidget->get_current_type() - 1; tissueTreeWidget->update_tree_widget(); - tissues_size_t currTissueType = - tissueTreeWidget->get_current_type(); + tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); if (nr != currTissueType - 1) { tissuenr_changed(currTissueType - 1); @@ -4988,25 +4806,23 @@ void MainWindow::execute_loadtissues() } else if (msgBox.clickedButton() == replaceButton) { - if (TissueInfos::LoadTissuesReadable(loadfilename.ascii(), - handler3D, removeTissuesRange)) + if (TissueInfos::LoadTissuesReadable(loadfilename.ascii(), handler3D, + removeTissuesRange)) { if (removeTissuesRange > 0) { #if 1 // Version: Ask user whether to delete tissues int ret = QMessageBox::question( - this, "iSeg", - "Some of the previously existing tissues are\nnot " - "contained in " - "the loaded tissue list.\n\nDo you want to delete " - "them?", - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No); + this, "iSeg", + "Some of the previously existing tissues are\nnot " + "contained in " + "the loaded tissue list.\n\nDo you want to delete " + "them?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); if (ret == QMessageBox::Yes) { std::set removeTissues; - for (tissues_size_t type = 1; - type <= removeTissuesRange; ++type) + for (tissues_size_t type = 1; type <= removeTissuesRange; ++type) { removeTissues.insert(type); } @@ -5019,8 +4835,7 @@ void MainWindow::execute_loadtissues() } #else std::set removeTissues; - for (tissues_size_t type = 1; type <= removeTissuesRange; - ++type) + for (tissues_size_t type = 1; type <= removeTissuesRange; ++type) { removeTissues.insert(type); } @@ -5045,7 +4860,7 @@ void MainWindow::execute_loadtissues() void MainWindow::execute_settissuesasdef() { TissueInfos::SaveDefaultTissueList( - m_tmppath.absFilePath(QString("def_tissues.txt"))); + m_tmppath.absFilePath(QString("def_tissues.txt"))); } void MainWindow::execute_removedeftissues() @@ -5075,7 +4890,8 @@ void MainWindow::execute_new() emit end_datachange(this, iseg::ClearUndo); m_saveprojfilename = QString(""); - setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + QString(" - No Filename")); + setCaption(QString(" iSeg ") + QString(xstr(ISEG_VERSION)) + + QString(" - No Filename")); m_notes->clear(); reset_brightnesscontrast(); @@ -5092,8 +4908,7 @@ void MainWindow::execute_3Dsurfaceviewer() if (SV3D == NULL) { SV3D = new surfaceviewer3D(handler3D, false, 0); - QObject::connect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3D_closed())); + QObject::connect(SV3D, SIGNAL(hasbeenclosed()), this, SLOT(SV3D_closed())); } SV3D->show(); @@ -5112,7 +4927,7 @@ void MainWindow::execute_3Dsurfaceviewerbmp() { SV3Dbmp = new surfaceviewer3D(handler3D, true, 0); QObject::connect(SV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); } SV3Dbmp->show(); @@ -5130,8 +4945,7 @@ void MainWindow::execute_3Dvolumeviewertissue() if (VV3D == NULL) { VV3D = new volumeviewer3D(handler3D, false, true, true, 0); - QObject::connect(VV3D, SIGNAL(hasbeenclosed()), this, - SLOT(VV3D_closed())); + QObject::connect(VV3D, SIGNAL(hasbeenclosed()), this, SLOT(VV3D_closed())); } VV3D->show(); @@ -5150,7 +4964,7 @@ void MainWindow::execute_3Dvolumeviewerbmp() { VV3Dbmp = new volumeviewer3D(handler3D, true, true, true, 0); QObject::connect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); } VV3Dbmp->show(); @@ -5251,18 +5065,18 @@ void MainWindow::xslice_closed() { if (xsliceshower != NULL) { - QObject::disconnect( - bmp_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); - QObject::disconnect( - work_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(bmp_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(work_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); + SLOT(xshower_slicechanged())); QObject::disconnect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); if (ysliceshower != NULL) { @@ -5280,18 +5094,18 @@ void MainWindow::yslice_closed() { if (ysliceshower != NULL) { - QObject::disconnect( - bmp_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); - QObject::disconnect( - work_show, SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(bmp_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); + QObject::disconnect(work_show, + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); + SLOT(yshower_slicechanged())); QObject::disconnect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); if (xsliceshower != NULL) { @@ -5310,7 +5124,7 @@ void MainWindow::SV3D_closed() if (SV3D != NULL) { QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3D_closed())); + SLOT(SV3D_closed())); delete SV3D; SV3D = NULL; } @@ -5321,7 +5135,7 @@ void MainWindow::SV3Dbmp_closed() if (SV3Dbmp != NULL) { QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); delete SV3Dbmp; SV3Dbmp = NULL; } @@ -5332,7 +5146,7 @@ void MainWindow::VV3D_closed() if (VV3D != NULL) { QObject::disconnect(VV3D, SIGNAL(hasbeenclosed()), this, - SLOT(VV3D_closed())); + SLOT(VV3D_closed())); delete VV3D; VV3D = NULL; } @@ -5343,7 +5157,7 @@ void MainWindow::VV3Dbmp_closed() if (VV3Dbmp != NULL) { QObject::disconnect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); delete VV3Dbmp; VV3Dbmp = NULL; } @@ -5412,21 +5226,21 @@ void MainWindow::execute_scale() { ScaleWork SW(handler3D, m_picpath, this); QObject::connect( - &SW, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - &SW, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &SW, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(&SW, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); SW.move(QCursor::pos()); SW.exec(); QObject::disconnect( - &SW, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + &SW, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::disconnect( - &SW, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &SW, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); return; } @@ -5435,21 +5249,21 @@ void MainWindow::execute_imagemath() { ImageMath IM(handler3D, this); QObject::connect( - &IM, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - &IM, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &IM, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(&IM, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); IM.move(QCursor::pos()); IM.exec(); QObject::disconnect( - &IM, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + &IM, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::disconnect( - &IM, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &IM, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); return; } @@ -5471,21 +5285,21 @@ void MainWindow::execute_overlay() { ImageOverlay IO(handler3D, this); QObject::connect( - &IO, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - &IO, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &IO, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(&IO, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); IO.move(QCursor::pos()); IO.exec(); QObject::disconnect( - &IO, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), - this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + &IO, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::disconnect( - &IO, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + &IO, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); return; } @@ -5592,7 +5406,7 @@ void MainWindow::execute_activeslicesconf() unsigned short slicenr = handler3D->get_activeslice() + 1; if (handler3D->return_startslice() >= slicenr || - handler3D->return_endslice() + 1 <= slicenr) + handler3D->return_endslice() + 1 <= slicenr) { lb_inactivewarning->setText(QString(" 3D Inactive Slice! ")); lb_inactivewarning->setPaletteBackgroundColor(QColor(0, 255, 0)); @@ -5601,7 +5415,7 @@ void MainWindow::execute_activeslicesconf() { lb_inactivewarning->setText(QString(" ")); lb_inactivewarning->setPaletteBackgroundColor( - this->paletteBackgroundColor()); + this->paletteBackgroundColor()); } return; @@ -5767,7 +5581,8 @@ void MainWindow::execute_showtabtoggled(bool) showpb_tab[i] = showtab_action[i]->isOn(); } - WidgetInterface* currentwidget = (WidgetInterface*)methodTab->visibleWidget(); + WidgetInterface *currentwidget = + (WidgetInterface *)methodTab->visibleWidget(); unsigned short i = 0; while ((i < nrtabbuttons) && (currentwidget != tabwidgets[i])) i++; @@ -5802,8 +5617,8 @@ void MainWindow::execute_xslice() if (xsliceshower == NULL) { xsliceshower = new SliceViewerWidget( - handler3D, true, handler3D->get_slicethickness(), - zoom_widget->get_zoom(), 0, 0, Qt::WStyle_StaysOnTop); + handler3D, true, handler3D->get_slicethickness(), + zoom_widget->get_zoom(), 0, 0, Qt::WStyle_StaysOnTop); xsliceshower->zpos_changed(); if (ysliceshower != NULL) { @@ -5820,17 +5635,17 @@ void MainWindow::execute_xslice() work_show->get_scaleoffsetfactor(offset1, factor1); xsliceshower->set_scale(offset1, factor1, false); QObject::connect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); + SLOT(xshower_slicechanged())); QObject::connect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); } xsliceshower->show(); @@ -5850,8 +5665,8 @@ void MainWindow::execute_yslice() if (ysliceshower == NULL) { ysliceshower = new SliceViewerWidget( - handler3D, false, handler3D->get_slicethickness(), - zoom_widget->get_zoom(), 0, 0, Qt::WStyle_StaysOnTop); + handler3D, false, handler3D->get_slicethickness(), + zoom_widget->get_zoom(), 0, 0, Qt::WStyle_StaysOnTop); ysliceshower->zpos_changed(); if (xsliceshower != NULL) { @@ -5868,17 +5683,17 @@ void MainWindow::execute_yslice() work_show->get_scaleoffsetfactor(offset1, factor1); ysliceshower->set_scale(offset1, factor1, false); QObject::connect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); + SLOT(yshower_slicechanged())); QObject::connect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); } ysliceshower->show(); @@ -5890,9 +5705,9 @@ void MainWindow::execute_yslice() void MainWindow::execute_removetissues() { QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { std::vector types; @@ -5900,7 +5715,7 @@ void MainWindow::execute_removetissues() { // this actually goes through slices and removes it from segmentation handler3D->remove_tissues( - std::set(types.begin(), types.end())); + std::set(types.begin(), types.end())); tissueTreeWidget->update_tree_widget(); tissuenr_changed(tissueTreeWidget->get_current_type() - 1); @@ -5908,8 +5723,8 @@ void MainWindow::execute_removetissues() else { QMessageBox::warning(this, "iSeg", - "Error: not all tissues are in tissue list", - QMessageBox::Ok | QMessageBox::Default); + "Error: not all tissues are in tissue list", + QMessageBox::Ok | QMessageBox::Default); } } } @@ -5919,14 +5734,14 @@ void MainWindow::execute_grouptissues() vector olds, news; QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { bool fail_on_unknown_tissue = true; if (read_grouptissuescapped(filename.ascii(), olds, news, - fail_on_unknown_tissue)) + fail_on_unknown_tissue)) { iseg::DataSelection dataSelection; dataSelection.allSlices = true; @@ -5940,8 +5755,8 @@ void MainWindow::execute_grouptissues() else { QMessageBox::warning(this, "iSeg", - "Error: not all tissues are in tissue list", - QMessageBox::Ok | QMessageBox::Default); + "Error: not all tissues are in tissue list", + QMessageBox::Ok | QMessageBox::Default); } } } @@ -6008,13 +5823,13 @@ void MainWindow::remove_mark(Point p) void MainWindow::select_tissue(Point p) { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto i = list.begin(); i != list.end(); ++i) { (*i)->setSelected(false); } tissueTreeWidget->set_current_tissue( - handler3D->get_tissue_pt(p, handler3D->get_activeslice())); + handler3D->get_tissue_pt(p, handler3D->get_activeslice())); } void MainWindow::next_featuring_slice() @@ -6034,8 +5849,7 @@ void MainWindow::next_featuring_slice() } else { - QMessageBox::information(this, "iSeg", - "The selected tissue its empty.\n"); + QMessageBox::information(this, "iSeg", "The selected tissue its empty.\n"); } } @@ -6061,7 +5875,7 @@ void MainWindow::add_tissue_connected(Point p) tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); handler3D->add2tissue_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); emit end_datachange(this); } @@ -6108,10 +5922,10 @@ void MainWindow::subtract_tissue(Point p) void MainWindow::add_tissue_clicked(Point p) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); addhold_tissue_clicked(p); } @@ -6129,20 +5943,19 @@ void MainWindow::addhold_tissue_clicked(Point p) QApplication::setOverrideCursor(QCursor(Qt::waitCursor)); if (cb_addsubconn->isChecked()) handler3D->add2tissueall_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); else handler3D->add2tissueall(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); QApplication::restoreOverrideCursor(); } else { if (cb_addsubconn->isChecked()) handler3D->add2tissue_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); else - handler3D->add2tissue(currTissueType, p, - cb_addsuboverride->isChecked()); + handler3D->add2tissue(currTissueType, p, cb_addsuboverride->isChecked()); } emit end_datachange(this); @@ -6159,10 +5972,10 @@ void MainWindow::addhold_tissue_clicked(Point p) void MainWindow::subtract_tissue_clicked(Point p) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); subtracthold_tissue_clicked(p); } @@ -6210,40 +6023,34 @@ void MainWindow::add_tissue_pushed() if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } if (pb_add->isOn()) { - // pb_add->setDown(false); QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); disconnect_mouseclick(); } else { - // pb_add->setDown(true); QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); connect_mouseclick(); } - /* if(pb_add3D->isDown()){ - QObject::disconnect(work_show,SIGNAL(mousepressed_sign(Point)),this,SLOT(add_tissue_3D_clicked(Point))); - pb_add3D->setDown(false); - }*/ } void MainWindow::add_tissue_shortkey() @@ -6267,26 +6074,26 @@ void MainWindow::addhold_tissue_pushed() if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_addhold->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); disconnect_mouseclick(); // pb_addhold->setDown(false); } @@ -6294,7 +6101,7 @@ void MainWindow::addhold_tissue_pushed() { // pb_addhold->setDown(true); QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); connect_mouseclick(); } /* if(pb_add3D->isDown()){ @@ -6327,32 +6134,32 @@ void MainWindow::subtract_tissue_pushed() if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_sub->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); disconnect_mouseclick(); } else { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); connect_mouseclick(); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); // pb_subhold->setDown(false); pb_subhold->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); // pb_addhold->setOn(false); pb_addhold->setOn(false); } @@ -6372,31 +6179,31 @@ void MainWindow::subtracthold_tissue_pushed() if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_subhold->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); disconnect_mouseclick(); } else { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); connect_mouseclick(); } if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } // pb_subhold->setDown(!pb_subhold->isDown()); @@ -6415,25 +6222,25 @@ void MainWindow::stophold_tissue_pushed() if (pb_add->isDown()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setDown(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_sub->isDown()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setDown(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } } @@ -6494,9 +6301,9 @@ void MainWindow::do_work2tissue_grouped() vector olds, news; QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { @@ -6516,8 +6323,7 @@ void MainWindow::do_work2tissue_grouped() // handler3D->build255tissues(); tissueTreeWidget->update_tree_widget(); - tissues_size_t currTissueType = - tissueTreeWidget->get_current_type(); + tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); tissuenr_changed(currTissueType); emit end_datachange(this); @@ -6525,7 +6331,7 @@ void MainWindow::do_work2tissue_grouped() } } -void MainWindow::tissueFilterChanged(const QString& text) +void MainWindow::tissueFilterChanged(const QString &text) { tissueTreeWidget->set_tissue_filter(text); } @@ -6543,30 +6349,29 @@ void MainWindow::newTissuePressed() void MainWindow::merge() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { - anyLocked |= - TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); + anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); } if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be merged.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to merge the selected tissues?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to merge the selected tissues?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { bool tmp; tmp = tissue3Dopt->isChecked(); tissue3Dopt->setChecked(true); selectedtissue2work(); - QList list; + QList list; list = tissueTreeWidget->selectedItems(); TissueAdder TA(false, tissueTreeWidget, this); //TA.move(QCursor::pos()); @@ -6628,8 +6433,8 @@ void MainWindow::modifFolder() { bool ok = false; QString newFolderName = QInputDialog::getText( - "Folder name", "Enter a name for the folder:", QLineEdit::Normal, - tissueTreeWidget->get_current_name(), &ok, this); + "Folder name", "Enter a name for the folder:", QLineEdit::Normal, + tissueTreeWidget->get_current_name(), &ok, this); if (ok) { tissueTreeWidget->set_current_folder_name(newFolderName); @@ -6651,24 +6456,23 @@ void MainWindow::removeTissueFolderPressed() void MainWindow::removeselected() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { - anyLocked |= - TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); + anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); } if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } bool removeCompletely = false; int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to remove the selected tissues?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to remove the selected tissues?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { removeCompletely = true; @@ -6677,20 +6481,20 @@ void MainWindow::removeselected() { return; // Cancel } - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); if (tissueTreeWidget->get_tissue_instance_count(currTissueType) > 1) { // There are more than one instance of the same tissue in the tree int ret = QMessageBox::question( - this, "iSeg", - "There are multiple occurrences\nof a selected tissue in the " - "hierarchy.\nDo you want to remove them all?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", + "There are multiple occurrences\nof a selected tissue in the " + "hierarchy.\nDo you want to remove them all?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { removeCompletely = true; @@ -6715,10 +6519,9 @@ void MainWindow::removeselected() tissues_size_t tissueCount = TissueInfos::GetTissueCount(); if (tissueCount < 2) { - QMessageBox::information( - this, "iSeg", - "It is not possible to erase this tissue.\nAt " - "least one tissue must be defined."); + QMessageBox::information(this, "iSeg", + "It is not possible to erase this tissue.\nAt " + "least one tissue must be defined."); return; } @@ -6746,11 +6549,11 @@ void MainWindow::removeselected() } } -void MainWindow::removeselectedmerge(QList list) +void MainWindow::removeselectedmerge(QList list) { for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); tissues_size_t tissueCount = TissueInfos::GetTissueCount(); iseg::DataSelection dataSelection; @@ -6775,11 +6578,10 @@ void MainWindow::removeFolder() { QMessageBox msgBox; msgBox.setText("Remove Folder"); - msgBox.setInformativeText( - "Do you want to keep all tissues\nand folders " - "contained in this folder?"); + msgBox.setInformativeText("Do you want to keep all tissues\nand folders " + "contained in this folder?"); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | - QMessageBox::Cancel); + QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Yes); int ret = msgBox.exec(); if (ret == QMessageBox::Yes) @@ -6796,11 +6598,11 @@ void MainWindow::removeFolder() bool anyLocked = false; std::set removeTissues; for (std::map::iterator iter = - childTissues.begin(); - iter != childTissues.end(); ++iter) + childTissues.begin(); + iter != childTissues.end(); ++iter) { if (iter->second == - tissueTreeWidget->get_tissue_instance_count(iter->first)) + tissueTreeWidget->get_tissue_instance_count(iter->first)) { anyLocked |= TissueInfos::GetTissueLocked(iter->first); removeTissues.insert(iter->first); @@ -6808,17 +6610,15 @@ void MainWindow::removeFolder() } if (anyLocked) { - QMessageBox::warning(this, "iSeg", - "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", + QMessageBox::Ok | QMessageBox::Default); return; } if (removeTissues.size() >= TissueInfos::GetTissueCount()) { - QMessageBox::information( - this, "iSeg", - "It is not possible to erase this folder.\nAt " - "least one tissue must be defined."); + QMessageBox::information(this, "iSeg", + "It is not possible to erase this folder.\nAt " + "least one tissue must be defined."); return; } @@ -6835,8 +6635,7 @@ void MainWindow::removeFolder() emit end_datachange(this, iseg::ClearUndo); - tissues_size_t currTissueType = - tissueTreeWidget->get_current_type(); + tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); tissuenr_changed(currTissueType - 1); } } @@ -6849,23 +6648,22 @@ void MainWindow::removeFolder() void MainWindow::removeTissueFolderAllPressed() { bool anyLocked = false; - QList list_ = tissueTreeWidget->get_all_items(); + QList list_ = tissueTreeWidget->get_all_items(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { - anyLocked |= - TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); + anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); } if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to remove all tissues and folders?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to remove all tissues and folders?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { iseg::DataSelection dataSelection; @@ -6915,11 +6713,11 @@ void MainWindow::selectedtissue2work() emit begin_datachange(dataSelection, this); handler3D->clear_work(); - QList list; + QList list; list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); if (tissue3Dopt->isChecked()) @@ -6957,23 +6755,22 @@ void MainWindow::tissue2workall() void MainWindow::cleartissues() { bool anyLocked = false; - QList list_ = tissueTreeWidget->get_all_items(); + QList list_ = tissueTreeWidget->get_all_items(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { - anyLocked |= - TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); + anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); } if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be cleared.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to clear all tissues?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to clear all tissues?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { iseg::DataSelection dataSelection; @@ -6999,18 +6796,18 @@ void MainWindow::cleartissues() void MainWindow::cleartissue() { bool isLocked = - TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type()); + TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type()); if (isLocked) { QMessageBox::warning(this, "iSeg", "Locked tissue can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to clear the tissue?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to clear the tissue?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { iseg::DataSelection dataSelection; @@ -7036,23 +6833,22 @@ void MainWindow::cleartissue() void MainWindow::clearselected() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { - anyLocked |= - TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); + anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); } if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be cleared.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } int ret = QMessageBox::warning( - this, "iSeg", "Do you really want to clear tissues?", - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", "Do you really want to clear tissues?", + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { iseg::DataSelection dataSelection; @@ -7061,11 +6857,11 @@ void MainWindow::clearselected() dataSelection.tissues = true; emit begin_datachange(dataSelection, this); - QList list; + QList list; list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; tissues_size_t nr = tissueTreeWidget->get_type(item); if (tissue3Dopt->isChecked()) { @@ -7130,20 +6926,20 @@ void MainWindow::workpicturevisible_changed() void MainWindow::slice_changed() { - WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); - qw->slicenr_changed(); + WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); + qw->on_slicenr_changed(); unsigned short slicenr = handler3D->get_activeslice() + 1; QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setValue(int(slicenr)); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setValue(int(slicenr)); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); bmp_show->slicenr_changed(); work_show->slicenr_changed(); scalewidget->slicenr_changed(); @@ -7151,7 +6947,7 @@ void MainWindow::slice_changed() imageoverlaywidget->slicenr_changed(); overlay_widget->slicenr_changed(); if (handler3D->return_startslice() >= slicenr || - handler3D->return_endslice() + 1 <= slicenr) + handler3D->return_endslice() + 1 <= slicenr) { lb_inactivewarning->setText(QString(" 3D Inactive Slice! ")); lb_inactivewarning->setPaletteBackgroundColor(QColor(0, 255, 0)); @@ -7160,7 +6956,7 @@ void MainWindow::slice_changed() { lb_inactivewarning->setText(QString(" ")); lb_inactivewarning->setPaletteBackgroundColor( - this->paletteBackgroundColor()); + this->paletteBackgroundColor()); } if (xsliceshower != NULL) @@ -7184,42 +6980,42 @@ void MainWindow::slices3d_changed(bool new_bitstack) for (size_t i = 0; i < tabwidgets.size(); i++) { - ((WidgetInterface*)(tabwidgets[i]))->newloaded(); + ((WidgetInterface *)(tabwidgets[i]))->newloaded(); } - WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); + WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); if (handler3D->return_nrslices() != nrslices) { QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setMaxValue((int)handler3D->return_nrslices()); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setMaxValue((int)handler3D->return_nrslices()); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); lb_slicenr->setText(QString(" of ") + - QString::number((int)handler3D->return_nrslices())); + QString::number((int)handler3D->return_nrslices())); interpolwidget->handler3D_changed(); nrslices = handler3D->return_nrslices(); } unsigned short slicenr = handler3D->get_activeslice() + 1; QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setValue(int(slicenr)); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setValue(int(slicenr)); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); if (handler3D->return_startslice() >= slicenr || - handler3D->return_endslice() + 1 <= slicenr) + handler3D->return_endslice() + 1 <= slicenr) { lb_inactivewarning->setText(QString(" 3D Inactive Slice! ")); lb_inactivewarning->setPaletteBackgroundColor(QColor(0, 255, 0)); @@ -7228,7 +7024,7 @@ void MainWindow::slices3d_changed(bool new_bitstack) { lb_inactivewarning->setText(QString(" ")); lb_inactivewarning->setPaletteBackgroundColor( - this->paletteBackgroundColor()); + this->paletteBackgroundColor()); } if (xsliceshower != NULL) @@ -7349,16 +7145,14 @@ void MainWindow::slicethickness_changed1() void MainWindow::tissuenr_changed(int i) { - QWidget* qw = methodTab->visibleWidget(); - - if (qw == iftrg_widget) - iftrg_widget->tissuenr_changed(i); - else if (qw == interpolwidget) - interpolwidget->tissuenr_changed(i); + QWidget *qw = methodTab->visibleWidget(); + if (auto tool = dynamic_cast(qw)) + { + tool->on_tissuenr_changed(i); + } bmp_show->color_changed(i); work_show->color_changed(i); - OutlineCorrect_widget->tissuenr_changed(i); bitstack_widget->tissuenr_changed(i); cb_tissuelock->setChecked(TissueInfos::GetTissueLocked(i + 1)); @@ -7366,7 +7160,7 @@ void MainWindow::tissuenr_changed(int i) void MainWindow::tissue_selection_changed() { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); if (list.size() > 1) { showpb_tab[6] = false; @@ -7394,23 +7188,23 @@ void MainWindow::tissue_selection_changed() void MainWindow::unselectall() { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; item->setSelected(false); } } -void MainWindow::tree_widget_doubleclicked(QTreeWidgetItem* item, int column) +void MainWindow::tree_widget_doubleclicked(QTreeWidgetItem *item, int column) { modifTissueFolderPressed(); } -void MainWindow::tree_widget_contextmenu(const QPoint& pos) +void MainWindow::tree_widget_contextmenu(const QPoint &pos) { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); if (list.size() <= 1) // single selection { @@ -7421,8 +7215,10 @@ void MainWindow::tree_widget_contextmenu(const QPoint& pos) contextMenu.insertSeparator(); contextMenu.insertItem("New Tissue...", this, SLOT(newTissuePressed())); contextMenu.insertItem("New Folder...", this, SLOT(newFolderPressed())); - contextMenu.insertItem("Mod. Folder...", this, SLOT(modifTissueFolderPressed())); - contextMenu.insertItem("Del. Folder...", this, SLOT(removeTissueFolderPressed())); + contextMenu.insertItem("Mod. Folder...", this, + SLOT(modifTissueFolderPressed())); + contextMenu.insertItem("Del. Folder...", this, + SLOT(removeTissueFolderPressed())); } else { @@ -7430,21 +7226,26 @@ void MainWindow::tree_widget_contextmenu(const QPoint& pos) contextMenu.insertSeparator(); contextMenu.insertItem("New Tissue...", this, SLOT(newTissuePressed())); contextMenu.insertItem("New Folder...", this, SLOT(newFolderPressed())); - contextMenu.insertItem("Mod. Tissue...", this, SLOT(modifTissueFolderPressed())); - contextMenu.insertItem("Del. Tissue...", this, SLOT(removeTissueFolderPressed())); + contextMenu.insertItem("Mod. Tissue...", this, + SLOT(modifTissueFolderPressed())); + contextMenu.insertItem("Del. Tissue...", this, + SLOT(removeTissueFolderPressed())); contextMenu.insertSeparator(); contextMenu.insertItem("Get Tissue", this, SLOT(tissue2work())); contextMenu.insertItem("Clear Tissue", this, SLOT(cleartissue())); contextMenu.insertSeparator(); - contextMenu.insertItem("Next Feat. Slice", this, SLOT(next_featuring_slice())); + contextMenu.insertItem("Next Feat. Slice", this, + SLOT(next_featuring_slice())); } contextMenu.insertSeparator(); - int itemId = - contextMenu.insertItem("Show Tissue Indices", tissueTreeWidget, SLOT(toggle_show_tissue_indices())); - contextMenu.setItemChecked( - itemId, !tissueTreeWidget->get_tissue_indices_hidden()); - contextMenu.insertItem("Sort By Name", tissueTreeWidget, SLOT(sort_by_tissue_name())); - contextMenu.insertItem("Sort By Index", tissueTreeWidget, SLOT(sort_by_tissue_index())); + int itemId = contextMenu.insertItem("Show Tissue Indices", tissueTreeWidget, + SLOT(toggle_show_tissue_indices())); + contextMenu.setItemChecked(itemId, + !tissueTreeWidget->get_tissue_indices_hidden()); + contextMenu.insertItem("Sort By Name", tissueTreeWidget, + SLOT(sort_by_tissue_name())); + contextMenu.insertItem("Sort By Index", tissueTreeWidget, + SLOT(sort_by_tissue_index())); contextMenu.exec(tissueTreeWidget->viewport()->mapToGlobal(pos)); } else // multi-selection @@ -7469,24 +7270,22 @@ void MainWindow::tissuelock_toggled() std::map childTissues; tissueTreeWidget->get_current_child_tissues(childTissues); for (std::map::iterator iter = - childTissues.begin(); - iter != childTissues.end(); ++iter) + childTissues.begin(); + iter != childTissues.end(); ++iter) { - TissueInfos::SetTissueLocked(iter->first, - cb_tissuelock->isChecked()); + TissueInfos::SetTissueLocked(iter->first, cb_tissuelock->isChecked()); } } else { - QList list; + QList list; list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem* item = *a; + QTreeWidgetItem *item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); //tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); - TissueInfos::SetTissueLocked(currTissueType, - cb_tissuelock->isChecked()); + TissueInfos::SetTissueLocked(currTissueType, cb_tissuelock->isChecked()); } } tissueTreeWidget->update_tissue_icons(); @@ -7582,67 +7381,66 @@ void MainWindow::do_clearundo() editmenu->setItemEnabled(undonr, false); } -void MainWindow::tab_changed(QWidget* qw) +void MainWindow::tab_changed(QWidget *qw) { - // int index=methodTab->currentPageIndex(); if (qw != tab_old) { - std::cerr << "Starting widget: " << qw->metaObject()->className() << std::endl; + std::cerr << "Starting widget: " << qw->metaObject()->className() + << std::endl; - /* if(qw==threshold_widget||qw==wshed_widget||qw==hyst_widget||qw==iftrg_widget|| - qw==FMF_widget||qw==OutlineCorrect_widget){ - bmp_show->set_workbordervisible(true); - cb_bmpoutlinevisible->setChecked(true); - } else { - bmp_show->set_workbordervisible(false); - cb_bmpoutlinevisible->setChecked(false); - }*/ + // disconnect signal-slots of previous widget + + if (tab_old) // generic slots from WidgetInterface + { + QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); + QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); + QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + } if (tab_old == threshold_widget) { QObject::disconnect(this, SIGNAL(bmp_changed()), threshold_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); } else if (tab_old == measurement_widget) { measurement_widget->cleanup(); // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); - QObject::disconnect(this, SIGNAL(marks_changed()), - measurement_widget, SLOT(marks_changed())); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); + QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, + SLOT(marks_changed())); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector*)), - bmp_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector*)), - work_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); - QObject::disconnect( - measurement_widget, SIGNAL(vpdyn_changed(std::vector*)), - work_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); + QObject::disconnect(measurement_widget, + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); QObject::disconnect( - measurement_widget, - SIGNAL(vp1dyn_changed(std::vector*, std::vector*, - bool)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, - bool))); + measurement_widget, + SIGNAL( + vp1dyn_changed(std::vector *, std::vector *, bool)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); QObject::disconnect( - measurement_widget, - SIGNAL(vp1dyn_changed(std::vector*, std::vector*, - bool)), - work_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, - bool))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); + measurement_widget, + SIGNAL( + vp1dyn_changed(std::vector *, std::vector *, bool)), + work_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); @@ -7650,75 +7448,59 @@ void MainWindow::tab_changed(QWidget* qw) else if (tab_old == vesselextr_widget) { vesselextr_widget->clean_up(); - QObject::disconnect(this, SIGNAL(marks_changed()), - measurement_widget, SLOT(marks_changed())); + QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, + SLOT(marks_changed())); QObject::disconnect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector*)), - bmp_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); } else if (tab_old == wshed_widget) { // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), wshed_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); } else if (tab_old == hyst_widget) { hyst_widget->clean_up(); QObject::disconnect(this, SIGNAL(bmp_changed()), hyst_widget, - SLOT(bmp_changed())); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - hyst_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - hyst_widget, SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - hyst_widget, SLOT(pt_released(Point))); + SLOT(bmp_changed())); QObject::disconnect(hyst_widget, - SIGNAL(vp1_changed(std::vector*)), - bmp_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(hyst_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect( - hyst_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*))); + hyst_widget, + SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *))); } else if (tab_old == lw_widget) { lw_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), lw_widget, - SLOT(bmp_changed())); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - lw_widget, SLOT(pt_clicked(Point))); + SLOT(bmp_changed())); QObject::disconnect(bmp_show, SIGNAL(mousedoubleclick_sign(Point)), - lw_widget, SLOT(pt_doubleclicked(Point))); + lw_widget, SLOT(pt_doubleclicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousepressedmid_sign(Point)), - lw_widget, SLOT(pt_midclicked(Point))); - QObject::disconnect(bmp_show, - SIGNAL(mousedoubleclickmid_sign(Point)), - lw_widget, SLOT(pt_doubleclickedmid(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - lw_widget, SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - lw_widget, SLOT(pt_released(Point))); - QObject::disconnect(lw_widget, - SIGNAL(vp1_changed(std::vector*)), - bmp_show, SLOT(set_vp1(std::vector*))); + lw_widget, SLOT(pt_midclicked(Point))); + QObject::disconnect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), + lw_widget, SLOT(pt_doubleclickedmid(Point))); + QObject::disconnect(lw_widget, SIGNAL(vp1_changed(std::vector *)), + bmp_show, SLOT(set_vp1(std::vector *))); QObject::disconnect(lw_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect( - lw_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*))); + lw_widget, + SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *))); bmp_show->setMouseTracking(false); } @@ -7727,98 +7509,47 @@ void MainWindow::tab_changed(QWidget* qw) iftrg_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), iftrg_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - iftrg_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - iftrg_widget, SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - iftrg_widget, SLOT(mouse_moved(Point))); - - QObject::disconnect(iftrg_widget, - SIGNAL(vm_changed(std::vector*)), - bmp_show, SLOT(set_vm(std::vector*))); + QObject::disconnect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), + bmp_show, SLOT(set_vm(std::vector *))); QObject::disconnect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); - - // QObject::disconnect(tissueTreeWidget,SIGNAL(activated(int)),iftrg_widget,SLOT(tissuenr_changed(int))); - // QObject::disconnect(tissueTreeWidget,SIGNAL(activated(int)),this,SLOT(tissuenr_changed(int))); + SIGNAL(vmdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (tab_old == FMF_widget) { FMF_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), FMF_widget, - SLOT(bmp_changed())); - - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - FMF_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - FMF_widget, SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - FMF_widget, SLOT(mouse_moved(Point))); + SLOT(bmp_changed())); QObject::disconnect(FMF_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (tab_old == OutlineCorrect_widget) { OutlineCorrect_widget->cleanup(); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_moved(Point))); - - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_released(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_moved(Point))); - - QObject::disconnect(this, SIGNAL(work_changed()), - OutlineCorrect_widget, - SLOT(workbits_changed())); + + QObject::disconnect(this, SIGNAL(work_changed()), OutlineCorrect_widget, + SLOT(workbits_changed())); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector*)), - work_show, - SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); } else if (tab_old == feature_widget) { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(kpt_moved(Point))); - QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); QObject::disconnect(feature_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); - QObject::disconnect( - feature_widget, SIGNAL(vpdyn_changed(std::vector*)), - work_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); + QObject::disconnect(feature_widget, + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); @@ -7831,241 +7562,177 @@ void MainWindow::tab_changed(QWidget* qw) else if (tab_old == pickerwidget) { pickerwidget->cleanup(); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector*)), - bmp_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector*)), - work_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); } else if (tab_old == transfrmWidget) { transfrmWidget->cleanup(); - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); + QObject::disconnect(this, SIGNAL(bmp_changed()), transfrmWidget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(this, SIGNAL(work_changed()), transfrmWidget, - SLOT(work_changed())); + SLOT(work_changed())); QObject::disconnect(this, SIGNAL(tissues_changed()), transfrmWidget, - SLOT(tissues_changed())); + SLOT(tissues_changed())); + } + + // connect signal-slots new widget + + if (qw) // generic slots from WidgetInterface + { + QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), qw, + SLOT(mouse_clicked(Point))); + QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), qw, + SLOT(mouse_moved(Point))); + QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), qw, + SLOT(mouse_released(Point))); + QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), qw, + SLOT(mouse_clicked(Point))); + QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), qw, + SLOT(mouse_moved(Point))); + QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), qw, + SLOT(mouse_released(Point))); } if (qw == threshold_widget) { QObject::connect(this, SIGNAL(bmp_changed()), threshold_widget, - SLOT(bmp_changed())); - // threshold_widget->init(); + SLOT(bmp_changed())); } else if (qw == measurement_widget) { QObject::connect(this, SIGNAL(marks_changed()), measurement_widget, - SLOT(marks_changed())); - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector*)), bmp_show, - SLOT(set_vp1(std::vector*))); + SLOT(marks_changed())); QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector*)), - work_show, SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector*)), - work_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vp1dyn_changed(std::vector*, - std::vector*, bool)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, - std::vector*, bool))); - QObject::connect(measurement_widget, - SIGNAL(vp1dyn_changed(std::vector*, - std::vector*, bool)), - work_show, - SLOT(set_vp1_dyn(std::vector*, - std::vector*, bool))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); + QObject::connect( + measurement_widget, + SIGNAL( + vp1dyn_changed(std::vector *, std::vector *, bool)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + QObject::connect( + measurement_widget, + SIGNAL( + vp1dyn_changed(std::vector *, std::vector *, bool)), + work_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); } else if (qw == vesselextr_widget) { QObject::connect(this, SIGNAL(marks_changed()), vesselextr_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); QObject::connect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector*)), bmp_show, - SLOT(set_vp1(std::vector*))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); } else if (qw == wshed_widget) { // QObject::disconnect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::connect(this, SIGNAL(marks_changed()), wshed_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); // wshed_widget->init(); } else if (qw == hyst_widget) { QObject::connect(this, SIGNAL(bmp_changed()), hyst_widget, - SLOT(bmp_changed())); - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - hyst_widget, SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - hyst_widget, SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - hyst_widget, SLOT(pt_released(Point))); - - QObject::connect(hyst_widget, - SIGNAL(vp1_changed(std::vector*)), bmp_show, - SLOT(set_vp1(std::vector*))); - QObject::connect(hyst_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SLOT(bmp_changed())); + + QObject::connect(hyst_widget, SIGNAL(vp1_changed(std::vector *)), + bmp_show, SLOT(set_vp1(std::vector *))); + QObject::connect(hyst_widget, SIGNAL(vpdyn_changed(std::vector *)), + bmp_show, SLOT(set_vpdyn(std::vector *))); QObject::connect( - hyst_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*))); + hyst_widget, + SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *))); // hyst_widget->init(); } else if (qw == lw_widget) { QObject::connect(this, SIGNAL(bmp_changed()), lw_widget, - SLOT(bmp_changed())); - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - lw_widget, SLOT(pt_clicked(Point))); + SLOT(bmp_changed())); QObject::connect(bmp_show, SIGNAL(mousedoubleclick_sign(Point)), - lw_widget, SLOT(pt_doubleclicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousepressedmid_sign(Point)), - lw_widget, SLOT(pt_midclicked(Point))); + lw_widget, SLOT(pt_doubleclicked(Point))); + QObject::connect(bmp_show, SIGNAL(mousepressedmid_sign(Point)), lw_widget, + SLOT(pt_midclicked(Point))); QObject::connect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), - lw_widget, SLOT(pt_doubleclickedmid(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - lw_widget, SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - lw_widget, SLOT(pt_released(Point))); - QObject::connect(lw_widget, - SIGNAL(vp1_changed(std::vector*)), bmp_show, - SLOT(set_vp1(std::vector*))); - QObject::connect(lw_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + lw_widget, SLOT(pt_doubleclickedmid(Point))); + QObject::connect(lw_widget, SIGNAL(vp1_changed(std::vector *)), + bmp_show, SLOT(set_vp1(std::vector *))); + QObject::connect(lw_widget, SIGNAL(vpdyn_changed(std::vector *)), + bmp_show, SLOT(set_vpdyn(std::vector *))); QObject::connect( - lw_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*))); + lw_widget, + SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + bmp_show, + SLOT(set_vp1_dyn(std::vector *, std::vector *))); // lw_widget->init(); bmp_show->setMouseTracking(true); } else if (qw == iftrg_widget) { - tissues_size_t currTissueType = - tissueTreeWidget->get_current_type(); - iftrg_widget->tissuenr_changed(currTissueType); - QObject::connect(this, SIGNAL(bmp_changed()), iftrg_widget, - SLOT(bmp_changed())); - - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - iftrg_widget, SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - iftrg_widget, SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - iftrg_widget, SLOT(mouse_moved(Point))); + SLOT(bmp_changed())); + QObject::connect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), + bmp_show, SLOT(set_vm(std::vector *))); QObject::connect(iftrg_widget, - SIGNAL(vm_changed(std::vector*)), bmp_show, - SLOT(set_vm(std::vector*))); - QObject::connect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vmdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (qw == FMF_widget) { QObject::connect(this, SIGNAL(bmp_changed()), FMF_widget, - SLOT(bmp_changed())); - - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - FMF_widget, SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - FMF_widget, SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - FMF_widget, SLOT(mouse_moved(Point))); - - QObject::connect(FMF_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SLOT(bmp_changed())); + + QObject::connect(FMF_widget, SIGNAL(vpdyn_changed(std::vector *)), + bmp_show, SLOT(set_vpdyn(std::vector *))); } else if (qw == OutlineCorrect_widget) { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, - SLOT(mouse_released(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - - QObject::connect(this, SIGNAL(work_changed()), - OutlineCorrect_widget, SLOT(workbits_changed())); + QObject::connect(this, SIGNAL(work_changed()), OutlineCorrect_widget, + SLOT(workbits_changed())); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector*)), - work_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); OutlineCorrect_widget->workbits_changed(); - // OutlineCorrect_widget->init(); } else if (qw == feature_widget) { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector*)), - bmp_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector*)), - work_show, SLOT(set_vpdyn(std::vector*))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); @@ -8078,43 +7745,36 @@ void MainWindow::tab_changed(QWidget* qw) } else if (qw == pickerwidget) { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - - QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector*)), - bmp_show, SLOT(set_vp1(vector*))); - QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector*)), - work_show, SLOT(set_vp1(vector*))); + QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), + bmp_show, SLOT(set_vp1(vector *))); + QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), + work_show, SLOT(set_vp1(vector *))); } else if (qw == transfrmWidget) { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); QObject::connect(this, SIGNAL(bmp_changed()), transfrmWidget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(this, SIGNAL(work_changed()), transfrmWidget, - SLOT(work_changed())); + SLOT(work_changed())); QObject::connect(this, SIGNAL(tissues_changed()), transfrmWidget, - SLOT(tissues_changed())); + SLOT(tissues_changed())); } - tab_old = (WidgetInterface*)qw; + tab_old = (WidgetInterface *)qw; tab_old->init(); + tab_old->on_tissuenr_changed(tissueTreeWidget->get_current_type() - 1); // \todo BL: is this correct for all widgets? + bmp_show->setCursor(*(tab_old->m_cursor)); work_show->setCursor(*(tab_old->m_cursor)); updateMethodButtonsPressed(tab_old); } else - tab_old = (WidgetInterface*)qw; + { + tab_old = (WidgetInterface *)qw; + } tab_old->setFocus(); - - return; } void MainWindow::updateTabvisibility() @@ -8152,11 +7812,11 @@ void MainWindow::updateTabvisibility() counter1++; } - WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); + WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); updateMethodButtonsPressed(qw); } -void MainWindow::updateMethodButtonsPressed(WidgetInterface* qw) +void MainWindow::updateMethodButtonsPressed(WidgetInterface *qw) { // QWidget *qw=methodTab->visibleWidget(); unsigned short counter = 0; @@ -8181,7 +7841,7 @@ void MainWindow::updateMethodButtonsPressed(WidgetInterface* qw) } for (unsigned short i = (nrtabbuttons + 1) / 2; counter1 < counter; - i++, counter1++) + i++, counter1++) { if (counter1 == pos) pb_tab[i]->setOn(true); @@ -8204,7 +7864,7 @@ void MainWindow::LoadAtlas(QDir path1) m_atlasfilename.m_atlasfilename[i] = names1[i]; QFileInfo names1fi(names1[i]); atlasmenu->changeItem(m_atlasfilename.atlasnr[i], - names1fi.completeBaseName()); + names1fi.completeBaseName()); atlasmenu->setItemVisible(m_atlasfilename.atlasnr[i], true); } for (size_t i = m_atlasfilename.nratlases; i < m_atlasfilename.maxnr; i++) @@ -8219,7 +7879,7 @@ void MainWindow::LoadAtlas(QDir path1) void MainWindow::LoadLoadProj(QString path1) { unsigned short projcounter = 0; - FILE* fplatestproj = fopen(path1.ascii(), "r"); + FILE *fplatestproj = fopen(path1.ascii(), "r"); char c; m_loadprojfilename.m_filename = path1; while (fplatestproj != NULL && projcounter < 4) @@ -8240,16 +7900,16 @@ void MainWindow::LoadLoadProj(QString path1) void MainWindow::AddLoadProj(QString path1) { if (m_loadprojfilename.m_loadprojfilename1 != path1 && - m_loadprojfilename.m_loadprojfilename2 != path1 && - m_loadprojfilename.m_loadprojfilename3 != path1 && - m_loadprojfilename.m_loadprojfilename4 != path1) + m_loadprojfilename.m_loadprojfilename2 != path1 && + m_loadprojfilename.m_loadprojfilename3 != path1 && + m_loadprojfilename.m_loadprojfilename4 != path1) { m_loadprojfilename.m_loadprojfilename4 = - m_loadprojfilename.m_loadprojfilename3; + m_loadprojfilename.m_loadprojfilename3; m_loadprojfilename.m_loadprojfilename3 = - m_loadprojfilename.m_loadprojfilename2; + m_loadprojfilename.m_loadprojfilename2; m_loadprojfilename.m_loadprojfilename2 = - m_loadprojfilename.m_loadprojfilename1; + m_loadprojfilename.m_loadprojfilename1; m_loadprojfilename.m_loadprojfilename1 = path1; } else @@ -8258,21 +7918,21 @@ void MainWindow::AddLoadProj(QString path1) { QString dummy = m_loadprojfilename.m_loadprojfilename2; m_loadprojfilename.m_loadprojfilename2 = - m_loadprojfilename.m_loadprojfilename1; + m_loadprojfilename.m_loadprojfilename1; m_loadprojfilename.m_loadprojfilename1 = dummy; } if (m_loadprojfilename.m_loadprojfilename3 == path1) { QString dummy = m_loadprojfilename.m_loadprojfilename3; m_loadprojfilename.m_loadprojfilename3 = - m_loadprojfilename.m_loadprojfilename1; + m_loadprojfilename.m_loadprojfilename1; m_loadprojfilename.m_loadprojfilename1 = dummy; } if (m_loadprojfilename.m_loadprojfilename4 == path1) { QString dummy = m_loadprojfilename.m_loadprojfilename4; m_loadprojfilename.m_loadprojfilename4 = - m_loadprojfilename.m_loadprojfilename1; + m_loadprojfilename.m_loadprojfilename1; m_loadprojfilename.m_loadprojfilename1 = dummy; } } @@ -8281,10 +7941,10 @@ void MainWindow::AddLoadProj(QString path1) { int pos = m_loadprojfilename.m_loadprojfilename1.findRev('/', -2); if (pos != -1 && - (int)m_loadprojfilename.m_loadprojfilename1.length() > pos + 1) + (int)m_loadprojfilename.m_loadprojfilename1.length() > pos + 1) { QString name1 = m_loadprojfilename.m_loadprojfilename1.right( - m_loadprojfilename.m_loadprojfilename1.length() - pos - 1); + m_loadprojfilename.m_loadprojfilename1.length() - pos - 1); file->changeItem(m_loadprojfilename.lpf1nr, name1); file->setItemVisible(m_loadprojfilename.lpf1nr, true); } @@ -8293,10 +7953,10 @@ void MainWindow::AddLoadProj(QString path1) { int pos = m_loadprojfilename.m_loadprojfilename2.findRev('/', -2); if (pos != -1 && - (int)m_loadprojfilename.m_loadprojfilename2.length() > pos + 1) + (int)m_loadprojfilename.m_loadprojfilename2.length() > pos + 1) { QString name1 = m_loadprojfilename.m_loadprojfilename2.right( - m_loadprojfilename.m_loadprojfilename2.length() - pos - 1); + m_loadprojfilename.m_loadprojfilename2.length() - pos - 1); file->changeItem(m_loadprojfilename.lpf2nr, name1); file->setItemVisible(m_loadprojfilename.lpf2nr, true); } @@ -8305,10 +7965,10 @@ void MainWindow::AddLoadProj(QString path1) { int pos = m_loadprojfilename.m_loadprojfilename3.findRev('/', -2); if (pos != -1 && - (int)m_loadprojfilename.m_loadprojfilename3.length() > pos + 1) + (int)m_loadprojfilename.m_loadprojfilename3.length() > pos + 1) { QString name1 = m_loadprojfilename.m_loadprojfilename3.right( - m_loadprojfilename.m_loadprojfilename3.length() - pos - 1); + m_loadprojfilename.m_loadprojfilename3.length() - pos - 1); file->changeItem(m_loadprojfilename.lpf3nr, name1); file->setItemVisible(m_loadprojfilename.lpf3nr, true); } @@ -8317,10 +7977,10 @@ void MainWindow::AddLoadProj(QString path1) { int pos = m_loadprojfilename.m_loadprojfilename4.findRev('/', -2); if (pos != -1 && - (int)m_loadprojfilename.m_loadprojfilename4.length() > pos + 1) + (int)m_loadprojfilename.m_loadprojfilename4.length() > pos + 1) { QString name1 = m_loadprojfilename.m_loadprojfilename4.right( - m_loadprojfilename.m_loadprojfilename4.length() - pos - 1); + m_loadprojfilename.m_loadprojfilename4.length() - pos - 1); file->changeItem(m_loadprojfilename.lpf4nr, name1); file->setItemVisible(m_loadprojfilename.lpf4nr, true); } @@ -8332,28 +7992,28 @@ void MainWindow::SaveLoadProj(QString latestprojpath) { if (latestprojpath == QString("")) return; - FILE* fplatestproj = fopen(latestprojpath.ascii(), "w"); + FILE *fplatestproj = fopen(latestprojpath.ascii(), "w"); if (fplatestproj != NULL) { if (m_loadprojfilename.m_loadprojfilename4 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename4.ascii()); + m_loadprojfilename.m_loadprojfilename4.ascii()); } if (m_loadprojfilename.m_loadprojfilename3 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename3.ascii()); + m_loadprojfilename.m_loadprojfilename3.ascii()); } if (m_loadprojfilename.m_loadprojfilename2 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename2.ascii()); + m_loadprojfilename.m_loadprojfilename2.ascii()); } if (m_loadprojfilename.m_loadprojfilename1 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename1.ascii()); + m_loadprojfilename.m_loadprojfilename1.ascii()); } fclose(fplatestproj); @@ -8478,24 +8138,22 @@ void MainWindow::execute_smoothtissues() void MainWindow::execute_cleanup() { - tissues_size_t** slices = - new tissues_size_t*[handler3D->return_endslice() - - handler3D->return_startslice()]; + tissues_size_t **slices = new tissues_size_t + *[handler3D->return_endslice() - handler3D->return_startslice()]; tissuelayers_size_t activelayer = handler3D->get_active_tissuelayer(); for (unsigned short i = handler3D->return_startslice(); - i < handler3D->return_endslice(); i++) + i < handler3D->return_endslice(); i++) { slices[i - handler3D->return_startslice()] = - handler3D->return_tissues(activelayer, i); + handler3D->return_tissues(activelayer, i); } TissueCleaner TC( - slices, handler3D->return_endslice() - handler3D->return_startslice(), - handler3D->return_width(), handler3D->return_height()); + slices, handler3D->return_endslice() - handler3D->return_startslice(), + handler3D->return_width(), handler3D->return_height()); if (!TC.Allocate()) { QMessageBox::information( - 0, "iSeg", - "Not enough memory.\nThis operation cannot be performed.\n"); + 0, "iSeg", "Not enough memory.\nThis operation cannot be performed.\n"); } else { @@ -8520,8 +8178,7 @@ void MainWindow::execute_cleanup() void MainWindow::wheelrotated(int delta) { - zoom_widget->zoom_changed(work_show->return_zoom() * - pow(1.2, delta / 120.0)); + zoom_widget->zoom_changed(work_show->return_zoom() * pow(1.2, delta / 120.0)); } void MainWindow::mousePosZoom_changed(QPoint point) @@ -8531,7 +8188,7 @@ void MainWindow::mousePosZoom_changed(QPoint point) //mousePosZoom = point; } -FILE* MainWindow::save_notes(FILE* fp, unsigned short version) +FILE *MainWindow::save_notes(FILE *fp, unsigned short version) { if (version >= 7) { @@ -8543,14 +8200,14 @@ FILE* MainWindow::save_notes(FILE* fp, unsigned short version) return fp; } -FILE* MainWindow::load_notes(FILE* fp, unsigned short version) +FILE *MainWindow::load_notes(FILE *fp, unsigned short version) { m_notes->clear(); if (version >= 7) { int dummy = 0; fread(&dummy, sizeof(int), 1, fp); - char* text = new char[dummy + 1]; + char *text = new char[dummy + 1]; text[dummy] = '\0'; fread(text, dummy, 1, fp); m_notes->setPlainText(QString(text)); @@ -8561,213 +8218,58 @@ FILE* MainWindow::load_notes(FILE* fp, unsigned short version) void MainWindow::disconnect_mouseclick() { - if (tab_old == measurement_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - } - else if (tab_old == hyst_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - hyst_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - hyst_widget, SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - hyst_widget, SLOT(pt_released(Point))); - } - else if (tab_old == lw_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - lw_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), lw_widget, - SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - lw_widget, SLOT(pt_released(Point))); - } - else if (tab_old == iftrg_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - iftrg_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - iftrg_widget, SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - iftrg_widget, SLOT(mouse_moved(Point))); - } - else if (tab_old == FMF_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - FMF_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - FMF_widget, SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - FMF_widget, SLOT(mouse_moved(Point))); - } - else if (tab_old == OutlineCorrect_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_released(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_released(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - } - else if (tab_old == feature_widget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(kpt_moved(Point))); - QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - } - else if (tab_old == pickerwidget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - } - else if (tab_old == transfrmWidget) - { - QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); - QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); + if (tab_old) + { + QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); + + QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); } } void MainWindow::connect_mouseclick() { - if (tab_old == measurement_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - measurement_widget, SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - measurement_widget, SLOT(pt_moved(Point))); - } - else if (tab_old == hyst_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - hyst_widget, SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), hyst_widget, - SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - hyst_widget, SLOT(pt_released(Point))); - } - else if (tab_old == lw_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), lw_widget, - SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), lw_widget, - SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), lw_widget, - SLOT(pt_released(Point))); - } - else if (tab_old == iftrg_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - iftrg_widget, SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - iftrg_widget, SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), iftrg_widget, - SLOT(mouse_moved(Point))); - } - else if (tab_old == FMF_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), FMF_widget, - SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - FMF_widget, SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), FMF_widget, - SLOT(mouse_moved(Point))); - } - else if (tab_old == OutlineCorrect_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_released(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_released(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - OutlineCorrect_widget, SLOT(mouse_moved(Point))); - } - else if (tab_old == feature_widget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - feature_widget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), - feature_widget, SLOT(pt_moved(Point))); - QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), - feature_widget, SLOT(pt_released(Point))); - } - else if (tab_old == pickerwidget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - pickerwidget, SLOT(pt_clicked(Point))); - } - else if (tab_old == transfrmWidget) - { - QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); - QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), - transfrmWidget, SLOT(pt_clicked(Point))); + if (tab_old) + { + QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); + QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, + SLOT(mouse_clicked(Point))); + QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, + SLOT(mouse_released(Point))); + QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, + SLOT(mouse_moved(Point))); } - - return; } void MainWindow::reconnectmouse_afterrelease(Point) { QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); connect_mouseclick(); } -void MainWindow::handle_begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender, bool beginUndo) +void MainWindow::handle_begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender, bool beginUndo) { undoStarted = beginUndo || undoStarted; changeData = dataSelection; // Handle pending transforms - if (methodTab->visibleWidget() == transfrmWidget && - sender != transfrmWidget) + if (methodTab->visibleWidget() == transfrmWidget && sender != transfrmWidget) { cancel_transform_helper(); } @@ -8778,8 +8280,8 @@ void MainWindow::handle_begin_datachange(iseg::DataSelection& dataSelection, if (changeData.allSlices) { // Start undo for all slices - canUndo3D = handler3D->return_undo3D() && - handler3D->start_undoall(changeData); + canUndo3D = + handler3D->return_undo3D() && handler3D->start_undoall(changeData); } else { @@ -8789,14 +8291,6 @@ void MainWindow::handle_begin_datachange(iseg::DataSelection& dataSelection, } } -//void MainWindow::handle_abort_datachange(QWidget *sender, bool abortUndo) -//{ -// if (abortUndo) { -// handler3D->abort_undo(); -// undoStarted = false; -// } -//} - void MainWindow::end_undo_helper(iseg::EndUndoAction undoAction) { if (undoStarted) @@ -8840,8 +8334,8 @@ void MainWindow::end_undo_helper(iseg::EndUndoAction undoAction) } } -void MainWindow::handle_end_datachange(QWidget* sender, - iseg::EndUndoAction undoAction) +void MainWindow::handle_end_datachange(QWidget *sender, + iseg::EndUndoAction undoAction) { // End undo end_undo_helper(undoAction); @@ -8859,13 +8353,13 @@ void MainWindow::handle_end_datachange(QWidget* sender, if (sender == methodTab->visibleWidget()) { QObject::disconnect(this, SIGNAL(bmp_changed()), sender, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); + SLOT(work_changed())); QObject::disconnect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); + SLOT(tissues_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); + SLOT(marks_changed())); } // Signal changed data @@ -8887,6 +8381,7 @@ void MainWindow::handle_end_datachange(QWidget* sender, } // Signal changed data + // \hack BL this looks like a hack, fixme if (changeData.bmp && changeData.work && changeData.allSlices) { // Do not reinitialize m_MultiDataset_widget after swapping @@ -8902,97 +8397,14 @@ void MainWindow::handle_end_datachange(QWidget* sender, if (sender == methodTab->visibleWidget()) { - QObject::connect(this, SIGNAL(bmp_changed()), sender, - SLOT(bmp_changed())); + QObject::connect(this, SIGNAL(bmp_changed()), sender, SLOT(bmp_changed())); QObject::connect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); + SLOT(work_changed())); QObject::connect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); + SLOT(tissues_changed())); QObject::connect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); + SLOT(marks_changed())); } - - //// Data loaded - //if (changeData.allSlices && changeData.bmp && changeData.work) - //{ - // emit main_dataset_loaded(); - //} -} - -void MainWindow::handle_end_datachange(QRect rect, QWidget* sender, - iseg::EndUndoAction undoAction) -{ - // End undo - end_undo_helper(undoAction); - - // Handle 3d data change - if (changeData.allSlices) - { - slices3d_changed(sender != bitstack_widget); - } - - // Update ranges - update_ranges_helper(); - -#if 0 // TODO: Introduce signals bmp_changed(QRect rect) etc - if (changeData.bmp) - { - update_bmp(rect); - } - if (changeData.work) - { - update_work(rect); - } - //if (changeData.tissues) { - // update_tissues(rect); - //} - //if (changeData.marks) { - // upate_marks(rect); - //} -#else - // Block changed data signals for visible widget - if (sender == methodTab->visibleWidget()) - { - QObject::disconnect(this, SIGNAL(bmp_changed()), sender, - SLOT(bmp_changed())); - QObject::disconnect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); - QObject::disconnect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); - QObject::disconnect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); - } - - // Signal changed data - if (changeData.bmp) - { - emit bmp_changed(); - } - if (changeData.work) - { - emit work_changed(); - } - if (changeData.tissues) - { - emit tissues_changed(); - } - if (changeData.marks) - { - emit marks_changed(); - } - - if (sender == methodTab->visibleWidget()) - { - QObject::connect(this, SIGNAL(bmp_changed()), sender, - SLOT(bmp_changed())); - QObject::connect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); - QObject::connect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); - QObject::connect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); - } -#endif } void MainWindow::DatasetChanged() @@ -9034,20 +8446,20 @@ void MainWindow::update_ranges_helper() void MainWindow::cancel_transform_helper() { QObject::disconnect( - transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + transfrmWidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::disconnect( - transfrmWidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + transfrmWidget, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + this, SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); transfrmWidget->CancelPushButtonClicked(); QObject::connect( - transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); - QObject::connect( - transfrmWidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); + transfrmWidget, + SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + QObject::connect(transfrmWidget, + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); // Signal changed data bool bmp, work, tissues; @@ -9066,12 +8478,12 @@ void MainWindow::cancel_transform_helper() } } -void MainWindow::handle_begin_dataexport(iseg::DataSelection& dataSelection, - QWidget* sender) +void MainWindow::handle_begin_dataexport(iseg::DataSelection &dataSelection, + QWidget *sender) { // Handle pending transforms if (methodTab->visibleWidget() == transfrmWidget && - (dataSelection.bmp || dataSelection.work || dataSelection.tissues)) + (dataSelection.bmp || dataSelection.work || dataSelection.tissues)) { cancel_transform_helper(); } @@ -9083,4 +8495,4 @@ void MainWindow::handle_begin_dataexport(iseg::DataSelection& dataSelection, } } -void MainWindow::handle_end_dataexport(QWidget* sender) {} +void MainWindow::handle_end_dataexport(QWidget *sender) {} diff --git a/iSeg/MainWindow.h b/iSeg/MainWindow.h index 485e8b9a..d025eaec 100755 --- a/iSeg/MainWindow.h +++ b/iSeg/MainWindow.h @@ -574,11 +574,11 @@ private slots: QWidget* sender = NULL, bool beginUndo = true); void handle_end_datachange(QWidget* sender = NULL, iseg::EndUndoAction undoAction = iseg::EndUndo); - void handle_end_datachange(QRect rect, QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void handle_begin_dataexport(iseg::DataSelection& dataSelection, QWidget* sender = NULL); void handle_end_dataexport(QWidget* sender = NULL); + void DatasetChanged(); void provide_selected_tissue_BG(); diff --git a/iSeg/MorphologyWidget.h b/iSeg/MorphologyWidget.h index ced57e54..dcbebaab 100755 --- a/iSeg/MorphologyWidget.h +++ b/iSeg/MorphologyWidget.h @@ -72,12 +72,6 @@ class MorphologyWidget : public WidgetInterface QButtonGroup* modegroup; QCheckBox* allslices; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: void slicenr_changed(); diff --git a/iSeg/OutlineCorrectionWidget.cpp b/iSeg/OutlineCorrectionWidget.cpp index 2381504d..71f1906f 100755 --- a/iSeg/OutlineCorrectionWidget.cpp +++ b/iSeg/OutlineCorrectionWidget.cpp @@ -378,7 +378,7 @@ void OutlineCorrectionWidget::draw_circle(Point p) vpdyn.clear(); } -void OutlineCorrectionWidget::mouse_clicked(Point p) +void OutlineCorrectionWidget::on_mouse_clicked(Point p) { if (selectobj) { @@ -473,7 +473,7 @@ void OutlineCorrectionWidget::mouse_clicked(Point p) } } -void OutlineCorrectionWidget::mouse_moved(Point p) +void OutlineCorrectionWidget::on_mouse_moved(Point p) { if (!selectobj) { @@ -543,13 +543,13 @@ void OutlineCorrectionWidget::mouse_moved(Point p) rect.setTop(max(0, dummy1 - sb_radius->value())); rect.setBottom(min((int)bmphand->return_height() - 1, dummy2 + sb_radius->value())); - emit end_datachange(rect, this, iseg::NoUndo); + emit end_datachange(this, iseg::NoUndo); last_pt = p; } } } -void OutlineCorrectionWidget::mouse_released(Point p) +void OutlineCorrectionWidget::on_mouse_released(Point p) { if (selectobj) { @@ -1131,7 +1131,7 @@ void OutlineCorrectionWidget::workbits_changed() } } -void OutlineCorrectionWidget::slicenr_changed() +void OutlineCorrectionWidget::on_slicenr_changed() { if (activeslice != handler3D->get_activeslice()) { @@ -1153,7 +1153,7 @@ void OutlineCorrectionWidget::bmphand_changed(bmphandler* bmph) void OutlineCorrectionWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } @@ -1164,7 +1164,7 @@ void OutlineCorrectionWidget::newloaded() bmphand = handler3D->get_activebmphandler(); } -void OutlineCorrectionWidget::tissuenr_changed(int tissuenr1) +void OutlineCorrectionWidget::on_tissuenr_changed(int tissuenr1) { tissuenr = (tissues_size_t)(tissuenr1 + 1); } diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index ade864d4..63b8b680 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -46,15 +46,20 @@ class OutlineCorrectionWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("OLC"); }; - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("olc.png")).ascii()); - }; + std::string GetName() { return std::string("OLC"); } + virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("olc.png")).ascii()); } void Select_selected_tissue_BG(QString tissueName, tissues_size_t nr); void Select_selected_tissue_TS(QString tissueName, tissues_size_t nr); +protected: + virtual void on_tissuenr_changed(int i) override; + virtual void on_slicenr_changed() override; + + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_released(Point p) override; + virtual void on_mouse_moved(Point p) override; + private: tissues_size_t tissuenr; tissues_size_t tissuenrnew; @@ -135,12 +140,6 @@ class OutlineCorrectionWidget : public WidgetInterface signals: void vpdyn_changed(std::vector* vpdyn_arg); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - void end_datachange(QRect rect, QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); void signal_request_selected_tissue_TS(); void signal_request_selected_tissue_BG(); @@ -148,19 +147,13 @@ class OutlineCorrectionWidget : public WidgetInterface public slots: void pixmm_changed(); void workbits_changed(); - void slicenr_changed(); - void tissuenr_changed(int tissuenr1); void request_selected_tissue_BG(); void request_selected_tissue_TS(); private slots: void bmphand_changed(bmphandler* bmph); - void mouse_clicked(Point p); - void mouse_released(Point p); - void mouse_moved(Point p); void method_changed(); - // void target_changed(); void removeholes_pushed(); void selectobj_pushed(); }; diff --git a/iSeg/RadiotherapyStructureSetImporter.h b/iSeg/RadiotherapyStructureSetImporter.h index 70f2dcc0..8af93bee 100755 --- a/iSeg/RadiotherapyStructureSetImporter.h +++ b/iSeg/RadiotherapyStructureSetImporter.h @@ -68,7 +68,6 @@ class RadiotherapyStructureSetImporter : public QDialog int currentitem; signals: - // void rtstruct_loaded(); void begin_datachange(iseg::DataSelection& dataSelection, QWidget* sender = NULL, bool beginUndo = true); void end_datachange(QWidget* sender = NULL, diff --git a/iSeg/SmoothingWidget.h b/iSeg/SmoothingWidget.h index c77ab23e..1027fdf6 100755 --- a/iSeg/SmoothingWidget.h +++ b/iSeg/SmoothingWidget.h @@ -46,11 +46,11 @@ class SmoothingWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("Smooth"); }; + std::string GetName() { return std::string("Smooth"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("smoothing.png")).ascii()); - }; + } private: bmphandler* bmphand; @@ -92,12 +92,6 @@ class SmoothingWidget : public WidgetInterface QCheckBox* allslices; bool dontundo; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: void slicenr_changed(); diff --git a/iSeg/ThresholdWidget.cpp b/iSeg/ThresholdWidget.cpp index 113dabea..6f3121b7 100755 --- a/iSeg/ThresholdWidget.cpp +++ b/iSeg/ThresholdWidget.cpp @@ -604,7 +604,7 @@ void ThresholdWidget::getrange() return; } -void ThresholdWidget::tissuenr_changed(int newval) +void ThresholdWidget::on_tissuenr_changed(int newval) { if (rb_manual->isOn()) { @@ -763,7 +763,7 @@ void ThresholdWidget::bmp_changed() QSize ThresholdWidget::sizeHint() const { return vbox1->sizeHint(); } -void ThresholdWidget::slicenr_changed() +void ThresholdWidget::on_slicenr_changed() { // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); @@ -1026,7 +1026,7 @@ FILE* ThresholdWidget::LoadParams(FILE* fp, int version) nrtissues_changed(sb_nrtissues->value()); dim_changed(sb_dim->value()); sb_tissuenr->setValue(dummy); - tissuenr_changed(dummy); + on_tissuenr_changed(dummy); QObject::connect(subsect, SIGNAL(clicked()), this, SLOT(subsect_toggled())); diff --git a/iSeg/ThresholdWidget.h b/iSeg/ThresholdWidget.h index cafc0c4c..ca48e086 100755 --- a/iSeg/ThresholdWidget.h +++ b/iSeg/ThresholdWidget.h @@ -49,13 +49,16 @@ class ThresholdWidget : public WidgetInterface void init(); void newloaded(); void hideparams_changed(); - std::string GetName() { return std::string("Threshold"); }; - virtual QIcon GetIcon(QDir picdir) + std::string GetName() override { return std::string("Threshold"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("thresholding.png")).ascii()); - }; + } private: + virtual void on_tissuenr_changed(int i) override; + virtual void on_slicenr_changed() override; + bmphandler* bmphand; SlicesHandler* handler3D; unsigned short activeslice; @@ -136,15 +139,6 @@ class ThresholdWidget : public WidgetInterface QPushButton* pushcenterFilename; QString centerFilename; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - -public slots: - void slicenr_changed(); - private slots: void bmphand_changed(bmphandler* bmph); void subsect_toggled(); @@ -153,7 +147,6 @@ private slots: void getrange(); void dim_changed(int newval); void nrtissues_changed(int newval); - void tissuenr_changed(int newval); void slider_changed(int newval); void slider_pressed(); void slider_released(); diff --git a/iSeg/featurewidget.cpp b/iSeg/featurewidget.cpp index 57408008..4366e947 100755 --- a/iSeg/featurewidget.cpp +++ b/iSeg/featurewidget.cpp @@ -99,13 +99,13 @@ FeatureWidget::FeatureWidget(SlicesHandler* hand3D, QWidget* parent, QSize FeatureWidget::sizeHint() const { return hbox1->sizeHint(); } -void FeatureWidget::pt_clicked(Point p) +void FeatureWidget::on_mouse_clicked(Point p) { selecting = true; pstart = p; } -void FeatureWidget::pt_moved(Point p) +void FeatureWidget::on_mouse_moved(Point p) { if (selecting) { @@ -143,7 +143,7 @@ void FeatureWidget::pt_moved(Point p) return; } -void FeatureWidget::pt_released(Point p) +void FeatureWidget::on_mouse_released(Point p) { dynamic.clear(); emit vpdyn_changed(&dynamic); diff --git a/iSeg/featurewidget.h b/iSeg/featurewidget.h index 86f11061..75a08297 100755 --- a/iSeg/featurewidget.h +++ b/iSeg/featurewidget.h @@ -54,6 +54,10 @@ class FeatureWidget : public WidgetInterface } private: + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_moved(Point p) override; + virtual void on_mouse_released(Point p) override; + bool selecting; std::vector dynamic; bmphandler* bmphand; @@ -94,11 +98,6 @@ class FeatureWidget : public WidgetInterface public slots: void slicenr_changed(); - -private slots: - void pt_clicked(Point p); - void pt_moved(Point p); - void pt_released(Point p); }; } // namespace iseg diff --git a/iSeg/livewirewidget.cpp b/iSeg/livewirewidget.cpp index 3df1f41d..e16dc507 100755 --- a/iSeg/livewirewidget.cpp +++ b/iSeg/livewirewidget.cpp @@ -135,7 +135,7 @@ livewire_widget::~livewire_widget() QSize livewire_widget::sizeHint() const { return hboxoverall->sizeHint(); } -void livewire_widget::pt_clicked(Point p) +void livewire_widget::on_mouse_clicked(Point p) { if (!drawing) { @@ -331,7 +331,7 @@ void livewire_widget::pt_doubleclickedmid(Point p) } } -void livewire_widget::pt_released(Point p) +void livewire_widget::on_mouse_released(Point p) { if (freedraw->isOn() && drawing) { @@ -360,7 +360,7 @@ void livewire_widget::pt_released(Point p) } } -void livewire_widget::pt_moved(Point p) +void livewire_widget::on_mouse_moved(Point p) { if (drawing) { diff --git a/iSeg/livewirewidget.h b/iSeg/livewirewidget.h index b32cbc69..d711009d 100755 --- a/iSeg/livewirewidget.h +++ b/iSeg/livewirewidget.h @@ -57,13 +57,17 @@ class livewire_widget : public WidgetInterface QSize sizeHint() const; ImageForestingTransformLivewire* lw; ImageForestingTransformLivewire* lwfirst; - std::string GetName() { return std::string("Contour"); }; + std::string GetName() { return std::string("Contour"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("contour.png")).ascii()); - }; + } private: + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_moved(Point p) override; + virtual void on_mouse_released(Point p) override; + void init1(); // bool isactive; bool drawing; @@ -102,10 +106,6 @@ class livewire_widget : public WidgetInterface void vp1_changed(std::vector* vp1); void vpdyn_changed(std::vector* vpdyn); void vp1dyn_changed(std::vector* vp1, std::vector* vpdyn); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void slicenr_changed(); @@ -113,12 +113,9 @@ public slots: private slots: void bmphand_changed(bmphandler* bmph); // void bmphand_changed(bmphandler *bmph); - void pt_clicked(Point p); void pt_doubleclicked(Point p); void pt_midclicked(Point p); void pt_doubleclickedmid(Point p); - void pt_moved(Point p); - void pt_released(Point p); void bmp_changed(); void mode_changed(); void freezing_changed(); diff --git a/iSeg/measurementwidget.cpp b/iSeg/measurementwidget.cpp index f6f2f04a..bef9f609 100755 --- a/iSeg/measurementwidget.cpp +++ b/iSeg/measurementwidget.cpp @@ -212,7 +212,7 @@ FILE* MeasurementWidget::LoadParams(FILE* fp, int version) return fp; } -void MeasurementWidget::pt_clicked(Point p) +void MeasurementWidget::on_mouse_clicked(Point p) { if (rb_pts->isOn()) { @@ -442,6 +442,16 @@ void MeasurementWidget::pt_clicked(Point p) } } +void MeasurementWidget::on_mouse_moved(Point p) +{ + if (drawing) + { + dynamic.clear(); + addLine(&dynamic, p1, p); + emit vpdyn_changed(&dynamic); + } +} + void MeasurementWidget::set_coord(unsigned short posit, Point p, unsigned short slicenr) { @@ -881,16 +891,6 @@ float MeasurementWidget::calculatevec(unsigned short orient) return value; } -void MeasurementWidget::pt_moved(Point p) -{ - if (drawing) - { - dynamic.clear(); - addLine(&dynamic, p1, p); - emit vpdyn_changed(&dynamic); - } -} - void MeasurementWidget::cleanup() { dynamic.clear(); diff --git a/iSeg/measurementwidget.h b/iSeg/measurementwidget.h index 2bc2f9ae..f8346266 100755 --- a/iSeg/measurementwidget.h +++ b/iSeg/measurementwidget.h @@ -44,13 +44,16 @@ class MeasurementWidget : public WidgetInterface void getlabels(); float calculate(); float calculatevec(unsigned short orient); - std::string GetName() { return std::string("Measurement"); }; + std::string GetName() { return std::string("Measurement"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("measurement.png")).ascii()); - }; + } private: + virtual void on_mouse_clicked(Point p) override; + virtual void on_mouse_moved(Point p) override; + bmphandler* bmphand; SlicesHandler* handler3D; std::vector labels; @@ -97,8 +100,6 @@ class MeasurementWidget : public WidgetInterface private slots: void marks_changed(); void bmphand_changed(bmphandler* bmph); - void pt_clicked(Point); - void pt_moved(Point); void cbb_changed(int); void method_changed(int); void inputtype_changed(int); diff --git a/iSeg/pickerwidget.cpp b/iSeg/pickerwidget.cpp index 70c83aec..37a7b60e 100755 --- a/iSeg/pickerwidget.cpp +++ b/iSeg/pickerwidget.cpp @@ -192,7 +192,7 @@ FILE* PickerWidget::LoadParams(FILE* fp, int version) return fp; } -void PickerWidget::pt_clicked(Point p) +void PickerWidget::on_mouse_clicked(Point p) { if (!shiftpressed) { diff --git a/iSeg/pickerwidget.h b/iSeg/pickerwidget.h index acac0c62..79d6633d 100755 --- a/iSeg/pickerwidget.h +++ b/iSeg/pickerwidget.h @@ -48,12 +48,11 @@ class PickerWidget : public WidgetInterface virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("picker.png")).ascii()); - }; - -public slots: - void slicenr_changed(); + } private: + virtual void on_mouse_clicked(Point p) override; + bmphandler* bmphand; SlicesHandler* handler3D; unsigned int width; @@ -85,10 +84,9 @@ public slots: signals: void vp1_changed(std::vector* vp1); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + +public slots: + void slicenr_changed(); private slots: void copy_pressed(); @@ -98,7 +96,6 @@ private slots: void worktissue_changed(int); void bmphand_changed(bmphandler* bmph); - void pt_clicked(Point); protected: void keyPressEvent(QKeyEvent* event); diff --git a/iSeg/transformwidget.cpp b/iSeg/transformwidget.cpp index 02e76cb7..9a059d2f 100755 --- a/iSeg/transformwidget.cpp +++ b/iSeg/transformwidget.cpp @@ -576,7 +576,7 @@ void TransformWidget::GetDataSelection(bool& source, bool& target, tissues = transformTissuesCheckBox->isChecked(); } -void TransformWidget::pt_clicked(Point p) +void TransformWidget::on_mouse_clicked(Point p) { if (centerSelectPushButton->isChecked()) { diff --git a/iSeg/transformwidget.h b/iSeg/transformwidget.h index 38c4fff8..af3aab8b 100755 --- a/iSeg/transformwidget.h +++ b/iSeg/transformwidget.h @@ -48,11 +48,11 @@ class TransformWidget : public WidgetInterface void GetDataSelection(bool& source, bool& target, bool& tissues); QSize sizeHint() const; - std::string GetName() { return std::string("Transform"); }; + std::string GetName() { return std::string("Transform"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("transform.png")).ascii()); - }; + } private: struct TransformParametersStruct @@ -71,6 +71,8 @@ class TransformWidget : public WidgetInterface void BitsChanged(); private: + virtual void on_mouse_clicked(Point p) override; + // Image data SlicesHandler* handler3D; @@ -128,15 +130,8 @@ class TransformWidget : public WidgetInterface double updateParameter2; TransformParametersStruct transformParameters; -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: void slicenr_changed(); - void pt_clicked(Point p); void bmp_changed(); void work_changed(); void tissues_changed(); diff --git a/iSeg/watershedwidget.h b/iSeg/watershedwidget.h index 9a05f905..96783403 100755 --- a/iSeg/watershedwidget.h +++ b/iSeg/watershedwidget.h @@ -44,13 +44,15 @@ class WatershedWidget : public WidgetInterface FILE* SaveParams(FILE* fp, int version); FILE* LoadParams(FILE* fp, int version); void hideparams_changed(); - std::string GetName() { return std::string("Watershed"); }; + std::string GetName() { return std::string("Watershed"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("watershed.png")).ascii()); - }; + } private: + void recalc1(); + unsigned int* usp; int sbh_old; bmphandler* bmphand; @@ -65,14 +67,6 @@ class WatershedWidget : public WidgetInterface QSlider* sl_h; QPushButton* btn_exec; - void recalc1(); - -signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - public slots: void slicenr_changed(); void marks_changed(); From 2296b0f6fec4c630ab29088c61fddf36d79b79be Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 08:13:46 +0200 Subject: [PATCH 3/9] use override keyword in widgetinterface derived classes --- Core/VTIreader.cpp | 1 - Plugin/WidgetInterface.h | 22 ++-- Plugins/BiasCorrection/BiasCorrection.cpp | 1 + Plugins/ConfidenceConnected/Confidence.h | 16 +-- iSeg/EdgeWidget.h | 17 ++- iSeg/FastmarchingFuzzyWidget.h | 20 ++-- iSeg/HystereticGrowingWidget.h | 22 ++-- ...eForestingTransformRegionGrowingWidget.cpp | 5 +- ...ageForestingTransformRegionGrowingWidget.h | 27 +++-- iSeg/InterpolationWidget.h | 18 ++-- iSeg/MainWindow.cpp | 100 +----------------- iSeg/MorphologyWidget.h | 16 +-- iSeg/OutlineCorrectionWidget.h | 27 ++--- iSeg/RadiotherapyStructureSetImporter.h | 5 +- iSeg/SlicesHandler.cpp | 10 +- iSeg/SmoothingWidget.h | 16 +-- iSeg/ThresholdWidget.h | 23 ++-- iSeg/VesselWidget.h | 12 +-- iSeg/bmpshower.h | 3 +- iSeg/featurewidget.h | 6 +- iSeg/livewirewidget.h | 26 ++--- iSeg/measurementwidget.h | 21 ++-- iSeg/pickerwidget.h | 21 ++-- iSeg/tissueinfos.h | 4 +- iSeg/transformwidget.h | 2 +- iSeg/watershedwidget.h | 16 +-- 26 files changed, 177 insertions(+), 280 deletions(-) diff --git a/Core/VTIreader.cpp b/Core/VTIreader.cpp index a03936b8..f940f481 100755 --- a/Core/VTIreader.cpp +++ b/Core/VTIreader.cpp @@ -616,7 +616,6 @@ bool VTIwriter::writeVolumeAll(const char* filename, float** slicesbmp, << endl; return false; } - //BL? input->Update(); int info = input->GetPointData()->SetActiveScalars("Source"); for (int k = 0; k < nrslices; k++) diff --git a/Plugin/WidgetInterface.h b/Plugin/WidgetInterface.h index 25eb949c..19f9b0e7 100755 --- a/Plugin/WidgetInterface.h +++ b/Plugin/WidgetInterface.h @@ -34,32 +34,22 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget } virtual void init() {} virtual void newloaded() {} - virtual FILE* SaveParams(FILE* fp, int version) - { - UNREFERENCED_PARAMETER(version); - return fp; - } - virtual FILE* LoadParams(FILE* fp, int version) - { - UNREFERENCED_PARAMETER(version); - return fp; - } + virtual FILE* SaveParams(FILE* fp, int version) { return fp; }; + virtual FILE* LoadParams(FILE* fp, int version) { return fp; }; virtual void hideparams_changed() {} static void set_hideparams(bool hide) { hideparams = hide; } static bool get_hideparams() { return hideparams; } virtual std::string GetName() { return std::string(""); } virtual QIcon GetIcon(QDir picdir) = 0; - virtual void on_tissuenr_changed(int i) {}//BL todo - virtual void on_slicenr_changed() {} //BL todo + virtual void on_tissuenr_changed(int i) {} + virtual void on_slicenr_changed() {} virtual void on_mouse_clicked(Point p) {} virtual void on_mouse_released(Point p) {} virtual void on_mouse_moved(Point p) {} -public: - QCursor* m_cursor; - + QCursor* get_cursor() { return m_cursor; } signals: void begin_datachange(iseg::DataSelection& dataSelection, @@ -77,6 +67,8 @@ private slots : void mouse_moved(Point p) { on_mouse_moved(p); } protected: + QCursor* m_cursor; + static bool hideparams; }; diff --git a/Plugins/BiasCorrection/BiasCorrection.cpp b/Plugins/BiasCorrection/BiasCorrection.cpp index b7fd7097..7e8f487a 100755 --- a/Plugins/BiasCorrection/BiasCorrection.cpp +++ b/Plugins/BiasCorrection/BiasCorrection.cpp @@ -179,6 +179,7 @@ void BiasCorrectionWidget::do_work() handler3D->ModifyWorkFloat(output); // BL: todo // BL: todo signal to 2D view to refresh display + // -> begin/end_data_change ... } } catch (itk::ExceptionObject&) diff --git a/Plugins/ConfidenceConnected/Confidence.h b/Plugins/ConfidenceConnected/Confidence.h index 6882bbe6..704f2dab 100755 --- a/Plugins/ConfidenceConnected/Confidence.h +++ b/Plugins/ConfidenceConnected/Confidence.h @@ -26,21 +26,21 @@ class ConfidenceWidget : public iseg::WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~ConfidenceWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - std::string GetName() { return std::string("ConfidenceFilter"); } + void init() override; + void newloaded() override; + std::string GetName() override { return std::string("ConfidenceFilter"); } virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("Confidence.png")).ascii()); } protected: - virtual void on_tissuenr_changed(int i) { std::cerr << "tissue " << i << std::endl; } - virtual void on_slicenr_changed() { std::cerr << "slice changed " << std::endl; } + virtual void on_tissuenr_changed(int i) override { std::cerr << "tissue " << i << std::endl; } + virtual void on_slicenr_changed() override { std::cerr << "slice changed " << std::endl; } - virtual void on_mouse_clicked(iseg::Point p) { std::cerr << "on_mouse_clicked" << std::endl; } - virtual void on_mouse_released(iseg::Point p) { std::cerr << "on_mouse_released" << std::endl; } - virtual void on_mouse_moved(iseg::Point p) { std::cerr << "on_mouse_moved" << std::endl; } + virtual void on_mouse_clicked(iseg::Point p) override { std::cerr << "on_mouse_clicked" << std::endl; } + virtual void on_mouse_released(iseg::Point p) override { std::cerr << "on_mouse_released" << std::endl; } + virtual void on_mouse_moved(iseg::Point p) override { std::cerr << "on_mouse_moved" << std::endl; } private: unsigned int* usp; diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index 1372788e..1b2f43cc 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -40,16 +40,13 @@ class EdgeWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~EdgeWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Edge"); } - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("edge.png")).ascii()); - } + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Edge"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("edge.png"))); } private: bmphandler* bmphand; diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index f0626f32..b72c3f43 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -41,23 +41,23 @@ class FastmarchingFuzzyWidget : public WidgetInterface FastmarchingFuzzyWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~FastmarchingFuzzyWidget(); - void init(); - void newloaded(); + void init() override; + void newloaded() override; void cleanup(); QSize sizeHint() const; - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Fuzzy"); } - virtual QIcon GetIcon(QDir picdir) + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Fuzzy"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("fuzzy.png")).ascii()); } protected: - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_released(Point p) override; - virtual void on_mouse_moved(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_released(Point p) override; + void on_mouse_moved(Point p) override; private: float* map; diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index fbad1a4b..64704e69 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -44,23 +44,23 @@ class HystereticGrowingWidget : public WidgetInterface HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~HystereticGrowingWidget(); - void init(); - void newloaded(); + void init() override; + void newloaded() override; void clean_up(); - QSize sizeHint() const; - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Growing"); } - virtual QIcon GetIcon(QDir picdir) + QSize sizeHint() const override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Growing"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("growing.png")).ascii()); } private: - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_moved(Point p) override; - virtual void on_mouse_released(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_moved(Point p) override; + void on_mouse_released(Point p) override; void init1(); Point p1; diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.cpp b/iSeg/ImageForestingTransformRegionGrowingWidget.cpp index 38fb895c..7667cc02 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.cpp +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.cpp @@ -115,11 +115,11 @@ void ImageForestingTransformRegionGrowingWidget::init() } } else + { init1(); + } hideparams_changed(); - - return; } void ImageForestingTransformRegionGrowingWidget::newloaded() @@ -136,7 +136,6 @@ void ImageForestingTransformRegionGrowingWidget::init1() it++) { vm.insert(vm.end(), it->begin(), it->end()); - ; } emit vm_changed(&vm); area = bmphand->return_height() * (unsigned)bmphand->return_width(); diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.h b/iSeg/ImageForestingTransformRegionGrowingWidget.h index 6f9ea840..8040376b 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.h +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.h @@ -36,26 +36,23 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface ImageForestingTransformRegionGrowingWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~ImageForestingTransformRegionGrowingWidget(); - void init(); - void newloaded(); + void init() override; + void newloaded() override; void cleanup(); QSize sizeHint() const; - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("IFT"); } - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("iftrg.png")).ascii()); - } + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("IFT"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("iftrg.png"))); } protected: - virtual void on_tissuenr_changed(int i) override; - virtual void on_slicenr_changed() override; + void on_tissuenr_changed(int i) override; + void on_slicenr_changed() override; - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_released(Point p) override; - virtual void on_mouse_moved(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_released(Point p) override; + void on_mouse_moved(Point p) override; private: void init1(); diff --git a/iSeg/InterpolationWidget.h b/iSeg/InterpolationWidget.h index c179e20b..206e67db 100755 --- a/iSeg/InterpolationWidget.h +++ b/iSeg/InterpolationWidget.h @@ -43,19 +43,19 @@ class InterpolationWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~InterpolationWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - std::string GetName() { return std::string("Interpol"); } - virtual QIcon GetIcon(QDir picdir) + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + std::string GetName() override { return std::string("Interpol"); } + virtual QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("interpolate.png")).ascii()); + return QIcon(picdir.absFilePath(QString("interpolate.png"))); } private: - virtual void on_tissuenr_changed(int i) override; - virtual void on_slicenr_changed() override; + void on_tissuenr_changed(int i) override; + void on_slicenr_changed() override; SlicesHandler* handler3D; Q3HBox* hboxoverall; diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 117e39f1..9acd8392 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -1901,7 +1901,6 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, m_NewDataAfterSwap = false; methodTab->raiseWidget(methodTab->visibleWidget()); - return; } MainWindow::~MainWindow() {} @@ -3246,92 +3245,6 @@ void MainWindow::execute_reloadnifti() return; } -//void MainWindow::execute_loadrtstruct() -//{ -// QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, "RTstruct (*.dcm)\n" "All(*.*)", this);//, filename); -// -// if(loadfilename.isEmpty()) return; -// -// gdcmvtk_rtstruct::tissuevec tissues; -// tissues.clear(); -// -// gdcmvtk_rtstruct::RequestData_RTStructureSetStorage(loadfilename.ascii() , tissues); -// -// bool *mask=new bool[handler3D->return_area()]; -// -// if(mask==0) return; -// -// bool undoactive=false; -// if(handler3D->return_undo3D()&&handler3D->start_undoall(4)){ -// undoactive=true; -// } else { -// do_clearundo(); -// } -// -// tissues_size_t tissuenr; -// std::string namedummy=std::string(""); -// for(gdcmvtk_rtstruct::tissuevec::iterator it=tissues.begin();it!=tissues.end();it++) { -// bool caninsert=true; -// if((*it)->name!=namedummy) { -// for(tissuenr=0;tissuenrname!=tissuenames[tissuenr].toStdString();tissuenr++) {} -// if(tissuenr==(tissues_size_t)tissuenames.size()) { -// QString name1=QString((*it)->name.c_str()); -// if(tissuenrcolor[0]; -// tissuecolor[tissuecount][1]=(*it)->color[1]; -// tissuecolor[tissuecount][2]=(*it)->color[2]; -// QPixmap abc(10,10); -// abc.fill(QColor((int)(255*(*it)->color[0]),(int)(255*(*it)->color[1]),(int)(255*(*it)->color[2]))); -// tissueTreeWidget->insertItem(abc,name1); -// } else caninsert=false; -// } -// tissuenr++; -// } -// if(caninsert) { -// Pair p; -// p=handler3D->get_pixelsize(); -// float thick=handler3D->get_slicethickness(); -// float disp[3]; -// handler3D->get_displacement(disp); -// size_t pospoints=0; -// size_t posoutlines=0; -// std::vector points; -// bool clockwisefill=false; -// while(posoutlines<(*it)->outlinelength.size()) { -// points.clear(); -// unsigned int *nrpoints=&((*it)->outlinelength[posoutlines]); -// float zcoord=(*it)->points[pospoints+2]; -// points.push_back(&((*it)->points[pospoints])); -// pospoints+=(*it)->outlinelength[posoutlines]*3; -// posoutlines++; -// while(posoutlines<(*it)->outlinelength.size()&&zcoord==(*it)->points[pospoints+2]) { -// points.push_back(&((*it)->points[pospoints])); -// pospoints+=(*it)->outlinelength[posoutlines]*3; -// posoutlines++; -// } -// int slicenr=handler3D->return_nrslices()-floor((zcoord-disp[2])/thick)-1; -// if(slicenr>=handler3D->return_startslice()&&slicenrreturn_endslice()) { -// fillcontours::fill_contour(mask, handler3D->return_width(), handler3D->return_height(), disp[0], disp[1], p.high, p.low, &(points[0]), nrpoints, points.size(), clockwisefill); -// handler3D->add2tissue(tissuenr,mask,(unsigned short)slicenr,true); -// } -// } -// } -// } -// -// if(undoactive){ -// do_undostepdone(); -// } -// -// tissuenr_changed(tissueTreeWidget->get_current_type()); -// emit tissues_changed(); -// -// delete[] mask; -//} - void MainWindow::execute_loadsurface() { maybeSafe(); @@ -6320,11 +6233,10 @@ void MainWindow::do_work2tissue_grouped() tissues_size_t m; handler3D->get_rangetissue(&m); handler3D->buildmissingtissues(m); - // handler3D->build255tissues(); tissueTreeWidget->update_tree_widget(); tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); - tissuenr_changed(currTissueType); + tissuenr_changed(currTissueType - 1); // TODO BL is this a bug? (I added the -1) emit end_datachange(this); } @@ -6857,8 +6769,7 @@ void MainWindow::clearselected() dataSelection.tissues = true; emit begin_datachange(dataSelection, this); - QList list; - list = tissueTreeWidget->selectedItems(); + auto list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { QTreeWidgetItem *item = *a; @@ -7385,8 +7296,7 @@ void MainWindow::tab_changed(QWidget *qw) { if (qw != tab_old) { - std::cerr << "Starting widget: " << qw->metaObject()->className() - << std::endl; + std::cerr << "Starting widget: " << qw->metaObject()->className() << std::endl; // disconnect signal-slots of previous widget @@ -7764,8 +7674,8 @@ void MainWindow::tab_changed(QWidget *qw) tab_old->init(); tab_old->on_tissuenr_changed(tissueTreeWidget->get_current_type() - 1); // \todo BL: is this correct for all widgets? - bmp_show->setCursor(*(tab_old->m_cursor)); - work_show->setCursor(*(tab_old->m_cursor)); + bmp_show->setCursor(*(tab_old->get_cursor())); + work_show->setCursor(*(tab_old->get_cursor())); updateMethodButtonsPressed(tab_old); } diff --git a/iSeg/MorphologyWidget.h b/iSeg/MorphologyWidget.h index dcbebaab..493d6b3b 100755 --- a/iSeg/MorphologyWidget.h +++ b/iSeg/MorphologyWidget.h @@ -39,15 +39,15 @@ class MorphologyWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~MorphologyWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Morpho"); }; - virtual QIcon GetIcon(QDir picdir) + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Morpho"); }; + virtual QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("morphology.png")).ascii()); + return QIcon(picdir.absFilePath(QString("morphology.png"))); }; private: diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index 63b8b680..74c2bb30 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -40,25 +40,26 @@ class OutlineCorrectionWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~OutlineCorrectionWidget(); QSize sizeHint() const; - void init(); - void newloaded(); void cleanup(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("OLC"); } - virtual QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("olc.png")).ascii()); } + + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("OLC"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("olc.png"))); } void Select_selected_tissue_BG(QString tissueName, tissues_size_t nr); void Select_selected_tissue_TS(QString tissueName, tissues_size_t nr); protected: - virtual void on_tissuenr_changed(int i) override; - virtual void on_slicenr_changed() override; + void on_tissuenr_changed(int i) override; + void on_slicenr_changed() override; - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_released(Point p) override; - virtual void on_mouse_moved(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_released(Point p) override; + void on_mouse_moved(Point p) override; private: tissues_size_t tissuenr; @@ -141,7 +142,7 @@ class OutlineCorrectionWidget : public WidgetInterface signals: void vpdyn_changed(std::vector* vpdyn_arg); - void signal_request_selected_tissue_TS(); + void signal_request_selected_tissue_TS(); // TODO BL hack void signal_request_selected_tissue_BG(); public slots: diff --git a/iSeg/RadiotherapyStructureSetImporter.h b/iSeg/RadiotherapyStructureSetImporter.h index 8af93bee..39692971 100755 --- a/iSeg/RadiotherapyStructureSetImporter.h +++ b/iSeg/RadiotherapyStructureSetImporter.h @@ -40,6 +40,9 @@ class RadiotherapyStructureSetImporter : public QDialog ~RadiotherapyStructureSetImporter(); private: + void storeparams(); + void updatevisibility(); + SlicesHandler* handler3D; Q3HBox* hbox1; Q3HBox* hbox2; @@ -63,8 +66,6 @@ class RadiotherapyStructureSetImporter : public QDialog std::vector vectissuenrs; std::vector vecpriorities; std::vector vectissuenames; - void storeparams(); - void updatevisibility(); int currentitem; signals: diff --git a/iSeg/SlicesHandler.cpp b/iSeg/SlicesHandler.cpp index 6048ced6..dac50ebc 100755 --- a/iSeg/SlicesHandler.cpp +++ b/iSeg/SlicesHandler.cpp @@ -482,10 +482,10 @@ int SlicesHandler::LoadDIBitmap(std::vector filenames, Point p, } } +// TODO BL this function has a terrible impl, e.g. using member variables rgb, width/height, etc. int SlicesHandler::LoadPng(std::vector filenames) { - UpdateColorLookupTable( - nullptr); // BL: here we could quantize colors instead and build color + UpdateColorLookupTable(nullptr); // BL: here we could quantize colors instead and build color activeslice = 0; active_tissuelayer = 0; @@ -500,10 +500,10 @@ int SlicesHandler::LoadPng(std::vector filenames) { ChannelMixer channelMixer(filenames, NULL); channelMixer.move(QCursor::pos()); - if (!channelMixer.exec()) - //return 0; + if (!channelMixer.exec()) // TODO BL check this works + return 0; - redFactor = channelMixer.GetRedFactor(); + redFactor = channelMixer.GetRedFactor(); greenFactor = channelMixer.GetGreenFactor(); blueFactor = channelMixer.GetBlueFactor(); diff --git a/iSeg/SmoothingWidget.h b/iSeg/SmoothingWidget.h index 1027fdf6..6ab54644 100755 --- a/iSeg/SmoothingWidget.h +++ b/iSeg/SmoothingWidget.h @@ -41,15 +41,15 @@ class SmoothingWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~SmoothingWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Smooth"); } - virtual QIcon GetIcon(QDir picdir) + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Smooth"); } + QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("smoothing.png")).ascii()); + return QIcon(picdir.absFilePath(QString("smoothing.png"))); } private: diff --git a/iSeg/ThresholdWidget.h b/iSeg/ThresholdWidget.h index ca48e086..9042f0f7 100755 --- a/iSeg/ThresholdWidget.h +++ b/iSeg/ThresholdWidget.h @@ -7,8 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#ifndef THRESHWIDGET_24Feb05 -#define THRESHWIDGET_24Feb05 +#pragma once #include "SlicesHandler.h" #include "bmp_read_1.h" @@ -43,21 +42,18 @@ class ThresholdWidget : public WidgetInterface ThresholdWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~ThresholdWidget(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const; - void init(); - void newloaded(); - void hideparams_changed(); + void init() override; + void newloaded() override; + void hideparams_changed() override; std::string GetName() override { return std::string("Threshold"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("thresholding.png")).ascii()); - } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("thresholding.png"))); } private: - virtual void on_tissuenr_changed(int i) override; - virtual void on_slicenr_changed() override; + void on_tissuenr_changed(int i) override; + void on_slicenr_changed() override; bmphandler* bmphand; SlicesHandler* handler3D; @@ -162,4 +158,3 @@ private slots: } // namespace iseg -#endif diff --git a/iSeg/VesselWidget.h b/iSeg/VesselWidget.h index e24b9d14..26fd161d 100755 --- a/iSeg/VesselWidget.h +++ b/iSeg/VesselWidget.h @@ -34,14 +34,14 @@ class VesselWidget : public WidgetInterface VesselWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~VesselWidget(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const; - void init(); - void newloaded(); + void init() override; + void newloaded() override; void slicenr_changed(); - std::string GetName() { return std::string("Vessel"); }; - virtual QIcon GetIcon(QDir picdir) + std::string GetName() override { return std::string("Vessel"); }; + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("vessel.png")).ascii()); }; diff --git a/iSeg/bmpshower.h b/iSeg/bmpshower.h index c4c9ba13..a782853a 100755 --- a/iSeg/bmpshower.h +++ b/iSeg/bmpshower.h @@ -17,14 +17,13 @@ #include #include #include -#include // BL TODO +#include #include #include #include #include #include #include -//Added by qt3to4: #include #include #include diff --git a/iSeg/featurewidget.h b/iSeg/featurewidget.h index 75a08297..57794910 100755 --- a/iSeg/featurewidget.h +++ b/iSeg/featurewidget.h @@ -54,9 +54,9 @@ class FeatureWidget : public WidgetInterface } private: - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_moved(Point p) override; - virtual void on_mouse_released(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_moved(Point p) override; + void on_mouse_released(Point p) override; bool selecting; std::vector dynamic; diff --git a/iSeg/livewirewidget.h b/iSeg/livewirewidget.h index d711009d..753d0c54 100755 --- a/iSeg/livewirewidget.h +++ b/iSeg/livewirewidget.h @@ -48,27 +48,29 @@ class livewire_widget : public WidgetInterface livewire_widget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~livewire_widget(); - void init(); - void newloaded(); + void init() override; + void newloaded() override; void cleanup(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; QSize sizeHint() const; - ImageForestingTransformLivewire* lw; - ImageForestingTransformLivewire* lwfirst; - std::string GetName() { return std::string("Contour"); } - virtual QIcon GetIcon(QDir picdir) + std::string GetName() override { return std::string("Contour"); } + virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("contour.png")).ascii()); } private: - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_moved(Point p) override; - virtual void on_mouse_released(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_moved(Point p) override; + void on_mouse_released(Point p) override; void init1(); + + ImageForestingTransformLivewire* lw; + ImageForestingTransformLivewire* lwfirst; + // bool isactive; bool drawing; std::vector clicks; diff --git a/iSeg/measurementwidget.h b/iSeg/measurementwidget.h index f8346266..e85911d6 100755 --- a/iSeg/measurementwidget.h +++ b/iSeg/measurementwidget.h @@ -35,24 +35,26 @@ class MeasurementWidget : public WidgetInterface MeasurementWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~MeasurementWidget(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const; - void init(); + void init() override; void cleanup(); - void newloaded(); + void newloaded() override; void getlabels(); float calculate(); float calculatevec(unsigned short orient); - std::string GetName() { return std::string("Measurement"); } - virtual QIcon GetIcon(QDir picdir) + std::string GetName() override { return std::string("Measurement"); } + virtual QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("measurement.png")).ascii()); + return QIcon(picdir.absFilePath(QString("measurement.png"))); } private: - virtual void on_mouse_clicked(Point p) override; - virtual void on_mouse_moved(Point p) override; + void on_mouse_clicked(Point p) override; + void on_mouse_moved(Point p) override; + + void set_coord(unsigned short posit, Point p, unsigned short slicenr); bmphandler* bmphand; SlicesHandler* handler3D; @@ -89,7 +91,6 @@ class MeasurementWidget : public WidgetInterface std::vector established; std::vector dynamic; Point p1; - void set_coord(unsigned short posit, Point p, unsigned short slicenr); signals: void vp1_changed(std::vector* vp1); diff --git a/iSeg/pickerwidget.h b/iSeg/pickerwidget.h index 79d6633d..b4939108 100755 --- a/iSeg/pickerwidget.h +++ b/iSeg/pickerwidget.h @@ -38,20 +38,23 @@ class PickerWidget : public WidgetInterface PickerWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~PickerWidget(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const; - void init(); + void init() override; void cleanup(); - void newloaded(); - std::string GetName() { return std::string("Picker"); }; - virtual QIcon GetIcon(QDir picdir) + void newloaded() override; + std::string GetName() override { return std::string("Picker"); }; + virtual QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("picker.png")).ascii()); + return QIcon(picdir.absFilePath(QString("picker.png"))); } private: - virtual void on_mouse_clicked(Point p) override; + void on_mouse_clicked(Point p) override; + + void update_active(); + void showborder(); bmphandler* bmphand; SlicesHandler* handler3D; @@ -79,8 +82,6 @@ class PickerWidget : public WidgetInterface QRadioButton* rb_fill; QButtonGroup* erasefillgroup; std::vector selection; - void update_active(); - void showborder(); signals: void vp1_changed(std::vector* vp1); diff --git a/iSeg/tissueinfos.h b/iSeg/tissueinfos.h index 53fecb67..734be799 100755 --- a/iSeg/tissueinfos.h +++ b/iSeg/tissueinfos.h @@ -11,8 +11,10 @@ #define TISSUEINFOS #include "Core/Types.h" -#include + #include // BL TODO get rid of this + +#include #include #include diff --git a/iSeg/transformwidget.h b/iSeg/transformwidget.h index af3aab8b..cf9f1a9e 100755 --- a/iSeg/transformwidget.h +++ b/iSeg/transformwidget.h @@ -71,7 +71,7 @@ class TransformWidget : public WidgetInterface void BitsChanged(); private: - virtual void on_mouse_clicked(Point p) override; + void on_mouse_clicked(Point p) override; // Image data SlicesHandler* handler3D; diff --git a/iSeg/watershedwidget.h b/iSeg/watershedwidget.h index 96783403..0019869c 100755 --- a/iSeg/watershedwidget.h +++ b/iSeg/watershedwidget.h @@ -39,15 +39,15 @@ class WatershedWidget : public WidgetInterface const char* name = 0, Qt::WindowFlags wFlags = 0); ~WatershedWidget(); QSize sizeHint() const; - void init(); - void newloaded(); - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - void hideparams_changed(); - std::string GetName() { return std::string("Watershed"); } - virtual QIcon GetIcon(QDir picdir) + void init() override; + void newloaded() override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; + void hideparams_changed() override; + std::string GetName() override { return std::string("Watershed"); } + virtual QIcon GetIcon(QDir picdir) override { - return QIcon(picdir.absFilePath(QString("watershed.png")).ascii()); + return QIcon(picdir.absFilePath(QString("watershed.png"))); } private: From 850c9d9bd34fb6855a0ca3da3f3b094ab66fcfd1 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 09:15:50 +0200 Subject: [PATCH 4/9] more cleanup of WidgetInterface and derived classes --- .clang-format | 8 +- Plugin/WidgetInterface.cpp | 7 + Plugin/WidgetInterface.h | 25 +- Plugins/ConfidenceConnected/Confidence.h | 49 +- Plugins/GraphCut/GraphCutBoneSegmentation.h | 44 +- Plugins/GraphCut/GraphCutTissueSeparator.h | 54 +- Plugins/Levelset/Levelset.h | 51 +- iSeg/EdgeWidget.h | 66 +- iSeg/FastmarchingFuzzyWidget.h | 97 +- iSeg/HystereticGrowingWidget.cpp | 160 +-- iSeg/HystereticGrowingWidget.h | 90 +- ...ageForestingTransformRegionGrowingWidget.h | 45 +- iSeg/InterpolationWidget.h | 68 +- iSeg/MainWindow.cpp | 1139 +++++++++-------- iSeg/MorphologyWidget.h | 57 +- iSeg/OutlineCorrectionWidget.h | 130 +- iSeg/SmoothingWidget.h | 85 +- iSeg/ThresholdWidget.h | 151 ++- iSeg/VesselWidget.cpp | 51 +- iSeg/VesselWidget.h | 53 +- iSeg/featurewidget.h | 73 +- iSeg/livewirewidget.h | 65 +- iSeg/main.cpp | 34 +- iSeg/measurementwidget.h | 85 +- iSeg/pickerwidget.h | 63 +- iSeg/transformwidget.h | 107 +- iSeg/watershedwidget.h | 40 +- 27 files changed, 1431 insertions(+), 1466 deletions(-) diff --git a/.clang-format b/.clang-format index 9f7a0d31..c143b18a 100644 --- a/.clang-format +++ b/.clang-format @@ -7,7 +7,7 @@ AllowShortFunctionsOnASingleLine: true AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AlignEscapedNewlines: Right -AlignAfterOpenBracket: Align +AlignAfterOpenBracket: DontAlign AlwaysBreakAfterReturnType: None BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom @@ -23,7 +23,8 @@ BraceWrapping: BeforeElse: true IndentBraces: false SplitEmptyFunction: true -BreakBeforeInheritanceComma: false +BreakBeforeInheritanceComma: true +BreakConstructorInitializers: BeforeColon CompactNamespaces: true Cpp11BracedListStyle: true FixNamespaceComments: true @@ -32,7 +33,7 @@ SortIncludes: true IndentCaseLabels: false IndentPPDirectives: AfterHash IndentWrappedFunctionNames: true -KeepEmptyLinesAtTheStartOfBlocks: false +KeepEmptyLinesAtTheStartOfBlocks: true NamespaceIndentation: None ReflowComments: false IndentWidth: 2 @@ -47,3 +48,4 @@ SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesInAngles: false MaxEmptyLinesToKeep: 1 +ColumnLimit: 0 \ No newline at end of file diff --git a/Plugin/WidgetInterface.cpp b/Plugin/WidgetInterface.cpp index ba7e85ca..b4b81fdc 100755 --- a/Plugin/WidgetInterface.cpp +++ b/Plugin/WidgetInterface.cpp @@ -12,4 +12,11 @@ namespace iseg { bool WidgetInterface::hideparams = false; + +WidgetInterface::WidgetInterface(QWidget *parent, const char *name, Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags) +{ + m_cursor = new QCursor(Qt::CrossCursor); } + +} // namespace iseg diff --git a/Plugin/WidgetInterface.h b/Plugin/WidgetInterface.h index 19f9b0e7..a01efb06 100755 --- a/Plugin/WidgetInterface.h +++ b/Plugin/WidgetInterface.h @@ -27,15 +27,12 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget { Q_OBJECT public: - WidgetInterface(QWidget* parent, const char* name, Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags) - { - m_cursor = new QCursor(Qt::CrossCursor); - } + WidgetInterface(QWidget *parent, const char *name, Qt::WindowFlags wFlags); virtual void init() {} virtual void newloaded() {} - virtual FILE* SaveParams(FILE* fp, int version) { return fp; }; - virtual FILE* LoadParams(FILE* fp, int version) { return fp; }; + virtual void cleanup() {} + virtual FILE *SaveParams(FILE *fp, int version) { return fp; }; + virtual FILE *LoadParams(FILE *fp, int version) { return fp; }; virtual void hideparams_changed() {} static void set_hideparams(bool hide) { hideparams = hide; } static bool get_hideparams() { return hideparams; } @@ -49,15 +46,15 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget virtual void on_mouse_released(Point p) {} virtual void on_mouse_moved(Point p) {} - QCursor* get_cursor() { return m_cursor; } + QCursor *get_cursor() { return m_cursor; } signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); -private slots : +private slots: void tissuenr_changed(int i) { on_tissuenr_changed(i); } void slicenr_changed() { on_slicenr_changed(); } @@ -67,7 +64,7 @@ private slots : void mouse_moved(Point p) { on_mouse_moved(p); } protected: - QCursor* m_cursor; + QCursor *m_cursor; static bool hideparams; }; diff --git a/Plugins/ConfidenceConnected/Confidence.h b/Plugins/ConfidenceConnected/Confidence.h index 704f2dab..5f647f91 100755 --- a/Plugins/ConfidenceConnected/Confidence.h +++ b/Plugins/ConfidenceConnected/Confidence.h @@ -22,17 +22,14 @@ class ConfidenceWidget : public iseg::WidgetInterface { Q_OBJECT public: - ConfidenceWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + ConfidenceWidget(iseg::SliceHandlerInterface *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~ConfidenceWidget(); - QSize sizeHint() const; void init() override; void newloaded() override; + QSize sizeHint() const override; std::string GetName() override { return std::string("ConfidenceFilter"); } - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("Confidence.png")).ascii()); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("Confidence.png"))); } protected: virtual void on_tissuenr_changed(int i) override { std::cerr << "tissue " << i << std::endl; } @@ -43,26 +40,26 @@ class ConfidenceWidget : public iseg::WidgetInterface virtual void on_mouse_moved(iseg::Point p) override { std::cerr << "on_mouse_moved" << std::endl; } private: - unsigned int* usp; - iseg::SliceHandlerInterface* handler3D; + unsigned int *usp; + iseg::SliceHandlerInterface *handler3D; unsigned short activeslice; - Q3VBox* vbox1; - QLabel* bias_header; - QPushButton* bias_exec; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3HBox* hbox5; - QLabel* txt_h2; - QLabel* txt_h3; - QLabel* txt_h4; - QLabel* txt_h5; - QSpinBox* sl_h2; - QSpinBox* sl_h3; - QSpinBox* sl_h4; - QSpinBox* sl_h5; - QSpinBox* sl_h6; - QSpinBox* sl_h7; + Q3VBox *vbox1; + QLabel *bias_header; + QPushButton *bias_exec; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3HBox *hbox5; + QLabel *txt_h2; + QLabel *txt_h3; + QLabel *txt_h4; + QLabel *txt_h5; + QSpinBox *sl_h2; + QSpinBox *sl_h3; + QSpinBox *sl_h4; + QSpinBox *sl_h5; + QSpinBox *sl_h6; + QSpinBox *sl_h7; public slots: void slicenr_changed(); diff --git a/Plugins/GraphCut/GraphCutBoneSegmentation.h b/Plugins/GraphCut/GraphCutBoneSegmentation.h index 79bb0232..ebe755b2 100755 --- a/Plugins/GraphCut/GraphCutBoneSegmentation.h +++ b/Plugins/GraphCut/GraphCutBoneSegmentation.h @@ -23,37 +23,33 @@ class BoneSegmentationWidget : public iseg::WidgetInterface { Q_OBJECT public: - BoneSegmentationWidget(iseg::SliceHandlerInterface* hand3D, - QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + BoneSegmentationWidget(iseg::SliceHandlerInterface *hand3D, + QWidget *parent = 0, const char *name = 0, Qt::WindowFlags wFlags = 0); ~BoneSegmentationWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init(); void newloaded(); - std::string GetName() { return std::string("CT Auto-Bone"); }; - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("graphcut.png")).ascii()); - }; + std::string GetName() { return std::string("CT Auto-Bone"); } + QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("graphcut.png"))); } private: - iseg::SliceHandlerInterface* m_Handler3D; + iseg::SliceHandlerInterface *m_Handler3D; unsigned short m_CurrentSlice; - Q3VBox* m_VGrid; - Q3HBox* m_HGrid1; - Q3HBox* m_HGrid2; - Q3HBox* m_HGrid3; - QLabel* m_LabelMaxFlowAlgorithm; - QLabel* m_LabelStart; - QLabel* m_LabelEnd; - QComboBox* m_MaxFlowAlgorithm; - QPushButton* m_Execute; - QCheckBox* m_6Connectivity; - QCheckBox* m_UseSliceRange; - QSpinBox* m_Start; - QSpinBox* m_End; + Q3VBox *m_VGrid; + Q3HBox *m_HGrid1; + Q3HBox *m_HGrid2; + Q3HBox *m_HGrid3; + QLabel *m_LabelMaxFlowAlgorithm; + QLabel *m_LabelStart; + QLabel *m_LabelEnd; + QComboBox *m_MaxFlowAlgorithm; + QPushButton *m_Execute; + QCheckBox *m_6Connectivity; + QCheckBox *m_UseSliceRange; + QSpinBox *m_Start; + QSpinBox *m_End; - itk::ProcessObject* m_CurrentFilter; + itk::ProcessObject *m_CurrentFilter; public slots: void slicenr_changed(); diff --git a/Plugins/GraphCut/GraphCutTissueSeparator.h b/Plugins/GraphCut/GraphCutTissueSeparator.h index aee18fc6..60305eea 100755 --- a/Plugins/GraphCut/GraphCutTissueSeparator.h +++ b/Plugins/GraphCut/GraphCutTissueSeparator.h @@ -23,43 +23,43 @@ class TissueSeparatorWidget : public iseg::WidgetInterface { Q_OBJECT public: - TissueSeparatorWidget(iseg::SliceHandlerInterface* hand3D, - QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + TissueSeparatorWidget(iseg::SliceHandlerInterface *hand3D, + QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~TissueSeparatorWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init(); void newloaded(); std::string GetName() { return std::string("Separate Tissue"); } - virtual QIcon GetIcon(QDir picdir) + QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("graphcut.png")).ascii()); } private: - iseg::SliceHandlerInterface* m_Handler3D; + iseg::SliceHandlerInterface *m_Handler3D; unsigned short m_CurrentSlice; - Q3VBox* m_VerticalGrid; - Q3HBox* m_Horizontal1; - Q3HBox* m_Horizontal2; - Q3HBox* m_Horizontal3; - Q3HBox* m_Horizontal4; - Q3HBox* m_Horizontal5; - QLabel* m_LabelForeground; - QLabel* m_LabelBackground; - QLabel* m_LabelMaxFlowAlgorithm; - QLabel* m_LabelStart; - QLabel* m_LabelEnd; - QSpinBox* m_ForegroundValue; - QSpinBox* m_BackgroundValue; - QCheckBox* USE_FB; // ? - QCheckBox* m_UseIntensity; - QComboBox* m_MaxFlowAlgorithm; - QCheckBox* m_6Connectivity; - QCheckBox* m_UseSliceRange; - QSpinBox* m_Start; - QSpinBox* m_End; - QPushButton* m_Execute; + Q3VBox *m_VerticalGrid; + Q3HBox *m_Horizontal1; + Q3HBox *m_Horizontal2; + Q3HBox *m_Horizontal3; + Q3HBox *m_Horizontal4; + Q3HBox *m_Horizontal5; + QLabel *m_LabelForeground; + QLabel *m_LabelBackground; + QLabel *m_LabelMaxFlowAlgorithm; + QLabel *m_LabelStart; + QLabel *m_LabelEnd; + QSpinBox *m_ForegroundValue; + QSpinBox *m_BackgroundValue; + QCheckBox *USE_FB; // ? + QCheckBox *m_UseIntensity; + QComboBox *m_MaxFlowAlgorithm; + QCheckBox *m_6Connectivity; + QCheckBox *m_UseSliceRange; + QSpinBox *m_Start; + QSpinBox *m_End; + QPushButton *m_Execute; public slots: void slicenr_changed(); diff --git a/Plugins/Levelset/Levelset.h b/Plugins/Levelset/Levelset.h index d01b0644..66be21fc 100755 --- a/Plugins/Levelset/Levelset.h +++ b/Plugins/Levelset/Levelset.h @@ -21,37 +21,34 @@ class LevelsetWidget : public iseg::WidgetInterface { Q_OBJECT public: - LevelsetWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + LevelsetWidget(iseg::SliceHandlerInterface *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~LevelsetWidget(); - QSize sizeHint() const; - void init(); - void newloaded(); - std::string GetName() { return std::string("LevelSet"); }; - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("LevelSet.png")).ascii()); - }; + QSize sizeHint() const override; + void init() override; + void newloaded() override; + std::string GetName() override { return std::string("LevelSet"); }; + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("LevelSet.png"))); }; private: - unsigned int* usp; - iseg::SliceHandlerInterface* handler3D; + unsigned int *usp; + iseg::SliceHandlerInterface *handler3D; unsigned short activeslice; - Q3VBox* vbox1; - QLabel* bias_header; - QPushButton* bias_exec; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3HBox* hbox5; - QLabel* txt_h2; - QLabel* txt_h3; - QLabel* txt_h4; - QSpinBox* sl_h2; - QSpinBox* sl_h3; - QSpinBox* sl_h4; - QLabel* txt_h5; - QSpinBox* sl_h5; + Q3VBox *vbox1; + QLabel *bias_header; + QPushButton *bias_exec; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3HBox *hbox5; + QLabel *txt_h2; + QLabel *txt_h3; + QLabel *txt_h4; + QSpinBox *sl_h2; + QSpinBox *sl_h3; + QSpinBox *sl_h4; + QLabel *txt_h5; + QSpinBox *sl_h5; public slots: void slicenr_changed(); diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index 1b2f43cc..ea80bb2f 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -36,52 +36,52 @@ class EdgeWidget : public WidgetInterface { Q_OBJECT public: - EdgeWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + EdgeWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~EdgeWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Edge"); } - virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("edge.png"))); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("edge.png"))); } private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3VBox* vbox1; - QLabel* txt_sigmal; - QLabel* txt_sigma2; - QLabel* txt_thresh11; - QLabel* txt_thresh12; - QLabel* txt_thresh21; - QLabel* txt_thresh22; - QSlider* sl_sigma; - QSlider* sl_thresh1; - QSlider* sl_thresh2; - QPushButton* btn_exec; - QRadioButton* rb_sobel; - QRadioButton* rb_laplacian; - QRadioButton* rb_interquartile; - QRadioButton* rb_momentline; - QRadioButton* rb_gaussline; - QRadioButton* rb_canny; - QRadioButton* rb_laplacianzero; - QButtonGroup* modegroup; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3VBox *vbox1; + QLabel *txt_sigmal; + QLabel *txt_sigma2; + QLabel *txt_thresh11; + QLabel *txt_thresh12; + QLabel *txt_thresh21; + QLabel *txt_thresh22; + QSlider *sl_sigma; + QSlider *sl_thresh1; + QSlider *sl_thresh2; + QPushButton *btn_exec; + QRadioButton *rb_sobel; + QRadioButton *rb_laplacian; + QRadioButton *rb_interquartile; + QRadioButton *rb_momentline; + QRadioButton *rb_gaussline; + QRadioButton *rb_canny; + QRadioButton *rb_laplacianzero; + QButtonGroup *modegroup; public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void execute(); void method_changed(int); void slider_changed(int newval); diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index b72c3f43..e6316841 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -38,21 +38,18 @@ class FastmarchingFuzzyWidget : public WidgetInterface { Q_OBJECT public: - FastmarchingFuzzyWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + FastmarchingFuzzyWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~FastmarchingFuzzyWidget(); void init() override; void newloaded() override; - void cleanup(); - QSize sizeHint() const; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + void cleanup() override; + QSize sizeHint() const override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Fuzzy"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("fuzzy.png")).ascii()); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("fuzzy.png"))); } protected: void on_mouse_clicked(Point p) override; @@ -60,46 +57,46 @@ class FastmarchingFuzzyWidget : public WidgetInterface void on_mouse_moved(Point p) override; private: - float* map; - ImageForestingTransformFastMarching* IFTmarch; - ImageForestingTransformAdaptFuzzy* IFTfuzzy; - bmphandler* bmphand; - SlicesHandler* handler3D; + float *map; + ImageForestingTransformFastMarching *IFTmarch; + ImageForestingTransformAdaptFuzzy *IFTfuzzy; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3HBox* hbox5; - Q3HBox* hbox7; - Q3VBox* vbox1; - Q3VBox* vboxfast; - Q3VBox* vboxfuzzy; - QLabel* txt_sigma; - QLabel* txt_thresh; - QLabel* txt_m1; - QLabel* txt_s1; - QLabel* txt_s2; - QLabel* txt_extend; - QSlider* sl_sigma; - QSlider* sl_thresh; - QSlider* sl_m1; - QSlider* sl_s1; - QSlider* sl_s2; - QSlider* sl_extend; - QSpinBox* sb_thresh; - QSpinBox* sb_m1; - QSpinBox* sb_s1; - QSpinBox* sb_s2; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3HBox *hbox5; + Q3HBox *hbox7; + Q3VBox *vbox1; + Q3VBox *vboxfast; + Q3VBox *vboxfuzzy; + QLabel *txt_sigma; + QLabel *txt_thresh; + QLabel *txt_m1; + QLabel *txt_s1; + QLabel *txt_s2; + QLabel *txt_extend; + QSlider *sl_sigma; + QSlider *sl_thresh; + QSlider *sl_m1; + QSlider *sl_s1; + QSlider *sl_s2; + QSlider *sl_extend; + QSpinBox *sb_thresh; + QSpinBox *sb_m1; + QSpinBox *sb_s1; + QSpinBox *sb_s2; // QPushButton *pushexec; - QRadioButton* rb_fastmarch; - QRadioButton* rb_fuzzy; - QRadioButton* rb_drag; - QRadioButton* rb_slider; - QButtonGroup* bg_method; - QButtonGroup* bg_interact; + QRadioButton *rb_fastmarch; + QRadioButton *rb_fuzzy; + QRadioButton *rb_drag; + QRadioButton *rb_slider; + QButtonGroup *bg_method; + QButtonGroup *bg_interact; void getrange(); float sigma, thresh, m1, s1, s2; float sigmamax; @@ -109,13 +106,13 @@ class FastmarchingFuzzyWidget : public WidgetInterface std::vector vpdyn_arg; signals: - void vpdyn_changed(std::vector* vpdyn_arg); + void vpdyn_changed(std::vector *vpdyn_arg); public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); //void mouse_clicked(Point p); //void mouse_released(Point p); //void mouse_moved(Point p); diff --git a/iSeg/HystereticGrowingWidget.cpp b/iSeg/HystereticGrowingWidget.cpp index 64715e5a..06c8d890 100755 --- a/iSeg/HystereticGrowingWidget.cpp +++ b/iSeg/HystereticGrowingWidget.cpp @@ -39,12 +39,12 @@ using namespace std; using namespace iseg; -HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) +HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler *hand3D, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Segment a tissue by picking seed points and adding " - "neighboring pixels with similar intensities.")); + "neighboring pixels with similar intensities.")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -121,43 +121,43 @@ HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* QObject::connect(clearlimit, SIGNAL(clicked()), this, SLOT(clearpressed())); QObject::connect(autoseed, SIGNAL(clicked()), this, SLOT(auto_toggled())); QObject::connect(sl_lower, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_upper, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_lowerhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_upperhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_lower, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_upper, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_lowerhyster, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_upperhyster, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_lower, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sl_upper, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sl_lowerhyster, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sl_upperhyster, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(le_bordervall, SIGNAL(returnPressed()), this, - SLOT(le_bordervall_returnpressed())); + SLOT(le_bordervall_returnpressed())); QObject::connect(le_bordervalu, SIGNAL(returnPressed()), this, - SLOT(le_bordervalu_returnpressed())); + SLOT(le_bordervalu_returnpressed())); QObject::connect(le_bordervallh, SIGNAL(returnPressed()), this, - SLOT(le_bordervallh_returnpressed())); + SLOT(le_bordervallh_returnpressed())); QObject::connect(le_bordervaluh, SIGNAL(returnPressed()), this, - SLOT(le_bordervaluh_returnpressed())); + SLOT(le_bordervaluh_returnpressed())); QObject::connect(pb_saveborders, SIGNAL(clicked()), this, - SLOT(saveborders_execute())); + SLOT(saveborders_execute())); QObject::connect(pb_loadborders, SIGNAL(clicked()), this, - SLOT(loadborders_execute())); + SLOT(loadborders_execute())); update_visible(); getrange(); @@ -174,7 +174,7 @@ void HystereticGrowingWidget::slicenr_changed() // } } -void HystereticGrowingWidget::bmphand_changed(bmphandler* bmph) +void HystereticGrowingWidget::bmphand_changed(bmphandler *bmph) { bmphand = bmph; @@ -253,35 +253,35 @@ void HystereticGrowingWidget::execute1() if (autoseed->isOn()) { float ll = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float ul = ll + (uu - ll) * 0.005f * sl_lowerhyster->value(); float lu = ll + (uu - ll) * 0.005f * sl_upperhyster->value(); if (allslices->isChecked()) handler3D->double_hysteretic_allslices(ll, ul, lu, uu, false, - 255.0f); + 255.0f); else bmphand->double_hysteretic(ll, ul, lu, uu, false, 255.0f); le_bordervall->setText(QString::number(ll, 'g', 3)); le_bordervalu->setText(QString::number(uu, 'g', 3)); le_bordervallh->setText( - QString::number(int(0.4f + (ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int(0.4f + (ul - ll) / (uu - ll) * 100), 'g', 3)); le_bordervaluh->setText( - QString::number(int(0.4f + (lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int(0.4f + (lu - ll) / (uu - ll) * 100), 'g', 3)); } else { float ll = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); // bmphand->thresholded_growing(p1,ll,uu,false,255.f); if (allslices->isChecked()) { handler3D->thresholded_growing(handler3D->get_activeslice(), p1, ll, - uu, 255.f); + uu, 255.f); } else { @@ -296,9 +296,9 @@ void HystereticGrowingWidget::execute1() void HystereticGrowingWidget::getrange() { float ll = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float ul = ll + (uu - ll) * 0.005f * sl_lowerhyster->value(); float lu = ll + (uu - ll) * 0.005f * sl_upperhyster->value(); @@ -328,7 +328,7 @@ void HystereticGrowingWidget::getrange_sub(float ll, float uu, float ul, float l sl_lower->setValue(100); else sl_lower->setValue(int( - 0.5f + (ll - lower_limit) / (upper_limit - lower_limit) * 200)); + 0.5f + (ll - lower_limit) / (upper_limit - lower_limit) * 200)); } if (uu < lower_limit) @@ -347,7 +347,7 @@ void HystereticGrowingWidget::getrange_sub(float ll, float uu, float ul, float l sl_upper->setValue(100); else sl_upper->setValue(int( - 0.5f + (uu - lower_limit) / (upper_limit - lower_limit) * 200)); + 0.5f + (uu - lower_limit) / (upper_limit - lower_limit) * 200)); } if (ul < ll) @@ -389,9 +389,9 @@ void HystereticGrowingWidget::getrange_sub(float ll, float uu, float ul, float l le_bordervall->setText(QString::number(ll, 'g', 3)); le_bordervalu->setText(QString::number(uu, 'g', 3)); le_bordervallh->setText( - QString::number(int(0.4f + (ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int(0.4f + (ul - ll) / (uu - ll) * 100), 'g', 3)); le_bordervaluh->setText( - QString::number(int(0.4f + (lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int(0.4f + (lu - ll) / (uu - ll) * 100), 'g', 3)); return; } @@ -425,10 +425,10 @@ void HystereticGrowingWidget::newloaded() bmphand = handler3D->get_activebmphandler(); getrange(); - vector>* vvp = bmphand->return_limits(); + vector> *vvp = bmphand->return_limits(); vp1.clear(); for (vector>::iterator it = vvp->begin(); it != vvp->end(); - it++) + it++) { vp1.insert(vp1.end(), it->begin(), it->end()); ; @@ -440,10 +440,10 @@ void HystereticGrowingWidget::init1() limitdrawing = false; drawlimit->setDown(false); - vector>* vvp = bmphand->return_limits(); + vector> *vvp = bmphand->return_limits(); vp1.clear(); for (vector>::iterator it = vvp->begin(); it != vvp->end(); - it++) + it++) { vp1.insert(vp1.end(), it->begin(), it->end()); ; @@ -452,7 +452,7 @@ void HystereticGrowingWidget::init1() emit vp1_changed(&vp1); } -void HystereticGrowingWidget::clean_up() +void HystereticGrowingWidget::cleanup() { limitdrawing = false; drawlimit->setDown(false); @@ -535,7 +535,7 @@ void HystereticGrowingWidget::slider_released() { emit end_datachange(this); } void HystereticGrowingWidget::saveborders_execute() { QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Thresholds (*.txt)\n", this); //, filename); + QString::null, "Thresholds (*.txt)\n", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".txt"))) savefilename.append(".txt"); @@ -543,12 +543,12 @@ void HystereticGrowingWidget::saveborders_execute() if (!savefilename.isEmpty()) { float ll = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = lower_limit + - (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float ul = ll + (uu - ll) * 0.005f * sl_lowerhyster->value(); float lu = ll + (uu - ll) * 0.005f * sl_upperhyster->value(); - FILE* fp = fopen(savefilename.ascii(), "w"); + FILE *fp = fopen(savefilename.ascii(), "w"); fprintf(fp, "%f %f %f %f \n", ll, ul, lu, uu); fclose(fp); } @@ -557,13 +557,13 @@ void HystereticGrowingWidget::saveborders_execute() void HystereticGrowingWidget::loadborders_execute() { QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "Borders (*.txt)\n" - "All(*.*)", - this); + "Borders (*.txt)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { - FILE* fp = fopen(loadfilename.ascii(), "r"); + FILE *fp = fopen(loadfilename.ascii(), "r"); if (fp != NULL) { float ll, uu, lu, ul; @@ -581,7 +581,7 @@ void HystereticGrowingWidget::le_bordervall_returnpressed() bool b1; float val = le_bordervall->text().toFloat(&b1); float ll = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); if (b1) { if (val < lower_limit) @@ -606,8 +606,8 @@ void HystereticGrowingWidget::le_bordervall_returnpressed() } else sl_lower->setValue(int(0.5f + (val - lower_limit) / - (upper_limit - lower_limit) * - 200)); + (upper_limit - lower_limit) * + 200)); } execute(); @@ -624,7 +624,7 @@ void HystereticGrowingWidget::le_bordervalu_returnpressed() bool b1; float val = le_bordervalu->text().toFloat(&b1); float uu = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); if (b1) { if (val < lower_limit) @@ -649,8 +649,8 @@ void HystereticGrowingWidget::le_bordervalu_returnpressed() } else sl_upper->setValue(int(0.5f + (val - lower_limit) / - (upper_limit - lower_limit) * - 200)); + (upper_limit - lower_limit) * + 200)); } execute(); @@ -667,9 +667,9 @@ void HystereticGrowingWidget::le_bordervallh_returnpressed() bool b1; float val = le_bordervallh->text().toFloat(&b1); float ll = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float ul = ll + (uu - ll) * 0.005f * sl_lowerhyster->value(); if (b1) { @@ -678,14 +678,14 @@ void HystereticGrowingWidget::le_bordervallh_returnpressed() ul = ll; sl_lowerhyster->setValue(0); le_bordervallh->setText( - QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); } else if (val > 100) { ul = uu; sl_lowerhyster->setValue(200); le_bordervallh->setText( - QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); } else { @@ -694,7 +694,7 @@ void HystereticGrowingWidget::le_bordervallh_returnpressed() ul = uu; sl_lowerhyster->setValue(100); le_bordervallh->setText( - QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); } else sl_lowerhyster->setValue(int(0.5f + val / 100 * 200)); @@ -706,7 +706,7 @@ void HystereticGrowingWidget::le_bordervallh_returnpressed() { QApplication::beep(); le_bordervallh->setText( - QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((ul - ll) / (uu - ll) * 100), 'g', 3)); } } @@ -715,9 +715,9 @@ void HystereticGrowingWidget::le_bordervaluh_returnpressed() bool b1; float val = le_bordervaluh->text().toFloat(&b1); float ll = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_lower->value(); float uu = - lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); + lower_limit + (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float lu = ll + (uu - ll) * 0.005f * sl_upperhyster->value(); if (b1) { @@ -726,14 +726,14 @@ void HystereticGrowingWidget::le_bordervaluh_returnpressed() lu = ll; sl_upperhyster->setValue(0); le_bordervaluh->setText( - QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); } else if (val > 100) { lu = uu; sl_upperhyster->setValue(200); le_bordervaluh->setText( - QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); } else { @@ -742,7 +742,7 @@ void HystereticGrowingWidget::le_bordervaluh_returnpressed() lu = uu; sl_upperhyster->setValue(100); le_bordervaluh->setText( - QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); } else sl_upperhyster->setValue(int(0.5f + val / 100 * 200)); @@ -754,11 +754,11 @@ void HystereticGrowingWidget::le_bordervaluh_returnpressed() { QApplication::beep(); le_bordervaluh->setText( - QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); + QString::number(int((lu - ll) / (uu - ll) * 100), 'g', 3)); } } -FILE* HystereticGrowingWidget::SaveParams(FILE* fp, int version) +FILE *HystereticGrowingWidget::SaveParams(FILE *fp, int version) { if (version >= 2) { @@ -783,20 +783,20 @@ FILE* HystereticGrowingWidget::SaveParams(FILE* fp, int version) return fp; } -FILE* HystereticGrowingWidget::LoadParams(FILE* fp, int version) +FILE *HystereticGrowingWidget::LoadParams(FILE *fp, int version) { if (version >= 2) { QObject::disconnect(autoseed, SIGNAL(clicked()), this, - SLOT(auto_toggled())); + SLOT(auto_toggled())); QObject::disconnect(sl_lower, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::disconnect(sl_upper, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::disconnect(sl_lowerhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::disconnect(sl_upperhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -820,15 +820,15 @@ FILE* HystereticGrowingWidget::LoadParams(FILE* fp, int version) fread(&lower_limit, sizeof(float), 1, fp); QObject::connect(autoseed, SIGNAL(clicked()), this, - SLOT(auto_toggled())); + SLOT(auto_toggled())); QObject::connect(sl_lower, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_upper, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_lowerhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_upperhyster, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); } return fp; } diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index 64704e69..9ab24b88 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -41,21 +41,18 @@ class HystereticGrowingWidget : public WidgetInterface { Q_OBJECT public: - HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + HystereticGrowingWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~HystereticGrowingWidget(); void init() override; void newloaded() override; - void clean_up(); + void cleanup() override; QSize sizeHint() const override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Growing"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("growing.png")).ascii()); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("growing.png"))); } private: void on_mouse_clicked(Point p) override; @@ -65,60 +62,60 @@ class HystereticGrowingWidget : public WidgetInterface void init1(); Point p1; Point last_pt; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; float upper_limit; float lower_limit; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox2a; - Q3HBox* hbox3; - Q3VBox* vbox1; - Q3VBox* vbox2; - Q3VBox* vbox3; - Q3VBox* vbox4; - Q3VBox* vbox5; - Q3VBox* vbox6; - Q3VBox* vbox7; - QLabel* txt_lower; - QLabel* txt_upper; - QLabel* txt_lowerhyster; - QLabel* txt_upperhyster; - QSlider* sl_lower; - QSlider* sl_upper; - QSlider* sl_lowerhyster; - QSlider* sl_upperhyster; - QPushButton* pushexec; - QPushButton* drawlimit; - QPushButton* clearlimit; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox2a; + Q3HBox *hbox3; + Q3VBox *vbox1; + Q3VBox *vbox2; + Q3VBox *vbox3; + Q3VBox *vbox4; + Q3VBox *vbox5; + Q3VBox *vbox6; + Q3VBox *vbox7; + QLabel *txt_lower; + QLabel *txt_upper; + QLabel *txt_lowerhyster; + QLabel *txt_upperhyster; + QSlider *sl_lower; + QSlider *sl_upper; + QSlider *sl_lowerhyster; + QSlider *sl_upperhyster; + QPushButton *pushexec; + QPushButton *drawlimit; + QPushButton *clearlimit; bool limitdrawing; - QCheckBox* autoseed; - QCheckBox* allslices; + QCheckBox *autoseed; + QCheckBox *allslices; void getrange(); void getrange_sub(float ll, float uu, float ul, float lu); std::vector vp1; std::vector vpdyn; void execute1(); bool dontundo; - QLineEdit* le_bordervall; - QLineEdit* le_bordervalu; - QLineEdit* le_bordervallh; - QLineEdit* le_bordervaluh; - QPushButton* pb_saveborders; - QPushButton* pb_loadborders; + QLineEdit *le_bordervall; + QLineEdit *le_bordervalu; + QLineEdit *le_bordervallh; + QLineEdit *le_bordervaluh; + QPushButton *pb_saveborders; + QPushButton *pb_loadborders; signals: - void vpdyn_changed(std::vector* vpdyn_arg); - void vp1_changed(std::vector* vp1_arg); - void vp1dyn_changed(std::vector* vp1_arg, - std::vector* vpdyn_arg); + void vpdyn_changed(std::vector *vpdyn_arg); + void vp1_changed(std::vector *vp1_arg); + void vp1dyn_changed(std::vector *vp1_arg, + std::vector *vpdyn_arg); public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void auto_toggled(); void update_visible(); void execute(); @@ -137,4 +134,3 @@ private slots: }; } // namespace iseg - diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.h b/iSeg/ImageForestingTransformRegionGrowingWidget.h index 8040376b..0545f06a 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.h +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.h @@ -33,18 +33,18 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface { Q_OBJECT public: - ImageForestingTransformRegionGrowingWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + ImageForestingTransformRegionGrowingWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~ImageForestingTransformRegionGrowingWidget(); void init() override; void newloaded() override; - void cleanup(); - QSize sizeHint() const; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + void cleanup() override; + QSize sizeHint() const override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("IFT"); } - virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("iftrg.png"))); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("iftrg.png"))); } protected: void on_tissuenr_changed(int i) override; @@ -59,20 +59,20 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface void removemarks(Point p); void getrange(); - float* lbmap; - ImageForestingTransformRegionGrowing* IFTrg; + float *lbmap; + ImageForestingTransformRegionGrowing *IFTrg; Point last_pt; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hbox1; - Q3VBox* vbox1; - QLabel* txt_lower; - QLabel* txt_upper; - QSlider* sl_thresh; - QPushButton* pushexec; - QPushButton* pushclear; - QPushButton* pushremove; + Q3HBox *hbox1; + Q3VBox *vbox1; + QLabel *txt_lower; + QLabel *txt_upper; + QSlider *sl_thresh; + QPushButton *pushexec; + QPushButton *pushclear; + QPushButton *pushremove; unsigned tissuenr; float thresh; float maxthresh; @@ -82,11 +82,11 @@ class ImageForestingTransformRegionGrowingWidget : public WidgetInterface unsigned area; signals: - void vm_changed(std::vector* vm1); - void vmdyn_changed(std::vector* vmdyn1); + void vm_changed(std::vector *vm1); + void vmdyn_changed(std::vector *vmdyn1); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void execute(); void clearmarks(); void slider_changed(int i); @@ -96,4 +96,3 @@ private slots: }; } // namespace iseg - diff --git a/iSeg/InterpolationWidget.h b/iSeg/InterpolationWidget.h index 206e67db..b84e628c 100755 --- a/iSeg/InterpolationWidget.h +++ b/iSeg/InterpolationWidget.h @@ -39,51 +39,48 @@ class InterpolationWidget : public WidgetInterface { Q_OBJECT public: - InterpolationWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + InterpolationWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~InterpolationWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; std::string GetName() override { return std::string("Interpol"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("interpolate.png"))); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("interpolate.png"))); } private: void on_tissuenr_changed(int i) override; void on_slicenr_changed() override; - SlicesHandler* handler3D; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3VBox* vboxdataselect; - Q3VBox* vboxparams; - Q3VBox* vboxexecute; - Q3HBox* hboxextra; - Q3HBox* hboxbatch; - QLabel* txt_slicenr; - QSpinBox* sb_slicenr; - QLabel* txt_batchstride; - QSpinBox* sb_batchstride; - QPushButton* pushexec; - QPushButton* pushstart; - QRadioButton* rb_tissue; - QRadioButton* rb_tissueall; - QRadioButton* rb_work; - QButtonGroup* sourcegroup; - QRadioButton* rb_inter; + SlicesHandler *handler3D; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3VBox *vboxdataselect; + Q3VBox *vboxparams; + Q3VBox *vboxexecute; + Q3HBox *hboxextra; + Q3HBox *hboxbatch; + QLabel *txt_slicenr; + QSpinBox *sb_slicenr; + QLabel *txt_batchstride; + QSpinBox *sb_batchstride; + QPushButton *pushexec; + QPushButton *pushstart; + QRadioButton *rb_tissue; + QRadioButton *rb_tissueall; + QRadioButton *rb_work; + QButtonGroup *sourcegroup; + QRadioButton *rb_inter; // QRadioButton *rb_intergrey; - QRadioButton* rb_extra; - QRadioButton* rb_batchinter; - QButtonGroup* modegroup; - QRadioButton* rb_4connectivity; - QRadioButton* rb_8connectivity; - QButtonGroup* connectivitygroup; - QCheckBox* cb_medianset; + QRadioButton *rb_extra; + QRadioButton *rb_batchinter; + QButtonGroup *modegroup; + QRadioButton *rb_4connectivity; + QRadioButton *rb_8connectivity; + QButtonGroup *connectivitygroup; + QCheckBox *cb_medianset; unsigned short startnr; unsigned short nrslices; unsigned short tissuenr; @@ -99,4 +96,3 @@ private slots: }; } // namespace iseg - diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 9acd8392..2e43b804 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -173,7 +173,7 @@ QString TruncateFileName(QString str) } bool read_grouptissues(const char *filename, vector &olds, - vector &news) + vector &news) { FILE *fp; if ((fp = fopen(filename, "r")) == NULL) @@ -195,8 +195,8 @@ bool read_grouptissues(const char *filename, vector &olds, } bool read_grouptissuescapped(const char *filename, vector &olds, - vector &news, - bool fail_on_unknown_tissue) + vector &news, + bool fail_on_unknown_tissue) { FILE *fp; if ((fp = fopen(filename, "r")) == NULL) @@ -359,9 +359,9 @@ bool MenuWTT::event(QEvent *e) } MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, - QDir picpath, QDir tmppath, bool editingmode, - QWidget *parent, const char *name, - Qt::WindowFlags wFlags, char **argv) + QDir picpath, QDir tmppath, bool editingmode, + QWidget *parent, const char *name, + Qt::WindowFlags wFlags, char **argv) : QMainWindow(parent, name, wFlags) { setObjectName("MainWindow"); @@ -593,7 +593,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, unsigned short slicenr = handler3D->get_activeslice() + 1; pb_first = new QPushButton("|<<", this); scb_slicenr = new QScrollBar(1, (int)handler3D->return_nrslices(), 1, 5, 1, - Qt::Horizontal, this); + Qt::Horizontal, this); scb_slicenr->setFixedWidth(500); scb_slicenr->setValue(int(slicenr)); pb_last = new QPushButton(">>|", this); @@ -614,14 +614,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, threshold_widget = new ThresholdWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(threshold_widget); hyst_widget = new HystereticGrowingWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(hyst_widget); lw_widget = new livewire_widget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(lw_widget); iftrg_widget = new ImageForestingTransformRegionGrowingWidget( handler3D, this, "new window", @@ -629,49 +629,49 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, tabwidgets.push_back(iftrg_widget); FMF_widget = new FastmarchingFuzzyWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(FMF_widget); wshed_widget = new WatershedWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(wshed_widget); OutlineCorrect_widget = new OutlineCorrectionWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(OutlineCorrect_widget); interpolwidget = new InterpolationWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(interpolwidget); smoothing_widget = new SmoothingWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(smoothing_widget); morph_widget = new MorphologyWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(morph_widget); edge_widg = new EdgeWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(edge_widg); feature_widget = new FeatureWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(feature_widget); measurement_widget = new MeasurementWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(measurement_widget); vesselextr_widget = new VesselWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(vesselextr_widget); pickerwidget = new PickerWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(pickerwidget); transfrmWidget = new TransformWidget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(transfrmWidget); boost::filesystem::path this_exe(argv[0]); @@ -752,21 +752,21 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, } scalewidget = new ScaleWork(handler3D, m_picpath, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); imagemathwidget = new ImageMath(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); imageoverlaywidget = new ImageOverlay(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); bitstack_widget = new bits_stack(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); overlay_widget = new extoverlay_widget(handler3D, this, "new window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); m_MultiDataset_widget = new MultiDataset_widget(handler3D, this, "multi dataset window", - Qt::WDestructiveClose | Qt::WResizeNoErase); + Qt::WDestructiveClose | Qt::WResizeNoErase); int height_max1 = height_max; // methodTab->setFixedHeight(height_max1); // bitstack_widget->setFixedHeight(height_max1); @@ -927,7 +927,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxslicew->setLayout(hboxslice); auto add_widget_filter = [this](QVBoxLayout *vbox, QPushButton *pb, - unsigned short i) { + unsigned short i) { #ifdef PLUGIN_VESSEL_WIDGET vbox->addWidget(pb); #else @@ -1180,11 +1180,11 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, reloadmenu->insertItem("Reopen .mhd...", this, SLOT(execute_reloadmhd())); reloadmenu->insertItem("Reopen .avw...", this, SLOT(execute_reloadavw())); reloadmenu->insertItem("Reopen .vti/.vtk...", this, - SLOT(execute_reloadvtk())); + SLOT(execute_reloadvtk())); reloadmenu->insertItem("Reopen NIfTI...", this, SLOT(execute_reloadnifti())); #ifndef NORTDOSESUPPORT reloadmenu->insertItem("Reopen RTdose...", this, - SLOT(execute_reloadrtdose())); + SLOT(execute_reloadrtdose())); #endif file->insertItem("&Reopen", reloadmenu); #ifndef NORTSTRUCTSUPPORT @@ -1194,7 +1194,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, openS4LLinkPos = file->actions().size(); QAction *importS4LLink = file->addAction("Import S4L link (h5)..."); connect(importS4LLink, SIGNAL(triggered()), this, - SLOT(execute_loads4llivelink())); + SLOT(execute_loads4llivelink())); importS4LLink->setToolTip("Loads a Sim4Life live link file (the h5 file, " "which is part of an iSEG project)."); importS4LLink->setEnabled(true); @@ -1203,7 +1203,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, importSurfacePos = file->actions().size(); QAction *importSurface = file->addAction("Import Surface..."); connect(importSurface, SIGNAL(triggered()), this, - SLOT(execute_loadsurface())); + SLOT(execute_loadsurface())); importSurface->setToolTip("Some data must be opened first to load the " "surface on top of the existing project."); importSurface->setEnabled(true); @@ -1211,7 +1211,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, importRTstructPos = file->actions().size(); QAction *importRTAction = file->addAction("Import RTstruct..."); connect(importRTAction, SIGNAL(triggered()), this, - SLOT(execute_loadrtstruct())); + SLOT(execute_loadrtstruct())); importRTAction->setToolTip( "Some data must be opened first to import its RTStruct file"); importRTAction->setEnabled(false); @@ -1220,22 +1220,22 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, file->insertItem("Export &Contour...", this, SLOT(execute_saveContours())); exportmenu = new Q3PopupMenu(this, "exportmenu"); exportmenu->insertItem("Export &Labelfield...(am)", this, - SLOT(execute_exportlabelfield())); + SLOT(execute_exportlabelfield())); exportmenu->insertItem("Export vtk-ascii...(vti/vtk)", this, - SLOT(execute_exportvtkascii())); + SLOT(execute_exportvtkascii())); exportmenu->insertItem("Export vtk-binary...(vti/vtk)", this, - SLOT(execute_exportvtkbinary())); + SLOT(execute_exportvtkbinary())); exportmenu->insertItem("Export vtk-compressed-ascii...(vti)", this, - SLOT(execute_exportvtkcompressedascii())); + SLOT(execute_exportvtkcompressedascii())); exportmenu->insertItem("Export vtk-compressed-binary...(vti)", this, - SLOT(execute_exportvtkcompressedbinary())); + SLOT(execute_exportvtkcompressedbinary())); exportmenu->insertItem("Export Matlab...(mat)", this, - SLOT(execute_exportmat())); + SLOT(execute_exportmat())); exportmenu->insertItem("Export hdf...(h5)", this, SLOT(execute_exporthdf())); exportmenu->insertItem("Export xml-extent index...(xml)", this, - SLOT(execute_exportxmlregionextent())); + SLOT(execute_exportxmlregionextent())); exportmenu->insertItem("Export tissue index...(txt)", this, - SLOT(execute_exporttissueindex())); + SLOT(execute_exporttissueindex())); file->insertItem("Export Tissue Distr.", exportmenu); file->insertSeparator(); @@ -1243,12 +1243,12 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, file->insertItem("Save &Project as...", this, SLOT(execute_saveprojas())); else file->insertItem("Save &Project-Copy as...", this, - SLOT(execute_savecopyas())); + SLOT(execute_savecopyas())); file->insertItem( QIcon(m_picpath.absFilePath(QString("filesave.png")).ascii()), "Save Pro&ject", this, SLOT(execute_saveproj()), QKeySequence("Ctrl+S")); file->insertItem("Save Active Slices...", this, - SLOT(execute_saveactiveslicesas())); + SLOT(execute_saveactiveslicesas())); if (!m_editingmode) file->insertItem( QIcon(m_picpath.absFilePath(QString("fileopen.png")).ascii()), @@ -1257,12 +1257,12 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, file->insertItem("Save &Tissuelist...", this, SLOT(execute_savetissues())); file->insertItem("Open T&issuelist...", this, SLOT(execute_loadtissues())); file->insertItem("Set Tissuelist as Default", this, - SLOT(execute_settissuesasdef())); + SLOT(execute_settissuesasdef())); file->insertItem("Remove Default Tissuelist", this, - SLOT(execute_removedeftissues())); + SLOT(execute_removedeftissues())); #ifndef NOSURFACEGENERATIONTOOLSUPPORT file->insertItem("Export Surface Generation Tool XML...", this, - SLOT(execute_exportsurfacegenerationtoolxml())); + SLOT(execute_exportsurfacegenerationtoolxml())); #endif file->insertSeparator(); if (!m_editingmode) @@ -1305,13 +1305,13 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, imagemenu->insertItem("&x Sliced", this, SLOT(execute_xslice())); imagemenu->insertItem("&y Sliced", this, SLOT(execute_yslice())); imagemenu->insertItem("3D surface view", this, - SLOT(execute_3Dsurfaceviewer())); + SLOT(execute_3Dsurfaceviewer())); imagemenu->insertItem("3D isosurface view", this, - SLOT(execute_3Dsurfaceviewerbmp())); + SLOT(execute_3Dsurfaceviewerbmp())); imagemenu->insertItem("3D volume view source", this, - SLOT(execute_3Dvolumeviewerbmp())); + SLOT(execute_3Dvolumeviewerbmp())); imagemenu->insertItem("3D volume view tissue", this, - SLOT(execute_3Dvolumeviewertissue())); + SLOT(execute_3Dvolumeviewertissue())); if (!m_editingmode) { //xxxa; @@ -1331,7 +1331,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, editmenu->insertSeparator(); editmenu->insertItem("&Configure Undo...", this, SLOT(execute_undoconf())); editmenu->insertItem("&Active Slices...", this, - SLOT(execute_activeslicesconf())); + SLOT(execute_activeslicesconf())); editmenu->setItemEnabled(undonr, false); editmenu->setItemEnabled(redonr, false); editmenu->insertItem("&Settings...", this, SLOT(execute_settings())); @@ -1354,25 +1354,25 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hidecontrastbright->setToggleAction(true); hidecontrastbright->setOn(true); connect(hidecontrastbright, SIGNAL(toggled(bool)), this, - SLOT(execute_hidecontrastbright(bool))); + SLOT(execute_hidecontrastbright(bool))); hidecontrastbright->addTo(hidemenu); hidesource = new Q3Action("Source", 0, this); hidesource->setToggleAction(true); hidesource->setOn(true); connect(hidesource, SIGNAL(toggled(bool)), this, - SLOT(execute_hidesource(bool))); + SLOT(execute_hidesource(bool))); hidesource->addTo(hidemenu); hidetarget = new Q3Action("Target", 0, this); hidetarget->setToggleAction(true); hidetarget->setOn(true); connect(hidetarget, SIGNAL(toggled(bool)), this, - SLOT(execute_hidetarget(bool))); + SLOT(execute_hidetarget(bool))); hidetarget->addTo(hidemenu); hidecopyswap = new Q3Action("Copy/Swap", 0, this); hidecopyswap->setToggleAction(true); hidecopyswap->setOn(true); connect(hidecopyswap, SIGNAL(toggled(bool)), this, - SLOT(execute_hidecopyswap(bool))); + SLOT(execute_hidecopyswap(bool))); hidecopyswap->addTo(hidemenu); for (unsigned short i = 0; i < nrtabbuttons; i++) { @@ -1381,14 +1381,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, showtab_action[i]->setToggleAction(true); showtab_action[i]->setOn(showpb_tab[i]); connect(showtab_action[i], SIGNAL(toggled(bool)), this, - SLOT(execute_showtabtoggled(bool))); + SLOT(execute_showtabtoggled(bool))); showtab_action[i]->addTo(hidesubmenu); } hideparameters = new Q3Action("Simplified", 0, this); hideparameters->setToggleAction(true); hideparameters->setOn(WidgetInterface::get_hideparams()); connect(hideparameters, SIGNAL(toggled(bool)), this, - SLOT(execute_hideparameters(bool))); + SLOT(execute_hideparameters(bool))); hidesubmenu->insertSeparator(); hideparameters->addTo(hidesubmenu); viewmenu->insertItem("&Toolbars", hidemenu); @@ -1397,21 +1397,21 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, toolmenu = menuBar()->addMenu(tr("T&ools")); toolmenu->insertItem("&Group Tissues...", this, SLOT(execute_grouptissues())); toolmenu->insertItem("Remove Tissues...", this, - SLOT(execute_removetissues())); + SLOT(execute_removetissues())); toolmenu->insertItem("Target->Tissue", this, SLOT(do_work2tissue())); toolmenu->insertItem("Target->Tissue grouped...", this, - SLOT(do_work2tissue_grouped())); + SLOT(do_work2tissue_grouped())); toolmenu->insertItem("Tissue->Target", this, SLOT(do_tissue2work())); toolmenu->insertItem("In&verse Slice Order", this, - SLOT(execute_inversesliceorder())); + SLOT(execute_inversesliceorder())); toolmenu->insertItem("Clean Up", this, SLOT(execute_cleanup())); toolmenu->insertItem("Smooth Steps", this, SLOT(execute_smoothsteps())); // toolmenu->insertItem( "Smooth Tissues", this, SLOT(execute_smoothtissues())); if (!m_editingmode) toolmenu->insertItem("Merge Projects...", this, - SLOT(execute_mergeprojects())); + SLOT(execute_mergeprojects())); toolmenu->insertItem("Check Bone Connectivity", this, - SLOT(execute_boneconnectivity())); + SLOT(execute_boneconnectivity())); atlasmenu = menuBar()->addMenu(tr("Atlas")); // todo: make atlas method generic, i.e. for loop @@ -1487,340 +1487,340 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(execute_about())); QObject::connect(toworkBtn, SIGNAL(clicked()), this, - SLOT(execute_bmp2work())); + SLOT(execute_bmp2work())); QObject::connect(tobmpBtn, SIGNAL(clicked()), this, SLOT(execute_work2bmp())); QObject::connect(swapBtn, SIGNAL(clicked()), this, - SLOT(execute_swap_bmpwork())); + SLOT(execute_swap_bmpwork())); QObject::connect(swapAllBtn, SIGNAL(clicked()), this, - SLOT(execute_swap_bmpworkall())); + SLOT(execute_swap_bmpworkall())); QObject::connect(this, SIGNAL(bmp_changed()), this, SLOT(update_bmp())); QObject::connect(this, SIGNAL(work_changed()), this, SLOT(update_work())); QObject::connect(this, SIGNAL(work_changed()), bmp_show, - SLOT(workborder_changed())); + SLOT(workborder_changed())); QObject::connect(this, SIGNAL(marks_changed()), bmp_show, - SLOT(mark_changed())); + SLOT(mark_changed())); QObject::connect(this, SIGNAL(marks_changed()), work_show, - SLOT(mark_changed())); + SLOT(mark_changed())); QObject::connect(this, SIGNAL(tissues_changed()), this, - SLOT(update_tissue())); + SLOT(update_tissue())); QObject::connect(bmp_show, SIGNAL(addmark_sign(Point)), this, - SLOT(add_mark(Point))); + SLOT(add_mark(Point))); QObject::connect(bmp_show, SIGNAL(addlabel_sign(Point, std::string)), this, - SLOT(add_label(Point, std::string))); + SLOT(add_label(Point, std::string))); QObject::connect(bmp_show, SIGNAL(clearmarks_sign()), this, - SLOT(clear_marks())); + SLOT(clear_marks())); QObject::connect(bmp_show, SIGNAL(removemark_sign(Point)), this, - SLOT(remove_mark(Point))); + SLOT(remove_mark(Point))); QObject::connect(bmp_show, SIGNAL(addtissue_sign(Point)), this, - SLOT(add_tissue(Point))); + SLOT(add_tissue(Point))); QObject::connect(bmp_show, SIGNAL(addtissueconnected_sign(Point)), this, - SLOT(add_tissue_connected(Point))); + SLOT(add_tissue_connected(Point))); QObject::connect(bmp_show, SIGNAL(subtissue_sign(Point)), this, - SLOT(subtract_tissue(Point))); + SLOT(subtract_tissue(Point))); QObject::connect(bmp_show, SIGNAL(addtissue3D_sign(Point)), this, - SLOT(add_tissue_3D(Point))); + SLOT(add_tissue_3D(Point))); QObject::connect(bmp_show, SIGNAL(addtissuelarger_sign(Point)), this, - SLOT(add_tissuelarger(Point))); + SLOT(add_tissuelarger(Point))); QObject::connect(bmp_show, SIGNAL(selecttissue_sign(Point)), this, - SLOT(select_tissue(Point))); + SLOT(select_tissue(Point))); QObject::connect(work_show, SIGNAL(addmark_sign(Point)), this, - SLOT(add_mark(Point))); + SLOT(add_mark(Point))); QObject::connect(work_show, SIGNAL(addlabel_sign(Point, std::string)), this, - SLOT(add_label(Point, std::string))); + SLOT(add_label(Point, std::string))); QObject::connect(work_show, SIGNAL(clearmarks_sign()), this, - SLOT(clear_marks())); + SLOT(clear_marks())); QObject::connect(work_show, SIGNAL(removemark_sign(Point)), this, - SLOT(remove_mark(Point))); + SLOT(remove_mark(Point))); QObject::connect(work_show, SIGNAL(addtissue_sign(Point)), this, - SLOT(add_tissue(Point))); + SLOT(add_tissue(Point))); QObject::connect(work_show, SIGNAL(addtissueconnected_sign(Point)), this, - SLOT(add_tissue_connected(Point))); + SLOT(add_tissue_connected(Point))); QObject::connect(work_show, SIGNAL(subtissue_sign(Point)), this, - SLOT(subtract_tissue(Point))); + SLOT(subtract_tissue(Point))); QObject::connect(work_show, SIGNAL(addtissue3D_sign(Point)), this, - SLOT(add_tissue_3D(Point))); + SLOT(add_tissue_3D(Point))); QObject::connect(work_show, SIGNAL(addtissuelarger_sign(Point)), this, - SLOT(add_tissuelarger(Point))); + SLOT(add_tissuelarger(Point))); QObject::connect(work_show, SIGNAL(selecttissue_sign(Point)), this, - SLOT(select_tissue(Point))); + SLOT(select_tissue(Point))); QObject::connect(tissueFilter, SIGNAL(textChanged(const QString &)), this, - SLOT(tissueFilterChanged(const QString &))); + SLOT(tissueFilterChanged(const QString &))); QObject::connect(lockTissues, SIGNAL(clicked()), this, - SLOT(lockAllTissues())); + SLOT(lockAllTissues())); QObject::connect(addTissue, SIGNAL(clicked()), this, - SLOT(newTissuePressed())); + SLOT(newTissuePressed())); QObject::connect(addFolder, SIGNAL(clicked()), this, - SLOT(newFolderPressed())); + SLOT(newFolderPressed())); QObject::connect(modifyTissueFolder, SIGNAL(clicked()), this, - SLOT(modifTissueFolderPressed())); + SLOT(modifTissueFolderPressed())); QObject::connect(removeTissueFolder, SIGNAL(clicked()), this, - SLOT(removeTissueFolderPressed())); + SLOT(removeTissueFolderPressed())); QObject::connect(removeTissueFolderAll, SIGNAL(clicked()), this, - SLOT(removeTissueFolderAllPressed())); + SLOT(removeTissueFolderAllPressed())); QObject::connect(getTissue, SIGNAL(clicked()), this, - SLOT(selectedtissue2work())); + SLOT(selectedtissue2work())); QObject::connect(getTissueAll, SIGNAL(clicked()), this, - SLOT(tissue2workall())); + SLOT(tissue2workall())); QObject::connect(clearTissue, SIGNAL(clicked()), this, SLOT(clearselected())); QObject::connect(clearTissues, SIGNAL(clicked()), this, SLOT(cleartissues())); QObject::connect(methodTab, SIGNAL(aboutToShow(QWidget *)), this, - SLOT(tab_changed(QWidget *))); + SLOT(tab_changed(QWidget *))); tissueTreeWidget->setSelectionMode( QAbstractItemView::SelectionMode::ExtendedSelection); QObject::connect(tissueTreeWidget, SIGNAL(itemSelectionChanged()), this, - SLOT(tissue_selection_changed())); + SLOT(tissue_selection_changed())); QObject::connect(tissueTreeWidget, - SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, - SLOT(tree_widget_doubleclicked(QTreeWidgetItem *, int))); + SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, + SLOT(tree_widget_doubleclicked(QTreeWidgetItem *, int))); QObject::connect(tissueTreeWidget, - SIGNAL(customContextMenuRequested(const QPoint &)), this, - SLOT(tree_widget_contextmenu(const QPoint &))); + SIGNAL(customContextMenuRequested(const QPoint &)), this, + SLOT(tree_widget_contextmenu(const QPoint &))); tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); bmp_show->color_changed(currTissueType - 1); work_show->color_changed(currTissueType - 1); QObject::connect(cb_bmptissuevisible, SIGNAL(clicked()), this, - SLOT(bmptissuevisible_changed())); + SLOT(bmptissuevisible_changed())); QObject::connect(cb_bmpcrosshairvisible, SIGNAL(clicked()), this, - SLOT(bmpcrosshairvisible_changed())); + SLOT(bmpcrosshairvisible_changed())); QObject::connect(cb_bmpoutlinevisible, SIGNAL(clicked()), this, - SLOT(bmpoutlinevisible_changed())); + SLOT(bmpoutlinevisible_changed())); QObject::connect(cb_worktissuevisible, SIGNAL(clicked()), this, - SLOT(worktissuevisible_changed())); + SLOT(worktissuevisible_changed())); QObject::connect(cb_workcrosshairvisible, SIGNAL(clicked()), this, - SLOT(workcrosshairvisible_changed())); + SLOT(workcrosshairvisible_changed())); QObject::connect(cb_workpicturevisible, SIGNAL(clicked()), this, - SLOT(workpicturevisible_changed())); + SLOT(workpicturevisible_changed())); QObject::connect(pb_first, SIGNAL(clicked()), this, SLOT(pb_first_pressed())); QObject::connect(pb_last, SIGNAL(clicked()), this, SLOT(pb_last_pressed())); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::connect(le_slicethick, SIGNAL(textChanged(const QString &)), this, - SLOT(slicethickness_changed())); + SLOT(slicethickness_changed())); QObject::connect(pb_add, SIGNAL(clicked()), this, SLOT(add_tissue_pushed())); QObject::connect(pb_sub, SIGNAL(clicked()), this, - SLOT(subtract_tissue_pushed())); + SLOT(subtract_tissue_pushed())); QObject::connect(pb_addhold, SIGNAL(clicked()), this, - SLOT(addhold_tissue_pushed())); + SLOT(addhold_tissue_pushed())); QObject::connect(pb_subhold, SIGNAL(clicked()), this, - SLOT(subtracthold_tissue_pushed())); + SLOT(subtracthold_tissue_pushed())); QObject::connect(bmp_scroller, SIGNAL(contentsMoving(int, int)), this, - SLOT(setWorkContentsPos(int, int))); + SLOT(setWorkContentsPos(int, int))); QObject::connect(work_scroller, SIGNAL(contentsMoving(int, int)), this, - SLOT(setBmpContentsPos(int, int))); + SLOT(setBmpContentsPos(int, int))); QObject::connect(bmp_show, SIGNAL(setcenter_sign(int, int)), bmp_scroller, - SLOT(center(int, int))); + SLOT(center(int, int))); QObject::connect(work_show, SIGNAL(setcenter_sign(int, int)), work_scroller, - SLOT(center(int, int))); + SLOT(center(int, int))); tomove_scroller = true; QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), bmp_show, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), work_show, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::connect( this, SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); QObject::connect(this, SIGNAL(end_dataexport(QWidget *)), this, - SLOT(handle_end_dataexport(QWidget *))); + SLOT(handle_end_dataexport(QWidget *))); QObject::connect( this, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(this, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( threshold_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(threshold_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( OutlineCorrect_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(OutlineCorrect_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(OutlineCorrect_widget, - SIGNAL(signal_request_selected_tissue_TS()), this, - SLOT(provide_selected_tissue_TS())); + SIGNAL(signal_request_selected_tissue_TS()), this, + SLOT(provide_selected_tissue_TS())); QObject::connect(OutlineCorrect_widget, - SIGNAL(signal_request_selected_tissue_BG()), this, - SLOT(provide_selected_tissue_BG())); + SIGNAL(signal_request_selected_tissue_BG()), this, + SLOT(provide_selected_tissue_BG())); QObject::connect( smoothing_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(smoothing_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( edge_widg, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(edge_widg, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( morph_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(morph_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( wshed_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(wshed_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( lw_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(lw_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( iftrg_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(iftrg_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( FMF_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(FMF_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( interpolwidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(interpolwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( scalewidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(scalewidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( imagemathwidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(imagemathwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( imageoverlaywidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(imageoverlaywidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( bitstack_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(bitstack_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( bitstack_widget, SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); QObject::connect(bitstack_widget, SIGNAL(end_dataexport(QWidget *)), this, - SLOT(handle_end_dataexport(QWidget *))); + SLOT(handle_end_dataexport(QWidget *))); QObject::connect( hyst_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(hyst_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( pickerwidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(pickerwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect( transfrmWidget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(transfrmWidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), bmp_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), work_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(overlay_widget, SIGNAL(overlayalpha_changed(float)), - bmp_show, SLOT(set_overlayalpha(float))); + bmp_show, SLOT(set_overlayalpha(float))); QObject::connect(overlay_widget, SIGNAL(overlayalpha_changed(float)), - work_show, SLOT(set_overlayalpha(float))); + work_show, SLOT(set_overlayalpha(float))); QObject::connect(overlay_widget, SIGNAL(bmpoverlayvisible_changed(bool)), - bmp_show, SLOT(set_overlayvisible(bool))); + bmp_show, SLOT(set_overlayvisible(bool))); QObject::connect(overlay_widget, SIGNAL(workoverlayvisible_changed(bool)), - work_show, SLOT(set_overlayvisible(bool))); + work_show, SLOT(set_overlayvisible(bool))); QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), bmp_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), work_show, - SLOT(overlay_changed())); + SLOT(overlay_changed())); QObject::connect(m_MultiDataset_widget, SIGNAL(dataset_changed()), this, - SLOT(DatasetChanged())); + SLOT(DatasetChanged())); QObject::connect( m_MultiDataset_widget, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(m_MultiDataset_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); QObject::connect(cb_tissuelock, SIGNAL(clicked()), this, - SLOT(tissuelock_toggled())); + SLOT(tissuelock_toggled())); QObject::connect(sl_contrastbmp, SIGNAL(valueChanged(int)), this, - SLOT(sl_contrastbmp_moved(int))); + SLOT(sl_contrastbmp_moved(int))); QObject::connect(sl_contrastwork, SIGNAL(valueChanged(int)), this, - SLOT(sl_contrastwork_moved(int))); + SLOT(sl_contrastwork_moved(int))); QObject::connect(sl_brightnessbmp, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightnessbmp_moved(int))); + SLOT(sl_brightnessbmp_moved(int))); QObject::connect(sl_brightnesswork, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightnesswork_moved(int))); + SLOT(sl_brightnesswork_moved(int))); QObject::connect(le_contrastbmp_val, SIGNAL(editingFinished()), this, - SLOT(le_contrastbmp_val_edited())); + SLOT(le_contrastbmp_val_edited())); QObject::connect(le_contrastwork_val, SIGNAL(editingFinished()), this, - SLOT(le_contrastwork_val_edited())); + SLOT(le_contrastwork_val_edited())); QObject::connect(le_brightnessbmp_val, SIGNAL(editingFinished()), this, - SLOT(le_brightnessbmp_val_edited())); + SLOT(le_brightnessbmp_val_edited())); QObject::connect(le_brightnesswork_val, SIGNAL(editingFinished()), this, - SLOT(le_brightnesswork_val_edited())); + SLOT(le_brightnesswork_val_edited())); // \todo BL add generic connections here, e.g. begin/end_datachange @@ -1828,21 +1828,21 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, for (int i = 0; i < nrtabbuttons; ++i) { QObject::connect(pb_tab[i], SIGNAL(clicked()), m_widget_signal_mapper, - SLOT(map())); + SLOT(map())); m_widget_signal_mapper->setMapping(pb_tab[i], i); QObject::connect(m_widget_signal_mapper, SIGNAL(mapped(int)), this, - SLOT(pb_tab_pressed(int))); + SLOT(pb_tab_pressed(int))); } QObject::connect(bmp_show, SIGNAL(wheelrotatedctrl_sign(int)), this, - SLOT(wheelrotated(int))); + SLOT(wheelrotated(int))); QObject::connect(work_show, SIGNAL(wheelrotatedctrl_sign(int)), this, - SLOT(wheelrotated(int))); + SLOT(wheelrotated(int))); QObject::connect(bmp_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(QPoint))); QObject::connect(work_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(QPoint))); // QObject::connect(pb_work2tissue,SIGNAL(clicked()),this,SLOT(do_work2tissue())); @@ -1880,13 +1880,13 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(subtract_tissue_shortkey())); m_acc_undo = new Q3Accel(this); m_acc_undo->connectItem(m_acc_undo->insertItem(QKeySequence(Qt::Key_Escape)), - this, SLOT(execute_undo())); + this, SLOT(execute_undo())); m_acc_undo2 = new Q3Accel(this); m_acc_undo2->connectItem(m_acc_undo2->insertItem(QKeySequence("Ctrl+Z")), - this, SLOT(execute_undo())); + this, SLOT(execute_undo())); m_acc_redo = new Q3Accel(this); m_acc_redo->connectItem(m_acc_redo->insertItem(QKeySequence("Ctrl+Y")), this, - SLOT(execute_redo())); + SLOT(execute_redo())); // setCentralWidget(hbox); // vbox->insertChild(hbox2); @@ -1913,62 +1913,62 @@ void MainWindow::closeEvent(QCloseEvent *qce) { xsliceshower->close(); QObject::disconnect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); + SLOT(xshower_slicechanged())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::disconnect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); delete xsliceshower; } if (ysliceshower != NULL) { ysliceshower->close(); QObject::disconnect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); + SLOT(yshower_slicechanged())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::disconnect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); delete ysliceshower; } if (SV3D != NULL) { SV3D->close(); QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3D_closed())); + SLOT(SV3D_closed())); delete SV3D; } if (SV3Dbmp != NULL) { SV3Dbmp->close(); QObject::disconnect(SV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); delete SV3Dbmp; } if (VV3D != NULL) { VV3D->close(); QObject::disconnect(VV3D, SIGNAL(hasbeenclosed()), this, - SLOT(VV3D_closed())); + SLOT(VV3D_closed())); delete VV3D; } if (VV3Dbmp != NULL) { VV3Dbmp->close(); QObject::disconnect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); delete VV3Dbmp; } @@ -2023,10 +2023,10 @@ void MainWindow::provide_selected_tissue_BG() if (TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type())) { QMessageBox::warning(this, "iSeg", - "Error: Unable to get " + - tissueTreeWidget->get_current_name() + - " because it is locked.\nPlease, unlock it.", - QMessageBox::Ok | QMessageBox::Default); + "Error: Unable to get " + + tissueTreeWidget->get_current_name() + + " because it is locked.\nPlease, unlock it.", + QMessageBox::Ok | QMessageBox::Default); return; } @@ -2039,10 +2039,10 @@ void MainWindow::provide_selected_tissue_TS() if (TissueInfos::GetTissueLocked(tissueTreeWidget->get_current_type())) { QMessageBox::warning(this, "iSeg", - "Error: Unable to get " + - tissueTreeWidget->get_current_name() + - " because it is locked.\nPlease, unlock it.", - QMessageBox::Ok | QMessageBox::Default); + "Error: Unable to get " + + tissueTreeWidget->get_current_name() + + " because it is locked.\nPlease, unlock it.", + QMessageBox::Ok | QMessageBox::Default); return; } @@ -2376,7 +2376,7 @@ void MainWindow::execute_resize(int resizetype) emit begin_datachange(dataSelection, this, false); ResizeDialog RD(handler3D, static_cast(resizetype), - this); + this); RD.move(QCursor::pos()); if (!RD.exec()) { @@ -2395,22 +2395,22 @@ void MainWindow::execute_resize(int resizetype) bool ok = true; str1 = QDir::temp().absFilePath(QString("bmp_float.raw")); if (handler3D->SaveRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, dzp, - false) != 0) + false) != 0) ok = false; str1 = QDir::temp().absFilePath(QString("work_float.raw")); if (handler3D->SaveRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, dzp, - true) != 0) + true) != 0) ok = false; str1 = QDir::temp().absFilePath(QString("tissues.raw")); if (handler3D->SaveTissuesRaw_resized(str1.ascii(), dxm, dxp, dym, dyp, dzm, - dzp) != 0) + dzp) != 0) ok = false; if (ok) { str1 = QDir::temp().absFilePath(QString("work_float.raw")); if (handler3D->ReadRawFloat(str1.ascii(), w + dxm + dxp, h + dym + dyp, 0, - nrslices + dzm + dzp) != 1) + nrslices + dzm + dzp) != 1) ok = false; } if (ok) @@ -2423,7 +2423,7 @@ void MainWindow::execute_resize(int resizetype) { str1 = QDir::temp().absFilePath(QString("tissues.raw")); if (handler3D->ReloadRawTissues(str1.ascii(), sizeof(tissues_size_t) * 8, - 0) != 1) + 0) != 1) ok = false; } @@ -2629,8 +2629,8 @@ void MainWindow::execute_loadbmp() QStringList files = Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2700,8 +2700,8 @@ void MainWindow::execute_loadpng() QStringList files = Q3FileDialog::getOpenFileNames("Images (*.png)\n" "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2751,8 +2751,8 @@ void MainWindow::execute_loadjpg() QStringList files = Q3FileDialog::getOpenFileNames("Images (*.jpg)\n" "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2819,8 +2819,8 @@ void MainWindow::execute_loaddicom() QStringList files = Q3FileDialog::getOpenFileNames("Images (*.dcm *.dicom)\n" "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!files.empty()) { @@ -2933,9 +2933,9 @@ void MainWindow::execute_loadmhd() QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "Metaheader (*.mhd *.mha)\n" - "All(*.*)", - this); + "Metaheader (*.mhd *.mha)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadImage(loadfilename.ascii()); @@ -2963,9 +2963,9 @@ void MainWindow::execute_loadvtk() bool res = true; QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "VTK (*.vti *.vtk)\n" - "All(*.*)", - this); + "VTK (*.vti *.vtk)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { res = handler3D->ReadImage(loadfilename.ascii()); @@ -2982,8 +2982,8 @@ void MainWindow::execute_loadvtk() if (!res) { QMessageBox::warning(this, "iSeg", - "Error: Could not load file\n" + loadfilename + "\n", - QMessageBox::Ok | QMessageBox::Default); + "Error: Could not load file\n" + loadfilename + "\n", + QMessageBox::Ok | QMessageBox::Default); } } @@ -3000,9 +3000,9 @@ void MainWindow::execute_loadnifti() QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" - "All(*.*)", - this); + "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadImage(loadfilename.ascii()); @@ -3029,9 +3029,9 @@ void MainWindow::execute_loadavw() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "AnalzyeAVW (*.avw)\n" - "All(*.*)", - this); + "AnalzyeAVW (*.avw)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadAvw(loadfilename.ascii()); @@ -3051,8 +3051,8 @@ void MainWindow::execute_reloadbmp() QStringList files = Q3FileDialog::getOpenFileNames("Images (*.bmp)\n" "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + QString::null, this, "open files dialog", + "Select one or more files to open"); if ((unsigned short)files.size() == handler3D->return_nrslices() || (unsigned short)files.size() == @@ -3157,9 +3157,9 @@ void MainWindow::execute_reloadavw() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "AnalzyeAVW (*.avw)\n" - "All(*.*)", - this); + "AnalzyeAVW (*.avw)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadAVW(loadfilename.ascii(), handler3D->return_startslice()); @@ -3181,13 +3181,13 @@ void MainWindow::execute_reloadmhd() QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "Metaheader (*.mhd *.mha)\n" - "All(*.*)", - this); + "Metaheader (*.mhd *.mha)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage(loadfilename.ascii(), - handler3D->return_startslice()); + handler3D->return_startslice()); reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3205,13 +3205,13 @@ void MainWindow::execute_reloadvtk() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "VTK (*.vti *.vtk)\n" - "All(*.*)", - this); + "VTK (*.vti *.vtk)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage(loadfilename.ascii(), - handler3D->return_startslice()); + handler3D->return_startslice()); reset_brightnesscontrast(); } emit end_datachange(this, iseg::ClearUndo); @@ -3230,9 +3230,9 @@ void MainWindow::execute_reloadnifti() QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" - "All(*.*)", - this); + "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadImage( @@ -3251,9 +3251,9 @@ void MainWindow::execute_loadsurface() bool ok = true; QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "STL (*.stl)\n" - "All(*.*)", - this); + "STL (*.stl)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { QMessageBox msgBox; @@ -3275,8 +3275,8 @@ void MainWindow::execute_loadsurface() if (!ok) { QMessageBox::warning(this, "iSeg", - "Error: Surface does not overlap with image", - QMessageBox::Ok | QMessageBox::Default); + "Error: Surface does not overlap with image", + QMessageBox::Ok | QMessageBox::Default); } } @@ -3284,9 +3284,9 @@ void MainWindow::execute_loadrtstruct() { #ifndef NORTSTRUCTSUPPORT QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTstruct (*.dcm)\n" - "All(*.*)", - this); //, filename); + "RTstruct (*.dcm)\n" + "All(*.*)", + this); //, filename); if (loadfilename.isEmpty()) { @@ -3300,8 +3300,8 @@ void MainWindow::execute_loadrtstruct() this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(&RI, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); RI.move(QCursor::pos()); RI.exec(); @@ -3335,9 +3335,9 @@ void MainWindow::execute_loadrtdose() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTdose (*.dcm)\n" - "All(*.*)", - this); + "RTdose (*.dcm)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReadRTdose(loadfilename.ascii()); @@ -3364,9 +3364,9 @@ void MainWindow::execute_reloadrtdose() emit begin_datachange(dataSelection, this, false); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "RTdose (*.dcm)\n" - "All(*.*)", - this); + "RTdose (*.dcm)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { handler3D->ReloadRTdose( @@ -3383,9 +3383,9 @@ void MainWindow::execute_reloadrtdose() void MainWindow::execute_loads4llivelink() { QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "S4L Link (*.h5)\n" - "All(*.*)", - this); + "S4L Link (*.h5)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { loadS4Llink(loadfilename); @@ -3474,7 +3474,7 @@ void MainWindow::execute_saveprojas() int numTasks = 3; QProgressDialog progress("Save in progress...", "Cancel", 0, numTasks, - this); + this); progress.show(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); progress.setWindowModality(Qt::WindowModal); @@ -3523,17 +3523,17 @@ void MainWindow::execute_saveprojas() if (QFile::exists(sourceFileNameWithoutExtension + ".xmf")) QFile::remove(sourceFileNameWithoutExtension + ".xmf"); QFile::rename(tempFileNameWithoutExtension + ".xmf", - sourceFileNameWithoutExtension + ".xmf"); + sourceFileNameWithoutExtension + ".xmf"); if (QFile::exists(sourceFileNameWithoutExtension + ".prj")) QFile::remove(sourceFileNameWithoutExtension + ".prj"); QFile::rename(tempFileNameWithoutExtension + ".prj", - sourceFileNameWithoutExtension + ".prj"); + sourceFileNameWithoutExtension + ".prj"); if (QFile::exists(sourceFileNameWithoutExtension + ".h5")) QFile::remove(sourceFileNameWithoutExtension + ".h5"); QFile::rename(tempFileNameWithoutExtension + ".h5", - sourceFileNameWithoutExtension + ".h5"); + sourceFileNameWithoutExtension + ".h5"); progress.setValue(numTasks); } @@ -3649,9 +3649,9 @@ void MainWindow::SaveSettings() settings.setValue("geometry", saveGeometry()); settings.setValue("state", saveState()); settings.setValue("NumberOfUndoSteps", - this->handler3D->GetNumberOfUndoSteps()); + this->handler3D->GetNumberOfUndoSteps()); settings.setValue("NumberOfUndoArrays", - this->handler3D->GetNumberOfUndoArrays()); + this->handler3D->GetNumberOfUndoArrays()); settings.setValue("Compression", this->handler3D->GetCompression()); settings.setValue("ContiguousMemory", this->handler3D->GetContiguousMemory()); settings.endGroup(); @@ -3675,7 +3675,7 @@ void MainWindow::LoadSettings(const char *loadfilename) } int loadProjVersion, tissuesVersion; iseg::ExtractTissuesVersion((int)combinedVersion, loadProjVersion, - tissuesVersion); + tissuesVersion); iseg::DataSelection dataSelection; dataSelection.allSlices = true; @@ -3773,7 +3773,7 @@ void MainWindow::LoadSettings(const char *loadfilename) { cerr << "LoadSettings() : restoring values..." << endl; QSettings settings(QSettings::IniFormat, QSettings::UserScope, "ZMT", - "iSeg"); + "iSeg"); settings.beginGroup("MainWindow"); restoreGeometry(settings.value("geometry").toByteArray()); restoreState(settings.value("state").toByteArray()); @@ -3895,7 +3895,7 @@ void MainWindow::execute_saveproj() int numTasks = 3; QProgressDialog progress("Save in progress...", "Cancel", 0, numTasks, - this); + this); progress.show(); QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); progress.setWindowModality(Qt::WindowModal); @@ -3964,7 +3964,7 @@ void MainWindow::execute_saveproj() } } QFile::rename(tempFileNameWithoutExtension + ".xmf", - sourceFileNameWithoutExtension + ".xmf"); + sourceFileNameWithoutExtension + ".xmf"); if (QFile::exists(sourceFileNameWithoutExtension + ".prj")) { @@ -3981,7 +3981,7 @@ void MainWindow::execute_saveproj() } } QFile::rename(tempFileNameWithoutExtension + ".prj", - sourceFileNameWithoutExtension + ".prj"); + sourceFileNameWithoutExtension + ".prj"); if (QFile::exists(sourceFileNameWithoutExtension + ".h5")) { @@ -3997,7 +3997,7 @@ void MainWindow::execute_saveproj() } } QFile::rename(tempFileNameWithoutExtension + ".h5", - sourceFileNameWithoutExtension + ".h5"); + sourceFileNameWithoutExtension + ".h5"); m_saveprojfilename = sourceFileNameWithoutExtension + ".prj"; @@ -4066,7 +4066,7 @@ void MainWindow::loadproj(const QString &loadfilename) { int loadProjVersion, tissuesVersion; iseg::ExtractTissuesVersion((int)combinedVersion, loadProjVersion, - tissuesVersion); + tissuesVersion); /*for(size_t i=0;iLoadParams(fp,version); }*/ @@ -4171,7 +4171,7 @@ void MainWindow::execute_mergeprojects() // Get save file name QString savefilename = Q3FileDialog::getSaveFileName(QString::null, "Projects (*.prj)", this, - "iSeg", "Save merged project as"); + "iSeg", "Save merged project as"); if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); @@ -4181,10 +4181,10 @@ void MainWindow::execute_mergeprojects() if (!fp) { QMessageBox::warning(this, "iSeg", - "Merge projects failed.\n\nPlease make sure that " - "all projects have the same xy extents\nand their " - "image data is contained in a .h5 and .xmf file.", - QMessageBox::Ok | QMessageBox::Default); + "Merge projects failed.\n\nPlease make sure that " + "all projects have the same xy extents\nand their " + "image data is contained in a .h5 and .xmf file.", + QMessageBox::Ok | QMessageBox::Default); return; } fp = bitstack_widget->save_proj(fp); @@ -4219,9 +4219,9 @@ void MainWindow::execute_mergeprojects() // Load merged project if (QMessageBox::question(this, "iSeg", - "Would you like to load the merged project?", - QMessageBox::Yes | QMessageBox::Default, - QMessageBox::No) == QMessageBox::Yes) + "Would you like to load the merged project?", + QMessageBox::Yes | QMessageBox::Default, + QMessageBox::No) == QMessageBox::Yes) { loadproj(savefilename); } @@ -4234,7 +4234,7 @@ void MainWindow::execute_boneconnectivity() boneConnectivityDialog = new CheckBoneConnectivityDialog( handler3D, "Bone Connectivity", this, Qt::Window); QObject::connect(boneConnectivityDialog, SIGNAL(slice_changed()), this, - SLOT(update_slice())); + SLOT(update_slice())); boneConnectivityDialog->show(); boneConnectivityDialog->raise(); @@ -4249,9 +4249,9 @@ void MainWindow::execute_loadproj() maybeSafe(); QString loadfilename = Q3FileDialog::getOpenFileName(QString::null, - "Projects (*.prj)\n" - "All(*.*)", - this); //, filename); + "Projects (*.prj)\n" + "All(*.*)", + this); //, filename); if (!loadfilename.isEmpty()) { @@ -4555,7 +4555,7 @@ void MainWindow::execute_exportvtkascii() QString::null, "VTK Ascii (*.vti *.vtk)", this); //, filename); if (savefilename.length() > 4 && !(savefilename.endsWith(QString(".vti")) || - savefilename.endsWith(QString(".vtk")))) + savefilename.endsWith(QString(".vtk")))) savefilename.append(".vti"); if (!savefilename.isEmpty()) @@ -4576,7 +4576,7 @@ void MainWindow::execute_exportvtkbinary() QString::null, "VTK bin (*.vti *.vtk)", this); //, filename); if (savefilename.length() > 4 && !(savefilename.endsWith(QString(".vti")) || - savefilename.endsWith(QString(".vtk")))) + savefilename.endsWith(QString(".vtk")))) savefilename.append(".vti"); if (!savefilename.isEmpty()) @@ -4650,7 +4650,7 @@ void MainWindow::execute_exportxmlregionextent() handler3D->print_xmlregionextent(savefilename.ascii(), true); else handler3D->print_xmlregionextent(savefilename.ascii(), true, - relfilename.ascii()); + relfilename.ascii()); } emit end_dataexport(this); @@ -4678,7 +4678,7 @@ void MainWindow::execute_exporttissueindex() handler3D->print_tissueindex(savefilename.ascii(), true); else handler3D->print_tissueindex(savefilename.ascii(), true, - relfilename.ascii()); + relfilename.ascii()); } emit end_dataexport(this); @@ -4707,7 +4707,7 @@ void MainWindow::execute_loadtissues() if (msgBox.clickedButton() == appendButton) { TissueInfos::LoadTissuesReadable(loadfilename.ascii(), handler3D, - removeTissuesRange); + removeTissuesRange); int nr = tissueTreeWidget->get_current_type() - 1; tissueTreeWidget->update_tree_widget(); @@ -4720,7 +4720,7 @@ void MainWindow::execute_loadtissues() else if (msgBox.clickedButton() == replaceButton) { if (TissueInfos::LoadTissuesReadable(loadfilename.ascii(), handler3D, - removeTissuesRange)) + removeTissuesRange)) { if (removeTissuesRange > 0) { @@ -4840,7 +4840,7 @@ void MainWindow::execute_3Dsurfaceviewerbmp() { SV3Dbmp = new surfaceviewer3D(handler3D, true, 0); QObject::connect(SV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); } SV3Dbmp->show(); @@ -4877,7 +4877,7 @@ void MainWindow::execute_3Dvolumeviewerbmp() { VV3Dbmp = new volumeviewer3D(handler3D, true, true, true, 0); QObject::connect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); } VV3Dbmp->show(); @@ -4979,17 +4979,17 @@ void MainWindow::xslice_closed() if (xsliceshower != NULL) { QObject::disconnect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); + SLOT(xshower_slicechanged())); QObject::disconnect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); if (ysliceshower != NULL) { @@ -5008,17 +5008,17 @@ void MainWindow::yslice_closed() if (ysliceshower != NULL) { QObject::disconnect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::disconnect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); + SLOT(yshower_slicechanged())); QObject::disconnect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); QObject::disconnect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); if (xsliceshower != NULL) { @@ -5037,7 +5037,7 @@ void MainWindow::SV3D_closed() if (SV3D != NULL) { QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3D_closed())); + SLOT(SV3D_closed())); delete SV3D; SV3D = NULL; } @@ -5048,7 +5048,7 @@ void MainWindow::SV3Dbmp_closed() if (SV3Dbmp != NULL) { QObject::disconnect(SV3D, SIGNAL(hasbeenclosed()), this, - SLOT(SV3Dbmp_closed())); + SLOT(SV3Dbmp_closed())); delete SV3Dbmp; SV3Dbmp = NULL; } @@ -5059,7 +5059,7 @@ void MainWindow::VV3D_closed() if (VV3D != NULL) { QObject::disconnect(VV3D, SIGNAL(hasbeenclosed()), this, - SLOT(VV3D_closed())); + SLOT(VV3D_closed())); delete VV3D; VV3D = NULL; } @@ -5070,7 +5070,7 @@ void MainWindow::VV3Dbmp_closed() if (VV3Dbmp != NULL) { QObject::disconnect(VV3Dbmp, SIGNAL(hasbeenclosed()), this, - SLOT(VV3Dbmp_closed())); + SLOT(VV3Dbmp_closed())); delete VV3Dbmp; VV3Dbmp = NULL; } @@ -5143,8 +5143,8 @@ void MainWindow::execute_scale() this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(&SW, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); SW.move(QCursor::pos()); SW.exec(); QObject::disconnect( @@ -5166,8 +5166,8 @@ void MainWindow::execute_imagemath() this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(&IM, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); IM.move(QCursor::pos()); IM.exec(); QObject::disconnect( @@ -5202,8 +5202,8 @@ void MainWindow::execute_overlay() this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(&IO, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); IO.move(QCursor::pos()); IO.exec(); QObject::disconnect( @@ -5548,17 +5548,17 @@ void MainWindow::execute_xslice() work_show->get_scaleoffsetfactor(offset1, factor1); xsliceshower->set_scale(offset1, factor1, false); QObject::connect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - xsliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + xsliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(xsliceshower, SIGNAL(slice_changed(int)), this, - SLOT(xshower_slicechanged())); + SLOT(xshower_slicechanged())); QObject::connect(xsliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(xslice_closed())); + SLOT(xslice_closed())); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), xsliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); } xsliceshower->show(); @@ -5596,17 +5596,17 @@ void MainWindow::execute_yslice() work_show->get_scaleoffsetfactor(offset1, factor1); ysliceshower->set_scale(offset1, factor1, false); QObject::connect(bmp_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(work_show, - SIGNAL(scaleoffsetfactor_changed(float, float, bool)), - ysliceshower, SLOT(set_scale(float, float, bool))); + SIGNAL(scaleoffsetfactor_changed(float, float, bool)), + ysliceshower, SLOT(set_scale(float, float, bool))); QObject::connect(ysliceshower, SIGNAL(slice_changed(int)), this, - SLOT(yshower_slicechanged())); + SLOT(yshower_slicechanged())); QObject::connect(ysliceshower, SIGNAL(hasbeenclosed()), this, - SLOT(yslice_closed())); + SLOT(yslice_closed())); QObject::connect(zoom_widget, SIGNAL(set_zoom(double)), ysliceshower, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); } ysliceshower->show(); @@ -5618,9 +5618,9 @@ void MainWindow::execute_yslice() void MainWindow::execute_removetissues() { QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { std::vector types; @@ -5636,8 +5636,8 @@ void MainWindow::execute_removetissues() else { QMessageBox::warning(this, "iSeg", - "Error: not all tissues are in tissue list", - QMessageBox::Ok | QMessageBox::Default); + "Error: not all tissues are in tissue list", + QMessageBox::Ok | QMessageBox::Default); } } } @@ -5647,14 +5647,14 @@ void MainWindow::execute_grouptissues() vector olds, news; QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { bool fail_on_unknown_tissue = true; if (read_grouptissuescapped(filename.ascii(), olds, news, - fail_on_unknown_tissue)) + fail_on_unknown_tissue)) { iseg::DataSelection dataSelection; dataSelection.allSlices = true; @@ -5668,8 +5668,8 @@ void MainWindow::execute_grouptissues() else { QMessageBox::warning(this, "iSeg", - "Error: not all tissues are in tissue list", - QMessageBox::Ok | QMessageBox::Default); + "Error: not all tissues are in tissue list", + QMessageBox::Ok | QMessageBox::Default); } } } @@ -5677,7 +5677,8 @@ void MainWindow::execute_grouptissues() void MainWindow::execute_about() { std::ostringstream ss; - ss << "\n\niSeg\n" << std::string(xstr(ISEG_DESCRIPTION)); + ss << "\n\niSeg\n" + << std::string(xstr(ISEG_DESCRIPTION)); QMessageBox::about(this, "About", QString(ss.str().c_str())); } @@ -5788,7 +5789,7 @@ void MainWindow::add_tissue_connected(Point p) tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); handler3D->add2tissue_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); emit end_datachange(this); } @@ -5835,10 +5836,10 @@ void MainWindow::subtract_tissue(Point p) void MainWindow::add_tissue_clicked(Point p) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); addhold_tissue_clicked(p); } @@ -5856,17 +5857,17 @@ void MainWindow::addhold_tissue_clicked(Point p) QApplication::setOverrideCursor(QCursor(Qt::waitCursor)); if (cb_addsubconn->isChecked()) handler3D->add2tissueall_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); else handler3D->add2tissueall(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); QApplication::restoreOverrideCursor(); } else { if (cb_addsubconn->isChecked()) handler3D->add2tissue_connected(currTissueType, p, - cb_addsuboverride->isChecked()); + cb_addsuboverride->isChecked()); else handler3D->add2tissue(currTissueType, p, cb_addsuboverride->isChecked()); } @@ -5885,10 +5886,10 @@ void MainWindow::addhold_tissue_clicked(Point p) void MainWindow::subtract_tissue_clicked(Point p) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); subtracthold_tissue_clicked(p); } @@ -5936,32 +5937,32 @@ void MainWindow::add_tissue_pushed() if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } if (pb_add->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); disconnect_mouseclick(); } else { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); connect_mouseclick(); } } @@ -5987,26 +5988,26 @@ void MainWindow::addhold_tissue_pushed() if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_addhold->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); disconnect_mouseclick(); // pb_addhold->setDown(false); } @@ -6014,7 +6015,7 @@ void MainWindow::addhold_tissue_pushed() { // pb_addhold->setDown(true); QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); connect_mouseclick(); } /* if(pb_add3D->isDown()){ @@ -6047,32 +6048,32 @@ void MainWindow::subtract_tissue_pushed() if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_sub->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); disconnect_mouseclick(); } else { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); connect_mouseclick(); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); // pb_subhold->setDown(false); pb_subhold->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); // pb_addhold->setOn(false); pb_addhold->setOn(false); } @@ -6092,31 +6093,31 @@ void MainWindow::subtracthold_tissue_pushed() if (pb_add->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setOn(false); } if (pb_subhold->isOn()) { QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); disconnect_mouseclick(); } else { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); connect_mouseclick(); } if (pb_sub->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setOn(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } // pb_subhold->setDown(!pb_subhold->isDown()); @@ -6135,25 +6136,25 @@ void MainWindow::stophold_tissue_pushed() if (pb_add->isDown()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(add_tissue_clicked(Point))); + SLOT(add_tissue_clicked(Point))); pb_add->setDown(false); } if (pb_subhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtracthold_tissue_clicked(Point))); + SLOT(subtracthold_tissue_clicked(Point))); pb_subhold->setOn(false); } if (pb_sub->isDown()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(subtract_tissue_clicked(Point))); + SLOT(subtract_tissue_clicked(Point))); pb_sub->setDown(false); } if (pb_addhold->isOn()) { QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), this, - SLOT(addhold_tissue_clicked(Point))); + SLOT(addhold_tissue_clicked(Point))); pb_addhold->setOn(false); } } @@ -6214,9 +6215,9 @@ void MainWindow::do_work2tissue_grouped() vector olds, news; QString filename = Q3FileDialog::getOpenFileName(QString::null, - "Text (*.txt)\n" - "All(*.*)", - this); + "Text (*.txt)\n" + "All(*.*)", + this); if (!filename.isEmpty()) { @@ -6269,7 +6270,7 @@ void MainWindow::merge() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be merged.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6376,7 +6377,7 @@ void MainWindow::removeselected() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6432,8 +6433,8 @@ void MainWindow::removeselected() if (tissueCount < 2) { QMessageBox::information(this, "iSeg", - "It is not possible to erase this tissue.\nAt " - "least one tissue must be defined."); + "It is not possible to erase this tissue.\nAt " + "least one tissue must be defined."); return; } @@ -6523,14 +6524,14 @@ void MainWindow::removeFolder() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } if (removeTissues.size() >= TissueInfos::GetTissueCount()) { QMessageBox::information(this, "iSeg", - "It is not possible to erase this folder.\nAt " - "least one tissue must be defined."); + "It is not possible to erase this folder.\nAt " + "least one tissue must be defined."); return; } @@ -6568,7 +6569,7 @@ void MainWindow::removeTissueFolderAllPressed() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6675,7 +6676,7 @@ void MainWindow::cleartissues() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be cleared.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6712,7 +6713,7 @@ void MainWindow::cleartissue() if (isLocked) { QMessageBox::warning(this, "iSeg", "Locked tissue can not be removed.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6753,7 +6754,7 @@ void MainWindow::clearselected() if (anyLocked) { QMessageBox::warning(this, "iSeg", "Locked tissues can not be cleared.", - QMessageBox::Ok | QMessageBox::Default); + QMessageBox::Ok | QMessageBox::Default); return; } @@ -6842,15 +6843,15 @@ void MainWindow::slice_changed() unsigned short slicenr = handler3D->get_activeslice() + 1; QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setValue(int(slicenr)); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setValue(int(slicenr)); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); bmp_show->slicenr_changed(); work_show->slicenr_changed(); scalewidget->slicenr_changed(); @@ -6899,15 +6900,15 @@ void MainWindow::slices3d_changed(bool new_bitstack) if (handler3D->return_nrslices() != nrslices) { QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setMaxValue((int)handler3D->return_nrslices()); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setMaxValue((int)handler3D->return_nrslices()); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); lb_slicenr->setText(QString(" of ") + QString::number((int)handler3D->return_nrslices())); interpolwidget->handler3D_changed(); @@ -6916,15 +6917,15 @@ void MainWindow::slices3d_changed(bool new_bitstack) unsigned short slicenr = handler3D->get_activeslice() + 1; QObject::disconnect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); scb_slicenr->setValue(int(slicenr)); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::disconnect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); sb_slicenr->setValue(int(slicenr)); QObject::connect(sb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(sb_slicenr_changed())); + SLOT(sb_slicenr_changed())); if (handler3D->return_startslice() >= slicenr || handler3D->return_endslice() + 1 <= slicenr) { @@ -7127,9 +7128,9 @@ void MainWindow::tree_widget_contextmenu(const QPoint &pos) contextMenu.insertItem("New Tissue...", this, SLOT(newTissuePressed())); contextMenu.insertItem("New Folder...", this, SLOT(newFolderPressed())); contextMenu.insertItem("Mod. Folder...", this, - SLOT(modifTissueFolderPressed())); + SLOT(modifTissueFolderPressed())); contextMenu.insertItem("Del. Folder...", this, - SLOT(removeTissueFolderPressed())); + SLOT(removeTissueFolderPressed())); } else { @@ -7138,25 +7139,25 @@ void MainWindow::tree_widget_contextmenu(const QPoint &pos) contextMenu.insertItem("New Tissue...", this, SLOT(newTissuePressed())); contextMenu.insertItem("New Folder...", this, SLOT(newFolderPressed())); contextMenu.insertItem("Mod. Tissue...", this, - SLOT(modifTissueFolderPressed())); + SLOT(modifTissueFolderPressed())); contextMenu.insertItem("Del. Tissue...", this, - SLOT(removeTissueFolderPressed())); + SLOT(removeTissueFolderPressed())); contextMenu.insertSeparator(); contextMenu.insertItem("Get Tissue", this, SLOT(tissue2work())); contextMenu.insertItem("Clear Tissue", this, SLOT(cleartissue())); contextMenu.insertSeparator(); contextMenu.insertItem("Next Feat. Slice", this, - SLOT(next_featuring_slice())); + SLOT(next_featuring_slice())); } contextMenu.insertSeparator(); int itemId = contextMenu.insertItem("Show Tissue Indices", tissueTreeWidget, - SLOT(toggle_show_tissue_indices())); + SLOT(toggle_show_tissue_indices())); contextMenu.setItemChecked(itemId, - !tissueTreeWidget->get_tissue_indices_hidden()); + !tissueTreeWidget->get_tissue_indices_hidden()); contextMenu.insertItem("Sort By Name", tissueTreeWidget, - SLOT(sort_by_tissue_name())); + SLOT(sort_by_tissue_name())); contextMenu.insertItem("Sort By Index", tissueTreeWidget, - SLOT(sort_by_tissue_index())); + SLOT(sort_by_tissue_index())); contextMenu.exec(tissueTreeWidget->viewport()->mapToGlobal(pos)); } else // multi-selection @@ -7303,42 +7304,42 @@ void MainWindow::tab_changed(QWidget *qw) if (tab_old) // generic slots from WidgetInterface { QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); } if (tab_old == threshold_widget) { QObject::disconnect(this, SIGNAL(bmp_changed()), threshold_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); } else if (tab_old == measurement_widget) { measurement_widget->cleanup(); // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); QObject::disconnect( measurement_widget, SIGNAL( @@ -7357,32 +7358,32 @@ void MainWindow::tab_changed(QWidget *qw) } else if (tab_old == vesselextr_widget) { - vesselextr_widget->clean_up(); + vesselextr_widget->cleanup(); QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); QObject::disconnect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); } else if (tab_old == wshed_widget) { // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), wshed_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); } else if (tab_old == hyst_widget) { - hyst_widget->clean_up(); + hyst_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), hyst_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(hyst_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(hyst_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect( hyst_widget, SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), @@ -7394,18 +7395,18 @@ void MainWindow::tab_changed(QWidget *qw) lw_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), lw_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(bmp_show, SIGNAL(mousedoubleclick_sign(Point)), - lw_widget, SLOT(pt_doubleclicked(Point))); + lw_widget, SLOT(pt_doubleclicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousepressedmid_sign(Point)), - lw_widget, SLOT(pt_midclicked(Point))); + lw_widget, SLOT(pt_midclicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), - lw_widget, SLOT(pt_doubleclickedmid(Point))); + lw_widget, SLOT(pt_doubleclickedmid(Point))); QObject::disconnect(lw_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); + bmp_show, SLOT(set_vp1(std::vector *))); QObject::disconnect(lw_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect( lw_widget, SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), @@ -7419,47 +7420,47 @@ void MainWindow::tab_changed(QWidget *qw) iftrg_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), iftrg_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), - bmp_show, SLOT(set_vm(std::vector *))); + bmp_show, SLOT(set_vm(std::vector *))); QObject::disconnect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vmdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (tab_old == FMF_widget) { FMF_widget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), FMF_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(FMF_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (tab_old == OutlineCorrect_widget) { OutlineCorrect_widget->cleanup(); QObject::disconnect(this, SIGNAL(work_changed()), OutlineCorrect_widget, - SLOT(workbits_changed())); + SLOT(workbits_changed())); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); } else if (tab_old == feature_widget) { QObject::disconnect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::disconnect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), + work_show, SLOT(set_vpdyn(std::vector *))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); @@ -7474,22 +7475,22 @@ void MainWindow::tab_changed(QWidget *qw) pickerwidget->cleanup(); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); } else if (tab_old == transfrmWidget) { transfrmWidget->cleanup(); QObject::disconnect(this, SIGNAL(bmp_changed()), transfrmWidget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(this, SIGNAL(work_changed()), transfrmWidget, - SLOT(work_changed())); + SLOT(work_changed())); QObject::disconnect(this, SIGNAL(tissues_changed()), transfrmWidget, - SLOT(tissues_changed())); + SLOT(tissues_changed())); } // connect signal-slots new widget @@ -7497,40 +7498,40 @@ void MainWindow::tab_changed(QWidget *qw) if (qw) // generic slots from WidgetInterface { QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), qw, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), qw, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), qw, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), qw, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), qw, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), qw, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); } if (qw == threshold_widget) { QObject::connect(this, SIGNAL(bmp_changed()), threshold_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); } else if (qw == measurement_widget) { QObject::connect(this, SIGNAL(marks_changed()), measurement_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), work_show, + SLOT(set_vp1(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect( measurement_widget, SIGNAL( @@ -7550,27 +7551,27 @@ void MainWindow::tab_changed(QWidget *qw) else if (qw == vesselextr_widget) { QObject::connect(this, SIGNAL(marks_changed()), vesselextr_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); QObject::connect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector *)), bmp_show, + SLOT(set_vp1(std::vector *))); } else if (qw == wshed_widget) { // QObject::disconnect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::connect(this, SIGNAL(marks_changed()), wshed_widget, - SLOT(marks_changed())); + SLOT(marks_changed())); // wshed_widget->init(); } else if (qw == hyst_widget) { QObject::connect(this, SIGNAL(bmp_changed()), hyst_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(hyst_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); + bmp_show, SLOT(set_vp1(std::vector *))); QObject::connect(hyst_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + bmp_show, SLOT(set_vpdyn(std::vector *))); QObject::connect( hyst_widget, SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), @@ -7582,17 +7583,17 @@ void MainWindow::tab_changed(QWidget *qw) else if (qw == lw_widget) { QObject::connect(this, SIGNAL(bmp_changed()), lw_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(bmp_show, SIGNAL(mousedoubleclick_sign(Point)), - lw_widget, SLOT(pt_doubleclicked(Point))); + lw_widget, SLOT(pt_doubleclicked(Point))); QObject::connect(bmp_show, SIGNAL(mousepressedmid_sign(Point)), lw_widget, - SLOT(pt_midclicked(Point))); + SLOT(pt_midclicked(Point))); QObject::connect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), - lw_widget, SLOT(pt_doubleclickedmid(Point))); + lw_widget, SLOT(pt_doubleclickedmid(Point))); QObject::connect(lw_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); + bmp_show, SLOT(set_vp1(std::vector *))); QObject::connect(lw_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + bmp_show, SLOT(set_vpdyn(std::vector *))); QObject::connect( lw_widget, SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), @@ -7605,44 +7606,44 @@ void MainWindow::tab_changed(QWidget *qw) else if (qw == iftrg_widget) { QObject::connect(this, SIGNAL(bmp_changed()), iftrg_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), - bmp_show, SLOT(set_vm(std::vector *))); + bmp_show, SLOT(set_vm(std::vector *))); QObject::connect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vmdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); } else if (qw == FMF_widget) { QObject::connect(this, SIGNAL(bmp_changed()), FMF_widget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(FMF_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + bmp_show, SLOT(set_vpdyn(std::vector *))); } else if (qw == OutlineCorrect_widget) { QObject::connect(this, SIGNAL(work_changed()), OutlineCorrect_widget, - SLOT(workbits_changed())); + SLOT(workbits_changed())); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); OutlineCorrect_widget->workbits_changed(); } else if (qw == feature_widget) { QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), bmp_show, + SLOT(set_vpdyn(std::vector *))); QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector *)), work_show, + SLOT(set_vpdyn(std::vector *))); work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); @@ -7656,18 +7657,18 @@ void MainWindow::tab_changed(QWidget *qw) else if (qw == pickerwidget) { QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), - bmp_show, SLOT(set_vp1(vector *))); + bmp_show, SLOT(set_vp1(vector *))); QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), - work_show, SLOT(set_vp1(vector *))); + work_show, SLOT(set_vp1(vector *))); } else if (qw == transfrmWidget) { QObject::connect(this, SIGNAL(bmp_changed()), transfrmWidget, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::connect(this, SIGNAL(work_changed()), transfrmWidget, - SLOT(work_changed())); + SLOT(work_changed())); QObject::connect(this, SIGNAL(tissues_changed()), transfrmWidget, - SLOT(tissues_changed())); + SLOT(tissues_changed())); } tab_old = (WidgetInterface *)qw; @@ -7774,7 +7775,7 @@ void MainWindow::LoadAtlas(QDir path1) m_atlasfilename.m_atlasfilename[i] = names1[i]; QFileInfo names1fi(names1[i]); atlasmenu->changeItem(m_atlasfilename.atlasnr[i], - names1fi.completeBaseName()); + names1fi.completeBaseName()); atlasmenu->setItemVisible(m_atlasfilename.atlasnr[i], true); } for (size_t i = m_atlasfilename.nratlases; i < m_atlasfilename.maxnr; i++) @@ -7908,22 +7909,22 @@ void MainWindow::SaveLoadProj(QString latestprojpath) if (m_loadprojfilename.m_loadprojfilename4 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename4.ascii()); + m_loadprojfilename.m_loadprojfilename4.ascii()); } if (m_loadprojfilename.m_loadprojfilename3 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename3.ascii()); + m_loadprojfilename.m_loadprojfilename3.ascii()); } if (m_loadprojfilename.m_loadprojfilename2 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename2.ascii()); + m_loadprojfilename.m_loadprojfilename2.ascii()); } if (m_loadprojfilename.m_loadprojfilename1 != QString("")) { fprintf(fplatestproj, "%s\n", - m_loadprojfilename.m_loadprojfilename1.ascii()); + m_loadprojfilename.m_loadprojfilename1.ascii()); } fclose(fplatestproj); @@ -8131,18 +8132,18 @@ void MainWindow::disconnect_mouseclick() if (tab_old) { QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::disconnect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::disconnect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); } } @@ -8151,29 +8152,29 @@ void MainWindow::connect_mouseclick() if (tab_old) { QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::connect(bmp_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::connect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); QObject::connect(work_show, SIGNAL(mousepressed_sign(Point)), tab_old, - SLOT(mouse_clicked(Point))); + SLOT(mouse_clicked(Point))); QObject::connect(work_show, SIGNAL(mousereleased_sign(Point)), tab_old, - SLOT(mouse_released(Point))); + SLOT(mouse_released(Point))); QObject::connect(work_show, SIGNAL(mousemoved_sign(Point)), tab_old, - SLOT(mouse_moved(Point))); + SLOT(mouse_moved(Point))); } } void MainWindow::reconnectmouse_afterrelease(Point) { QObject::disconnect(work_show, SIGNAL(mousereleased_sign(Point)), this, - SLOT(reconnectmouse_afterrelease(Point))); + SLOT(reconnectmouse_afterrelease(Point))); connect_mouseclick(); } void MainWindow::handle_begin_datachange(iseg::DataSelection &dataSelection, - QWidget *sender, bool beginUndo) + QWidget *sender, bool beginUndo) { undoStarted = beginUndo || undoStarted; changeData = dataSelection; @@ -8245,7 +8246,7 @@ void MainWindow::end_undo_helper(iseg::EndUndoAction undoAction) } void MainWindow::handle_end_datachange(QWidget *sender, - iseg::EndUndoAction undoAction) + iseg::EndUndoAction undoAction) { // End undo end_undo_helper(undoAction); @@ -8263,13 +8264,13 @@ void MainWindow::handle_end_datachange(QWidget *sender, if (sender == methodTab->visibleWidget()) { QObject::disconnect(this, SIGNAL(bmp_changed()), sender, - SLOT(bmp_changed())); + SLOT(bmp_changed())); QObject::disconnect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); + SLOT(work_changed())); QObject::disconnect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); + SLOT(tissues_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); + SLOT(marks_changed())); } // Signal changed data @@ -8309,11 +8310,11 @@ void MainWindow::handle_end_datachange(QWidget *sender, { QObject::connect(this, SIGNAL(bmp_changed()), sender, SLOT(bmp_changed())); QObject::connect(this, SIGNAL(work_changed()), sender, - SLOT(work_changed())); + SLOT(work_changed())); QObject::connect(this, SIGNAL(tissues_changed()), sender, - SLOT(tissues_changed())); + SLOT(tissues_changed())); QObject::connect(this, SIGNAL(marks_changed()), sender, - SLOT(marks_changed())); + SLOT(marks_changed())); } } @@ -8368,8 +8369,8 @@ void MainWindow::cancel_transform_helper() SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); QObject::connect(transfrmWidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); // Signal changed data bool bmp, work, tissues; @@ -8389,7 +8390,7 @@ void MainWindow::cancel_transform_helper() } void MainWindow::handle_begin_dataexport(iseg::DataSelection &dataSelection, - QWidget *sender) + QWidget *sender) { // Handle pending transforms if (methodTab->visibleWidget() == transfrmWidget && diff --git a/iSeg/MorphologyWidget.h b/iSeg/MorphologyWidget.h index 493d6b3b..c6f06569 100755 --- a/iSeg/MorphologyWidget.h +++ b/iSeg/MorphologyWidget.h @@ -35,48 +35,45 @@ class MorphologyWidget : public WidgetInterface { Q_OBJECT public: - MorphologyWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + MorphologyWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~MorphologyWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; - std::string GetName() override { return std::string("Morpho"); }; - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("morphology.png"))); - }; + std::string GetName() override { return std::string("Morpho"); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("morphology.png"))); } private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3VBox* vbox1; - QLabel* txt_n; - QSpinBox* sb_n; - QPushButton* btn_exec; - QRadioButton* rb_8connect; - QRadioButton* rb_4connect; - QButtonGroup* connectgroup; - QRadioButton* rb_open; - QRadioButton* rb_close; - QRadioButton* rb_erode; - QRadioButton* rb_dilate; - QButtonGroup* modegroup; - QCheckBox* allslices; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3VBox *vbox1; + QLabel *txt_n; + QSpinBox *sb_n; + QPushButton *btn_exec; + QRadioButton *rb_8connect; + QRadioButton *rb_4connect; + QButtonGroup *connectgroup; + QRadioButton *rb_open; + QRadioButton *rb_close; + QRadioButton *rb_erode; + QRadioButton *rb_dilate; + QButtonGroup *modegroup; + QCheckBox *allslices; public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void execute(); }; diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index 74c2bb30..e38f7b49 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -36,19 +36,19 @@ class OutlineCorrectionWidget : public WidgetInterface { Q_OBJECT public: - OutlineCorrectionWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + OutlineCorrectionWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~OutlineCorrectionWidget(); - QSize sizeHint() const; - void cleanup(); + QSize sizeHint() const override; + void cleanup() override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("OLC"); } - virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("olc.png"))); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("olc.png"))); } void Select_selected_tissue_BG(QString tissueName, tissues_size_t nr); void Select_selected_tissue_TS(QString tissueName, tissues_size_t nr); @@ -67,80 +67,80 @@ class OutlineCorrectionWidget : public WidgetInterface float f; bool draw; bool selectobj; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; float spacing[3]; Point last_pt; - Q3VBox* vbox1; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox2a; - Q3HBox* hbox3a; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; + Q3VBox *vbox1; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox2a; + Q3HBox *hbox3a; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; // Q3HBox *hbox3; // Q3HBox *hbox3cont; - Q3HBox* hbox4; - Q3HBox* hbox5o; - Q3HBox* hbox5; - Q3HBox* hbox6; - Q3HBox* hboxpixormm; - QRadioButton* brush; - QRadioButton* olcorr; - QRadioButton* holefill; - QRadioButton* removeislands; - QRadioButton* gapfill; - QRadioButton* allfill; - QRadioButton* addskin; - QRadioButton* fillskin; - QButtonGroup* method; - QRadioButton* tissue; - QRadioButton* work; - QButtonGroup* target; - QRadioButton* erasebrush; - QRadioButton* drawbrush; - QRadioButton* modifybrush; - QRadioButton* adapt; - QButtonGroup* brushtype; - QRadioButton* inside; - QRadioButton* outside; - QButtonGroup* in_or_out; - QRadioButton* pixel; - QRadioButton* mm; - QButtonGroup* pixelormm; - QLabel* txt_unit; - QLabel* txt_radius; - QSpinBox* sb_radius; - QLineEdit* mm_radius; - QLabel* txt_holesize; - QLabel* txt_gapsize; - QSpinBox* sb_holesize; - QSpinBox* sb_gapsize; - QPushButton* pb_removeholes; - QPushButton* pb_selectobj; - QCheckBox* allslices; + Q3HBox *hbox4; + Q3HBox *hbox5o; + Q3HBox *hbox5; + Q3HBox *hbox6; + Q3HBox *hboxpixormm; + QRadioButton *brush; + QRadioButton *olcorr; + QRadioButton *holefill; + QRadioButton *removeislands; + QRadioButton *gapfill; + QRadioButton *allfill; + QRadioButton *addskin; + QRadioButton *fillskin; + QButtonGroup *method; + QRadioButton *tissue; + QRadioButton *work; + QButtonGroup *target; + QRadioButton *erasebrush; + QRadioButton *drawbrush; + QRadioButton *modifybrush; + QRadioButton *adapt; + QButtonGroup *brushtype; + QRadioButton *inside; + QRadioButton *outside; + QButtonGroup *in_or_out; + QRadioButton *pixel; + QRadioButton *mm; + QButtonGroup *pixelormm; + QLabel *txt_unit; + QLabel *txt_radius; + QSpinBox *sb_radius; + QLineEdit *mm_radius; + QLabel *txt_holesize; + QLabel *txt_gapsize; + QSpinBox *sb_holesize; + QSpinBox *sb_gapsize; + QPushButton *pb_removeholes; + QPushButton *pb_selectobj; + QCheckBox *allslices; void draw_circle(Point p); std::vector vpdyn; bool dontundo; - Q3HBox* tissuesListBackground; - Q3HBox* tissuesListSkin; - QPushButton* getCurrentTissueBackground; - QPushButton* getCurrentTissueSkin; - QLineEdit* backgroundText; - QLineEdit* skinText; + Q3HBox *tissuesListBackground; + Q3HBox *tissuesListSkin; + QPushButton *getCurrentTissueBackground; + QPushButton *getCurrentTissueSkin; + QLineEdit *backgroundText; + QLineEdit *skinText; tissues_size_t selectedBacgroundID; tissues_size_t selectedSkinID; bool backgroundSelected; bool skinSelected; public: - QCheckBox* fb; - QCheckBox* bg; + QCheckBox *fb; + QCheckBox *bg; signals: - void vpdyn_changed(std::vector* vpdyn_arg); + void vpdyn_changed(std::vector *vpdyn_arg); void signal_request_selected_tissue_TS(); // TODO BL hack void signal_request_selected_tissue_BG(); @@ -153,7 +153,7 @@ public slots: void request_selected_tissue_TS(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void method_changed(); void removeholes_pushed(); void selectobj_pushed(); diff --git a/iSeg/SmoothingWidget.h b/iSeg/SmoothingWidget.h index 6ab54644..23b806cf 100755 --- a/iSeg/SmoothingWidget.h +++ b/iSeg/SmoothingWidget.h @@ -37,66 +37,63 @@ class SmoothingWidget : public WidgetInterface { Q_OBJECT public: - SmoothingWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + SmoothingWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~SmoothingWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Smooth"); } - QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("smoothing.png"))); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("smoothing.png"))); } private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3HBox* hbox5; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3HBox *hbox5; // Q3HBox *hbox6; - Q3VBox* vbox1; - Q3VBox* vbox2; - QLabel* txt_n; - QLabel* txt_sigma1; - QLabel* txt_sigma2; - QLabel* txt_dt; - QLabel* txt_iter; - QLabel* txt_k; - QLabel* txt_restrain1; - QLabel* txt_restrain2; - QSlider* sl_sigma; - QSlider* sl_k; - QSlider* sl_restrain; - QSpinBox* sb_n; - QSpinBox* sb_iter; - QSpinBox* sb_kmax; + Q3VBox *vbox1; + Q3VBox *vbox2; + QLabel *txt_n; + QLabel *txt_sigma1; + QLabel *txt_sigma2; + QLabel *txt_dt; + QLabel *txt_iter; + QLabel *txt_k; + QLabel *txt_restrain1; + QLabel *txt_restrain2; + QSlider *sl_sigma; + QSlider *sl_k; + QSlider *sl_restrain; + QSpinBox *sb_n; + QSpinBox *sb_iter; + QSpinBox *sb_kmax; // QSpinBox *sb_restrainmax; - QPushButton* pushexec; - QPushButton* contdiff; - QRadioButton* rb_gaussian; - QRadioButton* rb_average; - QRadioButton* rb_median; - QRadioButton* rb_sigmafilter; - QRadioButton* rb_anisodiff; - QButtonGroup* modegroup; - QCheckBox* allslices; + QPushButton *pushexec; + QPushButton *contdiff; + QRadioButton *rb_gaussian; + QRadioButton *rb_average; + QRadioButton *rb_median; + QRadioButton *rb_sigmafilter; + QRadioButton *rb_anisodiff; + QButtonGroup *modegroup; + QCheckBox *allslices; bool dontundo; public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void execute(); void continue_diff(); void method_changed(int); diff --git a/iSeg/ThresholdWidget.h b/iSeg/ThresholdWidget.h index 9042f0f7..e26a23b6 100755 --- a/iSeg/ThresholdWidget.h +++ b/iSeg/ThresholdWidget.h @@ -39,104 +39,104 @@ class ThresholdWidget : public WidgetInterface { Q_OBJECT public: - ThresholdWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + ThresholdWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~ThresholdWidget(); - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; - QSize sizeHint() const; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; + QSize sizeHint() const override; void init() override; void newloaded() override; void hideparams_changed() override; std::string GetName() override { return std::string("Threshold"); } - virtual QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("thresholding.png"))); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("thresholding.png"))); } private: void on_tissuenr_changed(int i) override; void on_slicenr_changed() override; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; std::vector filenames; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox1; - Q3HBox* hbox1b; - Q3HBox* hbox2; - Q3HBox* hbox2a; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3HBox* hbox5; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox1; + Q3HBox *hbox1b; + Q3HBox *hbox2; + Q3HBox *hbox2a; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3HBox *hbox5; // Q3HBox *hbox6; - Q3HBox* hbox7; - Q3HBox* hbox8; - Q3HBox* hboxfilenames; - Q3VBox* vbox1; - Q3VBox* vbox2; - Q3VBox* vbox3; - Q3VBox* vbox4; - Q3VBox* vbox5; - QLabel* txt_nrtissues; - QLabel* txt_dim; - QLabel* txt_useCenterFile; - QLabel* txt_tissuenr; - QLabel* txt_px; - QLabel* txt_py; - QLabel* txt_lx; - QLabel* txt_ly; - QLabel* txt_iternr; - QLabel* txt_converge; - QLabel* txt_minpix; - QLabel* txt_slider; - QLabel* txt_ratio; - QLabel* txt_lower; - QLabel* txt_upper; - QLabel* txt_filename; - QSlider* slider; - QSlider* ratio; - QSpinBox* sb_nrtissues; - QSpinBox* sb_dim; - QSpinBox* sb_tissuenr; - QSpinBox* sb_px; - QSpinBox* sb_py; - QSpinBox* sb_lx; - QSpinBox* sb_ly; - QSpinBox* sb_iternr; - QSpinBox* sb_converge; - QSpinBox* sb_minpix; - QPushButton* pushexec; - QPushButton* pushfilename; + Q3HBox *hbox7; + Q3HBox *hbox8; + Q3HBox *hboxfilenames; + Q3VBox *vbox1; + Q3VBox *vbox2; + Q3VBox *vbox3; + Q3VBox *vbox4; + Q3VBox *vbox5; + QLabel *txt_nrtissues; + QLabel *txt_dim; + QLabel *txt_useCenterFile; + QLabel *txt_tissuenr; + QLabel *txt_px; + QLabel *txt_py; + QLabel *txt_lx; + QLabel *txt_ly; + QLabel *txt_iternr; + QLabel *txt_converge; + QLabel *txt_minpix; + QLabel *txt_slider; + QLabel *txt_ratio; + QLabel *txt_lower; + QLabel *txt_upper; + QLabel *txt_filename; + QSlider *slider; + QSlider *ratio; + QSpinBox *sb_nrtissues; + QSpinBox *sb_dim; + QSpinBox *sb_tissuenr; + QSpinBox *sb_px; + QSpinBox *sb_py; + QSpinBox *sb_lx; + QSpinBox *sb_ly; + QSpinBox *sb_iternr; + QSpinBox *sb_converge; + QSpinBox *sb_minpix; + QPushButton *pushexec; + QPushButton *pushfilename; // QPushButton *pushrange; - QCheckBox* subsect; - QRadioButton* rb_manual; - QRadioButton* rb_histo; - QRadioButton* rb_kmeans; - QRadioButton* rb_EM; - QButtonGroup* modegroup; - QCheckBox* allslices; + QCheckBox *subsect; + QRadioButton *rb_manual; + QRadioButton *rb_histo; + QRadioButton *rb_kmeans; + QRadioButton *rb_EM; + QButtonGroup *modegroup; + QCheckBox *allslices; float lower, upper; float threshs[21]; float weights[20]; - float* bits[20]; + float *bits[20]; unsigned bits1[20]; bool dontundo; - QLineEdit* le_borderval; - QLineEdit* le_filename; - QPushButton* pb_saveborders; - QPushButton* pb_loadborders; + QLineEdit *le_borderval; + QLineEdit *le_filename; + QPushButton *pb_saveborders; + QPushButton *pb_loadborders; //QButtonGroup *buttonGroup; - QCheckBox* buttonR; - QCheckBox* buttonG; - QCheckBox* buttonB; - QCheckBox* buttonA; - QCheckBox* cb_useCenterFile; - QLineEdit* le_centerFilename; - QPushButton* pushcenterFilename; + QCheckBox *buttonR; + QCheckBox *buttonG; + QCheckBox *buttonB; + QCheckBox *buttonA; + QCheckBox *cb_useCenterFile; + QLineEdit *le_centerFilename; + QPushButton *pushcenterFilename; QString centerFilename; private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void subsect_toggled(); void execute(); void method_changed(int); @@ -157,4 +157,3 @@ private slots: }; } // namespace iseg - diff --git a/iSeg/VesselWidget.cpp b/iSeg/VesselWidget.cpp index 07bb6a31..6c3c8c9e 100755 --- a/iSeg/VesselWidget.cpp +++ b/iSeg/VesselWidget.cpp @@ -25,9 +25,9 @@ using namespace std; using namespace iseg; -VesselWidget::VesselWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) +VesselWidget::VesselWidget(SlicesHandler *hand3D, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { vbox1 = new Q3VBox(this); hbox1 = new Q3HBox(vbox1); @@ -66,15 +66,15 @@ VesselWidget::VesselWidget(SlicesHandler* hand3D, QWidget* parent, marks_changed(); QObject::connect(sb_nrend, SIGNAL(valueChanged(int)), this, - SLOT(nrend_changed(int))); + SLOT(nrend_changed(int))); QObject::connect(sb_endnr, SIGNAL(valueChanged(int)), this, - SLOT(endnr_changed(int))); + SLOT(endnr_changed(int))); QObject::connect(pb_exec, SIGNAL(clicked()), this, SLOT(execute())); QObject::connect(pb_store, SIGNAL(clicked()), this, SLOT(savevessel())); QObject::connect(cbb_lb1, SIGNAL(activated(int)), this, - SLOT(cbb1_changed(int))); + SLOT(cbb1_changed(int))); QObject::connect(cbb_lb2, SIGNAL(activated(int)), this, - SLOT(cbb2_changed(int))); + SLOT(cbb2_changed(int))); } VesselWidget::~VesselWidget() { delete vbox1; } @@ -90,18 +90,18 @@ void VesselWidget::init() if (branchTree.getSize() > 0) { branchTree.getItem()->getCenterListSlice_inclchildren( - handler3D->get_activeslice(), vp); + handler3D->get_activeslice(), vp); } emit vp1_changed(&vp); } -FILE* VesselWidget::SaveParams(FILE* fp, int version) +FILE *VesselWidget::SaveParams(FILE *fp, int version) { UNREFERENCED_PARAMETER(version); return fp; } -FILE* VesselWidget::LoadParams(FILE* fp, int version) +FILE *VesselWidget::LoadParams(FILE *fp, int version) { UNREFERENCED_PARAMETER(version); return fp; @@ -111,9 +111,9 @@ void VesselWidget::getlabels() { handler3D->get_labels(&labels); QObject::disconnect(cbb_lb1, SIGNAL(activated(int)), this, - SLOT(cbb1_changed(int))); + SLOT(cbb1_changed(int))); QObject::disconnect(cbb_lb2, SIGNAL(activated(int)), this, - SLOT(cbb2_changed(int))); + SLOT(cbb2_changed(int))); cbb_lb1->clear(); cbb_lb2->clear(); @@ -165,9 +165,9 @@ void VesselWidget::getlabels() } QObject::connect(cbb_lb1, SIGNAL(activated(int)), this, - SLOT(cbb1_changed(int))); + SLOT(cbb1_changed(int))); QObject::connect(cbb_lb2, SIGNAL(activated(int)), this, - SLOT(cbb2_changed(int))); + SLOT(cbb2_changed(int))); if (labels.empty()) { @@ -200,7 +200,7 @@ void VesselWidget::execute() end[1] = selectedlabels[0].p.py; end[2] = selectedlabels[0].slicenr; - std::vector seeds; // only distal seeds + std::vector seeds; // only distal seeds std::vector allSeeds; // seeds + end point // save all start seeds in s @@ -223,7 +223,7 @@ void VesselWidget::execute() allSeeds.push_back(end); if (!seeds.empty() && (handler3D->return_nrslices() > 0) && - (handler3D->return_width() > 0) && (handler3D->return_height() > 0)) + (handler3D->return_width() > 0) && (handler3D->return_height() > 0)) { Vec3 tmpbbStart; //tmpbbStart[0]=0; @@ -289,7 +289,7 @@ void VesselWidget::nrend_changed(int newval) void VesselWidget::endnr_changed(int newval) { QObject::disconnect(cbb_lb2, SIGNAL(activated(int)), this, - SLOT(cbb2_changed(int))); + SLOT(cbb2_changed(int))); size_t i = 0; while ((i < labels.size()) && (labels[i] != selectedlabels[newval])) @@ -297,7 +297,7 @@ void VesselWidget::endnr_changed(int newval) cbb_lb2->setCurrentItem(i); QObject::connect(cbb_lb2, SIGNAL(activated(int)), this, - SLOT(cbb2_changed(int))); + SLOT(cbb2_changed(int))); } void VesselWidget::cbb1_changed(int newval) @@ -327,7 +327,7 @@ void VesselWidget::slicenr_changed() if (branchTree.getSize() > 0) { branchTree.getItem()->getCenterListSlice_inclchildren( - handler3D->get_activeslice(), vp); + handler3D->get_activeslice(), vp); } emit vp1_changed(&vp); } @@ -335,7 +335,7 @@ void VesselWidget::slicenr_changed() void VesselWidget::savevessel() { QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Vessel-Tracks (*.txt)\n", this); //, filename); + QString::null, "Vessel-Tracks (*.txt)\n", this); //, filename); if (savefilename.length() > 4 && !savefilename.endsWith(QString(".txt"))) savefilename.append(".txt"); @@ -347,8 +347,8 @@ void VesselWidget::savevessel() float thick = handler3D->get_slicethickness(); float epsilon = max(max(pair1.high, pair1.low), thick); branchTree.getItem()->doug_peuck_inclchildren(epsilon, pair1.high, - pair1.low, thick, vp); - FILE* fp = fopen(savefilename.ascii(), "w"); + pair1.low, thick, vp); + FILE *fp = fopen(savefilename.ascii(), "w"); int version = 2; unsigned short w = handler3D->return_width(); unsigned short h = handler3D->return_height(); @@ -372,8 +372,13 @@ void VesselWidget::savevessel() } } -void VesselWidget::clean_up() +void VesselWidget::cleanup() { vp.clear(); emit vp1_changed(&vp); } + +QIcon iseg::VesselWidget::GetIcon(QDir picdir) +{ + return QIcon(picdir.absFilePath(QString("vessel.png"))); +} diff --git a/iSeg/VesselWidget.h b/iSeg/VesselWidget.h index 26fd161d..91fc0650 100755 --- a/iSeg/VesselWidget.h +++ b/iSeg/VesselWidget.h @@ -31,48 +31,45 @@ class VesselWidget : public WidgetInterface { Q_OBJECT public: - VesselWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + VesselWidget(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~VesselWidget(); - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; - QSize sizeHint() const; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; + QSize sizeHint() const override; void init() override; void newloaded() override; void slicenr_changed(); - std::string GetName() override { return std::string("Vessel"); }; - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("vessel.png")).ascii()); - }; - void clean_up(); + std::string GetName() override { return std::string("Vessel"); } + QIcon GetIcon(QDir picdir) override; + void cleanup() override; private: BranchTree branchTree; void getlabels(); void reset_branchTree(); - SlicesHandler* handler3D; + SlicesHandler *handler3D; std::vector labels; std::vector selectedlabels; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3VBox* vbox1; - QLabel* txt_start; - QLabel* txt_nrend; - QLabel* txt_endnr; - QLabel* txt_end; - QLabel* txt_info; - QComboBox* cbb_lb1; - QComboBox* cbb_lb2; - QSpinBox* sb_nrend; - QSpinBox* sb_endnr; - QPushButton* pb_exec; - QPushButton* pb_store; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3VBox *vbox1; + QLabel *txt_start; + QLabel *txt_nrend; + QLabel *txt_endnr; + QLabel *txt_end; + QLabel *txt_info; + QComboBox *cbb_lb1; + QComboBox *cbb_lb2; + QSpinBox *sb_nrend; + QSpinBox *sb_endnr; + QPushButton *pb_exec; + QPushButton *pb_store; std::vector vp; signals: - void vp1_changed(std::vector* vp1); + void vp1_changed(std::vector *vp1); private slots: void marks_changed(); diff --git a/iSeg/featurewidget.h b/iSeg/featurewidget.h index 57794910..183cc699 100755 --- a/iSeg/featurewidget.h +++ b/iSeg/featurewidget.h @@ -42,16 +42,13 @@ class FeatureWidget : public WidgetInterface { Q_OBJECT public: - FeatureWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + FeatureWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); void init(); void newloaded(); - QSize sizeHint() const; + QSize sizeHint() const override; std::string GetName() { return std::string("Feature"); } - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("feature.png")).ascii()); - } + QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("feature.png")).ascii()); } private: void on_mouse_clicked(Point p) override; @@ -60,41 +57,41 @@ class FeatureWidget : public WidgetInterface bool selecting; std::vector dynamic; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3VBox* vbox1; - Q3VBox* vbox2; - Q3VBox* vbox3; - Q3HBox* hbox1; - QLabel* lb_map; - QLabel* lb_av; - QLabel* lb_stddev; - QLabel* lb_min; - QLabel* lb_max; - QLabel* lb_pt; - QLabel* lb_tissue; - QLabel* lb_grey; - QLabel* lb_map_value; - QLabel* lb_av_value; - QLabel* lb_stddev_value; - QLabel* lb_min_value; - QLabel* lb_max_value; - QLabel* lb_pt_value; - QLabel* lb_grey_value; - QLabel* lb_work_map_value; - QLabel* lb_work_av_value; - QLabel* lb_work_stddev_value; - QLabel* lb_work_min_value; - QLabel* lb_work_max_value; - QLabel* lb_work_pt_value; - QLabel* lb_work_grey_value; - QLabel* lb_tissuename; - QLabel* lb_dummy; + Q3VBox *vbox1; + Q3VBox *vbox2; + Q3VBox *vbox3; + Q3HBox *hbox1; + QLabel *lb_map; + QLabel *lb_av; + QLabel *lb_stddev; + QLabel *lb_min; + QLabel *lb_max; + QLabel *lb_pt; + QLabel *lb_tissue; + QLabel *lb_grey; + QLabel *lb_map_value; + QLabel *lb_av_value; + QLabel *lb_stddev_value; + QLabel *lb_min_value; + QLabel *lb_max_value; + QLabel *lb_pt_value; + QLabel *lb_grey_value; + QLabel *lb_work_map_value; + QLabel *lb_work_av_value; + QLabel *lb_work_stddev_value; + QLabel *lb_work_min_value; + QLabel *lb_work_max_value; + QLabel *lb_work_pt_value; + QLabel *lb_work_grey_value; + QLabel *lb_tissuename; + QLabel *lb_dummy; Point pstart; signals: - void vpdyn_changed(std::vector* vpdyn); + void vpdyn_changed(std::vector *vpdyn); public slots: void slicenr_changed(); diff --git a/iSeg/livewirewidget.h b/iSeg/livewirewidget.h index 753d0c54..08176e55 100755 --- a/iSeg/livewirewidget.h +++ b/iSeg/livewirewidget.h @@ -45,21 +45,18 @@ class livewire_widget : public WidgetInterface { Q_OBJECT public: - livewire_widget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + livewire_widget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~livewire_widget(); void init() override; void newloaded() override; - void cleanup(); - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + void cleanup() override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; - QSize sizeHint() const; + QSize sizeHint() const override; std::string GetName() override { return std::string("Contour"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("contour.png")).ascii()); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("contour.png"))); } private: void on_mouse_clicked(Point p) override; @@ -68,9 +65,9 @@ class livewire_widget : public WidgetInterface void init1(); - ImageForestingTransformLivewire* lw; - ImageForestingTransformLivewire* lwfirst; - + ImageForestingTransformLivewire *lw; + ImageForestingTransformLivewire *lwfirst; + // bool isactive; bool drawing; std::vector clicks; @@ -82,38 +79,38 @@ class livewire_widget : public WidgetInterface int tlimit1; int tlimit2; bool cooling; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3VBox* vbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - QCheckBox* cb_freezing; - QCheckBox* cb_closing; - QSpinBox* sb_freezing; - QLabel* lb_freezing1; - QLabel* lb_freezing2; - QPushButton* pushexec; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3VBox *vbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + QCheckBox *cb_freezing; + QCheckBox *cb_closing; + QSpinBox *sb_freezing; + QLabel *lb_freezing1; + QLabel *lb_freezing2; + QPushButton *pushexec; bool straightmode; - QRadioButton* autotrace; - QRadioButton* straight; - QRadioButton* freedraw; - QButtonGroup* drawmode; + QRadioButton *autotrace; + QRadioButton *straight; + QRadioButton *freedraw; + QButtonGroup *drawmode; Point p1, p2; std::vector establishedlengths; signals: - void vp1_changed(std::vector* vp1); - void vpdyn_changed(std::vector* vpdyn); - void vp1dyn_changed(std::vector* vp1, std::vector* vpdyn); + void vp1_changed(std::vector *vp1); + void vpdyn_changed(std::vector *vpdyn); + void vp1dyn_changed(std::vector *vp1, std::vector *vpdyn); public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); // void bmphand_changed(bmphandler *bmph); void pt_doubleclicked(Point p); void pt_midclicked(Point p); diff --git a/iSeg/main.cpp b/iSeg/main.cpp index 9a1f77d7..b094f767 100755 --- a/iSeg/main.cpp +++ b/iSeg/main.cpp @@ -54,25 +54,25 @@ namespace { class vtkCustomOutputWindow : public vtkOutputWindow { public: - static vtkCustomOutputWindow* New(); + static vtkCustomOutputWindow *New(); vtkTypeMacro(vtkCustomOutputWindow, vtkOutputWindow); - virtual void PrintSelf(ostream& os, vtkIndent indent) {} + virtual void PrintSelf(ostream &os, vtkIndent indent) {} // Put the text into the output stream. - virtual void DisplayText(const char* msg) { std::cerr << msg << std::endl; } + virtual void DisplayText(const char *msg) { std::cerr << msg << std::endl; } protected: vtkCustomOutputWindow() {} private: - vtkCustomOutputWindow(const vtkCustomOutputWindow&); // Not implemented. - void operator=(const vtkCustomOutputWindow&); // Not implemented. + vtkCustomOutputWindow(const vtkCustomOutputWindow &); // Not implemented. + void operator=(const vtkCustomOutputWindow &); // Not implemented. }; vtkStandardNewMacro(vtkCustomOutputWindow); } // namespace -int main(int argc, char** argv) +int main(int argc, char **argv) { auto eow = vtkCustomOutputWindow::New(); eow->SetInstance(eow); @@ -158,7 +158,7 @@ int main(int argc, char** argv) palette.setColor(QPalette::ButtonText, QColor(255, 255, 255)); palette.setColor(QPalette::ToolTipText, QColor(0, 0, 0)); qApp->setPalette(palette); - app.setPalette(palette); + app.setPalette(palette); #ifdef SHOWSPLASH QString pixmapstr = QString(splashpicpath.toAscii().data()); @@ -170,24 +170,24 @@ int main(int argc, char** argv) #endif app.processEvents(); - MainWindow* mainWindow = NULL; + MainWindow *mainWindow = NULL; if (argc > 1) { QString qstr(argv[1]); if (qstr.compare(QString("S4Llink")) == 0) { mainWindow = new MainWindow( - &slice_handler, locationpath, picpath, tmpdir, - true, nullptr, "MainWindow", - Qt::WDestructiveClose | Qt::WResizeNoErase, argv); + &slice_handler, locationpath, picpath, tmpdir, + true, nullptr, "MainWindow", + Qt::WDestructiveClose | Qt::WResizeNoErase, argv); } } if (mainWindow == nullptr) { mainWindow = new MainWindow( - &slice_handler, locationpath, picpath, tmpdir, - false, nullptr, "MainWindow", - Qt::WDestructiveClose | Qt::WResizeNoErase, argv); + &slice_handler, locationpath, picpath, tmpdir, + false, nullptr, "MainWindow", + Qt::WDestructiveClose | Qt::WResizeNoErase, argv); } // needed on MacOS, but not WIN32? @@ -210,7 +210,7 @@ int main(int argc, char** argv) } #ifdef SHOWSPLASH - while (now.msecsTo(QTime::currentTime()) < 2000) + while (now.msecsTo(QTime::currentTime()) < 1000) { } #endif @@ -218,6 +218,10 @@ int main(int argc, char** argv) mainWindow->showMaximized(); mainWindow->show(); +#ifdef SHOWSPLASH + splash_screen.finish(mainWindow); +#endif + QObject::connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); return app.exec(); diff --git a/iSeg/measurementwidget.h b/iSeg/measurementwidget.h index e85911d6..88d93704 100755 --- a/iSeg/measurementwidget.h +++ b/iSeg/measurementwidget.h @@ -32,59 +32,56 @@ class MeasurementWidget : public WidgetInterface { Q_OBJECT public: - MeasurementWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + MeasurementWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~MeasurementWidget(); - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; - QSize sizeHint() const; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; + QSize sizeHint() const override; void init() override; - void cleanup(); + void cleanup() override; void newloaded() override; - void getlabels(); - float calculate(); float calculatevec(unsigned short orient); std::string GetName() override { return std::string("Measurement"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("measurement.png"))); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("measurement.png"))); } private: void on_mouse_clicked(Point p) override; void on_mouse_moved(Point p) override; + void getlabels(); + float calculate(); void set_coord(unsigned short posit, Point p, unsigned short slicenr); - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; std::vector labels; unsigned short activeslice; - Q3HBox* hboxoverall; - Q3VBox* vboxmethods; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3VBox* vbox1; - QLabel* txt_displayer; - QLabel* txt_ccb1; - QLabel* txt_ccb2; - QLabel* txt_ccb3; - QLabel* txt_ccb4; - QRadioButton* rb_vector; - QRadioButton* rb_dist; - QRadioButton* rb_thick; - QRadioButton* rb_angle; - QRadioButton* rb_4ptangle; - QRadioButton* rb_vol; - QButtonGroup* modegroup; - QRadioButton* rb_pts; - QRadioButton* rb_lbls; - QButtonGroup* inputgroup; - QComboBox* cbb_lb1; - QComboBox* cbb_lb2; - QComboBox* cbb_lb3; - QComboBox* cbb_lb4; + Q3HBox *hboxoverall; + Q3VBox *vboxmethods; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3VBox *vbox1; + QLabel *txt_displayer; + QLabel *txt_ccb1; + QLabel *txt_ccb2; + QLabel *txt_ccb3; + QLabel *txt_ccb4; + QRadioButton *rb_vector; + QRadioButton *rb_dist; + QRadioButton *rb_thick; + QRadioButton *rb_angle; + QRadioButton *rb_4ptangle; + QRadioButton *rb_vol; + QButtonGroup *modegroup; + QRadioButton *rb_pts; + QRadioButton *rb_lbls; + QButtonGroup *inputgroup; + QComboBox *cbb_lb1; + QComboBox *cbb_lb2; + QComboBox *cbb_lb3; + QComboBox *cbb_lb4; int state; int pt[4][3]; bool drawing; @@ -93,14 +90,14 @@ class MeasurementWidget : public WidgetInterface Point p1; signals: - void vp1_changed(std::vector* vp1); - void vpdyn_changed(std::vector* vpdyn); - void vp1dyn_changed(std::vector* vp1, std::vector* vpdyn, - bool also_points = false); + void vp1_changed(std::vector *vp1); + void vpdyn_changed(std::vector *vpdyn); + void vp1dyn_changed(std::vector *vp1, std::vector *vpdyn, + bool also_points = false); private slots: void marks_changed(); - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void cbb_changed(int); void method_changed(int); void inputtype_changed(int); diff --git a/iSeg/pickerwidget.h b/iSeg/pickerwidget.h index b4939108..5624b327 100755 --- a/iSeg/pickerwidget.h +++ b/iSeg/pickerwidget.h @@ -35,20 +35,17 @@ class PickerWidget : public WidgetInterface { Q_OBJECT public: - PickerWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + PickerWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~PickerWidget(); - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; - QSize sizeHint() const; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; + QSize sizeHint() const override; void init() override; - void cleanup(); + void cleanup() override; void newloaded() override; std::string GetName() override { return std::string("Picker"); }; - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("picker.png"))); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("picker.png"))); } private: void on_mouse_clicked(Point p) override; @@ -56,35 +53,35 @@ class PickerWidget : public WidgetInterface void update_active(); void showborder(); - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned int width; unsigned int height; bool hasclipboard; bool shiftpressed; bool clipboardworkortissue; - bool* mask; - bool* currentselection; - float* valuedistrib; + bool *mask; + bool *currentselection; + float *valuedistrib; unsigned char mode; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3VBox* vbox1; - QPushButton* pb_copy; - QPushButton* pb_paste; - QPushButton* pb_cut; - QPushButton* pb_delete; - QRadioButton* rb_work; - QRadioButton* rb_tissue; - QButtonGroup* worktissuegroup; - QRadioButton* rb_erase; - QRadioButton* rb_fill; - QButtonGroup* erasefillgroup; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3VBox *vbox1; + QPushButton *pb_copy; + QPushButton *pb_paste; + QPushButton *pb_cut; + QPushButton *pb_delete; + QRadioButton *rb_work; + QRadioButton *rb_tissue; + QButtonGroup *worktissuegroup; + QRadioButton *rb_erase; + QRadioButton *rb_fill; + QButtonGroup *erasefillgroup; std::vector selection; signals: - void vp1_changed(std::vector* vp1); + void vp1_changed(std::vector *vp1); public slots: void slicenr_changed(); @@ -96,11 +93,11 @@ private slots: void delete_pressed(); void worktissue_changed(int); - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); protected: - void keyPressEvent(QKeyEvent* event); - void keyReleaseEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent *event); + void keyReleaseEvent(QKeyEvent *event); }; } // namespace iseg diff --git a/iSeg/transformwidget.h b/iSeg/transformwidget.h index cf9f1a9e..5822e5a5 100755 --- a/iSeg/transformwidget.h +++ b/iSeg/transformwidget.h @@ -35,24 +35,20 @@ class TransformWidget : public WidgetInterface Q_OBJECT public: - TransformWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + TransformWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~TransformWidget(); - void init(); - void cleanup(); - void newloaded(); - void hideparams_changed(); + void init() override; + void cleanup() override; + void newloaded() override; + void hideparams_changed() override; - bool GetIsIdentityTransform(); - void GetDataSelection(bool& source, bool& target, bool& tissues); + QSize sizeHint() const override; + std::string GetName() override { return std::string("Transform"); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("transform.png"))); } - QSize sizeHint() const; - std::string GetName() { return std::string("Transform"); } - virtual QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("transform.png")).ascii()); - } + void GetDataSelection(bool &source, bool &target, bool &tissues); private: struct TransformParametersStruct @@ -64,6 +60,8 @@ class TransformWidget : public WidgetInterface int transformCenter[2]; }; + bool GetIsIdentityTransform(); + void UpdatePreview(); void SetCenter(int x, int y); void SetCenterDefault(); @@ -74,55 +72,55 @@ class TransformWidget : public WidgetInterface void on_mouse_clicked(Point p) override; // Image data - SlicesHandler* handler3D; + SlicesHandler *handler3D; // Slice transform - SliceTransform* sliceTransform; + SliceTransform *sliceTransform; // Widgets - Q3HBox* hBoxOverall; - Q3VBox* vBoxTransforms; - Q3VBox* vBoxParams; - Q3HBox* hBoxSelectData; - Q3HBox* hBoxSlider1; - Q3HBox* hBoxSlider2; - Q3HBox* hBoxFlip; - Q3HBox* hBoxAxisSelection; - Q3HBox* hBoxCenter; - Q3HBox* hBoxExecute; - - QCheckBox* transformSourceCheckBox; - QCheckBox* transformTargetCheckBox; - QCheckBox* transformTissuesCheckBox; - - QCheckBox* allSlicesCheckBox; - QPushButton* executePushButton; - QPushButton* cancelPushButton; - - QRadioButton* translateRadioButton; - QRadioButton* rotateRadioButton; - QRadioButton* scaleRadioButton; - QRadioButton* shearRadioButton; - QRadioButton* flipRadioButton; + Q3HBox *hBoxOverall; + Q3VBox *vBoxTransforms; + Q3VBox *vBoxParams; + Q3HBox *hBoxSelectData; + Q3HBox *hBoxSlider1; + Q3HBox *hBoxSlider2; + Q3HBox *hBoxFlip; + Q3HBox *hBoxAxisSelection; + Q3HBox *hBoxCenter; + Q3HBox *hBoxExecute; + + QCheckBox *transformSourceCheckBox; + QCheckBox *transformTargetCheckBox; + QCheckBox *transformTissuesCheckBox; + + QCheckBox *allSlicesCheckBox; + QPushButton *executePushButton; + QPushButton *cancelPushButton; + + QRadioButton *translateRadioButton; + QRadioButton *rotateRadioButton; + QRadioButton *scaleRadioButton; + QRadioButton *shearRadioButton; + QRadioButton *flipRadioButton; //QRadioButton *matrixRadioButton; - QButtonGroup* transformButtonGroup; + QButtonGroup *transformButtonGroup; - QLabel* slider1Label; - QLabel* slider2Label; - QSlider* slider1; - QSlider* slider2; - QLineEdit* lineEdit1; - QLineEdit* lineEdit2; + QLabel *slider1Label; + QLabel *slider2Label; + QSlider *slider1; + QSlider *slider2; + QLineEdit *lineEdit1; + QLineEdit *lineEdit2; - QRadioButton* xAxisRadioButton; - QRadioButton* yAxisRadioButton; - QButtonGroup* axisButtonGroup; + QRadioButton *xAxisRadioButton; + QRadioButton *yAxisRadioButton; + QButtonGroup *axisButtonGroup; - QPushButton* flipPushButton; + QPushButton *flipPushButton; - QLabel* centerLabel; - QLabel* centerCoordsLabel; - QPushButton* centerSelectPushButton; + QLabel *centerLabel; + QLabel *centerCoordsLabel; + QPushButton *centerSelectPushButton; // Transform parameters bool disableUpdatePreview; @@ -151,4 +149,3 @@ private slots: }; } // namespace iseg - diff --git a/iSeg/watershedwidget.h b/iSeg/watershedwidget.h index 0019869c..15d594ce 100755 --- a/iSeg/watershedwidget.h +++ b/iSeg/watershedwidget.h @@ -35,44 +35,41 @@ class WatershedWidget : public WidgetInterface { Q_OBJECT public: - WatershedWidget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + WatershedWidget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~WatershedWidget(); - QSize sizeHint() const; + QSize sizeHint() const override; void init() override; void newloaded() override; - FILE* SaveParams(FILE* fp, int version) override; - FILE* LoadParams(FILE* fp, int version) override; + FILE *SaveParams(FILE *fp, int version) override; + FILE *LoadParams(FILE *fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Watershed"); } - virtual QIcon GetIcon(QDir picdir) override - { - return QIcon(picdir.absFilePath(QString("watershed.png"))); - } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("watershed.png"))); } private: void recalc1(); - unsigned int* usp; + unsigned int *usp; int sbh_old; - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3VBox* vbox1; - QLabel* txt_h; - QSpinBox* sb_h; - QSlider* sl_h; - QPushButton* btn_exec; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3VBox *vbox1; + QLabel *txt_h; + QSpinBox *sb_h; + QSlider *sl_h; + QPushButton *btn_exec; public slots: void slicenr_changed(); void marks_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void hsl_changed(); void slider_pressed(); void slider_released(); @@ -82,4 +79,3 @@ private slots: }; } // namespace iseg - From 068350253d4ec07e6bc1e5c1ee88c72fccd01105 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 09:28:49 +0200 Subject: [PATCH 5/9] use git mv to rename files to fix capitalization --- Core/{sliceprovider.cpp => SliceProvider.cpp} | 0 Core/{sliceprovider.h => SliceProvider.h} | 0 Core/{vec3.h => Vec3.h} | 0 iSeg/{featurewidget.cpp => FeatureWidget.cpp} | 0 iSeg/{featurewidget.h => FeatureWidget.h} | 0 iSeg/{levelset.cpp => Levelset.cpp} | 0 iSeg/{levelset.h => Levelset.h} | 0 iSeg/{livewirewidget.cpp => LivewireWidget.cpp} | 0 iSeg/{livewirewidget.h => LivewireWidget.h} | 0 iSeg/{loaderwidgets.cpp => LoaderWidgets.cpp} | 0 iSeg/{loaderwidgets.h => LoaderWidgets.h} | 0 iSeg/{measurementwidget.cpp => MeasurementWidget.cpp} | 0 iSeg/{measurementwidget.h => MeasurementWidget.h} | 0 iSeg/{pickerwidget.cpp => PickerWidget.cpp} | 0 iSeg/{pickerwidget.h => PickerWidget.h} | 0 iSeg/{slicetransform.cpp => SliceTransform.cpp} | 0 iSeg/{slicetransform.h => SliceTransform.h} | 0 iSeg/{tissuecleaner.cpp => TissueCleaner.cpp} | 0 iSeg/{tissuecleaner.h => TissueCleaner.h} | 0 iSeg/{tissueinfos.cpp => TissueInfos.cpp} | 0 iSeg/{tissueinfos.h => TissueInfos.h} | 0 iSeg/{tissuelayerinfos.cpp => TissueLayerInfos.cpp} | 0 iSeg/{tissuelayerinfos.h => TissueLayerInfos.h} | 0 iSeg/{transformwidget.cpp => TransformWidget.cpp} | 0 iSeg/{transformwidget.h => TransformWidget.h} | 0 iSeg/{watershedwidget.cpp => WatershedWidget.cpp} | 0 iSeg/{watershedwidget.h => WatershedWidget.h} | 0 iSeg/{widgetcollection.cpp => WidgetCollection.cpp} | 0 iSeg/{widgetcollection.h => WidgetCollection.h} | 0 iSeg/{world.cpp => World.cpp} | 0 iSeg/{world.h => World.h} | 0 31 files changed, 0 insertions(+), 0 deletions(-) rename Core/{sliceprovider.cpp => SliceProvider.cpp} (100%) rename Core/{sliceprovider.h => SliceProvider.h} (100%) rename Core/{vec3.h => Vec3.h} (100%) rename iSeg/{featurewidget.cpp => FeatureWidget.cpp} (100%) rename iSeg/{featurewidget.h => FeatureWidget.h} (100%) rename iSeg/{levelset.cpp => Levelset.cpp} (100%) rename iSeg/{levelset.h => Levelset.h} (100%) rename iSeg/{livewirewidget.cpp => LivewireWidget.cpp} (100%) rename iSeg/{livewirewidget.h => LivewireWidget.h} (100%) rename iSeg/{loaderwidgets.cpp => LoaderWidgets.cpp} (100%) rename iSeg/{loaderwidgets.h => LoaderWidgets.h} (100%) rename iSeg/{measurementwidget.cpp => MeasurementWidget.cpp} (100%) rename iSeg/{measurementwidget.h => MeasurementWidget.h} (100%) rename iSeg/{pickerwidget.cpp => PickerWidget.cpp} (100%) rename iSeg/{pickerwidget.h => PickerWidget.h} (100%) rename iSeg/{slicetransform.cpp => SliceTransform.cpp} (100%) rename iSeg/{slicetransform.h => SliceTransform.h} (100%) rename iSeg/{tissuecleaner.cpp => TissueCleaner.cpp} (100%) rename iSeg/{tissuecleaner.h => TissueCleaner.h} (100%) rename iSeg/{tissueinfos.cpp => TissueInfos.cpp} (100%) rename iSeg/{tissueinfos.h => TissueInfos.h} (100%) rename iSeg/{tissuelayerinfos.cpp => TissueLayerInfos.cpp} (100%) rename iSeg/{tissuelayerinfos.h => TissueLayerInfos.h} (100%) rename iSeg/{transformwidget.cpp => TransformWidget.cpp} (100%) rename iSeg/{transformwidget.h => TransformWidget.h} (100%) rename iSeg/{watershedwidget.cpp => WatershedWidget.cpp} (100%) rename iSeg/{watershedwidget.h => WatershedWidget.h} (100%) rename iSeg/{widgetcollection.cpp => WidgetCollection.cpp} (100%) rename iSeg/{widgetcollection.h => WidgetCollection.h} (100%) rename iSeg/{world.cpp => World.cpp} (100%) rename iSeg/{world.h => World.h} (100%) diff --git a/Core/sliceprovider.cpp b/Core/SliceProvider.cpp similarity index 100% rename from Core/sliceprovider.cpp rename to Core/SliceProvider.cpp diff --git a/Core/sliceprovider.h b/Core/SliceProvider.h similarity index 100% rename from Core/sliceprovider.h rename to Core/SliceProvider.h diff --git a/Core/vec3.h b/Core/Vec3.h similarity index 100% rename from Core/vec3.h rename to Core/Vec3.h diff --git a/iSeg/featurewidget.cpp b/iSeg/FeatureWidget.cpp similarity index 100% rename from iSeg/featurewidget.cpp rename to iSeg/FeatureWidget.cpp diff --git a/iSeg/featurewidget.h b/iSeg/FeatureWidget.h similarity index 100% rename from iSeg/featurewidget.h rename to iSeg/FeatureWidget.h diff --git a/iSeg/levelset.cpp b/iSeg/Levelset.cpp similarity index 100% rename from iSeg/levelset.cpp rename to iSeg/Levelset.cpp diff --git a/iSeg/levelset.h b/iSeg/Levelset.h similarity index 100% rename from iSeg/levelset.h rename to iSeg/Levelset.h diff --git a/iSeg/livewirewidget.cpp b/iSeg/LivewireWidget.cpp similarity index 100% rename from iSeg/livewirewidget.cpp rename to iSeg/LivewireWidget.cpp diff --git a/iSeg/livewirewidget.h b/iSeg/LivewireWidget.h similarity index 100% rename from iSeg/livewirewidget.h rename to iSeg/LivewireWidget.h diff --git a/iSeg/loaderwidgets.cpp b/iSeg/LoaderWidgets.cpp similarity index 100% rename from iSeg/loaderwidgets.cpp rename to iSeg/LoaderWidgets.cpp diff --git a/iSeg/loaderwidgets.h b/iSeg/LoaderWidgets.h similarity index 100% rename from iSeg/loaderwidgets.h rename to iSeg/LoaderWidgets.h diff --git a/iSeg/measurementwidget.cpp b/iSeg/MeasurementWidget.cpp similarity index 100% rename from iSeg/measurementwidget.cpp rename to iSeg/MeasurementWidget.cpp diff --git a/iSeg/measurementwidget.h b/iSeg/MeasurementWidget.h similarity index 100% rename from iSeg/measurementwidget.h rename to iSeg/MeasurementWidget.h diff --git a/iSeg/pickerwidget.cpp b/iSeg/PickerWidget.cpp similarity index 100% rename from iSeg/pickerwidget.cpp rename to iSeg/PickerWidget.cpp diff --git a/iSeg/pickerwidget.h b/iSeg/PickerWidget.h similarity index 100% rename from iSeg/pickerwidget.h rename to iSeg/PickerWidget.h diff --git a/iSeg/slicetransform.cpp b/iSeg/SliceTransform.cpp similarity index 100% rename from iSeg/slicetransform.cpp rename to iSeg/SliceTransform.cpp diff --git a/iSeg/slicetransform.h b/iSeg/SliceTransform.h similarity index 100% rename from iSeg/slicetransform.h rename to iSeg/SliceTransform.h diff --git a/iSeg/tissuecleaner.cpp b/iSeg/TissueCleaner.cpp similarity index 100% rename from iSeg/tissuecleaner.cpp rename to iSeg/TissueCleaner.cpp diff --git a/iSeg/tissuecleaner.h b/iSeg/TissueCleaner.h similarity index 100% rename from iSeg/tissuecleaner.h rename to iSeg/TissueCleaner.h diff --git a/iSeg/tissueinfos.cpp b/iSeg/TissueInfos.cpp similarity index 100% rename from iSeg/tissueinfos.cpp rename to iSeg/TissueInfos.cpp diff --git a/iSeg/tissueinfos.h b/iSeg/TissueInfos.h similarity index 100% rename from iSeg/tissueinfos.h rename to iSeg/TissueInfos.h diff --git a/iSeg/tissuelayerinfos.cpp b/iSeg/TissueLayerInfos.cpp similarity index 100% rename from iSeg/tissuelayerinfos.cpp rename to iSeg/TissueLayerInfos.cpp diff --git a/iSeg/tissuelayerinfos.h b/iSeg/TissueLayerInfos.h similarity index 100% rename from iSeg/tissuelayerinfos.h rename to iSeg/TissueLayerInfos.h diff --git a/iSeg/transformwidget.cpp b/iSeg/TransformWidget.cpp similarity index 100% rename from iSeg/transformwidget.cpp rename to iSeg/TransformWidget.cpp diff --git a/iSeg/transformwidget.h b/iSeg/TransformWidget.h similarity index 100% rename from iSeg/transformwidget.h rename to iSeg/TransformWidget.h diff --git a/iSeg/watershedwidget.cpp b/iSeg/WatershedWidget.cpp similarity index 100% rename from iSeg/watershedwidget.cpp rename to iSeg/WatershedWidget.cpp diff --git a/iSeg/watershedwidget.h b/iSeg/WatershedWidget.h similarity index 100% rename from iSeg/watershedwidget.h rename to iSeg/WatershedWidget.h diff --git a/iSeg/widgetcollection.cpp b/iSeg/WidgetCollection.cpp similarity index 100% rename from iSeg/widgetcollection.cpp rename to iSeg/WidgetCollection.cpp diff --git a/iSeg/widgetcollection.h b/iSeg/WidgetCollection.h similarity index 100% rename from iSeg/widgetcollection.h rename to iSeg/WidgetCollection.h diff --git a/iSeg/world.cpp b/iSeg/World.cpp similarity index 100% rename from iSeg/world.cpp rename to iSeg/World.cpp diff --git a/iSeg/world.h b/iSeg/World.h similarity index 100% rename from iSeg/world.h rename to iSeg/World.h From 49681a1f71a2d78241c22e3adb6311d52aaa354b Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 09:45:02 +0200 Subject: [PATCH 6/9] rename some classes, change pointer/reference alignment --- .clang-format | 1 + Plugin/WidgetInterface.cpp | 2 +- iSeg/AtlasWidget.cpp | 56 +- iSeg/AtlasWidget.h | 48 +- iSeg/LivewireWidget.cpp | 126 ++-- iSeg/LivewireWidget.h | 6 +- iSeg/MainWindow.cpp | 798 ++++++++++++------------- iSeg/MainWindow.h | 48 +- iSeg/WidgetCollection.cpp | 1158 ++++++++++++++++++------------------ iSeg/WidgetCollection.h | 756 +++++++++++------------ 10 files changed, 1476 insertions(+), 1523 deletions(-) diff --git a/.clang-format b/.clang-format index c143b18a..dba60d76 100644 --- a/.clang-format +++ b/.clang-format @@ -25,6 +25,7 @@ BraceWrapping: SplitEmptyFunction: true BreakBeforeInheritanceComma: true BreakConstructorInitializers: BeforeColon +PointerAlignment: Left CompactNamespaces: true Cpp11BracedListStyle: true FixNamespaceComments: true diff --git a/Plugin/WidgetInterface.cpp b/Plugin/WidgetInterface.cpp index b4b81fdc..d0fd4ae2 100755 --- a/Plugin/WidgetInterface.cpp +++ b/Plugin/WidgetInterface.cpp @@ -13,7 +13,7 @@ namespace iseg { bool WidgetInterface::hideparams = false; -WidgetInterface::WidgetInterface(QWidget *parent, const char *name, Qt::WindowFlags wFlags) +WidgetInterface::WidgetInterface(QWidget* parent, const char* name, Qt::WindowFlags wFlags) : QWidget(parent, name, wFlags) { m_cursor = new QCursor(Qt::CrossCursor); diff --git a/iSeg/AtlasWidget.cpp b/iSeg/AtlasWidget.cpp index d9c95249..7be263d3 100755 --- a/iSeg/AtlasWidget.cpp +++ b/iSeg/AtlasWidget.cpp @@ -32,9 +32,9 @@ using namespace iseg; -AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags) +AtlasWidget::AtlasWidget(const char *filename, QDir picpath, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags) { isOK = false; QString title("Atlas - "); @@ -49,10 +49,10 @@ AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, isOK = true; m_picpath = picpath; - QVBoxLayout* vbox1 = new QVBoxLayout; - QHBoxLayout* hbox1 = new QHBoxLayout; - QHBoxLayout* hbox2 = new QHBoxLayout; - QHBoxLayout* hbox3 = new QHBoxLayout; + QVBoxLayout *vbox1 = new QVBoxLayout; + QHBoxLayout *hbox1 = new QHBoxLayout; + QHBoxLayout *hbox2 = new QHBoxLayout; + QHBoxLayout *hbox3 = new QHBoxLayout; sl_contrast = new QSlider(Qt::Horizontal, this); sl_contrast->setRange(0, 99); @@ -62,12 +62,12 @@ AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, sl_brightness->setValue(50); lb_contrast = new QLabel("C:", this); lb_contrast->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-contrast.png")).ascii()) + .pixmap()); lb_brightness = new QLabel("B:", this); lb_brightness->setPixmap( - QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) - .pixmap()); + QIcon(m_picpath.absFilePath(QString("icon-brightness.png")).ascii()) + .pixmap()); hbox1->addWidget(lb_contrast); hbox1->addWidget(sl_contrast); hbox1->addWidget(lb_brightness); @@ -78,7 +78,7 @@ AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, vbox1->addLayout(hbox1); sa_viewer = new QScrollArea(this); atlasViewer = new AtlasViewer(image, tissue, 2, dimx, dimy, dimz, dx, dy, - dz, &color_r, &color_g, &color_b, this); + dz, &color_r, &color_g, &color_b, this); sa_viewer->setWidget(atlasViewer); vbox1->addWidget(sa_viewer); scb_slicenr = new QScrollBar(0, dimz - 1, 1, 5, 0, Qt::Horizontal, this); @@ -106,7 +106,7 @@ AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, vbox1->addLayout(hbox2); vbox1->addLayout(hbox3); - zoomer = new zoomer_widget(1.0, m_picpath, this); + zoomer = new ZoomWidget(1.0, m_picpath, this); zoomer->setFixedSize(zoomer->sizeHint()); vbox1->addWidget(zoomer); lb_name = new QLabel(QString("jljlfds"), this); @@ -114,20 +114,20 @@ AtlasWidget::AtlasWidget(const char* filename, QDir picpath, QWidget* parent, setLayout(vbox1); QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, - SLOT(scb_slicenr_changed())); + SLOT(scb_slicenr_changed())); QObject::connect(sl_transp, SIGNAL(valueChanged(int)), this, - SLOT(sl_transp_changed())); + SLOT(sl_transp_changed())); QObject::connect(bg_orient, SIGNAL(buttonClicked(int)), this, - SLOT(xyz_changed())); + SLOT(xyz_changed())); QObject::connect(zoomer, SIGNAL(set_zoom(double)), atlasViewer, - SLOT(set_zoom(double))); + SLOT(set_zoom(double))); QObject::connect(sl_brightness, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightcontr_moved())); + SLOT(sl_brightcontr_moved())); QObject::connect(sl_contrast, SIGNAL(valueChanged(int)), this, - SLOT(sl_brightcontr_moved())); + SLOT(sl_brightcontr_moved())); QObject::connect(atlasViewer, SIGNAL(mousemoved_sign(tissues_size_t)), this, - SLOT(pt_moved(tissues_size_t))); + SLOT(pt_moved(tissues_size_t))); atlasViewer->setMouseTracking(true); } @@ -137,7 +137,7 @@ AtlasWidget::~AtlasWidget() delete[] image; } -bool AtlasWidget::loadfile(const char* filename) +bool AtlasWidget::loadfile(const char *filename) { dimx = dimy = dimz = 10; dx = dy = dz = 1.0; @@ -200,17 +200,17 @@ bool AtlasWidget::loadfile(const char* filename) { for (unsigned short i = 0; i < dimz; i++) { - in.readRawData((char*)&(image[area * i]), area * sizeof(float)); - in.readRawData((char*)&(tissue[area * i]), - area * sizeof(tissues_size_t)); + in.readRawData((char *)&(image[area * i]), area * sizeof(float)); + in.readRawData((char *)&(tissue[area * i]), + area * sizeof(tissues_size_t)); } } else { - char* charBuffer = new char[area]; + char *charBuffer = new char[area]; for (unsigned short i = 0; i < dimz; i++) { - in.readRawData((char*)&(image[area * i]), area * sizeof(float)); + in.readRawData((char *)&(image[area * i]), area * sizeof(float)); in.readRawData(charBuffer, area); for (int j = 0; j < area; j++) { @@ -321,7 +321,7 @@ void AtlasWidget::sl_brightcontr_moved() float factor, offset; factor = 255.0f * (1 + sl_contrast->value()) / (maxval - minval); offset = - (127.5f - maxval * factor) * (1.0f - sl_brightness->value() * 0.01f) + - 0.01f * (127.5f - minval * factor) * sl_brightness->value(); + (127.5f - maxval * factor) * (1.0f - sl_brightness->value() * 0.01f) + + 0.01f * (127.5f - minval * factor) * sl_brightness->value(); atlasViewer->set_scale(offset, factor); } diff --git a/iSeg/AtlasWidget.h b/iSeg/AtlasWidget.h index 506dde9f..2ee7af77 100755 --- a/iSeg/AtlasWidget.h +++ b/iSeg/AtlasWidget.h @@ -43,36 +43,36 @@ class AtlasWidget : public QWidget { Q_OBJECT public: - AtlasWidget(const char* filename, QDir picpath, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + AtlasWidget(const char *filename, QDir picpath, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~AtlasWidget(); bool isOK; private: - QLabel* lb_contrast; - QLabel* lb_brightness; - QLabel* lb_transp; - QLabel* lb_name; - QSlider* sl_contrast; - QSlider* sl_brightness; - QSlider* sl_transp; - AtlasViewer* atlasViewer; - QScrollArea* sa_viewer; - zoomer_widget* zoomer; - QScrollBar* scb_slicenr; - QButtonGroup* bg_orient; - QRadioButton* rb_x; - QRadioButton* rb_y; - QRadioButton* rb_z; - QHBoxLayout* hbox1; - QHBoxLayout* hbox2; - QHBoxLayout* hbox3; - QVBoxLayout* vbox1; + QLabel *lb_contrast; + QLabel *lb_brightness; + QLabel *lb_transp; + QLabel *lb_name; + QSlider *sl_contrast; + QSlider *sl_brightness; + QSlider *sl_transp; + AtlasViewer *atlasViewer; + QScrollArea *sa_viewer; + ZoomWidget *zoomer; + QScrollBar *scb_slicenr; + QButtonGroup *bg_orient; + QRadioButton *rb_x; + QRadioButton *rb_y; + QRadioButton *rb_z; + QHBoxLayout *hbox1; + QHBoxLayout *hbox2; + QHBoxLayout *hbox3; + QVBoxLayout *vbox1; - bool loadfile(const char* filename); + bool loadfile(const char *filename); - float* image; - tissues_size_t* tissue; + float *image; + tissues_size_t *tissue; float minval, maxval; float dx, dy, dz; unsigned short dimx, dimy, dimz; diff --git a/iSeg/LivewireWidget.cpp b/iSeg/LivewireWidget.cpp index e16dc507..ac7e28b8 100755 --- a/iSeg/LivewireWidget.cpp +++ b/iSeg/LivewireWidget.cpp @@ -38,12 +38,12 @@ using namespace std; using namespace iseg; -livewire_widget::livewire_widget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) +LivewireWidget::LivewireWidget(SlicesHandler *hand3D, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Use the Auto Trace to follow ideal contour path or draw " - "contours around a tissue to segment it.")); + "contours around a tissue to segment it.")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -60,24 +60,24 @@ livewire_widget::livewire_widget(SlicesHandler* hand3D, QWidget* parent, straight = new QRadioButton(QString("Straight"), vboxmethods); autotrace = new QRadioButton(QString("Auto Trace"), vboxmethods); autotrace->setToolTip(Format( - "The Livewire (intelligent scissors) algorithm " - "to automatically identify the ideal contour path.This algorithm uses " - "information " - "about the strength and orientation of the(smoothed) image gradient, " - "the zero - crossing of the Laplacian (for fine tuning) together with " - "some weighting " - "to favor straighter lines to determine the most likely contour path. " - "The " - "contouring is started by clicking the left mouse button. Each " - "subsequent left " - "button click fixes another point and the suggested contour line in " - "between. " - "
" - "Successive removing of unwanted points is achieved by clicking the " - "middle " - "mouse button. A double left click closes the contour while a double " - "middle " - "click aborts the line drawing process.")); + "The Livewire (intelligent scissors) algorithm " + "to automatically identify the ideal contour path.This algorithm uses " + "information " + "about the strength and orientation of the(smoothed) image gradient, " + "the zero - crossing of the Laplacian (for fine tuning) together with " + "some weighting " + "to favor straighter lines to determine the most likely contour path. " + "The " + "contouring is started by clicking the left mouse button. Each " + "subsequent left " + "button click fixes another point and the suggested contour line in " + "between. " + "
" + "Successive removing of unwanted points is achieved by clicking the " + "middle " + "mouse button. A double left click closes the contour while a double " + "middle " + "click aborts the line drawing process.")); freedraw = new QRadioButton(QString("Free"), vboxmethods); drawmode->insert(straight); drawmode->insert(autotrace); @@ -87,8 +87,8 @@ livewire_widget::livewire_widget(SlicesHandler* hand3D, QWidget* parent, hbox2 = new Q3HBox(vbox1); cb_freezing = new QCheckBox("Freezing", hbox2); cb_freezing->setToolTip( - Format("Specify the number of seconds after which a line segment is " - "frozen even without mouse click if it has not changed.")); + Format("Specify the number of seconds after which a line segment is " + "frozen even without mouse click if it has not changed.")); lb_freezing1 = new QLabel("Delay: ", hbox2); sb_freezing = new QSpinBox(1, 10, 1, hbox2); sb_freezing->setValue(3); @@ -114,16 +114,16 @@ livewire_widget::livewire_widget(SlicesHandler* hand3D, QWidget* parent, mode_changed(); QObject::connect(drawmode, SIGNAL(buttonClicked(int)), this, - SLOT(mode_changed())); + SLOT(mode_changed())); QObject::connect(cb_freezing, SIGNAL(clicked()), this, - SLOT(freezing_changed())); + SLOT(freezing_changed())); QObject::connect(sb_freezing, SIGNAL(valueChanged(int)), this, - SLOT(sbfreezing_changed(int))); + SLOT(sbfreezing_changed(int))); return; } -livewire_widget::~livewire_widget() +LivewireWidget::~LivewireWidget() { delete vbox1; delete drawmode; @@ -133,9 +133,9 @@ livewire_widget::~livewire_widget() delete lwfirst; } -QSize livewire_widget::sizeHint() const { return hboxoverall->sizeHint(); } +QSize LivewireWidget::sizeHint() const { return hboxoverall->sizeHint(); } -void livewire_widget::on_mouse_clicked(Point p) +void LivewireWidget::on_mouse_clicked(Point p) { if (!drawing) { @@ -180,7 +180,7 @@ void livewire_widget::on_mouse_clicked(Point p) { lw->return_path(p, &dynamic); established.insert(established.end(), dynamic.begin(), - dynamic.end()); + dynamic.end()); if (cb_closing->isChecked()) lwfirst->return_path(p, &dynamic); else @@ -199,7 +199,7 @@ void livewire_widget::on_mouse_clicked(Point p) } } -void livewire_widget::pt_doubleclicked(Point p) +void LivewireWidget::pt_doubleclicked(Point p) { if (drawing && !freedraw->isOn()) { @@ -213,10 +213,10 @@ void livewire_widget::pt_doubleclicked(Point p) { lw->return_path(p, &dynamic); established.insert(established.end(), dynamic.begin(), - dynamic.end()); + dynamic.end()); lwfirst->return_path(p, &dynamic); established.insert(established.end(), dynamic.begin(), - dynamic.end()); + dynamic.end()); } iseg::DataSelection dataSelection; @@ -244,7 +244,7 @@ void livewire_widget::pt_doubleclicked(Point p) } } -void livewire_widget::pt_midclicked(Point p) +void LivewireWidget::pt_midclicked(Point p) { if (drawing) { @@ -309,7 +309,7 @@ void livewire_widget::pt_midclicked(Point p) } } -void livewire_widget::pt_doubleclickedmid(Point p) +void LivewireWidget::pt_doubleclickedmid(Point p) { UNREFERENCED_PARAMETER(p); if (drawing) @@ -331,7 +331,7 @@ void livewire_widget::pt_doubleclickedmid(Point p) } } -void livewire_widget::on_mouse_released(Point p) +void LivewireWidget::on_mouse_released(Point p) { if (freedraw->isOn() && drawing) { @@ -360,7 +360,7 @@ void livewire_widget::on_mouse_released(Point p) } } -void livewire_widget::on_mouse_moved(Point p) +void LivewireWidget::on_mouse_moved(Point p) { if (drawing) { @@ -396,7 +396,7 @@ void livewire_widget::on_mouse_moved(Point p) times.resize(dynamic.size()); vector::iterator tit = times.begin(); while (rit != dynamic.rend() && ritold != dynamicold.rend() && - (*rit).px == (*ritold).px && (*rit).py == (*ritold).py) + (*rit).px == (*ritold).px && (*rit).py == (*ritold).py) { rit++; ritold++; @@ -412,7 +412,7 @@ void livewire_widget::on_mouse_moved(Point p) dynamicold.clear(); dynamicold.insert(dynamicold.begin(), dynamic.begin(), - dynamic.end()); + dynamic.end()); /*FILE *fp3=fopen("D:\\Development\\segmentation\\sample images\\test100.txt","w"); for(tit=times.begin();tit!=times.end();tit++) @@ -434,20 +434,20 @@ void livewire_widget::on_mouse_moved(Point p) lw->change_pt(*rit); rit++; established.insert(established.end(), dynamic.rbegin(), - rit); + rit); times.erase(times.begin(), tit); // dynamic.erase(dynamic.rbegin(),rit); if (cb_closing->isChecked()) dynamic.insert(dynamic.end(), dynamic1.begin(), - dynamic1.end()); + dynamic1.end()); emit vp1dyn_changed(&established, &dynamic); } else { if (cb_closing->isChecked()) dynamic.insert(dynamic.end(), dynamic1.begin(), - dynamic1.end()); + dynamic1.end()); emit vpdyn_changed(&dynamic); } } @@ -455,14 +455,14 @@ void livewire_widget::on_mouse_moved(Point p) { if (cb_closing->isChecked()) dynamic.insert(dynamic.end(), dynamic1.begin(), - dynamic1.end()); + dynamic1.end()); emit vpdyn_changed(&dynamic); } } } } -void livewire_widget::init() +void LivewireWidget::init() { if (activeslice != handler3D->get_activeslice()) { @@ -501,7 +501,7 @@ void livewire_widget::init() return; } -void livewire_widget::newloaded() +void LivewireWidget::newloaded() { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -529,7 +529,7 @@ void livewire_widget::newloaded() } } -void livewire_widget::init1() +void LivewireWidget::init1() { Point p; p.px = p.py = 0; @@ -541,7 +541,7 @@ void livewire_widget::init1() // isactive=true; } -void livewire_widget::cleanup() +void LivewireWidget::cleanup() { dynamic.clear(); established.clear(); @@ -564,7 +564,7 @@ void livewire_widget::cleanup() // isactive=false; } -void livewire_widget::bmp_changed() +void LivewireWidget::bmp_changed() { cleanup(); bmphand = handler3D->get_activebmphandler(); @@ -577,7 +577,7 @@ void livewire_widget::bmp_changed() } }*/ -void livewire_widget::slicenr_changed() +void LivewireWidget::slicenr_changed() { // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); @@ -585,7 +585,7 @@ void livewire_widget::slicenr_changed() // } } -void livewire_widget::bmphand_changed(bmphandler* bmph) +void LivewireWidget::bmphand_changed(bmphandler *bmph) { bmphand = bmph; @@ -616,7 +616,7 @@ void livewire_widget::bmphand_changed(bmphandler* bmph) emit vp1dyn_changed(&established, &dynamic); } -void livewire_widget::mode_changed() +void LivewireWidget::mode_changed() { if (autotrace->isOn()) { @@ -637,7 +637,7 @@ void livewire_widget::mode_changed() } } -void livewire_widget::freezing_changed() +void LivewireWidget::freezing_changed() { if (cb_freezing->isChecked()) { @@ -655,13 +655,13 @@ void livewire_widget::freezing_changed() } } -void livewire_widget::sbfreezing_changed(int i) +void LivewireWidget::sbfreezing_changed(int i) { tlimit1 = i * 1000; tlimit2 = (float(i) + 0.5f) * 1000; } -FILE* livewire_widget::SaveParams(FILE* fp, int version) +FILE *LivewireWidget::SaveParams(FILE *fp, int version) { if (version >= 2) { @@ -683,16 +683,16 @@ FILE* livewire_widget::SaveParams(FILE* fp, int version) return fp; } -FILE* livewire_widget::LoadParams(FILE* fp, int version) +FILE *LivewireWidget::LoadParams(FILE *fp, int version) { if (version >= 2) { QObject::disconnect(drawmode, SIGNAL(buttonClicked(int)), this, - SLOT(mode_changed())); + SLOT(mode_changed())); QObject::disconnect(cb_freezing, SIGNAL(clicked()), this, - SLOT(freezing_changed())); + SLOT(freezing_changed())); QObject::disconnect(sb_freezing, SIGNAL(valueChanged(int)), this, - SLOT(sbfreezing_changed(int))); + SLOT(sbfreezing_changed(int))); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -713,16 +713,16 @@ FILE* livewire_widget::LoadParams(FILE* fp, int version) mode_changed(); QObject::connect(drawmode, SIGNAL(buttonClicked(int)), this, - SLOT(mode_changed())); + SLOT(mode_changed())); QObject::connect(cb_freezing, SIGNAL(clicked()), this, - SLOT(freezing_changed())); + SLOT(freezing_changed())); QObject::connect(sb_freezing, SIGNAL(valueChanged(int)), this, - SLOT(sbfreezing_changed(int))); + SLOT(sbfreezing_changed(int))); } return fp; } -void livewire_widget::hideparams_changed() +void LivewireWidget::hideparams_changed() { mode_changed(); if (hideparams && !cb_freezing->isChecked()) diff --git a/iSeg/LivewireWidget.h b/iSeg/LivewireWidget.h index 08176e55..9f22c6a5 100755 --- a/iSeg/LivewireWidget.h +++ b/iSeg/LivewireWidget.h @@ -41,13 +41,13 @@ namespace iseg { -class livewire_widget : public WidgetInterface +class LivewireWidget : public WidgetInterface { Q_OBJECT public: - livewire_widget(SlicesHandler *hand3D, QWidget *parent = 0, + LivewireWidget(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, Qt::WindowFlags wFlags = 0); - ~livewire_widget(); + ~LivewireWidget(); void init() override; void newloaded() override; void cleanup() override; diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 2e43b804..8eb561be 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -80,7 +80,7 @@ int importSurfacePos = -1; int importRTstructPos = -1; } // namespace -int bmpimgnr(QString *s) +int bmpimgnr(QString* s) { int result = 0; uint pos; @@ -106,7 +106,7 @@ int bmpimgnr(QString *s) return result; } -int pngimgnr(QString *s) +int pngimgnr(QString* s) { int result = 0; uint pos; @@ -132,7 +132,7 @@ int pngimgnr(QString *s) return result; } -int jpgimgnr(QString *s) +int jpgimgnr(QString* s) { int result = 0; uint pos; @@ -172,10 +172,10 @@ QString TruncateFileName(QString str) return str; } -bool read_grouptissues(const char *filename, vector &olds, - vector &news) +bool read_grouptissues(const char* filename, vector& olds, + vector& news) { - FILE *fp; + FILE* fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -194,11 +194,11 @@ bool read_grouptissues(const char *filename, vector &olds, } } -bool read_grouptissuescapped(const char *filename, vector &olds, - vector &news, +bool read_grouptissuescapped(const char* filename, vector& olds, + vector& news, bool fail_on_unknown_tissue) { - FILE *fp; + FILE* fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -298,9 +298,9 @@ bool read_grouptissuescapped(const char *filename, vector &olds, } } -bool read_tissues(const char *filename, std::vector &types) +bool read_tissues(const char* filename, std::vector& types) { - FILE *fp; + FILE* fp; if ((fp = fopen(filename, "r")) == NULL) { return false; @@ -329,14 +329,14 @@ bool read_tissues(const char *filename, std::vector &types) return ok; } -void style_dockwidget(QDockWidget *dockwidg) +void style_dockwidget(QDockWidget* dockwidg) { //dockwidg->setStyleSheet("QDockWidget { color: black; } QDockWidget::title { background: gray; padding-left: 5px; padding-top: 3px; color: darkgray} QDockWidget::close-button, QDockWidget::float-button { background: gray; }"); } -bool MenuWTT::event(QEvent *e) +bool MenuWTT::event(QEvent* e) { - const QHelpEvent *helpEvent = static_cast(e); + const QHelpEvent* helpEvent = static_cast(e); if (helpEvent->type() == QEvent::ToolTip) { // call QToolTip::showText on that QAction's tooltip. @@ -358,10 +358,10 @@ bool MenuWTT::event(QEvent *e) return QMenu::event(e); } -MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, - QDir picpath, QDir tmppath, bool editingmode, - QWidget *parent, const char *name, - Qt::WindowFlags wFlags, char **argv) +MainWindow::MainWindow(SlicesHandler* hand3D, const QString& locationstring, + const QDir& picpath, const QDir& tmppath, bool editingmode, + QWidget* parent, const char* name, + Qt::WindowFlags wFlags, char** argv) : QMainWindow(parent, name, wFlags) { setObjectName("MainWindow"); @@ -493,7 +493,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, reset_brightnesscontrast(); - zoom_widget = new zoomer_widget(1.0, m_picpath, this); + zoom_widget = new ZoomWidget(1.0, m_picpath, this); tissueTreeWidget = new TissueTreeWidget(handler3D->get_tissue_hierachy(), m_picpath, this); @@ -620,7 +620,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, new HystereticGrowingWidget(handler3D, this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(hyst_widget); - lw_widget = new livewire_widget(handler3D, this, "new window", + lw_widget = new LivewireWidget(handler3D, this, "new window", Qt::WDestructiveClose | Qt::WResizeNoErase); tabwidgets.push_back(lw_widget); iftrg_widget = new ImageForestingTransformRegionGrowingWidget( @@ -722,7 +722,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, methodTab->raiseWidget(tabwidgets[posi]); } - tab_changed((WidgetInterface *)methodTab->visibleWidget()); + tab_changed((WidgetInterface*)methodTab->visibleWidget()); // tab_old=(QWidget1 *)methodTab->visibleWidget(); updateTabvisibility(); @@ -794,32 +794,32 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, this->paletteBackgroundColor()); } - QWidget *hbox2w = new QWidget; + QWidget* hbox2w = new QWidget; setCentralWidget(hbox2w); - QWidget *vbox2w = new QWidget; - QWidget *rightvboxw = new QWidget; - QWidget *hbox1w = new QWidget; - QWidget *hboxslicew = new QWidget; - QWidget *hboxslicenrw = new QWidget; - QWidget *hboxslicethickw = new QWidget; + QWidget* vbox2w = new QWidget; + QWidget* rightvboxw = new QWidget; + QWidget* hbox1w = new QWidget; + QWidget* hboxslicew = new QWidget; + QWidget* hboxslicenrw = new QWidget; + QWidget* hboxslicethickw = new QWidget; vboxbmpw = new QWidget; vboxworkw = new QWidget; - QWidget *vbox1w = new QWidget; - QWidget *hboxbmpw = new QWidget; - QWidget *hboxworkw = new QWidget; - QWidget *hboxbmp1w = new QWidget; - QWidget *hboxwork1w = new QWidget; - QWidget *vboxtissuew = new QWidget; - QWidget *hboxlockw = new QWidget; - QWidget *hboxtissueadderw = new QWidget; - QWidget *vboxtissueadder1w = new QWidget; - QWidget *vboxtissueadder2w = new QWidget; - QWidget *hboxtabsw = new QWidget; - QWidget *vboxtabs1w = new QWidget; - QWidget *vboxtabs2w = new QWidget; - - QHBoxLayout *hboxbmp1 = new QHBoxLayout; + QWidget* vbox1w = new QWidget; + QWidget* hboxbmpw = new QWidget; + QWidget* hboxworkw = new QWidget; + QWidget* hboxbmp1w = new QWidget; + QWidget* hboxwork1w = new QWidget; + QWidget* vboxtissuew = new QWidget; + QWidget* hboxlockw = new QWidget; + QWidget* hboxtissueadderw = new QWidget; + QWidget* vboxtissueadder1w = new QWidget; + QWidget* vboxtissueadder2w = new QWidget; + QWidget* hboxtabsw = new QWidget; + QWidget* vboxtabs1w = new QWidget; + QWidget* vboxtabs2w = new QWidget; + + QHBoxLayout* hboxbmp1 = new QHBoxLayout; hboxbmp1->setSpacing(0); hboxbmp1->setMargin(0); hboxbmp1->addWidget(lb_contrastbmp); @@ -832,7 +832,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxbmp1->addWidget(sl_brightnessbmp); hboxbmp1w->setLayout(hboxbmp1); - QHBoxLayout *hboxbmp = new QHBoxLayout; + QHBoxLayout* hboxbmp = new QHBoxLayout; hboxbmp->setSpacing(0); hboxbmp->setMargin(0); hboxbmp->addWidget(cb_bmptissuevisible); @@ -840,7 +840,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxbmp->addWidget(cb_bmpoutlinevisible); hboxbmpw->setLayout(hboxbmp); - QVBoxLayout *vboxbmp = new QVBoxLayout; + QVBoxLayout* vboxbmp = new QVBoxLayout; vboxbmp->setSpacing(0); vboxbmp->setMargin(0); vboxbmp->addWidget(lb_source); @@ -849,7 +849,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vboxbmp->addWidget(hboxbmpw); vboxbmpw->setLayout(vboxbmp); - QVBoxLayout *vbox1 = new QVBoxLayout; + QVBoxLayout* vbox1 = new QVBoxLayout; vbox1->setSpacing(0); vbox1->setMargin(0); vbox1->addWidget(toworkBtn); @@ -858,7 +858,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vbox1->addWidget(swapAllBtn); vbox1w->setLayout(vbox1); - QHBoxLayout *hboxwork1 = new QHBoxLayout; + QHBoxLayout* hboxwork1 = new QHBoxLayout; hboxwork1->setSpacing(0); hboxwork1->setMargin(0); hboxwork1->addWidget(lb_contrastwork); @@ -871,7 +871,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxwork1->addWidget(sl_brightnesswork); hboxwork1w->setLayout(hboxwork1); - QHBoxLayout *hboxwork = new QHBoxLayout; + QHBoxLayout* hboxwork = new QHBoxLayout; hboxwork->setSpacing(0); hboxwork->setMargin(0); hboxwork->addWidget(cb_worktissuevisible); @@ -880,7 +880,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxworkw->setLayout(hboxwork); // vboxworkw->setSizePolicy(QSizePolicy::Ignored); - QVBoxLayout *vboxwork = new QVBoxLayout; + QVBoxLayout* vboxwork = new QVBoxLayout; vboxwork->setSpacing(0); vboxwork->setMargin(0); vboxwork->addWidget(lb_target); @@ -892,7 +892,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, // vboxbmpw->setSizePolicy(QSizePolicy::Ignore,QSizePolicy::Ignore); // vboxworkw->setSizePolicy(QSizePolicy::Ignore,QSizePolicy::Ignore); - QHBoxLayout *hbox1 = new QHBoxLayout; + QHBoxLayout* hbox1 = new QHBoxLayout; hbox1->setSpacing(0); hbox1->setMargin(0); hbox1->addWidget(vboxbmpw); @@ -900,14 +900,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hbox1->addWidget(vboxworkw); hbox1w->setLayout(hbox1); - QHBoxLayout *hboxslicethick = new QHBoxLayout; + QHBoxLayout* hboxslicethick = new QHBoxLayout; hboxslicethick->setSpacing(0); hboxslicethick->setMargin(0); hboxslicethick->addWidget(lb_slicethick); hboxslicethick->addWidget(le_slicethick); hboxslicethickw->setLayout(hboxslicethick); - QHBoxLayout *hboxslicenr = new QHBoxLayout; + QHBoxLayout* hboxslicenr = new QHBoxLayout; hboxslicenr->setSpacing(0); hboxslicenr->setMargin(0); hboxslicenr->addWidget(pb_first); @@ -918,7 +918,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxslicenr->addWidget(lb_inactivewarning); hboxslicenrw->setLayout(hboxslicenr); - QHBoxLayout *hboxslice = new QHBoxLayout; + QHBoxLayout* hboxslice = new QHBoxLayout; hboxslice->setSpacing(0); hboxslice->setMargin(0); hboxslice->addWidget(hboxslicenrw); @@ -926,7 +926,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxslice->addWidget(hboxslicethickw); hboxslicew->setLayout(hboxslice); - auto add_widget_filter = [this](QVBoxLayout *vbox, QPushButton *pb, + auto add_widget_filter = [this](QVBoxLayout* vbox, QPushButton* pb, unsigned short i) { #ifdef PLUGIN_VESSEL_WIDGET vbox->addWidget(pb); @@ -938,7 +938,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, #endif }; - QVBoxLayout *vboxtabs1 = new QVBoxLayout; + QVBoxLayout* vboxtabs1 = new QVBoxLayout; vboxtabs1->setSpacing(0); vboxtabs1->setMargin(0); for (unsigned short i = 0; i < (nrtabbuttons + 1) / 2; i++) @@ -946,7 +946,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, add_widget_filter(vboxtabs1, pb_tab[i], i); } vboxtabs1w->setLayout(vboxtabs1); - QVBoxLayout *vboxtabs2 = new QVBoxLayout; + QVBoxLayout* vboxtabs2 = new QVBoxLayout; vboxtabs2->setSpacing(0); vboxtabs2->setMargin(0); for (unsigned short i = (nrtabbuttons + 1) / 2; i < nrtabbuttons; i++) @@ -965,7 +965,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vboxtabs2w->setMaximumHeight(height_max1); } - QHBoxLayout *hboxtabs = new QHBoxLayout; + QHBoxLayout* hboxtabs = new QHBoxLayout; hboxtabs->setSpacing(0); hboxtabs->setMargin(0); hboxtabs->addWidget(vboxtabs1w); @@ -973,14 +973,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxtabsw->setLayout(hboxtabs); hboxtabsw->setFixedWidth(hboxtabs->sizeHint().width()); - QDockWidget *tabswdock = new QDockWidget(tr("Methods"), this); + QDockWidget* tabswdock = new QDockWidget(tr("Methods"), this); style_dockwidget(tabswdock); tabswdock->setObjectName("Methods"); tabswdock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); tabswdock->setWidget(hboxtabsw); addDockWidget(Qt::BottomDockWidgetArea, tabswdock); - QDockWidget *methodTabdock = new QDockWidget(tr("Parameters"), this); + QDockWidget* methodTabdock = new QDockWidget(tr("Parameters"), this); style_dockwidget(methodTabdock); methodTabdock->setObjectName("Parameters"); methodTabdock->setAllowedAreas(Qt::TopDockWidgetArea | @@ -991,18 +991,18 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, methodTabdock->setWidget(methodTab); addDockWidget(Qt::BottomDockWidgetArea, methodTabdock); - QVBoxLayout *vboxnotes = new QVBoxLayout; + QVBoxLayout* vboxnotes = new QVBoxLayout; vboxnotes->setSpacing(0); vboxnotes->setMargin(0); - QDockWidget *notesdock = new QDockWidget(tr("Notes"), this); + QDockWidget* notesdock = new QDockWidget(tr("Notes"), this); style_dockwidget(notesdock); notesdock->setObjectName("Notes"); notesdock->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); notesdock->setWidget(m_notes); addDockWidget(Qt::BottomDockWidgetArea, notesdock); - QDockWidget *bitstackdock = new QDockWidget(tr("Img Clipboard"), this); + QDockWidget* bitstackdock = new QDockWidget(tr("Img Clipboard"), this); style_dockwidget(bitstackdock); bitstackdock->setObjectName("Clipboard"); bitstackdock->setAllowedAreas(Qt::TopDockWidgetArea | @@ -1010,7 +1010,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, bitstackdock->setWidget(bitstack_widget); addDockWidget(Qt::BottomDockWidgetArea, bitstackdock); - QDockWidget *multiDatasetDock = new QDockWidget(tr("Multi Dataset"), this); + QDockWidget* multiDatasetDock = new QDockWidget(tr("Multi Dataset"), this); style_dockwidget(multiDatasetDock); multiDatasetDock->setObjectName("Multi Dataset"); multiDatasetDock->setAllowedAreas(Qt::TopDockWidgetArea | @@ -1018,7 +1018,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, multiDatasetDock->setWidget(m_MultiDataset_widget); addDockWidget(Qt::BottomDockWidgetArea, multiDatasetDock); - QDockWidget *overlaydock = new QDockWidget(tr("Overlay"), this); + QDockWidget* overlaydock = new QDockWidget(tr("Overlay"), this); style_dockwidget(overlaydock); overlaydock->setObjectName("Overlay"); overlaydock->setAllowedAreas(Qt::TopDockWidgetArea | @@ -1026,14 +1026,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, overlaydock->setWidget(overlay_widget); addDockWidget(Qt::BottomDockWidgetArea, overlaydock); - QVBoxLayout *vbox2 = new QVBoxLayout; + QVBoxLayout* vbox2 = new QVBoxLayout; vbox2->setSpacing(0); vbox2->setMargin(0); vbox2->addWidget(hbox1w); vbox2->addWidget(hboxslicew); vbox2w->setLayout(vbox2); - QHBoxLayout *hboxlock = new QHBoxLayout; + QHBoxLayout* hboxlock = new QHBoxLayout; hboxlock->setSpacing(0); hboxlock->setMargin(0); hboxlock->addWidget(cb_tissuelock); @@ -1041,7 +1041,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxlock->addStretch(); hboxlockw->setLayout(hboxlock); - QVBoxLayout *vboxtissue = new QVBoxLayout; + QVBoxLayout* vboxtissue = new QVBoxLayout; vboxtissue->setSpacing(0); vboxtissue->setMargin(0); vboxtissue->addWidget(tissueFilter); @@ -1051,23 +1051,23 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vboxtissue->addWidget(addFolder); vboxtissue->addWidget(modifyTissueFolder); - QHBoxLayout *hboxtissueremove = new QHBoxLayout; + QHBoxLayout* hboxtissueremove = new QHBoxLayout; hboxtissueremove->addWidget(removeTissueFolder); hboxtissueremove->addWidget(removeTissueFolderAll); vboxtissue->addLayout(hboxtissueremove); vboxtissue->addWidget(tissue3Dopt); - QHBoxLayout *hboxtissueget = new QHBoxLayout; + QHBoxLayout* hboxtissueget = new QHBoxLayout; hboxtissueget->addWidget(getTissue); hboxtissueget->addWidget(getTissueAll); vboxtissue->addLayout(hboxtissueget); - QHBoxLayout *hboxtissueclear = new QHBoxLayout; + QHBoxLayout* hboxtissueclear = new QHBoxLayout; hboxtissueclear->addWidget(clearTissue); hboxtissueclear->addWidget(clearTissues); vboxtissue->addLayout(hboxtissueclear); vboxtissuew->setLayout(vboxtissue); //xxxb vboxtissuew->setFixedHeight(vboxtissue->sizeHint().height()); - QVBoxLayout *vboxtissueadder1 = new QVBoxLayout; + QVBoxLayout* vboxtissueadder1 = new QVBoxLayout; vboxtissueadder1->setSpacing(0); vboxtissueadder1->setMargin(0); vboxtissueadder1->addWidget(cb_addsub3d); @@ -1077,7 +1077,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vboxtissueadder1w->setLayout(vboxtissueadder1); vboxtissueadder1w->setFixedHeight(vboxtissueadder1->sizeHint().height()); - QVBoxLayout *vboxtissueadder2 = new QVBoxLayout; + QVBoxLayout* vboxtissueadder2 = new QVBoxLayout; vboxtissueadder2->setSpacing(0); vboxtissueadder2->setMargin(0); vboxtissueadder2->addWidget(cb_addsubconn); @@ -1087,7 +1087,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, vboxtissueadder2w->setLayout(vboxtissueadder2); vboxtissueadder2w->setFixedHeight(vboxtissueadder1->sizeHint().height()); - QHBoxLayout *hboxtissueadder = new QHBoxLayout; + QHBoxLayout* hboxtissueadder = new QHBoxLayout; hboxtissueadder->setSpacing(0); hboxtissueadder->setMargin(0); hboxtissueadder->addWidget(vboxtissueadder1w); @@ -1096,14 +1096,14 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxtissueadderw->setFixedHeight(hboxtissueadder->sizeHint().height()); //xxxb hboxtissueadderw->setFixedWidth(vboxtissue->sizeHint().width()); - QDockWidget *zoomdock = new QDockWidget(tr("Zoom"), this); + QDockWidget* zoomdock = new QDockWidget(tr("Zoom"), this); style_dockwidget(zoomdock); zoomdock->setObjectName("Zoom"); zoomdock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); zoomdock->setWidget(zoom_widget); addDockWidget(Qt::RightDockWidgetArea, zoomdock); - QDockWidget *tissuewdock = new QDockWidget(tr("Tissues"), this); + QDockWidget* tissuewdock = new QDockWidget(tr("Tissues"), this); style_dockwidget(tissuewdock); tissuewdock->setObjectName("Tissues"); tissuewdock->setAllowedAreas(Qt::LeftDockWidgetArea | @@ -1111,7 +1111,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, tissuewdock->setWidget(vboxtissuew); addDockWidget(Qt::RightDockWidgetArea, tissuewdock); - QDockWidget *tissuehierarchydock = + QDockWidget* tissuehierarchydock = new QDockWidget(tr("Tissue Hierarchy"), this); style_dockwidget(tissuehierarchydock); tissuehierarchydock->setToolTip( @@ -1123,7 +1123,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, tissuehierarchydock->setWidget(tissueHierarchyWidget); addDockWidget(Qt::RightDockWidgetArea, tissuehierarchydock); - QDockWidget *tissueadddock = new QDockWidget(tr("Adder"), this); + QDockWidget* tissueadddock = new QDockWidget(tr("Adder"), this); style_dockwidget(tissueadddock); tissueadddock->setToolTip(Format("The tissue adder provides functionality " "to add/remove an object selected/picked in " @@ -1138,7 +1138,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, hboxslice->addStretch(); hboxslice->addStretch(); - QHBoxLayout *hbox2 = new QHBoxLayout; + QHBoxLayout* hbox2 = new QHBoxLayout; hbox2->setSpacing(0); hbox2->setMargin(0); hbox2->addWidget(vbox2w); @@ -1192,7 +1192,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, if (!m_editingmode) { openS4LLinkPos = file->actions().size(); - QAction *importS4LLink = file->addAction("Import S4L link (h5)..."); + QAction* importS4LLink = file->addAction("Import S4L link (h5)..."); connect(importS4LLink, SIGNAL(triggered()), this, SLOT(execute_loads4llivelink())); importS4LLink->setToolTip("Loads a Sim4Life live link file (the h5 file, " @@ -1201,7 +1201,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, } importSurfacePos = file->actions().size(); - QAction *importSurface = file->addAction("Import Surface..."); + QAction* importSurface = file->addAction("Import Surface..."); connect(importSurface, SIGNAL(triggered()), this, SLOT(execute_loadsurface())); importSurface->setToolTip("Some data must be opened first to load the " @@ -1209,7 +1209,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, importSurface->setEnabled(true); importRTstructPos = file->actions().size(); - QAction *importRTAction = file->addAction("Import RTstruct..."); + QAction* importRTAction = file->addAction("Import RTstruct..."); connect(importRTAction, SIGNAL(triggered()), this, SLOT(execute_loadrtstruct())); importRTAction->setToolTip( @@ -1543,8 +1543,8 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(add_tissuelarger(Point))); QObject::connect(work_show, SIGNAL(selecttissue_sign(Point)), this, SLOT(select_tissue(Point))); - QObject::connect(tissueFilter, SIGNAL(textChanged(const QString &)), this, - SLOT(tissueFilterChanged(const QString &))); + QObject::connect(tissueFilter, SIGNAL(textChanged(const QString&)), this, + SLOT(tissueFilterChanged(const QString&))); QObject::connect(lockTissues, SIGNAL(clicked()), this, SLOT(lockAllTissues())); QObject::connect(addTissue, SIGNAL(clicked()), this, @@ -1564,8 +1564,8 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, QObject::connect(clearTissue, SIGNAL(clicked()), this, SLOT(clearselected())); QObject::connect(clearTissues, SIGNAL(clicked()), this, SLOT(cleartissues())); - QObject::connect(methodTab, SIGNAL(aboutToShow(QWidget *)), this, - SLOT(tab_changed(QWidget *))); + QObject::connect(methodTab, SIGNAL(aboutToShow(QWidget*)), this, + SLOT(tab_changed(QWidget*))); tissueTreeWidget->setSelectionMode( QAbstractItemView::SelectionMode::ExtendedSelection); @@ -1573,11 +1573,11 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, QObject::connect(tissueTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(tissue_selection_changed())); QObject::connect(tissueTreeWidget, - SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, - SLOT(tree_widget_doubleclicked(QTreeWidgetItem *, int))); + SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, + SLOT(tree_widget_doubleclicked(QTreeWidgetItem*, int))); QObject::connect(tissueTreeWidget, - SIGNAL(customContextMenuRequested(const QPoint &)), this, - SLOT(tree_widget_contextmenu(const QPoint &))); + SIGNAL(customContextMenuRequested(const QPoint&)), this, + SLOT(tree_widget_contextmenu(const QPoint&))); tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); bmp_show->color_changed(currTissueType - 1); @@ -1603,7 +1603,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, QObject::connect(scb_slicenr, SIGNAL(valueChanged(int)), this, SLOT(scb_slicenr_changed())); - QObject::connect(le_slicethick, SIGNAL(textChanged(const QString &)), this, + QObject::connect(le_slicethick, SIGNAL(textChanged(const QString&)), this, SLOT(slicethickness_changed())); QObject::connect(pb_add, SIGNAL(clicked()), this, SLOT(add_tissue_pushed())); @@ -1630,33 +1630,33 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(set_zoom(double))); QObject::connect( - this, SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, - SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); - QObject::connect(this, SIGNAL(end_dataexport(QWidget *)), this, - SLOT(handle_end_dataexport(QWidget *))); + this, SIGNAL(begin_dataexport(iseg::DataSelection&, QWidget*)), this, + SLOT(handle_begin_dataexport(iseg::DataSelection&, QWidget*))); + QObject::connect(this, SIGNAL(end_dataexport(QWidget*)), this, + SLOT(handle_end_dataexport(QWidget*))); QObject::connect( - this, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + this, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); - QObject::connect(this, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + QObject::connect(this, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( threshold_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(threshold_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( OutlineCorrect_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(OutlineCorrect_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect(OutlineCorrect_widget, SIGNAL(signal_request_selected_tissue_TS()), this, SLOT(provide_selected_tissue_TS())); @@ -1665,115 +1665,115 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(provide_selected_tissue_BG())); QObject::connect( smoothing_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(smoothing_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( edge_widg, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(edge_widg, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( morph_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(morph_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( wshed_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(wshed_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( lw_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(lw_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( iftrg_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(iftrg_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( FMF_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(FMF_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( interpolwidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(interpolwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( scalewidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(scalewidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( imagemathwidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(imagemathwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( imageoverlaywidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(imageoverlaywidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( bitstack_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(bitstack_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( bitstack_widget, - SIGNAL(begin_dataexport(iseg::DataSelection &, QWidget *)), this, - SLOT(handle_begin_dataexport(iseg::DataSelection &, QWidget *))); - QObject::connect(bitstack_widget, SIGNAL(end_dataexport(QWidget *)), this, - SLOT(handle_end_dataexport(QWidget *))); + SIGNAL(begin_dataexport(iseg::DataSelection&, QWidget*)), this, + SLOT(handle_begin_dataexport(iseg::DataSelection&, QWidget*))); + QObject::connect(bitstack_widget, SIGNAL(end_dataexport(QWidget*)), this, + SLOT(handle_end_dataexport(QWidget*))); QObject::connect( hyst_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(hyst_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( pickerwidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(pickerwidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect( transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(transfrmWidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), bmp_show, SLOT(overlay_changed())); QObject::connect(overlay_widget, SIGNAL(overlay_changed()), work_show, @@ -1795,11 +1795,11 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(DatasetChanged())); QObject::connect( m_MultiDataset_widget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(m_MultiDataset_widget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); QObject::connect(cb_tissuelock, SIGNAL(clicked()), this, SLOT(tissuelock_toggled())); @@ -1840,9 +1840,9 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, SLOT(wheelrotated(int))); QObject::connect(bmp_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(const QPoint&))); QObject::connect(work_show, SIGNAL(mousePosZoom_sign(QPoint)), this, - SLOT(mousePosZoom_changed(QPoint))); + SLOT(mousePosZoom_changed(const QPoint&))); // QObject::connect(pb_work2tissue,SIGNAL(clicked()),this,SLOT(do_work2tissue())); @@ -1905,7 +1905,7 @@ MainWindow::MainWindow(SlicesHandler *hand3D, QString locationstring, MainWindow::~MainWindow() {} -void MainWindow::closeEvent(QCloseEvent *qce) +void MainWindow::closeEvent(QCloseEvent* qce) { if (maybeSafe()) { @@ -2664,7 +2664,7 @@ void MainWindow::execute_loadbmp() } }*/ - std::vector vfilenames; + std::vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -2717,7 +2717,7 @@ void MainWindow::execute_loadpng() vi.push_back(pngimgnr(&files[i])); } - std::vector vfilenames; + std::vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -2783,7 +2783,7 @@ void MainWindow::execute_loadjpg() } }*/ - vector vfilenames; + vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -3085,7 +3085,7 @@ void MainWindow::execute_reloadbmp() } }*/ - vector vfilenames; + vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(files[i].ascii()); @@ -3296,12 +3296,12 @@ void MainWindow::execute_loadrtstruct() RadiotherapyStructureSetImporter RI(loadfilename, handler3D, this); QObject::connect( - &RI, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &RI, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); - QObject::connect(&RI, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + QObject::connect(&RI, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); RI.move(QCursor::pos()); RI.exec(); @@ -3310,12 +3310,12 @@ void MainWindow::execute_loadrtstruct() tissuenr_changed(tissueTreeWidget->get_current_type() - 1); QObject::disconnect( - &RI, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &RI, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::disconnect( - &RI, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + &RI, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); reset_brightnesscontrast(); #endif @@ -3487,7 +3487,7 @@ void MainWindow::execute_saveprojas() //m_saveprojfilename = tempFileName; //AddLoadProj(tempFileName); AddLoadProj(m_saveprojfilename); - FILE *fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); + FILE* fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); @@ -3557,7 +3557,7 @@ void MainWindow::execute_savecopyas() if (savefilename.length() <= 4 || !savefilename.endsWith(QString(".prj"))) savefilename.append(".prj"); - FILE *fp = handler3D->SaveProject(savefilename.ascii(), "xmf"); + FILE* fp = handler3D->SaveProject(savefilename.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); @@ -3593,7 +3593,7 @@ void MainWindow::execute_savecopyas() void MainWindow::SaveSettings() { - FILE *fp = fopen(settingsfile.c_str(), "wb"); + FILE* fp = fopen(settingsfile.c_str(), "wb"); if (fp == NULL) return; unsigned short saveProjVersion = 12; @@ -3658,10 +3658,10 @@ void MainWindow::SaveSettings() settings.sync(); } -void MainWindow::LoadSettings(const char *loadfilename) +void MainWindow::LoadSettings(const char* loadfilename) { settingsfile = loadfilename; - FILE *fp; + FILE* fp; if ((fp = fopen(loadfilename, "rb")) == NULL) { return; @@ -3735,9 +3735,9 @@ void MainWindow::LoadSettings(const char *loadfilename) execute_showtabtoggled(flag); fp = TissueInfos::LoadTissues(fp, tissuesVersion); - const char *defaultTissuesFilename = + const char* defaultTissuesFilename = m_tmppath.absFilePath(QString("def_tissues.txt")); - FILE *fpTmp = fopen(defaultTissuesFilename, "r"); + FILE* fpTmp = fopen(defaultTissuesFilename, "r"); if (fpTmp != NULL || TissueInfos::GetTissueCount() <= 0) { if (fpTmp != NULL) @@ -3817,7 +3817,7 @@ void MainWindow::execute_saveactiveslicesas() if (!savefilename.isEmpty()) { - FILE *fp = handler3D->SaveActiveSlices(savefilename.ascii(), "xmf"); + FILE* fp = handler3D->SaveActiveSlices(savefilename.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); @@ -3908,7 +3908,7 @@ void MainWindow::execute_saveproj() m_saveprojfilename = tempFileName; //FILE *fp=handler3D->SaveProject(m_saveprojfilename.ascii(),"xmf"); - FILE *fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); + FILE* fp = handler3D->SaveProject(tempFileName.ascii(), "xmf"); fp = bitstack_widget->save_proj(fp); unsigned short saveProjVersion = 12; fp = TissueInfos::SaveTissues(fp, saveProjVersion); @@ -4014,9 +4014,9 @@ void MainWindow::execute_saveproj() emit end_dataexport(this); } -void MainWindow::loadproj(const QString &loadfilename) +void MainWindow::loadproj(const QString& loadfilename) { - FILE *fp; + FILE* fp; if ((fp = fopen(loadfilename.ascii(), "r")) == NULL) { return; @@ -4110,7 +4110,7 @@ void MainWindow::loadproj(const QString &loadfilename) //m_S4Lcommunicationfilename=QString("F:\\applications\\bifurcation\\bifurcation2.h5");xxxa } -void MainWindow::loadS4Llink(const QString &loadfilename) +void MainWindow::loadS4Llink(const QString& loadfilename) { bool stillopen = false; @@ -4177,7 +4177,7 @@ void MainWindow::execute_mergeprojects() if (!savefilename.isEmpty() && mergefilenames.size() > 0) { - FILE *fp = handler3D->MergeProjects(savefilename.ascii(), mergefilenames); + FILE* fp = handler3D->MergeProjects(savefilename.ascii(), mergefilenames); if (!fp) { QMessageBox::warning(this, "iSeg", @@ -4309,7 +4309,7 @@ void MainWindow::execute_loadproj4() void MainWindow::execute_loadatlas(int i) { - AtlasWidget *AW = new AtlasWidget( + AtlasWidget* AW = new AtlasWidget( m_atlasfilename.m_atlasdir.absFilePath(m_atlasfilename.m_atlasfilename[i]) .ascii(), m_picpath); @@ -4694,11 +4694,11 @@ void MainWindow::execute_loadtissues() QMessageBox msgBox; msgBox.setText("Do you want to append the new tissues or to replace " "the old tissues?"); - QPushButton *appendButton = + QPushButton* appendButton = msgBox.addButton(tr("Append"), QMessageBox::AcceptRole); - QPushButton *replaceButton = + QPushButton* replaceButton = msgBox.addButton(tr("Replace"), QMessageBox::AcceptRole); - QPushButton *abortButton = msgBox.addButton(QMessageBox::Abort); + QPushButton* abortButton = msgBox.addButton(QMessageBox::Abort); msgBox.setIcon(QMessageBox::Question); msgBox.exec(); @@ -4905,19 +4905,6 @@ void MainWindow::update_bmp() } } -void MainWindow::update_bmp(QRect rect) -{ - bmp_show->update(rect); - if (xsliceshower != NULL) - { - xsliceshower->bmp_changed(); - } - if (ysliceshower != NULL) - { - ysliceshower->bmp_changed(); - } -} - void MainWindow::update_work() { work_show->update(); @@ -4932,20 +4919,6 @@ void MainWindow::update_work() } } -void MainWindow::update_work(QRect rect) -{ - work_show->update(rect); - - if (xsliceshower != NULL) - { - xsliceshower->work_changed(); - } - if (ysliceshower != NULL) - { - ysliceshower->work_changed(); - } -} - void MainWindow::update_tissue() { bmp_show->tissue_changed(); @@ -4960,20 +4933,6 @@ void MainWindow::update_tissue() SV3D->tissue_changed(); } -void MainWindow::update_tissue(QRect rect) -{ - bmp_show->tissue_changed(rect); - work_show->tissue_changed(rect); - if (xsliceshower != NULL) - xsliceshower->tissue_changed(); - if (ysliceshower != NULL) - ysliceshower->tissue_changed(); - if (VV3D != NULL) - VV3D->tissue_changed(); - if (SV3D != NULL) - SV3D->tissue_changed(); -} - void MainWindow::xslice_closed() { if (xsliceshower != NULL) @@ -5139,21 +5098,21 @@ void MainWindow::execute_scale() { ScaleWork SW(handler3D, m_picpath, this); QObject::connect( - &SW, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &SW, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); - QObject::connect(&SW, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + QObject::connect(&SW, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); SW.move(QCursor::pos()); SW.exec(); QObject::disconnect( - &SW, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &SW, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::disconnect( - &SW, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + &SW, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); return; } @@ -5162,21 +5121,21 @@ void MainWindow::execute_imagemath() { ImageMath IM(handler3D, this); QObject::connect( - &IM, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &IM, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); - QObject::connect(&IM, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + QObject::connect(&IM, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); IM.move(QCursor::pos()); IM.exec(); QObject::disconnect( - &IM, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &IM, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::disconnect( - &IM, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + &IM, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); return; } @@ -5198,21 +5157,21 @@ void MainWindow::execute_overlay() { ImageOverlay IO(handler3D, this); QObject::connect( - &IO, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &IO, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); - QObject::connect(&IO, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); + QObject::connect(&IO, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); IO.move(QCursor::pos()); IO.exec(); QObject::disconnect( - &IO, SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), + &IO, SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::disconnect( - &IO, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + &IO, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); return; } @@ -5494,8 +5453,8 @@ void MainWindow::execute_showtabtoggled(bool) showpb_tab[i] = showtab_action[i]->isOn(); } - WidgetInterface *currentwidget = - (WidgetInterface *)methodTab->visibleWidget(); + WidgetInterface* currentwidget = + (WidgetInterface*)methodTab->visibleWidget(); unsigned short i = 0; while ((i < nrtabbuttons) && (currentwidget != tabwidgets[i])) i++; @@ -5737,7 +5696,7 @@ void MainWindow::remove_mark(Point p) void MainWindow::select_tissue(Point p) { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto i = list.begin(); i != list.end(); ++i) { (*i)->setSelected(false); @@ -6244,7 +6203,7 @@ void MainWindow::do_work2tissue_grouped() } } -void MainWindow::tissueFilterChanged(const QString &text) +void MainWindow::tissueFilterChanged(const QString& text) { tissueTreeWidget->set_tissue_filter(text); } @@ -6262,7 +6221,7 @@ void MainWindow::newTissuePressed() void MainWindow::merge() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); @@ -6284,7 +6243,7 @@ void MainWindow::merge() tmp = tissue3Dopt->isChecked(); tissue3Dopt->setChecked(true); selectedtissue2work(); - QList list; + QList list; list = tissueTreeWidget->selectedItems(); TissueAdder TA(false, tissueTreeWidget, this); //TA.move(QCursor::pos()); @@ -6369,7 +6328,7 @@ void MainWindow::removeTissueFolderPressed() void MainWindow::removeselected() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); @@ -6394,10 +6353,10 @@ void MainWindow::removeselected() { return; // Cancel } - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); if (tissueTreeWidget->get_tissue_instance_count(currTissueType) > 1) { @@ -6462,11 +6421,11 @@ void MainWindow::removeselected() } } -void MainWindow::removeselectedmerge(QList list) +void MainWindow::removeselectedmerge(QList list) { for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); tissues_size_t tissueCount = TissueInfos::GetTissueCount(); iseg::DataSelection dataSelection; @@ -6561,7 +6520,7 @@ void MainWindow::removeFolder() void MainWindow::removeTissueFolderAllPressed() { bool anyLocked = false; - QList list_ = tissueTreeWidget->get_all_items(); + QList list_ = tissueTreeWidget->get_all_items(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); @@ -6626,11 +6585,11 @@ void MainWindow::selectedtissue2work() emit begin_datachange(dataSelection, this); handler3D->clear_work(); - QList list; + QList list; list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); if (tissue3Dopt->isChecked()) @@ -6668,7 +6627,7 @@ void MainWindow::tissue2workall() void MainWindow::cleartissues() { bool anyLocked = false; - QList list_ = tissueTreeWidget->get_all_items(); + QList list_ = tissueTreeWidget->get_all_items(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); @@ -6746,7 +6705,7 @@ void MainWindow::cleartissue() void MainWindow::clearselected() { bool anyLocked = false; - QList list_ = tissueTreeWidget->selectedItems(); + QList list_ = tissueTreeWidget->selectedItems(); for (auto a = list_.begin(); a != list_.end() && !anyLocked; ++a) { anyLocked |= TissueInfos::GetTissueLocked(tissueTreeWidget->get_type(*a)); @@ -6773,7 +6732,7 @@ void MainWindow::clearselected() auto list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; tissues_size_t nr = tissueTreeWidget->get_type(item); if (tissue3Dopt->isChecked()) { @@ -6838,7 +6797,7 @@ void MainWindow::workpicturevisible_changed() void MainWindow::slice_changed() { - WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); + WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); qw->on_slicenr_changed(); unsigned short slicenr = handler3D->get_activeslice() + 1; @@ -6892,10 +6851,10 @@ void MainWindow::slices3d_changed(bool new_bitstack) for (size_t i = 0; i < tabwidgets.size(); i++) { - ((WidgetInterface *)(tabwidgets[i]))->newloaded(); + ((WidgetInterface*)(tabwidgets[i]))->newloaded(); } - WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); + WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); if (handler3D->return_nrslices() != nrslices) { @@ -7057,8 +7016,8 @@ void MainWindow::slicethickness_changed1() void MainWindow::tissuenr_changed(int i) { - QWidget *qw = methodTab->visibleWidget(); - if (auto tool = dynamic_cast(qw)) + QWidget* qw = methodTab->visibleWidget(); + if (auto tool = dynamic_cast(qw)) { tool->on_tissuenr_changed(i); } @@ -7072,7 +7031,7 @@ void MainWindow::tissuenr_changed(int i) void MainWindow::tissue_selection_changed() { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); if (list.size() > 1) { showpb_tab[6] = false; @@ -7100,23 +7059,23 @@ void MainWindow::tissue_selection_changed() void MainWindow::unselectall() { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; item->setSelected(false); } } -void MainWindow::tree_widget_doubleclicked(QTreeWidgetItem *item, int column) +void MainWindow::tree_widget_doubleclicked(QTreeWidgetItem* item, int column) { modifTissueFolderPressed(); } -void MainWindow::tree_widget_contextmenu(const QPoint &pos) +void MainWindow::tree_widget_contextmenu(const QPoint& pos) { - QList list = tissueTreeWidget->selectedItems(); + QList list = tissueTreeWidget->selectedItems(); if (list.size() <= 1) // single selection { @@ -7190,11 +7149,11 @@ void MainWindow::tissuelock_toggled() } else { - QList list; + QList list; list = tissueTreeWidget->selectedItems(); for (auto a = list.begin(); a != list.end(); ++a) { - QTreeWidgetItem *item = *a; + QTreeWidgetItem* item = *a; tissues_size_t currTissueType = tissueTreeWidget->get_type(item); //tissues_size_t currTissueType = tissueTreeWidget->get_current_type(); TissueInfos::SetTissueLocked(currTissueType, cb_tissuelock->isChecked()); @@ -7293,7 +7252,7 @@ void MainWindow::do_clearundo() editmenu->setItemEnabled(undonr, false); } -void MainWindow::tab_changed(QWidget *qw) +void MainWindow::tab_changed(QWidget* qw) { if (qw != tab_old) { @@ -7329,29 +7288,29 @@ void MainWindow::tab_changed(QWidget *qw) QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, SLOT(marks_changed())); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); QObject::disconnect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), work_show, + SLOT(set_vp1(std::vector*))); QObject::disconnect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::disconnect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), + work_show, SLOT(set_vpdyn(std::vector*))); QObject::disconnect( measurement_widget, SIGNAL( - vp1dyn_changed(std::vector *, std::vector *, bool)), + vp1dyn_changed(std::vector*, std::vector*, bool)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); QObject::disconnect( measurement_widget, SIGNAL( - vp1dyn_changed(std::vector *, std::vector *, bool)), + vp1dyn_changed(std::vector*, std::vector*, bool)), work_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); @@ -7362,8 +7321,8 @@ void MainWindow::tab_changed(QWidget *qw) QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, SLOT(marks_changed())); QObject::disconnect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); } else if (tab_old == wshed_widget) { @@ -7379,16 +7338,16 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(bmp_changed())); QObject::disconnect(hyst_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); QObject::disconnect(hyst_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::disconnect( hyst_widget, - SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *))); + SLOT(set_vp1_dyn(std::vector*, std::vector*))); } else if (tab_old == lw_widget) { @@ -7402,16 +7361,16 @@ void MainWindow::tab_changed(QWidget *qw) lw_widget, SLOT(pt_midclicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), lw_widget, SLOT(pt_doubleclickedmid(Point))); - QObject::disconnect(lw_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); + QObject::disconnect(lw_widget, SIGNAL(vp1_changed(std::vector*)), + bmp_show, SLOT(set_vp1(std::vector*))); QObject::disconnect(lw_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::disconnect( lw_widget, - SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *))); + SLOT(set_vp1_dyn(std::vector*, std::vector*))); bmp_show->setMouseTracking(false); } @@ -7422,11 +7381,11 @@ void MainWindow::tab_changed(QWidget *qw) QObject::disconnect(this, SIGNAL(bmp_changed()), iftrg_widget, SLOT(bmp_changed())); - QObject::disconnect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), - bmp_show, SLOT(set_vm(std::vector *))); + QObject::disconnect(iftrg_widget, SIGNAL(vm_changed(std::vector*)), + bmp_show, SLOT(set_vm(std::vector*))); QObject::disconnect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vmdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); } else if (tab_old == FMF_widget) { @@ -7436,8 +7395,8 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(bmp_changed())); QObject::disconnect(FMF_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); } else if (tab_old == OutlineCorrect_widget) { @@ -7447,20 +7406,20 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(workbits_changed())); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::disconnect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), + work_show, SLOT(set_vpdyn(std::vector*))); } else if (tab_old == feature_widget) { QObject::disconnect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::disconnect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), - work_show, SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), + work_show, SLOT(set_vpdyn(std::vector*))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); @@ -7475,11 +7434,11 @@ void MainWindow::tab_changed(QWidget *qw) pickerwidget->cleanup(); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); QObject::disconnect(pickerwidget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), work_show, + SLOT(set_vp1(std::vector*))); } else if (tab_old == transfrmWidget) { @@ -7521,29 +7480,29 @@ void MainWindow::tab_changed(QWidget *qw) QObject::connect(this, SIGNAL(marks_changed()), measurement_widget, SLOT(marks_changed())); QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); QObject::connect(measurement_widget, - SIGNAL(vp1_changed(std::vector *)), work_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), work_show, + SLOT(set_vp1(std::vector*))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::connect(measurement_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), work_show, + SLOT(set_vpdyn(std::vector*))); QObject::connect( measurement_widget, SIGNAL( - vp1dyn_changed(std::vector *, std::vector *, bool)), + vp1dyn_changed(std::vector*, std::vector*, bool)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); QObject::connect( measurement_widget, SIGNAL( - vp1dyn_changed(std::vector *, std::vector *, bool)), + vp1dyn_changed(std::vector*, std::vector*, bool)), work_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *, bool))); + SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); @@ -7553,8 +7512,8 @@ void MainWindow::tab_changed(QWidget *qw) QObject::connect(this, SIGNAL(marks_changed()), vesselextr_widget, SLOT(marks_changed())); QObject::connect(vesselextr_widget, - SIGNAL(vp1_changed(std::vector *)), bmp_show, - SLOT(set_vp1(std::vector *))); + SIGNAL(vp1_changed(std::vector*)), bmp_show, + SLOT(set_vp1(std::vector*))); } else if (qw == wshed_widget) { @@ -7568,15 +7527,15 @@ void MainWindow::tab_changed(QWidget *qw) QObject::connect(this, SIGNAL(bmp_changed()), hyst_widget, SLOT(bmp_changed())); - QObject::connect(hyst_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); - QObject::connect(hyst_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + QObject::connect(hyst_widget, SIGNAL(vp1_changed(std::vector*)), + bmp_show, SLOT(set_vp1(std::vector*))); + QObject::connect(hyst_widget, SIGNAL(vpdyn_changed(std::vector*)), + bmp_show, SLOT(set_vpdyn(std::vector*))); QObject::connect( hyst_widget, - SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *))); + SLOT(set_vp1_dyn(std::vector*, std::vector*))); // hyst_widget->init(); } @@ -7590,15 +7549,15 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(pt_midclicked(Point))); QObject::connect(bmp_show, SIGNAL(mousedoubleclickmid_sign(Point)), lw_widget, SLOT(pt_doubleclickedmid(Point))); - QObject::connect(lw_widget, SIGNAL(vp1_changed(std::vector *)), - bmp_show, SLOT(set_vp1(std::vector *))); - QObject::connect(lw_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + QObject::connect(lw_widget, SIGNAL(vp1_changed(std::vector*)), + bmp_show, SLOT(set_vp1(std::vector*))); + QObject::connect(lw_widget, SIGNAL(vpdyn_changed(std::vector*)), + bmp_show, SLOT(set_vpdyn(std::vector*))); QObject::connect( lw_widget, - SIGNAL(vp1dyn_changed(std::vector *, std::vector *)), + SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), bmp_show, - SLOT(set_vp1_dyn(std::vector *, std::vector *))); + SLOT(set_vp1_dyn(std::vector*, std::vector*))); // lw_widget->init(); bmp_show->setMouseTracking(true); @@ -7608,19 +7567,19 @@ void MainWindow::tab_changed(QWidget *qw) QObject::connect(this, SIGNAL(bmp_changed()), iftrg_widget, SLOT(bmp_changed())); - QObject::connect(iftrg_widget, SIGNAL(vm_changed(std::vector *)), - bmp_show, SLOT(set_vm(std::vector *))); + QObject::connect(iftrg_widget, SIGNAL(vm_changed(std::vector*)), + bmp_show, SLOT(set_vm(std::vector*))); QObject::connect(iftrg_widget, - SIGNAL(vmdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vmdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); } else if (qw == FMF_widget) { QObject::connect(this, SIGNAL(bmp_changed()), FMF_widget, SLOT(bmp_changed())); - QObject::connect(FMF_widget, SIGNAL(vpdyn_changed(std::vector *)), - bmp_show, SLOT(set_vpdyn(std::vector *))); + QObject::connect(FMF_widget, SIGNAL(vpdyn_changed(std::vector*)), + bmp_show, SLOT(set_vpdyn(std::vector*))); } else if (qw == OutlineCorrect_widget) { @@ -7628,22 +7587,22 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(workbits_changed())); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::connect(OutlineCorrect_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), work_show, + SLOT(set_vpdyn(std::vector*))); OutlineCorrect_widget->workbits_changed(); } else if (qw == feature_widget) { QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), bmp_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), bmp_show, + SLOT(set_vpdyn(std::vector*))); QObject::connect(feature_widget, - SIGNAL(vpdyn_changed(std::vector *)), work_show, - SLOT(set_vpdyn(std::vector *))); + SIGNAL(vpdyn_changed(std::vector*)), work_show, + SLOT(set_vpdyn(std::vector*))); work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); @@ -7656,10 +7615,10 @@ void MainWindow::tab_changed(QWidget *qw) } else if (qw == pickerwidget) { - QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), - bmp_show, SLOT(set_vp1(vector *))); - QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector *)), - work_show, SLOT(set_vp1(vector *))); + QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector*)), + bmp_show, SLOT(set_vp1(vector*))); + QObject::connect(pickerwidget, SIGNAL(vp1_changed(vector*)), + work_show, SLOT(set_vp1(vector*))); } else if (qw == transfrmWidget) { @@ -7671,7 +7630,7 @@ void MainWindow::tab_changed(QWidget *qw) SLOT(tissues_changed())); } - tab_old = (WidgetInterface *)qw; + tab_old = (WidgetInterface*)qw; tab_old->init(); tab_old->on_tissuenr_changed(tissueTreeWidget->get_current_type() - 1); // \todo BL: is this correct for all widgets? @@ -7682,7 +7641,7 @@ void MainWindow::tab_changed(QWidget *qw) } else { - tab_old = (WidgetInterface *)qw; + tab_old = (WidgetInterface*)qw; } tab_old->setFocus(); @@ -7723,11 +7682,11 @@ void MainWindow::updateTabvisibility() counter1++; } - WidgetInterface *qw = (WidgetInterface *)methodTab->visibleWidget(); + WidgetInterface* qw = (WidgetInterface*)methodTab->visibleWidget(); updateMethodButtonsPressed(qw); } -void MainWindow::updateMethodButtonsPressed(WidgetInterface *qw) +void MainWindow::updateMethodButtonsPressed(WidgetInterface* qw) { // QWidget *qw=methodTab->visibleWidget(); unsigned short counter = 0; @@ -7761,7 +7720,7 @@ void MainWindow::updateMethodButtonsPressed(WidgetInterface *qw) } } -void MainWindow::LoadAtlas(QDir path1) +void MainWindow::LoadAtlas(const QDir& path1) { m_atlasfilename.m_atlasdir = path1; QStringList filters; @@ -7787,10 +7746,10 @@ void MainWindow::LoadAtlas(QDir path1) atlasmenu->setItemVisible(m_atlasfilename.separatornr, true); } -void MainWindow::LoadLoadProj(QString path1) +void MainWindow::LoadLoadProj(const QString& path1) { unsigned short projcounter = 0; - FILE *fplatestproj = fopen(path1.ascii(), "r"); + FILE* fplatestproj = fopen(path1.ascii(), "r"); char c; m_loadprojfilename.m_filename = path1; while (fplatestproj != NULL && projcounter < 4) @@ -7808,7 +7767,7 @@ void MainWindow::LoadLoadProj(QString path1) fclose(fplatestproj); } -void MainWindow::AddLoadProj(QString path1) +void MainWindow::AddLoadProj(const QString& path1) { if (m_loadprojfilename.m_loadprojfilename1 != path1 && m_loadprojfilename.m_loadprojfilename2 != path1 && @@ -7899,11 +7858,11 @@ void MainWindow::AddLoadProj(QString path1) file->setItemVisible(m_loadprojfilename.separatornr, true); } -void MainWindow::SaveLoadProj(QString latestprojpath) +void MainWindow::SaveLoadProj(const QString& latestprojpath) { if (latestprojpath == QString("")) return; - FILE *fplatestproj = fopen(latestprojpath.ascii(), "w"); + FILE* fplatestproj = fopen(latestprojpath.ascii(), "w"); if (fplatestproj != NULL) { if (m_loadprojfilename.m_loadprojfilename4 != QString("")) @@ -8049,8 +8008,7 @@ void MainWindow::execute_smoothtissues() void MainWindow::execute_cleanup() { - tissues_size_t **slices = new tissues_size_t - *[handler3D->return_endslice() - handler3D->return_startslice()]; + tissues_size_t** slices = new tissues_size_t*[handler3D->return_endslice() - handler3D->return_startslice()]; tissuelayers_size_t activelayer = handler3D->get_active_tissuelayer(); for (unsigned short i = handler3D->return_startslice(); i < handler3D->return_endslice(); i++) @@ -8092,14 +8050,14 @@ void MainWindow::wheelrotated(int delta) zoom_widget->zoom_changed(work_show->return_zoom() * pow(1.2, delta / 120.0)); } -void MainWindow::mousePosZoom_changed(QPoint point) +void MainWindow::mousePosZoom_changed(const QPoint& point) { bmp_show->setMousePosZoom(point); work_show->setMousePosZoom(point); //mousePosZoom = point; } -FILE *MainWindow::save_notes(FILE *fp, unsigned short version) +FILE* MainWindow::save_notes(FILE* fp, unsigned short version) { if (version >= 7) { @@ -8111,14 +8069,14 @@ FILE *MainWindow::save_notes(FILE *fp, unsigned short version) return fp; } -FILE *MainWindow::load_notes(FILE *fp, unsigned short version) +FILE* MainWindow::load_notes(FILE* fp, unsigned short version) { m_notes->clear(); if (version >= 7) { int dummy = 0; fread(&dummy, sizeof(int), 1, fp); - char *text = new char[dummy + 1]; + char* text = new char[dummy + 1]; text[dummy] = '\0'; fread(text, dummy, 1, fp); m_notes->setPlainText(QString(text)); @@ -8173,8 +8131,8 @@ void MainWindow::reconnectmouse_afterrelease(Point) connect_mouseclick(); } -void MainWindow::handle_begin_datachange(iseg::DataSelection &dataSelection, - QWidget *sender, bool beginUndo) +void MainWindow::handle_begin_datachange(iseg::DataSelection& dataSelection, + QWidget* sender, bool beginUndo) { undoStarted = beginUndo || undoStarted; changeData = dataSelection; @@ -8245,7 +8203,7 @@ void MainWindow::end_undo_helper(iseg::EndUndoAction undoAction) } } -void MainWindow::handle_end_datachange(QWidget *sender, +void MainWindow::handle_end_datachange(QWidget* sender, iseg::EndUndoAction undoAction) { // End undo @@ -8358,19 +8316,19 @@ void MainWindow::cancel_transform_helper() { QObject::disconnect( transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::disconnect( - transfrmWidget, SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), - this, SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + transfrmWidget, SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), + this, SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); transfrmWidget->CancelPushButtonClicked(); QObject::connect( transfrmWidget, - SIGNAL(begin_datachange(iseg::DataSelection &, QWidget *, bool)), this, - SLOT(handle_begin_datachange(iseg::DataSelection &, QWidget *, bool))); + SIGNAL(begin_datachange(iseg::DataSelection&, QWidget*, bool)), this, + SLOT(handle_begin_datachange(iseg::DataSelection&, QWidget*, bool))); QObject::connect(transfrmWidget, - SIGNAL(end_datachange(QWidget *, iseg::EndUndoAction)), this, - SLOT(handle_end_datachange(QWidget *, iseg::EndUndoAction))); + SIGNAL(end_datachange(QWidget*, iseg::EndUndoAction)), this, + SLOT(handle_end_datachange(QWidget*, iseg::EndUndoAction))); // Signal changed data bool bmp, work, tissues; @@ -8389,8 +8347,8 @@ void MainWindow::cancel_transform_helper() } } -void MainWindow::handle_begin_dataexport(iseg::DataSelection &dataSelection, - QWidget *sender) +void MainWindow::handle_begin_dataexport(iseg::DataSelection& dataSelection, + QWidget* sender) { // Handle pending transforms if (methodTab->visibleWidget() == transfrmWidget && @@ -8406,4 +8364,4 @@ void MainWindow::handle_begin_dataexport(iseg::DataSelection &dataSelection, } } -void MainWindow::handle_end_dataexport(QWidget *sender) {} +void MainWindow::handle_end_dataexport(QWidget* sender) {} diff --git a/iSeg/MainWindow.h b/iSeg/MainWindow.h index d025eaec..5abdaebd 100755 --- a/iSeg/MainWindow.h +++ b/iSeg/MainWindow.h @@ -55,7 +55,7 @@ class MultiDataset_widget; class ScaleWork; class ImageMath; class ImageOverlay; -class zoomer_widget; +class ZoomWidget; class CheckBoneConnectivityDialog; class SliceViewerWidget; class PickerWidget; @@ -65,7 +65,7 @@ class OutlineCorrectionWidget; class ImageForestingTransformRegionGrowingWidget; class TransformWidget; class FastmarchingFuzzyWidget; -class livewire_widget; +class LivewireWidget; class EdgeWidget; class MorphologyWidget; class HystereticGrowingWidget; @@ -90,18 +90,18 @@ class MainWindow : public QMainWindow { Q_OBJECT public: - MainWindow(SlicesHandler* hand3D, QString locationstring, QDir picpath, - QDir tmppath, bool editingmode = false, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0, - char** argv = NULL); + MainWindow(SlicesHandler* hand3D, const QString& locationstring, const QDir& picpath, + const QDir& tmppath, bool editingmode = false, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0, + char** argv = NULL); ~MainWindow(); friend class Settings; - void LoadLoadProj(QString path1); - void LoadAtlas(QDir path1); - void AddLoadProj(QString path1); - void SaveLoadProj(QString latestprojpath); + void LoadLoadProj(const QString& path1); + void LoadAtlas(const QDir& path1); + void AddLoadProj(const QString& path1); + void SaveLoadProj(const QString& latestprojpath); void SaveSettings(); void LoadSettings(const char* loadfilename); void loadproj(const QString& loadfilename); @@ -133,11 +133,11 @@ class MainWindow : public QMainWindow void tissues_changed(); void drawing_changed(); void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); + QWidget* sender = NULL, bool beginUndo = true); void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + iseg::EndUndoAction undoAction = iseg::EndUndo); void begin_dataexport(iseg::DataSelection& dataSelection, - QWidget* sender = NULL); + QWidget* sender = NULL); void end_dataexport(QWidget* sender = NULL); private: @@ -207,10 +207,10 @@ class MainWindow : public QMainWindow Q3PopupMenu* hidemenu; Q3PopupMenu* hidesubmenu; TissueTreeWidget* - tissueTreeWidget; // Widget visualizing the tissue hierarchy + tissueTreeWidget; // Widget visualizing the tissue hierarchy QLineEdit* tissueFilter; TissueHierarchyWidget* - tissueHierarchyWidget; // Widget for selecting the tissue hierarchy + tissueHierarchyWidget; // Widget for selecting the tissue hierarchy QCheckBox* cb_tissuelock; QPushButton* lockTissues; QPushButton* addTissue; @@ -245,7 +245,7 @@ class MainWindow : public QMainWindow MorphologyWidget* morph_widget; WatershedWidget* wshed_widget; HystereticGrowingWidget* hyst_widget; - livewire_widget* lw_widget; + LivewireWidget* lw_widget; ImageForestingTransformRegionGrowingWidget* iftrg_widget; FastmarchingFuzzyWidget* FMF_widget; OutlineCorrectionWidget* OutlineCorrect_widget; @@ -283,7 +283,7 @@ class MainWindow : public QMainWindow Q3ScrollView* bmp_scroller; Q3ScrollView* work_scroller; bool tomove_scroller; - zoomer_widget* zoom_widget; + ZoomWidget* zoom_widget; // float thickness; SliceViewerWidget* xsliceshower; SliceViewerWidget* ysliceshower; @@ -350,13 +350,8 @@ class MainWindow : public QMainWindow private slots: void update_bmp(); - void update_bmp(QRect rect); void update_work(); - void update_work(QRect rect); void update_tissue(); - void update_tissue(QRect rect); - // void marks_changed(); - // void drawing_changed(); void execute_bmp2work(); void execute_work2bmp(); void execute_swap_bmpwork(); @@ -568,15 +563,14 @@ private slots: void bmpcrosshairvisible_changed(); void workcrosshairvisible_changed(); void wheelrotated(int delta); - void mousePosZoom_changed(QPoint point); + void mousePosZoom_changed(const QPoint& point); void handle_begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); + QWidget* sender = NULL, bool beginUndo = true); void handle_end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + iseg::EndUndoAction undoAction = iseg::EndUndo); - void handle_begin_dataexport(iseg::DataSelection& dataSelection, - QWidget* sender = NULL); + void handle_begin_dataexport(iseg::DataSelection& dataSelection, QWidget* sender = NULL); void handle_end_dataexport(QWidget* sender = NULL); void DatasetChanged(); diff --git a/iSeg/WidgetCollection.cpp b/iSeg/WidgetCollection.cpp index d4567edc..171cc366 100755 --- a/iSeg/WidgetCollection.cpp +++ b/iSeg/WidgetCollection.cpp @@ -64,7 +64,7 @@ using namespace std; using namespace iseg; namespace { -inline bool SearchFilter(const std::string& text, const std::string& filter) +inline bool SearchFilter(const std::string &text, const std::string &filter) { namespace algo = boost::algorithm; @@ -75,7 +75,7 @@ inline bool SearchFilter(const std::string& text, const std::string& filter) std::vector search_tokens; algo::split(search_tokens, search_text, algo::is_space(), - algo::token_compress_on); + algo::token_compress_on); for (auto tok : search_tokens) { @@ -89,10 +89,10 @@ inline bool SearchFilter(const std::string& text, const std::string& filter) } } // namespace -ScaleWork::ScaleWork(SlicesHandler* hand3D, QDir picpath, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - // : QWidget( parent, name, wFlags ),handler3D(hand3D) - : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) +ScaleWork::ScaleWork(SlicesHandler *hand3D, QDir picpath, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + // : QWidget( parent, name, wFlags ),handler3D(hand3D) + : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -121,8 +121,8 @@ ScaleWork::ScaleWork(SlicesHandler* hand3D, QDir picpath, QWidget* parent, lb_brightness = new QLabel(QString("B: "), hbox3); lb_brightness->show(); lb_brightness->setPixmap( - QIcon(picpath.absFilePath(QString("icon-brightness.png")).ascii()) - .pixmap()); + QIcon(picpath.absFilePath(QString("icon-brightness.png")).ascii()) + .pixmap()); sl_brighness = new QSlider(Qt::Horizontal, hbox3); sl_brighness->setRange(0, 100); sl_brighness->setValue(30); @@ -131,8 +131,8 @@ ScaleWork::ScaleWork(SlicesHandler* hand3D, QDir picpath, QWidget* parent, lb_contrast = new QLabel(QString("C: "), hbox4); lb_contrast->show(); lb_contrast->setPixmap( - QIcon(picpath.absFilePath(QString("icon-contrast.png")).ascii()) - .pixmap()); + QIcon(picpath.absFilePath(QString("icon-contrast.png")).ascii()) + .pixmap()); sl_contrast = new QSlider(Qt::Horizontal, hbox4); sl_contrast->setRange(0, 99); sl_contrast->setValue(30); @@ -145,21 +145,21 @@ ScaleWork::ScaleWork(SlicesHandler* hand3D, QDir picpath, QWidget* parent, QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QObject::connect(getRange, SIGNAL(clicked()), this, - SLOT(getrange_pushed())); + SLOT(getrange_pushed())); QObject::connect(doScale, SIGNAL(clicked()), this, SLOT(scale_pushed())); QObject::connect(doCrop, SIGNAL(clicked()), this, SLOT(crop_pushed())); QObject::connect(sl_brighness, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_brighness, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_brighness, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sl_contrast, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_contrast, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_contrast, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); getrange_pushed(); @@ -187,9 +187,9 @@ void ScaleWork::getrange_pushed() limitHigh->setText(QString::number((double)p.high, 'f', 6)); QObject::disconnect(sl_brighness, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::disconnect(sl_contrast, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); int brightnessint = (int)(100 * (maxval - 127.5f) / (maxval - minval)); if (brightnessint < 0) { @@ -211,9 +211,9 @@ void ScaleWork::getrange_pushed() } sl_contrast->setValue(contrastint); QObject::connect(sl_brighness, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_contrast, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); if (allslices->isChecked()) { @@ -284,7 +284,7 @@ void ScaleWork::slicenr_changed() // } } -void ScaleWork::bmphand_changed(bmphandler* bmph) +void ScaleWork::bmphand_changed(bmphandler *bmph) { bmphand = bmph; return; @@ -300,10 +300,10 @@ void ScaleWork::slider_changed(int newval) bmphand->get_range(&p1); float subpos1, subpos2; subpos1 = ((1.0f - 0.01f * sl_brighness->value()) * (maxval - minval) - - (minval1 - minval)) / - (maxval1 - minval1); + (minval1 - minval)) / + (maxval1 - minval1); subpos2 = (1.0f - 0.01f * sl_contrast->value()) * (maxval - minval) * - 0.5f / (maxval1 - minval1); + 0.5f / (maxval1 - minval1); p.low = p1.low + (p1.high - p1.low) * (subpos1 - subpos2); p.high = p1.low + (p1.high - p1.low) * (subpos1 + subpos2); @@ -351,9 +351,9 @@ void ScaleWork::slider_released() emit end_datachange(this); } -HistoWin::HistoWin(unsigned int* histo1, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags) +HistoWin::HistoWin(unsigned int *histo1, QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags) { histo = histo1; image.create(258, 258, 8); @@ -392,14 +392,14 @@ void HistoWin::update() return; } -void HistoWin::histo_changed(unsigned int* histo1) +void HistoWin::histo_changed(unsigned int *histo1) { histo = histo1; return; } -void HistoWin::paintEvent(QPaintEvent* e) +void HistoWin::paintEvent(QPaintEvent *e) { if (image.size() != QSize(0, 0)) // is an image loaded? { @@ -409,9 +409,9 @@ void HistoWin::paintEvent(QPaintEvent* e) } } -ShowHisto::ShowHisto(SlicesHandler* hand3D, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) +ShowHisto::ShowHisto(SlicesHandler *hand3D, QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -469,9 +469,9 @@ ShowHisto::ShowHisto(SlicesHandler* hand3D, QWidget* parent, const char* name, vbox1->show(); QObject::connect(updateSubsect, SIGNAL(clicked()), this, - SLOT(subsect_update())); + SLOT(subsect_update())); QObject::connect(workpict, SIGNAL(toggled(bool)), this, - SLOT(pict_toggled(bool))); + SLOT(pict_toggled(bool))); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QObject::connect(subsect, SIGNAL(clicked()), this, SLOT(subsect_toggled())); @@ -526,12 +526,12 @@ void ShowHisto::draw_histo() p.px = xoffset->value(); p.py = yoffset->value(); bmphand->make_histogram( - p, - min((int)bmphand->return_width() - xoffset->value(), - xlength->value()), - min((int)bmphand->return_height() - yoffset->value(), - ylength->value()), - true); + p, + min((int)bmphand->return_width() - xoffset->value(), + xlength->value()), + min((int)bmphand->return_height() - yoffset->value(), + ylength->value()), + true); } else { @@ -547,12 +547,12 @@ void ShowHisto::draw_histo() p.px = xoffset->value(); p.py = yoffset->value(); bmphand->make_histogram( - p, - min((int)bmphand->return_width() - xoffset->value(), - xlength->value()), - min((int)bmphand->return_height() - yoffset->value(), - ylength->value()), - true); + p, + min((int)bmphand->return_width() - xoffset->value(), + xlength->value()), + min((int)bmphand->return_height() - yoffset->value(), + ylength->value()), + true); } else { @@ -572,7 +572,7 @@ void ShowHisto::slicenr_changed() // } } -void ShowHisto::bmphand_changed(bmphandler* bmph) +void ShowHisto::bmphand_changed(bmphandler *bmph) { bmphand = bmph; histwindow->histo_changed(bmphand->return_histogram()); @@ -586,9 +586,9 @@ void ShowHisto::newloaded() bmphand_changed(handler3D->get_activebmphandler()); } -colorshower::colorshower(int lx1, int ly1, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags) +colorshower::colorshower(int lx1, int ly1, QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags) { lx = lx1; ly = ly1; @@ -612,26 +612,26 @@ void colorshower::color_changed(float fr1, float fg1, float fb1, float opac1) repaint(); } -void colorshower::paintEvent(QPaintEvent* e) +void colorshower::paintEvent(QPaintEvent *e) { QColor color; color.setRgb((int)(opac * fr * 255), (int)(opac * fg * 255), - (int)(opac * fb * 255)); + (int)(opac * fb * 255)); QPainter painter(this); painter.setClipRect(e->rect()); painter.fillRect(0, 0, lx, ly, color); color.setRgb((int)((1 - opac + opac * fr) * 255), - (int)((1 - opac + opac * fg) * 255), - (int)((1 - opac + opac * fb) * 255)); + (int)((1 - opac + opac * fg) * 255), + (int)((1 - opac + opac * fb) * 255)); painter.setClipRect(e->rect()); painter.fillRect(lx / 4, ly / 4, lx / 2, ly / 2, color); return; } -TissueTreeWidget::TissueTreeWidget(TissueHiearchy* hierarchy, QDir picpath, - QWidget* parent) - : QTreeWidget(parent), hierarchies(hierarchy) +TissueTreeWidget::TissueTreeWidget(TissueHiearchy *hierarchy, QDir picpath, + QWidget *parent) + : QTreeWidget(parent), hierarchies(hierarchy) { picturePath = picpath; sortByNameAscending = true; @@ -649,10 +649,10 @@ TissueTreeWidget::TissueTreeWidget(TissueHiearchy* hierarchy, QDir picpath, setRootIsDecorated(true); //xxxb setFixedHeight(250); //xxxb setFixedWidth(110); - QObject::connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, - SLOT(resize_columns_to_contents(QTreeWidgetItem*))); - QObject::connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, - SLOT(resize_columns_to_contents(QTreeWidgetItem*))); + QObject::connect(this, SIGNAL(itemExpanded(QTreeWidgetItem *)), this, + SLOT(resize_columns_to_contents(QTreeWidgetItem *))); + QObject::connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, + SLOT(resize_columns_to_contents(QTreeWidgetItem *))); initialize(); } @@ -666,7 +666,7 @@ void TissueTreeWidget::initialize() emit hierarchy_list_changed(); } -void TissueTreeWidget::set_tissue_filter(const QString& filter) +void TissueTreeWidget::set_tissue_filter(const QString &filter) { if (filter.toStdString() != tissue_filter) { @@ -685,11 +685,11 @@ void TissueTreeWidget::update_visibility() } } -void TissueTreeWidget::update_visibility_recursive(QTreeWidgetItem* current) +void TissueTreeWidget::update_visibility_recursive(QTreeWidgetItem *current) { // setHidden hides/shows recursively bool const matches = - SearchFilter(get_name(current).toStdString(), tissue_filter); + SearchFilter(get_name(current).toStdString(), tissue_filter); bool const is_folder = get_is_folder(current); if (matches || !is_folder) { @@ -707,7 +707,7 @@ void TissueTreeWidget::update_visibility_recursive(QTreeWidgetItem* current) bool any_child_visible = false; for (unsigned int i = 0; i < current->childCount(); ++i) { - QTreeWidgetItem* child = current->child(i); + QTreeWidgetItem *child = current->child(i); update_visibility_recursive(child); if (!child->isHidden()) @@ -729,17 +729,17 @@ void TissueTreeWidget::update_hierarchy() hierarchies->set_selected_hierarchy(create_current_hierarchy()); } -TissueHierarchyItem* TissueTreeWidget::create_current_hierarchy() +TissueHierarchyItem *TissueTreeWidget::create_current_hierarchy() { // Create internal representation from current QTreeWidget - TissueHierarchyItem* root = new TissueHierarchyItem(true, QString("root")); + TissueHierarchyItem *root = new TissueHierarchyItem(true, QString("root")); for (unsigned int i = 0; i < topLevelItemCount(); ++i) { // Add top-level child - QTreeWidgetItem* currWidgetItem = topLevelItem(i); - TissueHierarchyItem* newTreeItem = - create_hierarchy_item(currWidgetItem); + QTreeWidgetItem *currWidgetItem = topLevelItem(i); + TissueHierarchyItem *newTreeItem = + create_hierarchy_item(currWidgetItem); root->AddChild(newTreeItem); // Subtree of current child @@ -753,14 +753,14 @@ TissueHierarchyItem* TissueTreeWidget::create_current_hierarchy() } void TissueTreeWidget::create_hierarchy_recursively( - QTreeWidgetItem* parentIn, TissueHierarchyItem* parentOut) + QTreeWidgetItem *parentIn, TissueHierarchyItem *parentOut) { for (unsigned int i = 0; i < parentIn->childCount(); ++i) { // Add child - QTreeWidgetItem* currWidgetItem = parentIn->child(i); - TissueHierarchyItem* newTreeItem = - create_hierarchy_item(currWidgetItem); + QTreeWidgetItem *currWidgetItem = parentIn->child(i); + TissueHierarchyItem *newTreeItem = + create_hierarchy_item(currWidgetItem); parentOut->AddChild(newTreeItem); // Subtree of current child @@ -771,11 +771,11 @@ void TissueTreeWidget::create_hierarchy_recursively( } } -TissueHierarchyItem* - TissueTreeWidget::create_hierarchy_item(QTreeWidgetItem* item) +TissueHierarchyItem * + TissueTreeWidget::create_hierarchy_item(QTreeWidgetItem *item) { return new TissueHierarchyItem(get_is_folder(item), - item->text(TISSUETREEWIDGET_COLUMN_NAME)); + item->text(TISSUETREEWIDGET_COLUMN_NAME)); } namespace { @@ -789,7 +789,7 @@ QPixmap generatePixmap(tissues_size_t tissuenr) return abc; } unsigned char r, g, b; - TissueInfoStruct* tissueInfo = TissueInfos::GetTissueInfo(tissuenr); + TissueInfoStruct *tissueInfo = TissueInfos::GetTissueInfo(tissuenr); tissueInfo->GetColorRGB(r, g, b); abc.fill(QColor(r, g, b)); if (tissueInfo->locked) @@ -817,43 +817,43 @@ QPixmap generatePixmap(tissues_size_t tissuenr) } // namespace -QTreeWidgetItem* TissueTreeWidget::create_hierarchy_item(bool isFolder, - const QString& name) +QTreeWidgetItem *TissueTreeWidget::create_hierarchy_item(bool isFolder, + const QString &name) { if (isFolder) { - QTreeWidgetItem* newFolder = new QTreeWidgetItem(); + QTreeWidgetItem *newFolder = new QTreeWidgetItem(); newFolder->setIcon( - TISSUETREEWIDGET_COLUMN_NAME, - QIcon(picturePath.absFilePath(QString("fileopen.png")).ascii())); + TISSUETREEWIDGET_COLUMN_NAME, + QIcon(picturePath.absFilePath(QString("fileopen.png")).ascii())); newFolder->setText(TISSUETREEWIDGET_COLUMN_NAME, name); newFolder->setText(TISSUETREEWIDGET_COLUMN_FOLDER, - QString::number(isFolder)); + QString::number(isFolder)); newFolder->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator); newFolder->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | - Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); + Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled); return newFolder; } else { tissues_size_t type = TissueInfos::GetTissueType(name); - QTreeWidgetItem* newTissue = new QTreeWidgetItem(); + QTreeWidgetItem *newTissue = new QTreeWidgetItem(); newTissue->setIcon(TISSUETREEWIDGET_COLUMN_NAME, generatePixmap(type)); newTissue->setText(TISSUETREEWIDGET_COLUMN_NAME, name); newTissue->setText(TISSUETREEWIDGET_COLUMN_TYPE, QString::number(type)); newTissue->setText(TISSUETREEWIDGET_COLUMN_FOLDER, - QString::number(isFolder)); + QString::number(isFolder)); newTissue->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicator); newTissue->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | - Qt::ItemIsDragEnabled); + Qt::ItemIsDragEnabled); return newTissue; } } -void TissueTreeWidget::insert_item(bool isFolder, const QString& name) +void TissueTreeWidget::insert_item(bool isFolder, const QString &name) { - QTreeWidgetItem* currItem = currentItem(); - QTreeWidgetItem* newItem = create_hierarchy_item(isFolder, name); + QTreeWidgetItem *currItem = currentItem(); + QTreeWidgetItem *newItem = create_hierarchy_item(isFolder, name); if (get_is_folder(currItem) && currItem->isExpanded()) { @@ -863,7 +863,7 @@ void TissueTreeWidget::insert_item(bool isFolder, const QString& name) else { // Insert at current position - QTreeWidgetItem* currParent = currItem->parent(); + QTreeWidgetItem *currParent = currItem->parent(); if (currParent == 0) { insertTopLevelItem(indexOfTopLevelItem(currItem), newItem); @@ -871,7 +871,7 @@ void TissueTreeWidget::insert_item(bool isFolder, const QString& name) else { currParent->insertChild(currParent->indexOfChild(currItem), - newItem); + newItem); } } setCurrentItem(newItem); @@ -880,17 +880,17 @@ void TissueTreeWidget::insert_item(bool isFolder, const QString& name) update_hierarchy(); } -void TissueTreeWidget::insert_item(bool isFolder, const QString& name, - QTreeWidgetItem* insertAbove) +void TissueTreeWidget::insert_item(bool isFolder, const QString &name, + QTreeWidgetItem *insertAbove) { if (insertAbove == 0) { return; } - QTreeWidgetItem* newItem = create_hierarchy_item(isFolder, name); + QTreeWidgetItem *newItem = create_hierarchy_item(isFolder, name); - QTreeWidgetItem* parent = insertAbove->parent(); + QTreeWidgetItem *parent = insertAbove->parent(); if (parent == 0) { insertTopLevelItem(indexOfTopLevelItem(insertAbove), newItem); @@ -906,10 +906,10 @@ void TissueTreeWidget::insert_item(bool isFolder, const QString& name, update_hierarchy(); } -void TissueTreeWidget::insert_item(bool isFolder, const QString& name, - QTreeWidgetItem* parent, unsigned int index) +void TissueTreeWidget::insert_item(bool isFolder, const QString &name, + QTreeWidgetItem *parent, unsigned int index) { - QTreeWidgetItem* newItem = create_hierarchy_item(isFolder, name); + QTreeWidgetItem *newItem = create_hierarchy_item(isFolder, name); if (parent == 0) { @@ -926,13 +926,13 @@ void TissueTreeWidget::insert_item(bool isFolder, const QString& name, update_hierarchy(); } -void TissueTreeWidget::remove_tissue(const QString& name) +void TissueTreeWidget::remove_tissue(const QString &name) { // Removes a tissue completely from all hierarchies blockSignals(true); for (int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* currItem = topLevelItem(i); + QTreeWidgetItem *currItem = topLevelItem(i); if (get_is_folder(currItem)) { remove_tissue_recursively(currItem, name); @@ -948,9 +948,9 @@ void TissueTreeWidget::remove_tissue(const QString& name) { // Update tissue type tissues_size_t newType = TissueInfos::GetTissueType( - currItem->text(TISSUETREEWIDGET_COLUMN_NAME)); + currItem->text(TISSUETREEWIDGET_COLUMN_NAME)); currItem->setText(TISSUETREEWIDGET_COLUMN_TYPE, - QString::number(newType)); + QString::number(newType)); } } blockSignals(false); @@ -962,12 +962,12 @@ void TissueTreeWidget::remove_tissue(const QString& name) hierarchies->update_hierarchies(); } -void TissueTreeWidget::remove_tissue_recursively(QTreeWidgetItem* parent, - const QString& name) +void TissueTreeWidget::remove_tissue_recursively(QTreeWidgetItem *parent, + const QString &name) { for (int i = 0; i < parent->childCount(); ++i) { - QTreeWidgetItem* currItem = parent->child(i); + QTreeWidgetItem *currItem = parent->child(i); if (get_is_folder(currItem)) { remove_tissue_recursively(currItem, name); @@ -983,9 +983,9 @@ void TissueTreeWidget::remove_tissue_recursively(QTreeWidgetItem* parent, { // Update tissue type tissues_size_t newType = TissueInfos::GetTissueType( - currItem->text(TISSUETREEWIDGET_COLUMN_NAME)); + currItem->text(TISSUETREEWIDGET_COLUMN_NAME)); currItem->setText(TISSUETREEWIDGET_COLUMN_TYPE, - QString::number(newType)); + QString::number(newType)); } } } @@ -994,8 +994,8 @@ void TissueTreeWidget::remove_current_item(bool removeChildren) { // Removes current item in QTreeWidget and internal representations - QTreeWidgetItem* currItem = currentItem(); - QTreeWidgetItem* currParent = currItem->parent(); + QTreeWidgetItem *currItem = currentItem(); + QTreeWidgetItem *currParent = currItem->parent(); bool updateTissues = false; if (get_is_folder(currItem)) @@ -1004,7 +1004,7 @@ void TissueTreeWidget::remove_current_item(bool removeChildren) if (removeChildren) { // Delete all children of current item - QList children; + QList children; take_children_recursively(currItem, children); qDeleteAll(children); @@ -1028,14 +1028,14 @@ void TissueTreeWidget::remove_current_item(bool removeChildren) if (currParent == 0) { insertTopLevelItems(indexOfTopLevelItem(currItem), - currItem->takeChildren()); + currItem->takeChildren()); takeTopLevelItem(indexOfTopLevelItem(currItem)); delete currItem; } else { currParent->insertChildren(currParent->indexOfChild(currItem), - currItem->takeChildren()); + currItem->takeChildren()); currParent->removeChild(currItem); delete currItem; } @@ -1081,11 +1081,11 @@ void TissueTreeWidget::remove_all_folders(bool removeChildren) { for (int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { // Delete all children of item - QList children; + QList children; take_children_recursively(item, children); qDeleteAll(children); @@ -1101,7 +1101,7 @@ void TissueTreeWidget::remove_all_folders(bool removeChildren) { for (int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { // Insert children into parent and delete item @@ -1124,8 +1124,8 @@ void TissueTreeWidget::remove_all_folders(bool removeChildren) } } -void TissueTreeWidget::update_tissue_name(const QString& oldName, - const QString& newName) +void TissueTreeWidget::update_tissue_name(const QString &oldName, + const QString &newName) { if (oldName.compare(newName) == 0) { @@ -1133,7 +1133,7 @@ void TissueTreeWidget::update_tissue_name(const QString& oldName, } // Update tissue name in internal representations - auto& hierarchyTrees = hierarchies->hierarchies(); + auto &hierarchyTrees = hierarchies->hierarchies(); for (unsigned int i = 0; i < hierarchyTrees.size(); ++i) { hierarchyTrees[i]->UpdateTissueNameRecursively(oldName, newName); @@ -1143,9 +1143,9 @@ void TissueTreeWidget::update_tissue_name(const QString& oldName, update_tissue_name_widget(oldName, newName); } -void TissueTreeWidget::update_tissue_name_widget(const QString& oldName, - const QString& newName, - QTreeWidgetItem* parent) +void TissueTreeWidget::update_tissue_name_widget(const QString &oldName, + const QString &newName, + QTreeWidgetItem *parent) { if (parent == 0) { @@ -1169,7 +1169,7 @@ void TissueTreeWidget::update_tissue_name_widget(const QString& oldName, { // Update tissue name if (parent->text(TISSUETREEWIDGET_COLUMN_NAME).compare(oldName) == - 0) + 0) { parent->setText(TISSUETREEWIDGET_COLUMN_NAME, newName); } @@ -1177,7 +1177,7 @@ void TissueTreeWidget::update_tissue_name_widget(const QString& oldName, } } -void TissueTreeWidget::update_tissue_icons(QTreeWidgetItem* parent) +void TissueTreeWidget::update_tissue_icons(QTreeWidgetItem *parent) { if (parent == 0) { @@ -1201,12 +1201,12 @@ void TissueTreeWidget::update_tissue_icons(QTreeWidgetItem* parent) { // Update tissue icon parent->setIcon(TISSUETREEWIDGET_COLUMN_NAME, - generatePixmap(get_type(parent))); + generatePixmap(get_type(parent))); } } } -void TissueTreeWidget::update_folder_icons(QTreeWidgetItem* parent) +void TissueTreeWidget::update_folder_icons(QTreeWidgetItem *parent) { // Updates the folder icons based on the lock state of the child tissues // This only works if the tree widget is completely built @@ -1229,25 +1229,25 @@ void TissueTreeWidget::update_folder_icons(QTreeWidgetItem* parent) { // All child tissues unlocked parent->setIcon( - TISSUETREEWIDGET_COLUMN_NAME, - QIcon(picturePath.absFilePath(QString("fileopen.png")) - .ascii())); + TISSUETREEWIDGET_COLUMN_NAME, + QIcon(picturePath.absFilePath(QString("fileopen.png")) + .ascii())); } else if (lockStates == 1) { // All child tissues locked parent->setIcon( - TISSUETREEWIDGET_COLUMN_NAME, - QIcon(picturePath.absFilePath(QString("folderlock1.png")) - .ascii())); + TISSUETREEWIDGET_COLUMN_NAME, + QIcon(picturePath.absFilePath(QString("folderlock1.png")) + .ascii())); } else { // Mixed locked/unlocked parent->setIcon( - TISSUETREEWIDGET_COLUMN_NAME, - QIcon(picturePath.absFilePath(QString("folderlock2.png")) - .ascii())); + TISSUETREEWIDGET_COLUMN_NAME, + QIcon(picturePath.absFilePath(QString("folderlock2.png")) + .ascii())); } // Recursion with children @@ -1260,7 +1260,7 @@ void TissueTreeWidget::update_folder_icons(QTreeWidgetItem* parent) } // TODO: Optimize by introducing folder map / hidden flag -short TissueTreeWidget::get_child_lockstates(QTreeWidgetItem* folder) +short TissueTreeWidget::get_child_lockstates(QTreeWidgetItem *folder) { // Returns whether all child tissues (including subfolders) are // unlocked (return value 0), @@ -1272,7 +1272,7 @@ short TissueTreeWidget::get_child_lockstates(QTreeWidgetItem* folder) short lockStates = 0; // Empty folders are considered to be unlocked for (i = 0; i < folder->childCount(); ++i) { - QTreeWidgetItem* currChild = folder->child(i); + QTreeWidgetItem *currChild = folder->child(i); if (get_is_folder(currChild)) { if (currChild->childCount() > 0) @@ -1303,18 +1303,18 @@ short TissueTreeWidget::get_child_lockstates(QTreeWidgetItem* folder) // Test against lock states of other children for (int i = 1; i < folder->childCount(); ++i) { - QTreeWidgetItem* currChild = folder->child(i); + QTreeWidgetItem *currChild = folder->child(i); if (get_is_folder(currChild)) { // Skip empty folders if (currChild->childCount() > 0 && - (lockStates != get_child_lockstates(currChild))) + (lockStates != get_child_lockstates(currChild))) { return -1; } } else if ((bool)lockStates != - TissueInfos::GetTissueLocked(get_type(currChild))) + TissueInfos::GetTissueLocked(get_type(currChild))) { return -1; } @@ -1335,7 +1335,7 @@ void TissueTreeWidget::pad_tissue_indices() for (unsigned int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { pad_tissue_indices_recursively(item, digits); @@ -1353,12 +1353,12 @@ void TissueTreeWidget::pad_tissue_indices() } } -void TissueTreeWidget::pad_tissue_indices_recursively(QTreeWidgetItem* parent, - unsigned short digits) +void TissueTreeWidget::pad_tissue_indices_recursively(QTreeWidgetItem *parent, + unsigned short digits) { for (unsigned int i = 0; i < parent->childCount(); ++i) { - QTreeWidgetItem* item = parent->child(i); + QTreeWidgetItem *item = parent->child(i); if (get_is_folder(item)) { pad_tissue_indices_recursively(item, digits); @@ -1380,7 +1380,7 @@ void TissueTreeWidget::update_tissue_indices() { for (unsigned int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { update_tissue_indices_recursively(item); @@ -1388,18 +1388,18 @@ void TissueTreeWidget::update_tissue_indices() else { tissues_size_t type = TissueInfos::GetTissueType( - item->text(TISSUETREEWIDGET_COLUMN_NAME)); + item->text(TISSUETREEWIDGET_COLUMN_NAME)); item->setText(TISSUETREEWIDGET_COLUMN_TYPE, QString::number(type)); } } } void TissueTreeWidget::update_tissue_indices_recursively( - QTreeWidgetItem* parent) + QTreeWidgetItem *parent) { for (unsigned int i = 0; i < parent->childCount(); ++i) { - QTreeWidgetItem* item = parent->child(i); + QTreeWidgetItem *item = parent->child(i); if (get_is_folder(item)) { update_tissue_indices_recursively(item); @@ -1407,13 +1407,13 @@ void TissueTreeWidget::update_tissue_indices_recursively( else { tissues_size_t type = TissueInfos::GetTissueType( - item->text(TISSUETREEWIDGET_COLUMN_NAME)); + item->text(TISSUETREEWIDGET_COLUMN_NAME)); item->setText(TISSUETREEWIDGET_COLUMN_TYPE, QString::number(type)); } } } -void TissueTreeWidget::set_current_folder_name(const QString& name) +void TissueTreeWidget::set_current_folder_name(const QString &name) { if (get_current_is_folder()) { @@ -1424,7 +1424,7 @@ void TissueTreeWidget::set_current_folder_name(const QString& name) } } -void TissueTreeWidget::set_current_item(QTreeWidgetItem* item) +void TissueTreeWidget::set_current_item(QTreeWidgetItem *item) { if (item) { @@ -1440,9 +1440,9 @@ void TissueTreeWidget::set_current_tissue(tissues_size_t type) { if (type > 0 && type <= TissueInfos::GetTissueCount()) { - QTreeWidgetItem* item = find_tissue_item(type); + QTreeWidgetItem *item = find_tissue_item(type); setCurrentItem(item); - QTreeWidgetItem* parent = item->parent(); + QTreeWidgetItem *parent = item->parent(); if (parent != 0) { parent->setExpanded(true); @@ -1454,16 +1454,16 @@ void TissueTreeWidget::set_current_tissue(tissues_size_t type) } } -QTreeWidgetItem* TissueTreeWidget::find_tissue_item(tissues_size_t type, - QTreeWidgetItem* parent) +QTreeWidgetItem *TissueTreeWidget::find_tissue_item(tissues_size_t type, + QTreeWidgetItem *parent) { if (parent == 0) { // Recursion with top level children for (int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* recursiveRes = - find_tissue_item(type, topLevelItem(i)); + QTreeWidgetItem *recursiveRes = + find_tissue_item(type, topLevelItem(i)); if (recursiveRes != 0) { return recursiveRes; @@ -1480,15 +1480,15 @@ QTreeWidgetItem* TissueTreeWidget::find_tissue_item(tissues_size_t type, // Recursion with children for (int i = 0; i < parent->childCount(); ++i) { - QTreeWidgetItem* recursiveRes = - find_tissue_item(type, parent->child(i)); + QTreeWidgetItem *recursiveRes = + find_tissue_item(type, parent->child(i)); if (recursiveRes != 0) { return recursiveRes; } } } - return (QTreeWidgetItem*)0; + return (QTreeWidgetItem *)0; } tissues_size_t TissueTreeWidget::get_current_type() @@ -1503,7 +1503,7 @@ bool TissueTreeWidget::get_current_is_folder() return get_is_folder(currentItem()); } -bool TissueTreeWidget::get_is_folder(QTreeWidgetItem* item) +bool TissueTreeWidget::get_is_folder(QTreeWidgetItem *item) { if (item) { @@ -1512,17 +1512,17 @@ bool TissueTreeWidget::get_is_folder(QTreeWidgetItem* item) return true; } -tissues_size_t TissueTreeWidget::get_type(QTreeWidgetItem* item) +tissues_size_t TissueTreeWidget::get_type(QTreeWidgetItem *item) { if (item && !get_is_folder(item)) { return (tissues_size_t)item->text(TISSUETREEWIDGET_COLUMN_TYPE) - .toUInt(); + .toUInt(); } return 0; } -QString TissueTreeWidget::get_name(QTreeWidgetItem* item) +QString TissueTreeWidget::get_name(QTreeWidgetItem *item) { if (item) { @@ -1544,7 +1544,7 @@ bool TissueTreeWidget::get_current_has_children() } void TissueTreeWidget::get_current_child_tissues( - std::map& types) + std::map &types) { types.clear(); if (currentItem() != 0) @@ -1554,12 +1554,12 @@ void TissueTreeWidget::get_current_child_tissues( } void TissueTreeWidget::get_sublevel_child_tissues( - std::map& types) + std::map &types) { types.clear(); for (unsigned int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { get_child_tissues_recursively(item, types); @@ -1568,13 +1568,13 @@ void TissueTreeWidget::get_sublevel_child_tissues( } void TissueTreeWidget::get_child_tissues_recursively( - QTreeWidgetItem* parent, std::map& types) + QTreeWidgetItem *parent, std::map &types) { for (int i = 0; i < parent->childCount(); ++i) { tissues_size_t currType = (tissues_size_t)parent->child(i) - ->text(TISSUETREEWIDGET_COLUMN_TYPE) - .toUInt(); + ->text(TISSUETREEWIDGET_COLUMN_TYPE) + .toUInt(); if (currType > 0) { // Insert tissue @@ -1605,7 +1605,7 @@ unsigned short TissueTreeWidget::get_hierarchy_count() return hierarchies->get_hierarchy_count(); } -std::vector* TissueTreeWidget::get_hierarchy_names_ptr() +std::vector *TissueTreeWidget::get_hierarchy_names_ptr() { return hierarchies->get_hierarchy_names_ptr(); } @@ -1648,7 +1648,7 @@ void TissueTreeWidget::set_hierarchy(unsigned short index) resize_columns_to_contents(); } -void TissueTreeWidget::build_tree_widget(TissueHierarchyItem* root) +void TissueTreeWidget::build_tree_widget(TissueHierarchyItem *root) { clear(); @@ -1659,30 +1659,30 @@ void TissueTreeWidget::build_tree_widget(TissueHierarchyItem* root) tissueTypes.insert(type); } - vector* children = root->GetChildren(); - for (vector::iterator iter = children->begin(); - iter != children->end(); ++iter) + vector *children = root->GetChildren(); + for (vector::iterator iter = children->begin(); + iter != children->end(); ++iter) { // Add top-level item - TissueHierarchyItem* currItem = *iter; + TissueHierarchyItem *currItem = *iter; if (currItem->GetIsFolder()) { - QTreeWidgetItem* newFolder = - create_hierarchy_item(true, currItem->GetName()); + QTreeWidgetItem *newFolder = + create_hierarchy_item(true, currItem->GetName()); addTopLevelItem(newFolder); build_tree_widget_recursively(currItem, newFolder, &tissueTypes); } else { tissues_size_t type = - TissueInfos::GetTissueType(currItem->GetName()); + TissueInfos::GetTissueType(currItem->GetName()); if (type > 0) { - QTreeWidgetItem* newTissue = - create_hierarchy_item(false, currItem->GetName()); + QTreeWidgetItem *newTissue = + create_hierarchy_item(false, currItem->GetName()); addTopLevelItem(newTissue); std::set::iterator iter = - tissueTypes.find(type); + tissueTypes.find(type); if (iter != tissueTypes.end()) { tissueTypes.erase(iter); @@ -1693,10 +1693,10 @@ void TissueTreeWidget::build_tree_widget(TissueHierarchyItem* root) // Add all missing tissues at top level for (std::set::iterator iter = tissueTypes.begin(); - iter != tissueTypes.end(); ++iter) + iter != tissueTypes.end(); ++iter) { addTopLevelItem( - create_hierarchy_item(false, TissueInfos::GetTissueName(*iter))); + create_hierarchy_item(false, TissueInfos::GetTissueName(*iter))); } // Update folder icons @@ -1706,33 +1706,33 @@ void TissueTreeWidget::build_tree_widget(TissueHierarchyItem* root) } void TissueTreeWidget::build_tree_widget_recursively( - TissueHierarchyItem* parentIn, QTreeWidgetItem* parentOut, - std::set* tissueTypes) + TissueHierarchyItem *parentIn, QTreeWidgetItem *parentOut, + std::set *tissueTypes) { - vector* children = parentIn->GetChildren(); - for (vector::iterator iter = children->begin(); - iter != children->end(); ++iter) + vector *children = parentIn->GetChildren(); + for (vector::iterator iter = children->begin(); + iter != children->end(); ++iter) { // Add item to parentOut - TissueHierarchyItem* currItem = *iter; + TissueHierarchyItem *currItem = *iter; if (currItem->GetIsFolder()) { - QTreeWidgetItem* newFolder = - create_hierarchy_item(true, currItem->GetName()); + QTreeWidgetItem *newFolder = + create_hierarchy_item(true, currItem->GetName()); parentOut->addChild(newFolder); build_tree_widget_recursively(currItem, newFolder, tissueTypes); } else { tissues_size_t type = - TissueInfos::GetTissueType(currItem->GetName()); + TissueInfos::GetTissueType(currItem->GetName()); if (type > 0) { - QTreeWidgetItem* newTissue = - create_hierarchy_item(false, currItem->GetName()); + QTreeWidgetItem *newTissue = + create_hierarchy_item(false, currItem->GetName()); parentOut->addChild(newTissue); std::set::iterator iter = - tissueTypes->find(type); + tissueTypes->find(type); if (iter != tissueTypes->end()) { tissueTypes->erase(iter); @@ -1742,7 +1742,7 @@ void TissueTreeWidget::build_tree_widget_recursively( } } -void TissueTreeWidget::add_new_hierarchy(const QString& name) +void TissueTreeWidget::add_new_hierarchy(const QString &name) { // Create and select default hierarchy hierarchies->add_new_hierarchy(name); @@ -1750,7 +1750,7 @@ void TissueTreeWidget::add_new_hierarchy(const QString& name) emit hierarchy_list_changed(); } -bool TissueTreeWidget::load_hierarchy(const QString& path) +bool TissueTreeWidget::load_hierarchy(const QString &path) { if (!hierarchies->load_hierarchy(path)) { @@ -1763,7 +1763,7 @@ bool TissueTreeWidget::load_hierarchy(const QString& path) } void TissueTreeWidget::take_children_recursively( - QTreeWidgetItem* parent, QList& appendTo) + QTreeWidgetItem *parent, QList &appendTo) { // Recursion with children for (int i = 0; i < parent->childCount(); ++i) @@ -1780,8 +1780,8 @@ void TissueTreeWidget::update_tree_widget() set_hierarchy(hierarchies->get_selected_hierarchy()); } -bool TissueTreeWidget::save_hierarchy_as(const QString& name, - const QString& path) +bool TissueTreeWidget::save_hierarchy_as(const QString &name, + const QString &path) { if (hierarchies->get_selected_hierarchy() == 0) { @@ -1821,7 +1821,7 @@ void TissueTreeWidget::remove_current_hierarchy() void TissueTreeWidget::toggle_show_tissue_indices() { setColumnHidden(TISSUETREEWIDGET_COLUMN_TYPE, - !isColumnHidden(TISSUETREEWIDGET_COLUMN_TYPE)); + !isColumnHidden(TISSUETREEWIDGET_COLUMN_TYPE)); resize_columns_to_contents(); } @@ -1868,9 +1868,9 @@ bool TissueTreeWidget::get_tissue_indices_hidden() return isColumnHidden(TISSUETREEWIDGET_COLUMN_TYPE); } -QList get_my_children(QTreeWidgetItem* item) +QList get_my_children(QTreeWidgetItem *item) { - QList my_children; + QList my_children; if (item->childCount() == 0) { @@ -1887,9 +1887,9 @@ QList get_my_children(QTreeWidgetItem* item) return my_children; } -QList TissueTreeWidget::get_all_items() +QList TissueTreeWidget::get_all_items() { - QList all_items; + QList all_items; all_items.append(get_my_children(invisibleRootItem())); auto nItems = all_items.size(); return all_items; @@ -1903,7 +1903,7 @@ void TissueTreeWidget::resize_columns_to_contents() } } -void TissueTreeWidget::resize_columns_to_contents(QTreeWidgetItem* item) +void TissueTreeWidget::resize_columns_to_contents(QTreeWidgetItem *item) { resize_columns_to_contents(); } @@ -1918,7 +1918,7 @@ unsigned short TissueTreeWidget::get_tissue_instance_count(tissues_size_t type) unsigned short res = 0; for (unsigned int i = 0; i < topLevelItemCount(); ++i) { - QTreeWidgetItem* item = topLevelItem(i); + QTreeWidgetItem *item = topLevelItem(i); if (get_is_folder(item)) { res += get_tissue_instance_count_recursively(item, type); @@ -1932,12 +1932,12 @@ unsigned short TissueTreeWidget::get_tissue_instance_count(tissues_size_t type) } unsigned short TissueTreeWidget::get_tissue_instance_count_recursively( - QTreeWidgetItem* parent, tissues_size_t type) + QTreeWidgetItem *parent, tissues_size_t type) { unsigned short res = 0; for (unsigned int i = 0; i < parent->childCount(); ++i) { - QTreeWidgetItem* item = parent->child(i); + QTreeWidgetItem *item = parent->child(i); if (get_is_folder(item)) { res += get_tissue_instance_count_recursively(item, type); @@ -1950,12 +1950,12 @@ unsigned short TissueTreeWidget::get_tissue_instance_count_recursively( return res; } -FILE* TissueTreeWidget::SaveParams(FILE* fp, int version) +FILE *TissueTreeWidget::SaveParams(FILE *fp, int version) { return hierarchies->SaveParams(fp, version); } -FILE* TissueTreeWidget::LoadParams(FILE* fp, int version) +FILE *TissueTreeWidget::LoadParams(FILE *fp, int version) { fp = hierarchies->LoadParams(fp, version); @@ -1967,12 +1967,12 @@ FILE* TissueTreeWidget::LoadParams(FILE* fp, int version) return fp; } -FILE* TissueTreeWidget::save_hierarchy(FILE* fp, unsigned short idx) +FILE *TissueTreeWidget::save_hierarchy(FILE *fp, unsigned short idx) { return hierarchies->save_hierarchy(fp, idx); } -FILE* TissueTreeWidget::load_hierarchy(FILE* fp) +FILE *TissueTreeWidget::load_hierarchy(FILE *fp) { fp = hierarchies->load_hierarchy(fp); @@ -1987,7 +1987,7 @@ FILE* TissueTreeWidget::load_hierarchy(FILE* fp) return fp; } -void TissueTreeWidget::dropEvent(QDropEvent* de) +void TissueTreeWidget::dropEvent(QDropEvent *de) { // Only accept internal move actions if (!(de->source() == this && (de->possibleActions() & Qt::MoveAction))) @@ -1996,11 +1996,11 @@ void TissueTreeWidget::dropEvent(QDropEvent* de) } if (!get_current_is_folder() && - (de->keyboardModifiers() & Qt::ShiftModifier)) + (de->keyboardModifiers() & Qt::ShiftModifier)) { // Move the item and insert a duplicate at the original position - QTreeWidgetItem* currItem = currentItem(); - QTreeWidgetItem* currParent = currItem->parent(); + QTreeWidgetItem *currItem = currentItem(); + QTreeWidgetItem *currParent = currItem->parent(); // Get original index unsigned int oldIdx = 0; @@ -2048,10 +2048,10 @@ void TissueTreeWidget::dropEvent(QDropEvent* de) update_folder_icons(); } -TissueAdder::TissueAdder(bool modifyTissue, TissueTreeWidget* tissueTree, - QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QDialog(parent, name, TRUE, wFlags), tissueTreeWidget(tissueTree) +TissueAdder::TissueAdder(bool modifyTissue, TissueTreeWidget *tissueTree, + QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QDialog(parent, name, TRUE, wFlags), tissueTreeWidget(tissueTree) { modify = modifyTissue; @@ -2126,8 +2126,8 @@ TissueAdder::TissueAdder(bool modifyTissue, TissueTreeWidget* tissueTree, { addTissue->setText("Modify Tissue"); - TissueInfoStruct* tissueInfo = - TissueInfos::GetTissueInfo(tissueTreeWidget->get_current_type()); + TissueInfoStruct *tissueInfo = + TissueInfos::GetTissueInfo(tissueTreeWidget->get_current_type()); nameField->setText(tissueInfo->name); r->setValue(int(tissueInfo->color[0] * 255)); g->setValue(int(tissueInfo->color[1] * 255)); @@ -2144,27 +2144,27 @@ TissueAdder::TissueAdder(bool modifyTissue, TissueTreeWidget* tissueTree, transp1 = float(sl_transp->value()) / 100; QObject::connect(r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_r(int))); + SLOT(update_color_r(int))); QObject::connect(g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_g(int))); + SLOT(update_color_g(int))); QObject::connect(b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_b(int))); + SLOT(update_color_b(int))); QObject::connect(sl_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opac(int))); + SLOT(update_opac(int))); QObject::connect(sb_r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_rsb(int))); + SLOT(update_color_rsb(int))); QObject::connect(sb_g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_gsb(int))); + SLOT(update_color_gsb(int))); QObject::connect(sb_b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_bsb(int))); + SLOT(update_color_bsb(int))); QObject::connect(sb_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opacsb(int))); + SLOT(update_opacsb(int))); QObject::connect(addTissue, SIGNAL(clicked()), this, - SLOT(add_pressed())); + SLOT(add_pressed())); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QObject::connect(this, - SIGNAL(color_changed(float, float, float, float)), cs, - SLOT(color_changed(float, float, float, float))); + SIGNAL(color_changed(float, float, float, float)), cs, + SLOT(color_changed(float, float, float, float))); emit color_changed(fr1, fg1, fb1, 1.0 - transp1); } @@ -2187,19 +2187,19 @@ TissueAdder::TissueAdder(bool modifyTissue, TissueTreeWidget* tissueTree, transp1 = float(sl_transp->value()) / 100; QObject::connect(r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_r(int))); + SLOT(update_color_r(int))); QObject::connect(g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_g(int))); + SLOT(update_color_g(int))); QObject::connect(b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_b(int))); + SLOT(update_color_b(int))); QObject::connect(sl_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opac(int))); + SLOT(update_opac(int))); QObject::connect(addTissue, SIGNAL(clicked()), this, - SLOT(add_pressed())); + SLOT(add_pressed())); QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QObject::connect(this, - SIGNAL(color_changed(float, float, float, float)), cs, - SLOT(color_changed(float, float, float, float))); + SIGNAL(color_changed(float, float, float, float)), cs, + SLOT(color_changed(float, float, float, float))); } return; @@ -2230,10 +2230,10 @@ TissueAdder::~TissueAdder() void TissueAdder::update_color_r(int v) { QObject::disconnect(sb_r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_rsb(int))); + SLOT(update_color_rsb(int))); sb_r->setValue(v); QObject::connect(sb_r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_rsb(int))); + SLOT(update_color_rsb(int))); fr1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2241,10 +2241,10 @@ void TissueAdder::update_color_r(int v) void TissueAdder::update_color_g(int v) { QObject::disconnect(sb_g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_gsb(int))); + SLOT(update_color_gsb(int))); sb_g->setValue(v); QObject::connect(sb_g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_gsb(int))); + SLOT(update_color_gsb(int))); fg1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2252,10 +2252,10 @@ void TissueAdder::update_color_g(int v) void TissueAdder::update_color_b(int v) { QObject::disconnect(sb_b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_bsb(int))); + SLOT(update_color_bsb(int))); sb_b->setValue(v); QObject::connect(sb_b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_bsb(int))); + SLOT(update_color_bsb(int))); fb1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2263,10 +2263,10 @@ void TissueAdder::update_color_b(int v) void TissueAdder::update_opac(int v) { QObject::disconnect(sb_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opacsb(int))); + SLOT(update_opacsb(int))); sb_transp->setValue(v); QObject::connect(sb_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opacsb(int))); + SLOT(update_opacsb(int))); transp1 = float(v) / 100; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2274,10 +2274,10 @@ void TissueAdder::update_opac(int v) void TissueAdder::update_color_rsb(int v) { QObject::disconnect(r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_r(int))); + SLOT(update_color_r(int))); r->setValue(v); QObject::connect(r, SIGNAL(valueChanged(int)), this, - SLOT(update_color_r(int))); + SLOT(update_color_r(int))); fr1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2285,10 +2285,10 @@ void TissueAdder::update_color_rsb(int v) void TissueAdder::update_color_gsb(int v) { QObject::disconnect(g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_g(int))); + SLOT(update_color_g(int))); g->setValue(v); QObject::connect(g, SIGNAL(valueChanged(int)), this, - SLOT(update_color_g(int))); + SLOT(update_color_g(int))); fg1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2296,10 +2296,10 @@ void TissueAdder::update_color_gsb(int v) void TissueAdder::update_color_bsb(int v) { QObject::disconnect(b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_b(int))); + SLOT(update_color_b(int))); b->setValue(v); QObject::connect(b, SIGNAL(valueChanged(int)), this, - SLOT(update_color_b(int))); + SLOT(update_color_b(int))); fb1 = float(v) / 255; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2307,10 +2307,10 @@ void TissueAdder::update_color_bsb(int v) void TissueAdder::update_opacsb(int v) { QObject::disconnect(sl_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opac(int))); + SLOT(update_opac(int))); sl_transp->setValue(v); QObject::connect(sl_transp, SIGNAL(valueChanged(int)), this, - SLOT(update_opac(int))); + SLOT(update_opac(int))); transp1 = float(v) / 100; emit color_changed(fr1, fg1, fb1, 1.0f - transp1); } @@ -2322,14 +2322,14 @@ void TissueAdder::add_pressed() if (!nameField->text().isEmpty()) { tissues_size_t type = tissueTreeWidget->get_current_type(); - TissueInfoStruct* tissueInfo = TissueInfos::GetTissueInfo(type); + TissueInfoStruct *tissueInfo = TissueInfos::GetTissueInfo(type); QString oldName = tissueInfo->name; if (oldName.compare(nameField->text(), Qt::CaseInsensitive) != 0 && - TissueInfos::GetTissueType(nameField->text()) > 0) + TissueInfos::GetTissueType(nameField->text()) > 0) { QMessageBox::information( - this, "iSeg", - "A tissue with the same name already exists."); + this, "iSeg", + "A tissue with the same name already exists."); return; } TissueInfos::SetTissueName(type, nameField->text()); @@ -2358,8 +2358,8 @@ void TissueAdder::add_pressed() if (TissueInfos::GetTissueType(nameField->text()) > 0) { QMessageBox::information( - this, "iSeg", - "A tissue with the same name already exists."); + this, "iSeg", + "A tissue with the same name already exists."); return; } TissueInfoStruct tissueInfo; @@ -2382,10 +2382,10 @@ void TissueAdder::add_pressed() return; } -TissueFolderAdder::TissueFolderAdder(TissueTreeWidget* tissueTree, - QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QDialog(parent, name, TRUE, wFlags), tissueTreeWidget(tissueTree) +TissueFolderAdder::TissueFolderAdder(TissueTreeWidget *tissueTree, + QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QDialog(parent, name, TRUE, wFlags), tissueTreeWidget(tissueTree) { setFixedWidth(235); setFixedHeight(161); @@ -2423,10 +2423,10 @@ void TissueFolderAdder::add_pressed() close(); } -TissueHierarchyWidget::TissueHierarchyWidget(TissueTreeWidget* tissueTree, - QWidget* parent, - Qt::WindowFlags wFlags) - : QWidget(parent, wFlags), tissueTreeWidget(tissueTree) +TissueHierarchyWidget::TissueHierarchyWidget(TissueTreeWidget *tissueTree, + QWidget *parent, + Qt::WindowFlags wFlags) + : QWidget(parent, wFlags), tissueTreeWidget(tissueTree) { hboxOverall = new Q3HBoxLayout(this); vboxOverall = new Q3VBoxLayout(); @@ -2449,19 +2449,19 @@ TissueHierarchyWidget::TissueHierarchyWidget(TissueTreeWidget* tissueTree, vboxOverall->addLayout(vboxHierarchyButtons); QObject::connect(hierarchyComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(hierarchy_changed(int))); + SLOT(hierarchy_changed(int))); QObject::connect(newHierarchyButton, SIGNAL(clicked()), this, - SLOT(new_hierarchy_pressed())); + SLOT(new_hierarchy_pressed())); QObject::connect(loadHierarchyButton, SIGNAL(clicked()), this, - SLOT(load_hierarchy_pressed())); + SLOT(load_hierarchy_pressed())); QObject::connect(saveHierarchyAsButton, SIGNAL(clicked()), this, - SLOT(save_hierarchy_as_pressed())); + SLOT(save_hierarchy_as_pressed())); QObject::connect(removeHierarchyButton, SIGNAL(clicked()), this, - SLOT(remove_hierarchy_pressed())); + SLOT(remove_hierarchy_pressed())); QObject::connect(tissueTreeWidget, SIGNAL(hierarchy_list_changed()), this, - SLOT(update_hierarchy_combo_box())); + SLOT(update_hierarchy_combo_box())); update_hierarchy_combo_box(); @@ -2478,7 +2478,7 @@ void TissueHierarchyWidget::update_hierarchy_combo_box() hierarchyComboBox->addItem(name); } hierarchyComboBox->setCurrentItem( - tissueTreeWidget->get_selected_hierarchy()); + tissueTreeWidget->get_selected_hierarchy()); hierarchyComboBox->blockSignals(false); } @@ -2508,14 +2508,14 @@ bool TissueHierarchyWidget::handle_changed_hierarchy() return true; #else // Version: Commit change, but only save to xml if default hierarchy changed if (tissueTreeWidget->get_selected_hierarchy() == 0 && - tissueTreeWidget->get_hierarchy_modified()) + tissueTreeWidget->get_hierarchy_modified()) { int ret = QMessageBox::warning( - this, "iSeg", - QString("Do you want to save changes to hierarchy %1?") - .arg(tissueTreeWidget->get_current_hierarchy_name()), - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, - QMessageBox::Cancel | QMessageBox::Escape); + this, "iSeg", + QString("Do you want to save changes to hierarchy %1?") + .arg(tissueTreeWidget->get_current_hierarchy_name()), + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, + QMessageBox::Cancel | QMessageBox::Escape); if (ret == QMessageBox::Yes) { // Save hierarchy as... @@ -2584,8 +2584,8 @@ void TissueHierarchyWidget::new_hierarchy_pressed() // Get hierarchy name bool ok = false; QString newHierarchyName = QInputDialog::getText( - "Hierarchy name", "Enter a name for the hierarchy:", QLineEdit::Normal, - "New Hierarchy", &ok, this); + "Hierarchy name", "Enter a name for the hierarchy:", QLineEdit::Normal, + "New Hierarchy", &ok, this); if (!ok) { return; @@ -2605,7 +2605,7 @@ void TissueHierarchyWidget::load_hierarchy_pressed() // Get file name QString fileName = QFileDialog::getOpenFileName(this, tr("Load File"), "", - tr("XML files (*.xml)")); + tr("XML files (*.xml)")); if (fileName.isNull()) { return; @@ -2616,7 +2616,7 @@ void TissueHierarchyWidget::load_hierarchy_pressed() // Set loaded hierarchy selected tissueTreeWidget->set_hierarchy(tissueTreeWidget->get_hierarchy_count() - - 1); + 1); update_hierarchy_combo_box(); } @@ -2624,7 +2624,7 @@ bool TissueHierarchyWidget::save_hierarchy_as_pressed() { // Get file name QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "", - tr("XML files (*.xml)")); + tr("XML files (*.xml)")); if (fileName.isNull()) { return false; @@ -2633,8 +2633,8 @@ bool TissueHierarchyWidget::save_hierarchy_as_pressed() // Get hierarchy name bool ok = false; QString newHierarchyName = QInputDialog::getText( - "Hierarchy name", "Enter a name for the hierarchy:", QLineEdit::Normal, - tissueTreeWidget->get_current_hierarchy_name(), &ok, this); + "Hierarchy name", "Enter a name for the hierarchy:", QLineEdit::Normal, + tissueTreeWidget->get_current_hierarchy_name(), &ok, this); if (!ok) { return false; @@ -2650,9 +2650,9 @@ void TissueHierarchyWidget::remove_hierarchy_pressed() tissueTreeWidget->remove_current_hierarchy(); } -bits_stack::bits_stack(SlicesHandler* hand3D, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags), handler3D(hand3D) +bits_stack::bits_stack(SlicesHandler *hand3D, QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags), handler3D(hand3D) { bits_names = new QListWidget(this); hbox1 = new Q3HBoxLayout(this); @@ -2684,20 +2684,20 @@ bits_stack::bits_stack(SlicesHandler* hand3D, QWidget* parent, const char* name, bits_names->setDropIndicatorShown(true); QObject::connect(pushwork, SIGNAL(clicked()), this, - SLOT(pushwork_pressed())); + SLOT(pushwork_pressed())); QObject::connect(pushbmp, SIGNAL(clicked()), this, SLOT(pushbmp_pressed())); QObject::connect(pushtissue, SIGNAL(clicked()), this, - SLOT(pushtissue_pressed())); + SLOT(pushtissue_pressed())); QObject::connect(popwork, SIGNAL(clicked()), this, SLOT(popwork_pressed())); QObject::connect(popbmp, SIGNAL(clicked()), this, SLOT(popbmp_pressed())); QObject::connect(poptissue, SIGNAL(clicked()), this, - SLOT(poptissue_pressed())); + SLOT(poptissue_pressed())); QObject::connect(deletebtn, SIGNAL(clicked()), this, - SLOT(delete_pressed())); + SLOT(delete_pressed())); QObject::connect(saveitem, SIGNAL(clicked()), this, - SLOT(saveitem_pressed())); + SLOT(saveitem_pressed())); QObject::connect(loaditem, SIGNAL(clicked()), this, - SLOT(loaditem_pressed())); + SLOT(loaditem_pressed())); oldw = handler3D->return_width(); oldh = handler3D->return_height(); @@ -2749,7 +2749,7 @@ void bits_stack::push_helper(bool source, bool target, bool tissue) emit begin_dataexport(dataSelection, this); bits_stack_pushdialog pushdialog(this, QString("Copy ") + dataName + - QString("...")); + QString("...")); if (pushdialog.exec() == QDialog::Rejected) { emit end_dataexport(this); @@ -2761,21 +2761,21 @@ void bits_stack::push_helper(bool source, bool target, bool tissue) // Copy current slice bool ok; QString newText = QInputDialog::getText( - "Name", "Enter a name for the picture:", QLineEdit::Normal, "", &ok, - this); + "Name", "Enter a name for the picture:", QLineEdit::Normal, "", &ok, + this); newText = newText + QString(" (") + - QString::number(handler3D->get_activeslice() + 1) + - QString(")"); + QString::number(handler3D->get_activeslice() + 1) + + QString(")"); while (ok && - bits_names->findItems(newText, Qt::MatchExactly).size() > 0) + bits_names->findItems(newText, Qt::MatchExactly).size() > 0) { newText = QInputDialog::getText( - "Name", - "Enter a !new! name for the picture:", QLineEdit::Normal, "", - &ok, this); + "Name", + "Enter a !new! name for the picture:", QLineEdit::Normal, "", + &ok, this); newText = newText + QString(" (") + - QString::number(handler3D->get_activeslice() + 1) + - QString(")"); + QString::number(handler3D->get_activeslice() + 1) + + QString(")"); } if (ok) { @@ -2804,11 +2804,11 @@ void bits_stack::push_helper(bool source, bool target, bool tissue) unsigned int startslice = pushdialog.get_startslice(&startok); unsigned int endslice = pushdialog.get_endslice(&endok); while (!startok || !endok || startslice > endslice || startslice < 1 || - endslice > handler3D->return_nrslices()) + endslice > handler3D->return_nrslices()) { QMessageBox::information( - this, QString("Copy ") + dataName + QString("..."), - "Please enter a valid slice range.\n"); + this, QString("Copy ") + dataName + QString("..."), + "Please enter a valid slice range.\n"); if (pushdialog.exec() == QDialog::Rejected) { emit end_dataexport(this); @@ -2820,22 +2820,22 @@ void bits_stack::push_helper(bool source, bool target, bool tissue) matchfound = true; QString newText = QInputDialog::getText( - "Name", "Enter a name for the pictures:", QLineEdit::Normal, "", - &ok, this); + "Name", "Enter a name for the pictures:", QLineEdit::Normal, "", + &ok, this); while (ok && matchfound) { matchfound = false; for (unsigned int slice = startslice; slice <= endslice; ++slice) { QString newTextExt = newText + QString(" (") + - QString::number(slice) + QString(")"); + QString::number(slice) + QString(")"); if (bits_names->findItems(newTextExt, Qt::MatchExactly).size() > - 0) + 0) { matchfound = true; newText = QInputDialog::getText( - "Name", "Enter a !new! name for the pictures:", - QLineEdit::Normal, "", &ok, this); + "Name", "Enter a !new! name for the pictures:", + QLineEdit::Normal, "", &ok, this); break; } } @@ -2845,7 +2845,7 @@ void bits_stack::push_helper(bool source, bool target, bool tissue) for (unsigned int slice = startslice; slice <= endslice; ++slice) { QString newTextExt = newText + QString(" (") + - QString::number(slice) + QString(")"); + QString::number(slice) + QString(")"); unsigned dummy; if (source) { @@ -2896,18 +2896,18 @@ void bits_stack::pop_helper(bool source, bool target, bool tissue) dataName = QString("Tissue"); } - QList selectedItems = bits_names->selectedItems(); + QList selectedItems = bits_names->selectedItems(); if (selectedItems.size() <= 0) { return; } else if (handler3D->get_activeslice() + selectedItems.size() > - handler3D->return_nrslices()) + handler3D->return_nrslices()) { QMessageBox::information( - this, QString("Paste ") + dataName, - "The number of images to be pasted starting at the\ncurrent slice " - "would surpass the end of the data stack.\n"); + this, QString("Paste ") + dataName, + "The number of images to be pasted starting at the\ncurrent slice " + "would surpass the end of the data stack.\n"); return; } @@ -2922,27 +2922,27 @@ void bits_stack::pop_helper(bool source, bool target, bool tissue) unsigned int slice = handler3D->get_activeslice(); if (source) { - for (QList::iterator iter = selectedItems.begin(); - iter != selectedItems.end(); ++iter) + for (QList::iterator iter = selectedItems.begin(); + iter != selectedItems.end(); ++iter) { handler3D->getstack_bmp(slice++, bits_nr[(*iter)->text()]); } } else if (target) { - for (QList::iterator iter = selectedItems.begin(); - iter != selectedItems.end(); ++iter) + for (QList::iterator iter = selectedItems.begin(); + iter != selectedItems.end(); ++iter) { handler3D->getstack_work(slice++, bits_nr[(*iter)->text()]); } } else if (tissue) { - for (QList::iterator iter = selectedItems.begin(); - iter != selectedItems.end(); ++iter) + for (QList::iterator iter = selectedItems.begin(); + iter != selectedItems.end(); ++iter) { handler3D->getstack_tissue(slice++, bits_nr[(*iter)->text()], - tissuenr, true); + tissuenr, true); } } @@ -2957,10 +2957,10 @@ void bits_stack::poptissue_pressed() { pop_helper(false, false, true); } void bits_stack::loaditem_pressed() { - Q3FileDialog* dialog = new Q3FileDialog(QString::null, - "Stackitems (*.stk)\n" - "All(*.*)", - this); + Q3FileDialog *dialog = new Q3FileDialog(QString::null, + "Stackitems (*.stk)\n" + "All(*.*)", + this); dialog->setMode(Q3FileDialog::ExistingFiles); if (dialog->exec() == QDialog::Rejected) { @@ -2975,23 +2975,23 @@ void bits_stack::loaditem_pressed() bool ok; bool matchfound = true; QString newText = QInputDialog::getText( - "Name", "Enter a name for the pictures:", QLineEdit::Normal, "", - &ok, this); + "Name", "Enter a name for the pictures:", QLineEdit::Normal, "", + &ok, this); while (ok && matchfound) { matchfound = false; unsigned int suffix = 0; for (QStringList::Iterator iter = selectedFiles.begin(); - iter != selectedFiles.end(); ++iter) + iter != selectedFiles.end(); ++iter) { QString newTextExt = newText + QString::number(suffix++); if (bits_names->findItems(newTextExt, Qt::MatchExactly).size() > - 0) + 0) { matchfound = true; newText = QInputDialog::getText( - "Name", "Enter a !new! name for the pictures:", - QLineEdit::Normal, "", &ok, this); + "Name", "Enter a !new! name for the pictures:", + QLineEdit::Normal, "", &ok, this); break; } } @@ -3001,7 +3001,7 @@ void bits_stack::loaditem_pressed() { unsigned int suffix = 0; for (QStringList::Iterator iter = selectedFiles.begin(); - iter != selectedFiles.end(); ++iter) + iter != selectedFiles.end(); ++iter) { QString newTextExt = newText + QString::number(suffix++); unsigned dummy = handler3D->loadstack(iter->ascii()); @@ -3019,15 +3019,15 @@ void bits_stack::loaditem_pressed() // Load single item bool ok; QString newText = QInputDialog::getText( - "Name", "Enter a name for the picture:", QLineEdit::Normal, "", &ok, - this); + "Name", "Enter a name for the picture:", QLineEdit::Normal, "", &ok, + this); while (ok && - bits_names->findItems(newText, Qt::MatchExactly).size() > 0) + bits_names->findItems(newText, Qt::MatchExactly).size() > 0) { newText = QInputDialog::getText( - "Name", - "Enter a !new! name for the picture:", QLineEdit::Normal, "", - &ok, this); + "Name", + "Enter a !new! name for the picture:", QLineEdit::Normal, "", + &ok, this); } if (ok) @@ -3048,14 +3048,14 @@ void bits_stack::loaditem_pressed() void bits_stack::saveitem_pressed() { - QList selectedItems = bits_names->selectedItems(); + QList selectedItems = bits_names->selectedItems(); if (selectedItems.size() <= 0) { return; } QString savefilename = Q3FileDialog::getSaveFileName( - QString::null, "Stackitems (*.stk)\n", this); //, filename); + QString::null, "Stackitems (*.stk)\n", this); //, filename); if (savefilename.endsWith(QString(".stk"))) { savefilename.remove(savefilename.length() - 4, 4); @@ -3075,35 +3075,35 @@ void bits_stack::saveitem_pressed() fieldWidth++; } unsigned int suffix = 1; - for (QList::iterator iter = selectedItems.begin(); - iter != selectedItems.end(); ++iter) + for (QList::iterator iter = selectedItems.begin(); + iter != selectedItems.end(); ++iter) { QString savefilenameExt = - savefilename + - QString("%1").arg(suffix++, fieldWidth, 10, QChar('0')) + - QString(".stk"); + savefilename + + QString("%1").arg(suffix++, fieldWidth, 10, QChar('0')) + + QString(".stk"); handler3D->savestack(bits_nr[(*iter)->text()], - savefilenameExt.ascii()); + savefilenameExt.ascii()); } } else { QString savefilenameExt = savefilename + QString(".stk"); handler3D->savestack(bits_nr[selectedItems[0]->text()], - savefilenameExt.ascii()); + savefilenameExt.ascii()); } } void bits_stack::delete_pressed() { - QList selectedItems = bits_names->selectedItems(); + QList selectedItems = bits_names->selectedItems(); if (selectedItems.size() <= 0) { return; } - for (QList::iterator iter = selectedItems.begin(); - iter != selectedItems.end(); ++iter) + for (QList::iterator iter = selectedItems.begin(); + iter != selectedItems.end(); ++iter) { handler3D->removestack(bits_nr[(*iter)->text()]); bits_nr.erase((*iter)->text()); @@ -3112,7 +3112,7 @@ void bits_stack::delete_pressed() } } -QMap* bits_stack::return_bitsnr() { return &bits_nr; } +QMap *bits_stack::return_bitsnr() { return &bits_nr; } void bits_stack::newloaded() { @@ -3134,7 +3134,7 @@ void bits_stack::clear_stack() emit stack_changed(); } -FILE* bits_stack::save_proj(FILE* fp) +FILE *bits_stack::save_proj(FILE *fp) { int size = int(bits_nr.size()); fwrite(&size, 1, sizeof(int), fp); @@ -3152,7 +3152,7 @@ FILE* bits_stack::save_proj(FILE* fp) return fp; } -FILE* bits_stack::load_proj(FILE* fp) +FILE *bits_stack::load_proj(FILE *fp) { oldw = handler3D->return_width(); oldh = handler3D->return_height(); @@ -3182,9 +3182,9 @@ FILE* bits_stack::load_proj(FILE* fp) return fp; } -extoverlay_widget::extoverlay_widget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags), handler3D(hand3D) +extoverlay_widget::extoverlay_widget(SlicesHandler *hand3D, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -3241,17 +3241,17 @@ extoverlay_widget::extoverlay_widget(SlicesHandler* hand3D, QWidget* parent, setFixedHeight(hboxOverall->sizeHint().height()); QObject::connect(datasetComboBox, SIGNAL(currentIndexChanged(int)), this, - SLOT(dataset_changed(int))); + SLOT(dataset_changed(int))); QObject::connect(loadDatasetButton, SIGNAL(clicked()), this, - SLOT(load_dataset_pressed())); + SLOT(load_dataset_pressed())); QObject::connect(leAlpha, SIGNAL(editingFinished()), this, - SLOT(alpha_changed())); + SLOT(alpha_changed())); QObject::connect(slAlpha, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(srcCheckBox, SIGNAL(clicked()), this, - SLOT(source_toggled())); + SLOT(source_toggled())); QObject::connect(tgtCheckBox, SIGNAL(clicked()), this, - SLOT(target_toggled())); + SLOT(target_toggled())); initialize(); } @@ -3275,7 +3275,7 @@ void extoverlay_widget::initialize() void extoverlay_widget::newloaded() { handler3D->clear_overlay(); } -void extoverlay_widget::add_dataset(const QString& path) +void extoverlay_widget::add_dataset(const QString &path) { datasetNames.push_back(QFileInfo(path).fileName()); datasetFilepaths.push_back(path); @@ -3307,30 +3307,30 @@ void extoverlay_widget::reload_overlay() handler3D->clear_overlay(); } else if (datasetFilepaths[selectedDataset].endsWith(QString(".raw"), - Qt::CaseInsensitive)) + Qt::CaseInsensitive)) { ok = handler3D->ReadRawOverlay(datasetFilepaths[selectedDataset], 8, - handler3D->get_activeslice()); + handler3D->get_activeslice()); } else if (datasetFilepaths[selectedDataset].endsWith(QString(".vtk"), - Qt::CaseInsensitive) || - datasetFilepaths[selectedDataset].endsWith(QString(".vti"), - Qt::CaseInsensitive)) + Qt::CaseInsensitive) || + datasetFilepaths[selectedDataset].endsWith(QString(".vti"), + Qt::CaseInsensitive)) { ok = handler3D->ReadOverlay(datasetFilepaths[selectedDataset], - handler3D->get_activeslice()); + handler3D->get_activeslice()); } else if (datasetFilepaths[selectedDataset].endsWith(QString(".nii"), - Qt::CaseInsensitive) || - datasetFilepaths[selectedDataset].endsWith(QString(".hdr"), - Qt::CaseInsensitive) || - datasetFilepaths[selectedDataset].endsWith(QString(".img"), - Qt::CaseInsensitive) || - datasetFilepaths[selectedDataset].endsWith(QString(".nii.gz"), - Qt::CaseInsensitive)) + Qt::CaseInsensitive) || + datasetFilepaths[selectedDataset].endsWith(QString(".hdr"), + Qt::CaseInsensitive) || + datasetFilepaths[selectedDataset].endsWith(QString(".img"), + Qt::CaseInsensitive) || + datasetFilepaths[selectedDataset].endsWith(QString(".nii.gz"), + Qt::CaseInsensitive)) { ok = handler3D->ReadOverlay(datasetFilepaths[selectedDataset], - handler3D->get_activeslice()); + handler3D->get_activeslice()); } if (!ok) @@ -3363,12 +3363,12 @@ extoverlay_widget::~extoverlay_widget() void extoverlay_widget::load_dataset_pressed() { QString loadfilename = - Q3FileDialog::getOpenFileName(QString::null, - "VTK (*.vti *.vtk)\n" - "Raw files (*.raw)\n" - "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" - "All(*.*)", - this); // TODO: Support other file types + Q3FileDialog::getOpenFileName(QString::null, + "VTK (*.vti *.vtk)\n" + "Raw files (*.raw)\n" + "NIFTI (*.nii *.hdr *.img *.nii.gz)\n" + "All(*.*)", + this); // TODO: Support other file types if (!loadfilename.isEmpty()) { add_dataset(loadfilename); @@ -3420,10 +3420,10 @@ void extoverlay_widget::target_toggled() emit workoverlayvisible_changed(isset); } -MultiDataset_widget::MultiDataset_widget(SlicesHandler* hand3D, QWidget* parent, - const char* name, - Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags), m_Handler3D(hand3D) +MultiDataset_widget::MultiDataset_widget(SlicesHandler *hand3D, QWidget *parent, + const char *name, + Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags), m_Handler3D(hand3D) { hboxOverall = new Q3HBoxLayout(this); vboxOverall = new Q3VBoxLayout(); @@ -3441,7 +3441,7 @@ MultiDataset_widget::MultiDataset_widget(SlicesHandler* hand3D, QWidget* parent, vboxOverall->addWidget(m_DatasetsGroupBox); //Buttons - QHBoxLayout* buttonsGrid = new QHBoxLayout(); + QHBoxLayout *buttonsGrid = new QHBoxLayout(); vboxOverall->addLayout(buttonsGrid); // Add dataset button @@ -3459,15 +3459,15 @@ MultiDataset_widget::MultiDataset_widget(SlicesHandler* hand3D, QWidget* parent, setFixedHeight(hboxOverall->sizeHint().height()); QObject::connect(m_AddDatasetButton, SIGNAL(clicked()), this, - SLOT(AddDatasetPressed())); + SLOT(AddDatasetPressed())); QObject::connect(m_LoadDatasetButton, SIGNAL(clicked()), this, - SLOT(SwitchDataset())); + SLOT(SwitchDataset())); QObject::connect(m_ChangeNameButton, SIGNAL(clicked()), this, - SLOT(ChangeDatasetName())); + SLOT(ChangeDatasetName())); QObject::connect(m_RemoveDatasetButton, SIGNAL(clicked()), this, - SLOT(RemoveDataset())); + SLOT(RemoveDataset())); QObject::connect(m_DatasetsGroupBox, SIGNAL(clicked()), this, - SLOT(DatasetSelectionChanged())); + SLOT(DatasetSelectionChanged())); Initialize(); InitializeMap(); @@ -3504,7 +3504,7 @@ void MultiDataset_widget::ClearRadioButtons() { if (m_VboxDatasets->layout() != NULL) { - QLayoutItem* item; + QLayoutItem *item; while ((item = m_VboxDatasets->layout()->takeAt(0)) != NULL) { delete item->widget(); @@ -3570,7 +3570,7 @@ void MultiDataset_widget::AddDatasetPressed() if (selectedType != -1) { - SlicesHandler* handler3D = new SlicesHandler(); + SlicesHandler *handler3D = new SlicesHandler(); QStringList loadfilenames; unsigned short width, height, nrofslices; MultiDataset_widget::SDatasetInfo dataInfo; @@ -3582,17 +3582,17 @@ void MultiDataset_widget::AddDatasetPressed() case SupportedMultiDatasetTypes::supportedTypes::bmp: { loadfilenames = Q3FileDialog::getOpenFileNames( - "Images (*.bmp)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + "Images (*.bmp)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!loadfilenames.empty()) { sort(loadfilenames.begin(), loadfilenames.end()); short nrelem = loadfilenames.size(); - vector vfilenames; + vector vfilenames; for (short i = 0; i < nrelem; i++) { vfilenames.push_back(loadfilenames[i].ascii()); @@ -3607,7 +3607,7 @@ void MultiDataset_widget::AddDatasetPressed() nrofslices = handler3D->return_nrslices(); success = CheckInfoAndAddToList(dataInfo, loadfilenames, width, - height, nrofslices); + height, nrofslices); } } break; @@ -3615,10 +3615,10 @@ void MultiDataset_widget::AddDatasetPressed() case SupportedMultiDatasetTypes::supportedTypes::dcm: { loadfilenames = Q3FileDialog::getOpenFileNames( - "Images (*.dcm *.dicom)\n" - "All(*.*)", - QString::null, this, "open files dialog", - "Select one or more files to open"); + "Images (*.dcm *.dicom)\n" + "All(*.*)", + QString::null, this, "open files dialog", + "Select one or more files to open"); if (!loadfilenames.empty()) { @@ -3632,7 +3632,7 @@ void MultiDataset_widget::AddDatasetPressed() nrofslices = handler3D->return_nrslices(); success = CheckInfoAndAddToList(dataInfo, loadfilenames, width, - height, nrofslices); + height, nrofslices); } break; @@ -3649,7 +3649,7 @@ void MultiDataset_widget::AddDatasetPressed() nrofslices = handler3D->return_nrslices(); success = CheckInfoAndAddToList(dataInfo, loadfilenames, width, - height, nrofslices); + height, nrofslices); } break; @@ -3658,11 +3658,11 @@ void MultiDataset_widget::AddDatasetPressed() { bool res = true; QString loadfilename = Q3FileDialog::getOpenFileName( - QString::null, - "VTK (*.vti *.vtk)\n" - "NIFTI (*.nii *.hdr *.img *.nia)\n" - "All(*.*)", - this); + QString::null, + "VTK (*.vti *.vtk)\n" + "NIFTI (*.nii *.hdr *.img *.nia)\n" + "All(*.*)", + this); if (!loadfilename.isEmpty()) { if (handler3D->ReadImage(loadfilename.ascii())) @@ -3673,7 +3673,7 @@ void MultiDataset_widget::AddDatasetPressed() nrofslices = handler3D->return_nrslices(); success = CheckInfoAndAddToList(dataInfo, loadfilenames, - width, height, nrofslices); + width, height, nrofslices); } } } @@ -3700,9 +3700,9 @@ void MultiDataset_widget::AddDatasetPressed() } bool MultiDataset_widget::CheckInfoAndAddToList( - MultiDataset_widget::SDatasetInfo& newRadioButton, - QStringList loadfilenames, unsigned short width, unsigned short height, - unsigned short nrofslices) + MultiDataset_widget::SDatasetInfo &newRadioButton, + QStringList loadfilenames, unsigned short width, unsigned short height, + unsigned short nrofslices) { // check whether the new dataset matches the dataset loaded const unsigned short w_loaded = m_Handler3D->return_width(); @@ -3712,24 +3712,24 @@ bool MultiDataset_widget::CheckInfoAndAddToList( if (w_loaded == 512 && h_loaded == 512 && nrofslices_loaded == 1) { QMessageBox mb( - "Loading failed", "The main dataset must be loaded first.", - QMessageBox::Critical, QMessageBox::Ok | QMessageBox::Default, - QMessageBox::NoButton, QMessageBox::NoButton); + "Loading failed", "The main dataset must be loaded first.", + QMessageBox::Critical, QMessageBox::Ok | QMessageBox::Default, + QMessageBox::NoButton, QMessageBox::NoButton); mb.exec(); } if (w_loaded == width && h_loaded == height && - nrofslices_loaded == nrofslices) + nrofslices_loaded == nrofslices) { return AddDatasetToList(newRadioButton, loadfilenames); } else { QMessageBox mb( - "Loading failed", - "The resolution of the dataset must match the one loaded.", - QMessageBox::Critical, QMessageBox::Ok | QMessageBox::Default, - QMessageBox::NoButton, QMessageBox::NoButton); + "Loading failed", + "The resolution of the dataset must match the one loaded.", + QMessageBox::Critical, QMessageBox::Ok | QMessageBox::Default, + QMessageBox::NoButton, QMessageBox::NoButton); mb.exec(); } @@ -3737,26 +3737,26 @@ bool MultiDataset_widget::CheckInfoAndAddToList( } bool MultiDataset_widget::AddDatasetToList( - MultiDataset_widget::SDatasetInfo& newRadioButton, - QStringList loadfilenames) + MultiDataset_widget::SDatasetInfo &newRadioButton, + QStringList loadfilenames) { QString butText = loadfilenames[0]; newRadioButton.m_RadioButton = - new QRadioButton(QFileInfo(loadfilenames[0]).fileName()); + new QRadioButton(QFileInfo(loadfilenames[0]).fileName()); newRadioButton.m_DatasetFilepath = loadfilenames; newRadioButton.m_RadioButtonText = butText; m_VboxDatasets->addWidget(newRadioButton.m_RadioButton, 0, Qt::AlignTop); QObject::connect(newRadioButton.m_RadioButton, SIGNAL(clicked()), this, - SLOT(DatasetSelectionChanged())); + SLOT(DatasetSelectionChanged())); return !newRadioButton.m_DatasetFilepath.empty(); } void MultiDataset_widget::CopyImagesSlices( - SlicesHandler* handler3D, MultiDataset_widget::SDatasetInfo& newRadioButton, - const bool saveOnlyWorkingBits /*= false*/) + SlicesHandler *handler3D, MultiDataset_widget::SDatasetInfo &newRadioButton, + const bool saveOnlyWorkingBits /*= false*/) { const int nrslices = handler3D->return_nrslices(); const int width = handler3D->return_width(); @@ -3771,7 +3771,7 @@ void MultiDataset_widget::CopyImagesSlices( newRadioButton.m_BmpSlices.clear(); for (int i = 0; i < nrslices; i++) { - float* bmp_data = (float*)malloc(sizeof(float) * size); + float *bmp_data = (float *)malloc(sizeof(float) * size); memcpy(bmp_data, handler3D->return_bmp(i), sizeof(float) * size); newRadioButton.m_BmpSlices.push_back(bmp_data); } @@ -3780,7 +3780,7 @@ void MultiDataset_widget::CopyImagesSlices( newRadioButton.m_WorkSlices.clear(); for (int i = 0; i < nrslices; i++) { - float* work_data = (float*)malloc(sizeof(float) * size); + float *work_data = (float *)malloc(sizeof(float) * size); memcpy(work_data, handler3D->return_work(i), sizeof(float) * size); newRadioButton.m_WorkSlices.push_back(work_data); } @@ -3788,7 +3788,7 @@ void MultiDataset_widget::CopyImagesSlices( void MultiDataset_widget::SwitchDataset() { - for (auto& radioButton : m_RadioButtons) + for (auto &radioButton : m_RadioButtons) { if (radioButton.m_RadioButton->isChecked()) { @@ -3808,9 +3808,9 @@ void MultiDataset_widget::SwitchDataset() float size = radioButton.m_Width * radioButton.m_Height; const int nSlices = radioButton.m_BmpSlices.size(); assert(radioButton.m_BmpSlices.size() == - m_Handler3D->return_nrslices()); + m_Handler3D->return_nrslices()); assert(radioButton.m_WorkSlices.size() == - m_Handler3D->return_nrslices()); + m_Handler3D->return_nrslices()); for (int i = 0; i < nSlices; i++) { @@ -3825,7 +3825,7 @@ void MultiDataset_widget::SwitchDataset() for (int i = 0; i < nSlices; i++) { m_Handler3D->copy2work(i, radioButton.m_WorkSlices.at(i), - 1); + 1); //m_Handler3D->set_work( i, radioButton.m_WorkSlices.at(i), 1 ); //float* work_data = (float*) malloc(sizeof(float)*size); //memcpy(work_data, radioButton.m_WorkSlices.at(i), sizeof(float)*size); @@ -3856,12 +3856,12 @@ void MultiDataset_widget::SwitchDataset() void MultiDataset_widget::ChangeDatasetName() { - for (auto& radioButton : m_RadioButtons) + for (auto &radioButton : m_RadioButtons) { if (radioButton.m_RadioButton->isChecked()) { EditText edit_text_dlg(this->parentWidget(), "", - this->windowFlags()); + this->windowFlags()); edit_text_dlg.set_editable_text(radioButton.m_RadioButton->text()); if (edit_text_dlg.exec()) { @@ -3877,20 +3877,20 @@ void MultiDataset_widget::ChangeDatasetName() void MultiDataset_widget::RemoveDataset() { int index = 0; - for (auto& radioButton : m_RadioButtons) + for (auto &radioButton : m_RadioButtons) { if (radioButton.m_RadioButton->isChecked()) { m_VboxDatasets->removeWidget(radioButton.m_RadioButton); std::for_each(radioButton.m_BmpSlices.begin(), - radioButton.m_BmpSlices.end(), - [](float* element) { delete element; }); + radioButton.m_BmpSlices.end(), + [](float *element) { delete element; }); radioButton.m_BmpSlices.clear(); std::for_each(radioButton.m_WorkSlices.begin(), - radioButton.m_WorkSlices.end(), - [](float* element) { delete element; }); + radioButton.m_WorkSlices.end(), + [](float *element) { delete element; }); radioButton.m_WorkSlices.clear(); delete radioButton.m_RadioButton; @@ -3956,17 +3956,17 @@ bool MultiDataset_widget::IsActive(const int multiDS_index) return false; } -std::vector MultiDataset_widget::GetBmpData(const int multiDS_index) +std::vector MultiDataset_widget::GetBmpData(const int multiDS_index) { if (multiDS_index < m_RadioButtons.size()) { return m_RadioButtons.at(multiDS_index).m_BmpSlices; } - return std::vector(); + return std::vector(); } void MultiDataset_widget::SetBmpData(const int multiDS_index, - std::vector bmp_bits_vc) + std::vector bmp_bits_vc) { if (multiDS_index < m_RadioButtons.size()) { @@ -3974,17 +3974,17 @@ void MultiDataset_widget::SetBmpData(const int multiDS_index, } } -std::vector MultiDataset_widget::GetWorkingData(const int multiDS_index) +std::vector MultiDataset_widget::GetWorkingData(const int multiDS_index) { if (multiDS_index < m_RadioButtons.size()) { return m_RadioButtons.at(multiDS_index).m_WorkSlices; } - return std::vector(); + return std::vector(); } void MultiDataset_widget::SetWorkingData(const int multiDS_index, - std::vector work_bits_vc) + std::vector work_bits_vc) { if (multiDS_index < m_RadioButtons.size()) { @@ -3992,9 +3992,9 @@ void MultiDataset_widget::SetWorkingData(const int multiDS_index, } } -bits_stack_pushdialog::bits_stack_pushdialog(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QDialog(parent, name, false, wFlags) +bits_stack_pushdialog::bits_stack_pushdialog(QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QDialog(parent, name, false, wFlags) { vboxoverall = new Q3VBox(this); hboxparams = new Q3HBox(vboxoverall); @@ -4006,9 +4006,9 @@ bits_stack_pushdialog::bits_stack_pushdialog(QWidget* parent, const char* name, hboxpushbuttons = new Q3HBox(vboxoverall); rb_currentslice = - new QRadioButton(QString("Current slice"), vboxsliceselection); + new QRadioButton(QString("Current slice"), vboxsliceselection); rb_multislices = - new QRadioButton(QString("Slice range"), vboxsliceselection); + new QRadioButton(QString("Slice range"), vboxsliceselection); slicegroup = new QButtonGroup(this); slicegroup->insert(rb_currentslice); slicegroup->insert(rb_multislices); @@ -4036,7 +4036,7 @@ bits_stack_pushdialog::bits_stack_pushdialog(QWidget* parent, const char* name, QObject::connect(pushexec, SIGNAL(clicked()), this, SLOT(accept())); QObject::connect(pushcancel, SIGNAL(clicked()), this, SLOT(reject())); QObject::connect(slicegroup, SIGNAL(buttonClicked(int)), this, - SLOT(sliceselection_changed())); + SLOT(sliceselection_changed())); } bits_stack_pushdialog::~bits_stack_pushdialog() @@ -4050,12 +4050,12 @@ bool bits_stack_pushdialog::get_pushcurrentslice() return rb_currentslice->isChecked(); } -unsigned int bits_stack_pushdialog::get_startslice(bool* ok) +unsigned int bits_stack_pushdialog::get_startslice(bool *ok) { return le_startslice->text().toUInt(ok); } -unsigned int bits_stack_pushdialog::get_endslice(bool* ok) +unsigned int bits_stack_pushdialog::get_endslice(bool *ok) { return le_endslice->text().toUInt(ok); } @@ -4074,23 +4074,23 @@ void bits_stack_pushdialog::sliceselection_changed() //xxxxxxxxxxxxxxxxxxxxxx histo xxxxxxxxxxxxxxxxxxxxxxxxxxxx -zoomer_widget::zoomer_widget(double zoom1, QDir picpath, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : QWidget(parent, name, wFlags) +ZoomWidget::ZoomWidget(double zoom1, QDir picpath, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + : QWidget(parent, name, wFlags) { zoom = zoom1; vbox1 = new Q3VBoxLayout(this); pushzoomin = new QPushButton( - QIcon(picpath.absFilePath(QString("zoomin.png")).ascii()), "Zoom in", - this); + QIcon(picpath.absFilePath(QString("zoomin.png")).ascii()), "Zoom in", + this); pushzoomout = new QPushButton( - QIcon(picpath.absFilePath(QString("zoomout.png")).ascii()), "Zoom out", - this); + QIcon(picpath.absFilePath(QString("zoomout.png")).ascii()), "Zoom out", + this); pushunzoom = new QPushButton( - QIcon(picpath.absFilePath(QString("unzoom.png")).ascii()), "Unzoom", - this); + QIcon(picpath.absFilePath(QString("unzoom.png")).ascii()), "Unzoom", + this); zoom_f = - new QLabel(QString("x"), this); //+QString::number(zoom,'g',4),this); + new QLabel(QString("x"), this); //+QString::number(zoom,'g',4),this); le_zoom_f = new QLineEdit(QString::number(zoom, 'g', 4), this); le_zoom_f->setFixedWidth(80); vbox1->addWidget(pushzoomin); @@ -4105,16 +4105,16 @@ zoomer_widget::zoomer_widget(double zoom1, QDir picpath, QWidget* parent, setFixedHeight(vbox1->sizeHint().height()); QObject::connect(pushzoomin, SIGNAL(clicked()), this, - SLOT(zoomin_pushed())); + SLOT(zoomin_pushed())); QObject::connect(pushzoomout, SIGNAL(clicked()), this, - SLOT(zoomout_pushed())); + SLOT(zoomout_pushed())); QObject::connect(pushunzoom, SIGNAL(clicked()), this, - SLOT(unzoom_pushed())); + SLOT(unzoom_pushed())); QObject::connect(le_zoom_f, SIGNAL(editingFinished()), this, - SLOT(le_zoom_changed())); + SLOT(le_zoom_changed())); } -zoomer_widget::~zoomer_widget() +ZoomWidget::~ZoomWidget() { delete vbox1; delete pushzoomin; @@ -4124,9 +4124,9 @@ zoomer_widget::~zoomer_widget() delete zoom_f; } -double zoomer_widget::get_zoom() { return zoom; } +double ZoomWidget::get_zoom() { return zoom; } -void zoomer_widget::zoom_changed(double z) +void ZoomWidget::zoom_changed(double z) { zoom = z; zoom_f->setText(QString("x")); //+QString::number(zoom,'g',4)); @@ -4134,7 +4134,7 @@ void zoomer_widget::zoom_changed(double z) emit set_zoom(zoom); } -void zoomer_widget::zoomin_pushed() +void ZoomWidget::zoomin_pushed() { zoom = 2 * zoom; zoom_f->setText(QString("x")); //+QString::number(zoom,'g',4)); @@ -4142,7 +4142,7 @@ void zoomer_widget::zoomin_pushed() emit set_zoom(zoom); } -void zoomer_widget::zoomout_pushed() +void ZoomWidget::zoomout_pushed() { zoom = 0.5 * zoom; zoom_f->setText(QString("x")); //+QString::number(zoom,'g',4)); @@ -4150,7 +4150,7 @@ void zoomer_widget::zoomout_pushed() emit set_zoom(zoom); } -void zoomer_widget::unzoom_pushed() +void ZoomWidget::unzoom_pushed() { zoom = 1.0; zoom_f->setText(QString("x")); //+QString::number(zoom,'g',4)); @@ -4158,7 +4158,7 @@ void zoomer_widget::unzoom_pushed() emit set_zoom(zoom); } -void zoomer_widget::le_zoom_changed() +void ZoomWidget::le_zoom_changed() { bool b1; float zoom1 = le_zoom_f->text().toFloat(&b1); @@ -4198,10 +4198,10 @@ QSize QHBoxLayout_fixedheight::maximumSize() const //-------------------------------------------------- -ImageMath::ImageMath(SlicesHandler* hand3D, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - // : QWidget( parent, name, wFlags ),handler3D(hand3D) - : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) +ImageMath::ImageMath(SlicesHandler *hand3D, QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + // : QWidget( parent, name, wFlags ),handler3D(hand3D) + : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -4254,9 +4254,9 @@ ImageMath::ImageMath(SlicesHandler* hand3D, QWidget* parent, const char* name, QObject::connect(doMult, SIGNAL(clicked()), this, SLOT(mult_pushed())); QObject::connect(doNeg, SIGNAL(clicked()), this, SLOT(neg_pushed())); QObject::connect(imgorval, SIGNAL(buttonClicked(int)), this, - SLOT(imgorval_changed(int))); + SLOT(imgorval_changed(int))); QObject::connect(le_val, SIGNAL(editingFinished()), this, - SLOT(value_changed())); + SLOT(value_changed())); return; } @@ -4415,7 +4415,7 @@ void ImageMath::slicenr_changed() bmphand_changed(handler3D->get_activebmphandler()); } -void ImageMath::bmphand_changed(bmphandler* bmph) +void ImageMath::bmphand_changed(bmphandler *bmph) { bmphand = bmph; return; @@ -4440,14 +4440,14 @@ void ImageMath::value_changed() //-------------------------------------------------- -ImageOverlay::ImageOverlay(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - // : QWidget( parent, name, wFlags ),handler3D(hand3D) - : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) +ImageOverlay::ImageOverlay(SlicesHandler *hand3D, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) + // : QWidget( parent, name, wFlags ),handler3D(hand3D) + : QDialog(parent, name, TRUE, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); - bkpWork = (float*)malloc(sizeof(float) * bmphand->return_area()); + bkpWork = (float *)malloc(sizeof(float) * bmphand->return_area()); bmphand->copyfromwork(bkpWork); alpha = 0.0f; @@ -4496,11 +4496,11 @@ ImageOverlay::ImageOverlay(SlicesHandler* hand3D, QWidget* parent, QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close())); QObject::connect(applyButton, SIGNAL(clicked()), this, - SLOT(apply_pushed())); + SLOT(apply_pushed())); QObject::connect(leAlpha, SIGNAL(editingFinished()), this, - SLOT(alpha_changed())); + SLOT(alpha_changed())); QObject::connect(slAlpha, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); return; } @@ -4511,7 +4511,7 @@ ImageOverlay::~ImageOverlay() free(bkpWork); } -void ImageOverlay::closeEvent(QCloseEvent* e) +void ImageOverlay::closeEvent(QCloseEvent *e) { QDialog::closeEvent(e); @@ -4565,7 +4565,7 @@ void ImageOverlay::slicenr_changed() bmphand_changed(handler3D->get_activebmphandler()); } -void ImageOverlay::bmphand_changed(bmphandler* bmph) +void ImageOverlay::bmphand_changed(bmphandler *bmph) { bmphand = bmph; bmphand->copyfromwork(bkpWork); @@ -4575,8 +4575,8 @@ void ImageOverlay::bmphand_changed(bmphandler* bmph) void ImageOverlay::newloaded() { free(bkpWork); - bkpWork = (float*)malloc(sizeof(float) * - handler3D->get_activebmphandler()->return_area()); + bkpWork = (float *)malloc(sizeof(float) * + handler3D->get_activebmphandler()->return_area()); } void ImageOverlay::alpha_changed() @@ -4632,8 +4632,8 @@ void ImageOverlay::slider_changed(int newval) emit end_datachange(this, iseg::NoUndo); } -CleanerParams::CleanerParams(int* rate1, int* minsize1, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) +CleanerParams::CleanerParams(int *rate1, int *minsize1, QWidget *parent, + const char *name, Qt::WindowFlags wFlags) { rate = rate1; minsize = minsize1; @@ -4650,7 +4650,7 @@ CleanerParams::CleanerParams(int* rate1, int* minsize1, QWidget* parent, pb_dontdoit = new QPushButton("Cancel", vbox2); QObject::connect(pb_doit, SIGNAL(clicked()), this, SLOT(doit_pressed())); QObject::connect(pb_dontdoit, SIGNAL(clicked()), this, - SLOT(dontdoit_pressed())); + SLOT(dontdoit_pressed())); hbox1->setFixedSize(hbox1->sizeHint()); setFixedSize(hbox1->size()); @@ -4672,9 +4672,9 @@ void CleanerParams::dontdoit_pressed() close(); } -MergeProjectsDialog::MergeProjectsDialog(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : QDialog(parent, name, TRUE, wFlags) +MergeProjectsDialog::MergeProjectsDialog(QWidget *parent, const char *name, + Qt::WindowFlags wFlags) + : QDialog(parent, name, TRUE, wFlags) { hboxOverall = new Q3HBoxLayout(this); vboxFileList = new Q3VBoxLayout(this); @@ -4715,11 +4715,11 @@ MergeProjectsDialog::MergeProjectsDialog(QWidget* parent, const char* name, QObject::connect(addButton, SIGNAL(clicked()), this, SLOT(add_pressed())); QObject::connect(removeButton, SIGNAL(clicked()), this, - SLOT(remove_pressed())); + SLOT(remove_pressed())); QObject::connect(moveUpButton, SIGNAL(clicked()), this, - SLOT(move_up_pressed())); + SLOT(move_up_pressed())); QObject::connect(moveDownButton, SIGNAL(clicked()), this, - SLOT(move_down_pressed())); + SLOT(move_down_pressed())); QObject::connect(executeButton, SIGNAL(clicked()), this, SLOT(accept())); QObject::connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); } @@ -4729,16 +4729,16 @@ MergeProjectsDialog::~MergeProjectsDialog() { delete hboxOverall; } void MergeProjectsDialog::add_pressed() { QStringList openfilenames = Q3FileDialog::getOpenFileNames( - "Projects (*.prj)", QString::null, this, "iSeg", - "Select one or more files to add"); + "Projects (*.prj)", QString::null, this, "iSeg", + "Select one or more files to add"); fileListWidget->addItems(openfilenames); } void MergeProjectsDialog::remove_pressed() { - QList removeItems = fileListWidget->selectedItems(); - for (QList::const_iterator iter = removeItems.begin(); - iter != removeItems.end(); ++iter) + QList removeItems = fileListWidget->selectedItems(); + for (QList::const_iterator iter = removeItems.begin(); + iter != removeItems.end(); ++iter) { delete fileListWidget->takeItem(fileListWidget->row(*iter)); } @@ -4746,7 +4746,7 @@ void MergeProjectsDialog::remove_pressed() void MergeProjectsDialog::move_up_pressed() { - QList moveItems = fileListWidget->selectedItems(); + QList moveItems = fileListWidget->selectedItems(); if (moveItems.size() <= 0) { return; @@ -4764,7 +4764,7 @@ void MergeProjectsDialog::move_up_pressed() void MergeProjectsDialog::move_down_pressed() { - QList moveItems = fileListWidget->selectedItems(); + QList moveItems = fileListWidget->selectedItems(); if (moveItems.size() <= 0) { return; @@ -4780,7 +4780,7 @@ void MergeProjectsDialog::move_down_pressed() fileListWidget->insertItem(rowFirst, fileListWidget->takeItem(rowLast + 1)); } -void MergeProjectsDialog::get_filenames(std::vector& filenames) +void MergeProjectsDialog::get_filenames(std::vector &filenames) { filenames.clear(); for (int row = 0; row < fileListWidget->count(); ++row) @@ -4790,9 +4790,9 @@ void MergeProjectsDialog::get_filenames(std::vector& filenames) } CheckBoneConnectivityDialog::CheckBoneConnectivityDialog( - SlicesHandler* hand3D, const char* name, QWidget* parent /*=0*/, - Qt::WindowFlags wFlags /*=0*/) - : QWidget(parent, name, wFlags), handler3D(hand3D) + SlicesHandler *hand3D, const char *name, QWidget *parent /*=0*/, + Qt::WindowFlags wFlags /*=0*/) + : QWidget(parent, name, wFlags), handler3D(hand3D) { mainBox = new Q3HBox(this); vbox1 = new Q3VBox(mainBox); @@ -4829,14 +4829,14 @@ CheckBoneConnectivityDialog::CheckBoneConnectivityDialog( QStringList tableHeader; tableHeader << "Bone 1" - << "Bone 2" - << "Slice #"; + << "Bone 2" + << "Slice #"; foundConnectionsTable->setHorizontalHeaderLabels(tableHeader); foundConnectionsTable->verticalHeader()->setVisible(false); foundConnectionsTable->setColumnWidth(BoneConnectionColumn::kTissue1, 160); foundConnectionsTable->setColumnWidth(BoneConnectionColumn::kTissue2, 160); foundConnectionsTable->setColumnWidth(BoneConnectionColumn::kSliceNumber, - 60); + 60); hbox1->show(); hbox2->show(); @@ -4847,13 +4847,13 @@ CheckBoneConnectivityDialog::CheckBoneConnectivityDialog( mainBox->show(); QObject::connect(executeButton, SIGNAL(clicked()), this, - SLOT(execute_pressed())); + SLOT(execute_pressed())); QObject::connect(cancelButton, SIGNAL(clicked()), this, - SLOT(cancel_pressed())); + SLOT(cancel_pressed())); QObject::connect(exportButton, SIGNAL(clicked()), this, - SLOT(export_pressed())); + SLOT(export_pressed())); QObject::connect(foundConnectionsTable, SIGNAL(cellClicked(int, int)), this, - SLOT(cellClicked(int, int))); + SLOT(cellClicked(int, int))); CheckBoneExist(); @@ -4862,12 +4862,12 @@ CheckBoneConnectivityDialog::CheckBoneConnectivityDialog( CheckBoneConnectivityDialog::~CheckBoneConnectivityDialog() {} -void CheckBoneConnectivityDialog::ShowText(const std::string& text) +void CheckBoneConnectivityDialog::ShowText(const std::string &text) { progressText->setText(QString::fromStdString(text)); } -bool CheckBoneConnectivityDialog::IsBone(const std::string& label_name) const +bool CheckBoneConnectivityDialog::IsBone(const std::string &label_name) const { std::string name = label_name; std::transform(name.begin(), name.end(), name.begin(), ::tolower); @@ -4902,7 +4902,7 @@ void CheckBoneConnectivityDialog::CheckBoneExist() tissues_size_t tissuecount = TissueInfos::GetTissueCount(); for (tissues_size_t i = 0; i <= tissuecount; i++) { - TissueInfoStruct* tissueInfo = TissueInfos::GetTissueInfo(i); + TissueInfoStruct *tissueInfo = TissueInfos::GetTissueInfo(i); if (IsBone(tissueInfo->name.toUtf8().constData())) { bonesFound++; @@ -4941,7 +4941,7 @@ void CheckBoneConnectivityDialog::LookForConnections() int numTasks = endSl - startSl; QProgressDialog progress("Looking for connected bones...", "Cancel", 0, - numTasks, mainBox); + numTasks, mainBox); progress.show(); progress.setWindowModality(Qt::WindowModal); progress.setModal(true); @@ -4951,13 +4951,13 @@ void CheckBoneConnectivityDialog::LookForConnections() tissues_size_t tissuecount = TissueInfos::GetTissueCount(); for (tissues_size_t i = 0; i <= tissuecount; i++) { - TissueInfoStruct* tissueInfo = TissueInfos::GetTissueInfo(i); + TissueInfoStruct *tissueInfo = TissueInfos::GetTissueInfo(i); label_names.push_back(tissueInfo->name.toUtf8().constData()); } std::vector same_bone_map(label_names.size(), -1); - auto replace = [](std::string& str, const std::string& from, - const std::string& to) { + auto replace = [](std::string &str, const std::string &from, + const std::string &to) { size_t start_pos = str.find(from); if (start_pos == std::string::npos) { @@ -4981,7 +4981,7 @@ void CheckBoneConnectivityDialog::LookForConnections() { std::string namei = label_names[idx]; std::transform(namei.begin(), namei.end(), namei.begin(), - ::tolower); + ::tolower); if (namei == name) { break; @@ -5000,7 +5000,7 @@ void CheckBoneConnectivityDialog::LookForConnections() for (int sliceN = startSl; sliceN < endSl - 1; sliceN++) { - tissues_size_t* tissuesMain = handler3D->return_tissues(0, sliceN); + tissues_size_t *tissuesMain = handler3D->return_tissues(0, sliceN); unsigned pos = 0; //for( int y=height-1; y>=0; y-- ) for (int y = height - 2; y >= 1; y--) @@ -5011,7 +5011,7 @@ void CheckBoneConnectivityDialog::LookForConnections() tissues_size_t tissue_value = tissuesMain[pos]; if (std::find(same_bone_map.begin(), same_bone_map.end(), - tissue_value) != same_bone_map.end()) + tissue_value) != same_bone_map.end()) { // check neighbour connection std::vector neighbour_tissues; @@ -5050,43 +5050,43 @@ void CheckBoneConnectivityDialog::LookForConnections() //+1 slice: if (sliceN + 1 < endSl) { - tissues_size_t* tissues_plus1 = - handler3D->return_tissues(0, sliceN + 1); + tissues_size_t *tissues_plus1 = + handler3D->return_tissues(0, sliceN + 1); neighbour_tissues.push_back( - tissues_plus1[pos - width - 1]); + tissues_plus1[pos - width - 1]); neighbour_tissues.push_back(tissues_plus1[pos - width]); neighbour_tissues.push_back( - tissues_plus1[pos - width + 1]); + tissues_plus1[pos - width + 1]); neighbour_tissues.push_back(tissues_plus1[pos - 1]); neighbour_tissues.push_back(tissues_plus1[pos]); neighbour_tissues.push_back(tissues_plus1[pos + 1]); neighbour_tissues.push_back( - tissues_plus1[pos + width - 1]); + tissues_plus1[pos + width - 1]); neighbour_tissues.push_back(tissues_plus1[pos + width]); neighbour_tissues.push_back( - tissues_plus1[pos + width + 1]); + tissues_plus1[pos + width + 1]); } //remove the same bone values std::sort(neighbour_tissues.begin(), - neighbour_tissues.end()); + neighbour_tissues.end()); neighbour_tissues.erase( - std::unique(neighbour_tissues.begin(), + std::unique(neighbour_tissues.begin(), neighbour_tissues.end()), - neighbour_tissues.end()); + neighbour_tissues.end()); neighbour_tissues.erase( - std::remove(neighbour_tissues.begin(), + std::remove(neighbour_tissues.begin(), neighbour_tissues.end(), tissue_value), - neighbour_tissues.end()); + neighbour_tissues.end()); for (size_t k = 0; k < neighbour_tissues.size(); k++) { if (std::find( - same_bone_map.begin(), same_bone_map.end(), - neighbour_tissues[k]) != same_bone_map.end()) + same_bone_map.begin(), same_bone_map.end(), + neighbour_tissues[k]) != same_bone_map.end()) { tissues_size_t tis1, tis2; if (tissue_value < neighbour_tissues[k]) @@ -5119,8 +5119,8 @@ void CheckBoneConnectivityDialog::LookForConnections() std::sort(foundConnections.begin(), foundConnections.end()); foundConnections.erase( - std::unique(foundConnections.begin(), foundConnections.end()), - foundConnections.end()); + std::unique(foundConnections.begin(), foundConnections.end()), + foundConnections.end()); } void CheckBoneConnectivityDialog::FillConnectionsTable() @@ -5137,18 +5137,18 @@ void CheckBoneConnectivityDialog::FillConnectionsTable() BoneConnectionInfo newLineInfo = foundConnections.at(i); - TissueInfoStruct* tissueInfo1 = - TissueInfos::GetTissueInfo(newLineInfo.TissueID1); - TissueInfoStruct* tissueInfo2 = - TissueInfos::GetTissueInfo(newLineInfo.TissueID2); + TissueInfoStruct *tissueInfo1 = + TissueInfos::GetTissueInfo(newLineInfo.TissueID1); + TissueInfoStruct *tissueInfo2 = + TissueInfos::GetTissueInfo(newLineInfo.TissueID2); foundConnectionsTable->setItem(row, BoneConnectionColumn::kTissue1, - new QTableWidgetItem(tissueInfo1->name)); + new QTableWidgetItem(tissueInfo1->name)); foundConnectionsTable->setItem(row, BoneConnectionColumn::kTissue2, - new QTableWidgetItem(tissueInfo2->name)); + new QTableWidgetItem(tissueInfo2->name)); foundConnectionsTable->setItem( - row, BoneConnectionColumn::kSliceNumber, - new QTableWidgetItem(QString::number(newLineInfo.SliceNumber + 1))); + row, BoneConnectionColumn::kSliceNumber, + new QTableWidgetItem(QString::number(newLineInfo.SliceNumber + 1))); } exportButton->setEnabled(foundConnections.size() > 0); @@ -5159,7 +5159,7 @@ void CheckBoneConnectivityDialog::cellClicked(int row, int col) if (row < foundConnectionsTable->rowCount()) { int sliceNumber = - foundConnectionsTable->item(row, kSliceNumber)->text().toInt() - 1; + foundConnectionsTable->item(row, kSliceNumber)->text().toInt() - 1; handler3D->set_activeslice(sliceNumber); emit slice_changed(); } @@ -5185,13 +5185,13 @@ void CheckBoneConnectivityDialog::export_pressed() for (unsigned int i = 0; i < foundConnections.size(); i++) { - TissueInfoStruct* tissueInfo1 = - TissueInfos::GetTissueInfo(foundConnections[i].TissueID1); - TissueInfoStruct* tissueInfo2 = - TissueInfos::GetTissueInfo(foundConnections[i].TissueID2); + TissueInfoStruct *tissueInfo1 = + TissueInfos::GetTissueInfo(foundConnections[i].TissueID1); + TissueInfoStruct *tissueInfo2 = + TissueInfos::GetTissueInfo(foundConnections[i].TissueID2); output_file << tissueInfo1->name.toStdString() << " " - << tissueInfo2->name.toStdString() << " " - << foundConnections[i].SliceNumber + 1 << endl; + << tissueInfo2->name.toStdString() << " " + << foundConnections[i].SliceNumber + 1 << endl; } output_file.close(); diff --git a/iSeg/WidgetCollection.h b/iSeg/WidgetCollection.h index dac9c4a9..161a1aef 100755 --- a/iSeg/WidgetCollection.h +++ b/iSeg/WidgetCollection.h @@ -59,47 +59,47 @@ class ScaleWork : public QDialog { Q_OBJECT public: - ScaleWork(SlicesHandler* hand3D, QDir picpath, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + ScaleWork(SlicesHandler *hand3D, QDir picpath, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~ScaleWork(); private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - Q3VBox* vbox1; - QPushButton* getRange; - QPushButton* doScale; - QPushButton* doCrop; - QSlider* sl_brighness; - QSlider* sl_contrast; - QLineEdit* limitLow; - QLineEdit* limitHigh; - QLabel* lL; - QLabel* lH; - QLabel* lb_brightness; - QLabel* lb_contrast; - QCheckBox* allslices; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + Q3VBox *vbox1; + QPushButton *getRange; + QPushButton *doScale; + QPushButton *doCrop; + QSlider *sl_brighness; + QSlider *sl_contrast; + QLineEdit *limitLow; + QLineEdit *limitHigh; + QLabel *lL; + QLabel *lH; + QLabel *lb_brightness; + QLabel *lb_contrast; + QCheckBox *allslices; float minval, maxval; float minval1, maxval1; bool dontundo; - QPushButton* closeButton; + QPushButton *closeButton; signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void getrange_pushed(); void scale_pushed(); void crop_pushed(); @@ -112,42 +112,42 @@ class ImageMath : public QDialog { Q_OBJECT public: - ImageMath(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + ImageMath(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~ImageMath(); private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3VBox* vbox1; - QPushButton* doAdd; - QPushButton* doSub; - QPushButton* doMult; - QPushButton* doNeg; - QButtonGroup* imgorval; - QRadioButton* rb_img; - QRadioButton* rb_val; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3VBox *vbox1; + QPushButton *doAdd; + QPushButton *doSub; + QPushButton *doMult; + QPushButton *doNeg; + QButtonGroup *imgorval; + QRadioButton *rb_img; + QRadioButton *rb_val; float val; - QLineEdit* le_val; - QLabel* lb_val; - QCheckBox* allslices; - QPushButton* closeButton; + QLineEdit *le_val; + QLabel *lb_val; + QCheckBox *allslices; + QPushButton *closeButton; signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void add_pushed(); void sub_pushed(); void mult_pushed(); @@ -160,44 +160,44 @@ class ImageOverlay : public QDialog { Q_OBJECT public: - ImageOverlay(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + ImageOverlay(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~ImageOverlay(); protected: - virtual void closeEvent(QCloseEvent* e); + virtual void closeEvent(QCloseEvent *e); private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3VBox* vbox1; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - QLabel* lbAlpha; - QSlider* slAlpha; - QLineEdit* leAlpha; - QCheckBox* allslices; - QPushButton* closeButton; - QPushButton* applyButton; + Q3VBox *vbox1; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + QLabel *lbAlpha; + QSlider *slAlpha; + QLineEdit *leAlpha; + QCheckBox *allslices; + QPushButton *closeButton; + QPushButton *applyButton; float alpha; int sliderMax; unsigned short sliderPrecision; - float* bkpWork; + float *bkpWork; signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); public slots: void newloaded(); void slicenr_changed(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void apply_pushed(); void alpha_changed(); void slider_changed(int newval); @@ -207,59 +207,59 @@ class HistoWin : public QWidget { Q_OBJECT public: - HistoWin(unsigned int* histo1, QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + HistoWin(unsigned int *histo1, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); void update(); - void histo_changed(unsigned int* histo1); + void histo_changed(unsigned int *histo1); protected: - void paintEvent(QPaintEvent* e); + void paintEvent(QPaintEvent *e); private: QImage image; - unsigned int* histo; + unsigned int *histo; }; class ShowHisto : public QDialog { Q_OBJECT public: - ShowHisto(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + ShowHisto(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~ShowHisto(); private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; - HistoWin* histwindow; - Q3VBox* vbox1; - Q3VBox* vbox2; - QPushButton* closeButton; - QPushButton* updateSubsect; - QSpinBox* xoffset; - QSpinBox* yoffset; - QSpinBox* xlength; - QSpinBox* ylength; - QCheckBox* subsect; - QLabel* xoffs; - QLabel* yoffs; - QLabel* xl; - QLabel* yl; - QButtonGroup* pictselect; - QRadioButton* workpict; - QRadioButton* bmppict; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; + HistoWin *histwindow; + Q3VBox *vbox1; + Q3VBox *vbox2; + QPushButton *closeButton; + QPushButton *updateSubsect; + QSpinBox *xoffset; + QSpinBox *yoffset; + QSpinBox *xlength; + QSpinBox *ylength; + QCheckBox *subsect; + QLabel *xoffs; + QLabel *yoffs; + QLabel *xl; + QLabel *yl; + QButtonGroup *pictselect; + QRadioButton *workpict; + QRadioButton *bmppict; public slots: void slicenr_changed(); void newloaded(); private slots: - void bmphand_changed(bmphandler* bmph); + void bmphand_changed(bmphandler *bmph); void draw_histo(); void subsect_toggled(); void pict_toggled(bool on); @@ -270,11 +270,11 @@ class colorshower : public QWidget { Q_OBJECT public: - colorshower(int lx1, int ly1, QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + colorshower(int lx1, int ly1, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); protected: - void paintEvent(QPaintEvent* e); + void paintEvent(QPaintEvent *e); private: int lx; @@ -292,130 +292,130 @@ class TissueTreeWidget : public QTreeWidget { Q_OBJECT public: - TissueTreeWidget(TissueHiearchy* hierarchy, QDir picpath, - QWidget* parent = 0); + TissueTreeWidget(TissueHiearchy *hierarchy, QDir picpath, + QWidget *parent = 0); ~TissueTreeWidget(); public: void initialize(); - void set_tissue_filter(const QString& filter); + void set_tissue_filter(const QString &filter); void update_visibility(); - void update_visibility_recursive(QTreeWidgetItem* item); + void update_visibility_recursive(QTreeWidgetItem *item); // Add tree items - void insert_item(bool isFolder, const QString& name); + void insert_item(bool isFolder, const QString &name); // Delete tree items - void remove_tissue(const QString& name); + void remove_tissue(const QString &name); void remove_current_item(bool removeChildren = false); void remove_all_folders(bool removeChildren = false); // Update items - void update_tissue_name(const QString& oldName, const QString& newName); - void update_tissue_icons(QTreeWidgetItem* parent = 0); - void update_folder_icons(QTreeWidgetItem* parent = 0); - void set_current_folder_name(const QString& name); + void update_tissue_name(const QString &oldName, const QString &newName); + void update_tissue_icons(QTreeWidgetItem *parent = 0); + void update_folder_icons(QTreeWidgetItem *parent = 0); + void set_current_folder_name(const QString &name); // Current item - void set_current_item(QTreeWidgetItem* item); + void set_current_item(QTreeWidgetItem *item); void set_current_tissue(tissues_size_t type); bool get_current_is_folder(); tissues_size_t get_current_type(); QString get_current_name(); bool get_current_has_children(); void get_current_child_tissues( - std::map& types); + std::map &types); // Hierarchy void - update_tree_widget(); // Updates QTreeWidget from internal representation - void update_hierarchy(); // Updates internal representation from QTreeWidget + update_tree_widget(); // Updates QTreeWidget from internal representation + void update_hierarchy(); // Updates internal representation from QTreeWidget unsigned short get_selected_hierarchy(); unsigned short get_hierarchy_count(); - std::vector* get_hierarchy_names_ptr(); + std::vector *get_hierarchy_names_ptr(); QString get_current_hierarchy_name(); void reset_default_hierarchy(); void set_hierarchy(unsigned short index); - void add_new_hierarchy(const QString& name); + void add_new_hierarchy(const QString &name); void remove_current_hierarchy(); bool get_hierarchy_modified(); void set_hierarchy_modified(bool val); unsigned short get_tissue_instance_count(tissues_size_t type); void get_sublevel_child_tissues( - std::map& types); + std::map &types); // File IO - FILE* SaveParams(FILE* fp, int version); - FILE* LoadParams(FILE* fp, int version); - bool load_hierarchy(const QString& path); - bool save_hierarchy_as(const QString& name, const QString& path); + FILE *SaveParams(FILE *fp, int version); + FILE *LoadParams(FILE *fp, int version); + bool load_hierarchy(const QString &path); + bool save_hierarchy_as(const QString &name, const QString &path); // Display bool get_tissue_indices_hidden(); - QList get_all_items(); + QList get_all_items(); public slots: void toggle_show_tissue_indices(); void sort_by_tissue_name(); void sort_by_tissue_index(); - tissues_size_t get_type(QTreeWidgetItem* item); - QString get_name(QTreeWidgetItem* item); + tissues_size_t get_type(QTreeWidgetItem *item); + QString get_name(QTreeWidgetItem *item); protected: // Drag & drop - void dropEvent(QDropEvent* de); + void dropEvent(QDropEvent *de); private: void resize_columns_to_contents(); - bool get_is_folder(QTreeWidgetItem* item); + bool get_is_folder(QTreeWidgetItem *item); - QTreeWidgetItem* find_tissue_item(tissues_size_t type, - QTreeWidgetItem* parent = 0); - void take_children_recursively(QTreeWidgetItem* parent, - QList& appendTo); + QTreeWidgetItem *find_tissue_item(tissues_size_t type, + QTreeWidgetItem *parent = 0); + void take_children_recursively(QTreeWidgetItem *parent, + QList &appendTo); void get_child_tissues_recursively( - QTreeWidgetItem* parent, - std::map& types); + QTreeWidgetItem *parent, + std::map &types); unsigned short - get_tissue_instance_count_recursively(QTreeWidgetItem* parent, - tissues_size_t type); - void insert_item(bool isFolder, const QString& name, - QTreeWidgetItem* insertAbove); - void insert_item(bool isFolder, const QString& name, - QTreeWidgetItem* parent, unsigned int index); - void remove_tissue_recursively(QTreeWidgetItem* parent, - const QString& name); - void update_tissue_name_widget(const QString& oldName, - const QString& newName, - QTreeWidgetItem* parent = 0); - short get_child_lockstates(QTreeWidgetItem* folder); + get_tissue_instance_count_recursively(QTreeWidgetItem *parent, + tissues_size_t type); + void insert_item(bool isFolder, const QString &name, + QTreeWidgetItem *insertAbove); + void insert_item(bool isFolder, const QString &name, + QTreeWidgetItem *parent, unsigned int index); + void remove_tissue_recursively(QTreeWidgetItem *parent, + const QString &name); + void update_tissue_name_widget(const QString &oldName, + const QString &newName, + QTreeWidgetItem *parent = 0); + short get_child_lockstates(QTreeWidgetItem *folder); void pad_tissue_indices(); - void pad_tissue_indices_recursively(QTreeWidgetItem* parent, - unsigned short digits); + void pad_tissue_indices_recursively(QTreeWidgetItem *parent, + unsigned short digits); void update_tissue_indices(); - void update_tissue_indices_recursively(QTreeWidgetItem* parent); + void update_tissue_indices_recursively(QTreeWidgetItem *parent); // Convert QTreeWidget to internal representation - TissueHierarchyItem* create_current_hierarchy(); - void create_hierarchy_recursively(QTreeWidgetItem* parentIn, - TissueHierarchyItem* parentOut); - TissueHierarchyItem* create_hierarchy_item(QTreeWidgetItem* item); + TissueHierarchyItem *create_current_hierarchy(); + void create_hierarchy_recursively(QTreeWidgetItem *parentIn, + TissueHierarchyItem *parentOut); + TissueHierarchyItem *create_hierarchy_item(QTreeWidgetItem *item); // Convert internal representation to QTreeWidget - void build_tree_widget(TissueHierarchyItem* root); - void build_tree_widget_recursively(TissueHierarchyItem* parentIn, - QTreeWidgetItem* parentOut, - std::set* tissueTypes); - QTreeWidgetItem* create_hierarchy_item(bool isFolder, const QString& name); + void build_tree_widget(TissueHierarchyItem *root); + void build_tree_widget_recursively(TissueHierarchyItem *parentIn, + QTreeWidgetItem *parentOut, + std::set *tissueTypes); + QTreeWidgetItem *create_hierarchy_item(bool isFolder, const QString &name); // SaveParams - FILE* save_hierarchy(FILE* fp, unsigned short idx); - FILE* load_hierarchy(FILE* fp); + FILE *save_hierarchy(FILE *fp, unsigned short idx); + FILE *load_hierarchy(FILE *fp); private: - TissueHiearchy* hierarchies; + TissueHiearchy *hierarchies; std::string tissue_filter; QDir picturePath; bool modified; @@ -426,55 +426,55 @@ public slots: void hierarchy_list_changed(void); private slots: - void resize_columns_to_contents(QTreeWidgetItem* item); + void resize_columns_to_contents(QTreeWidgetItem *item); }; class TissueAdder : public QDialog { Q_OBJECT public: - TissueAdder(bool modifyTissue, TissueTreeWidget* tissueTree, - QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + TissueAdder(bool modifyTissue, TissueTreeWidget *tissueTree, + QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~TissueAdder(); // FILE *save_proj(FILE *fp); private: bool modify; - Q3HBoxLayout* hbox1; - Q3HBoxLayout* hbox2; - Q3HBoxLayout* hbox3; + Q3HBoxLayout *hbox1; + Q3HBoxLayout *hbox2; + Q3HBoxLayout *hbox3; /* QHBoxLayout *hboxr; QHBoxLayout *hboxg; QHBoxLayout *hboxb;*/ - colorshower* cs; - Q3VBoxLayout* vbox1; - Q3VBoxLayout* vbox2; - Q3VBoxLayout* vbox3; - Q3VBoxLayout* vbox4; - QPushButton* closeButton; + colorshower *cs; + Q3VBoxLayout *vbox1; + Q3VBoxLayout *vbox2; + Q3VBoxLayout *vbox3; + Q3VBoxLayout *vbox4; + QPushButton *closeButton; // QPushButton *colorButton; - QPushButton* addTissue; - QLabel* red; - QLabel* green; - QLabel* blue; - QLabel* opac; - QLabel* tissuename; - QLineEdit* nameField; - QSlider* r; - QSlider* g; - QSlider* b; - QSlider* sl_transp; - QSpinBox* sb_r; - QSpinBox* sb_g; - QSpinBox* sb_b; - QSpinBox* sb_transp; + QPushButton *addTissue; + QLabel *red; + QLabel *green; + QLabel *blue; + QLabel *opac; + QLabel *tissuename; + QLineEdit *nameField; + QSlider *r; + QSlider *g; + QSlider *b; + QSlider *sl_transp; + QSpinBox *sb_r; + QSpinBox *sb_g; + QSpinBox *sb_b; + QSpinBox *sb_transp; float fr1; float fg1; float fb1; float transp1; - TissueTreeWidget* tissueTreeWidget; + TissueTreeWidget *tissueTreeWidget; // float **tc; signals: @@ -496,20 +496,20 @@ class TissueFolderAdder : public QDialog { Q_OBJECT public: - TissueFolderAdder(TissueTreeWidget* tissueTree, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + TissueFolderAdder(TissueTreeWidget *tissueTree, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~TissueFolderAdder(); private: - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxOverall; - Q3HBoxLayout* hboxFolderName; - Q3HBoxLayout* hboxPushButtons; - QLabel* nameLabel; - QLineEdit* nameLineEdit; - QPushButton* addButton; - QPushButton* closeButton; - TissueTreeWidget* tissueTreeWidget; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxOverall; + Q3HBoxLayout *hboxFolderName; + Q3HBoxLayout *hboxPushButtons; + QLabel *nameLabel; + QLineEdit *nameLineEdit; + QPushButton *addButton; + QPushButton *closeButton; + TissueTreeWidget *tissueTreeWidget; private slots: void add_pressed(); @@ -519,23 +519,23 @@ class TissueHierarchyWidget : public QWidget { Q_OBJECT public: - TissueHierarchyWidget(TissueTreeWidget* tissueTree, QWidget* parent = 0, - Qt::WindowFlags wFlags = 0); + TissueHierarchyWidget(TissueTreeWidget *tissueTree, QWidget *parent = 0, + Qt::WindowFlags wFlags = 0); ~TissueHierarchyWidget(); bool handle_changed_hierarchy(); private: QDir picturePath; - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxOverall; - Q3VBoxLayout* vboxHierarchyButtons; - QComboBox* hierarchyComboBox; - QPushButton* newHierarchyButton; - QPushButton* loadHierarchyButton; - QPushButton* saveHierarchyAsButton; - QPushButton* removeHierarchyButton; - TissueTreeWidget* tissueTreeWidget; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxOverall; + Q3VBoxLayout *vboxHierarchyButtons; + QComboBox *hierarchyComboBox; + QPushButton *newHierarchyButton; + QPushButton *loadHierarchyButton; + QPushButton *saveHierarchyAsButton; + QPushButton *removeHierarchyButton; + TissueTreeWidget *tissueTreeWidget; public slots: void update_hierarchy_combo_box(); @@ -552,13 +552,13 @@ class bits_stack : public QWidget { Q_OBJECT public: - bits_stack(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + bits_stack(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~bits_stack(); - QMap* return_bitsnr(); + QMap *return_bitsnr(); void newloaded(); - FILE* save_proj(FILE* fp); - FILE* load_proj(FILE* fp); + FILE *save_proj(FILE *fp); + FILE *load_proj(FILE *fp); void clear_stack(); protected: @@ -567,31 +567,31 @@ class bits_stack : public QWidget private: unsigned short oldw, oldh; - SlicesHandler* handler3D; - QListWidget* bits_names; - Q3HBoxLayout* hbox1; - Q3VBoxLayout* vbox1; - QPushButton* pushwork; - QPushButton* pushbmp; - QPushButton* pushtissue; - QPushButton* popwork; - QPushButton* popbmp; - QPushButton* loaditem; - QPushButton* saveitem; - QPushButton* poptissue; - QPushButton* deletebtn; + SlicesHandler *handler3D; + QListWidget *bits_names; + Q3HBoxLayout *hbox1; + Q3VBoxLayout *vbox1; + QPushButton *pushwork; + QPushButton *pushbmp; + QPushButton *pushtissue; + QPushButton *popwork; + QPushButton *popbmp; + QPushButton *loaditem; + QPushButton *saveitem; + QPushButton *poptissue; + QPushButton *deletebtn; QMap bits_nr; tissues_size_t tissuenr; signals: void stack_changed(); - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); - void begin_dataexport(iseg::DataSelection& dataSelection, - QWidget* sender = NULL); - void end_dataexport(QWidget* sender = NULL); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_dataexport(iseg::DataSelection &dataSelection, + QWidget *sender = NULL); + void end_dataexport(QWidget *sender = NULL); public slots: void tissuenr_changed(unsigned short i); @@ -612,31 +612,31 @@ class bits_stack_pushdialog : public QDialog { Q_OBJECT public: - bits_stack_pushdialog(QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + bits_stack_pushdialog(QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~bits_stack_pushdialog(); bool get_pushcurrentslice(); - unsigned int get_startslice(bool* ok); - unsigned int get_endslice(bool* ok); + unsigned int get_startslice(bool *ok); + unsigned int get_endslice(bool *ok); private: - Q3VBox* vboxoverall; - Q3HBox* hboxparams; - Q3VBox* vboxsliceselection; - Q3VBox* vboxdelimiter; - Q3HBox* hboxslicerange; - Q3VBox* vboxslicerangelabels; - Q3VBox* vboxslicerangelineedits; - Q3HBox* hboxpushbuttons; - QRadioButton* rb_currentslice; - QRadioButton* rb_multislices; - QButtonGroup* slicegroup; - QLabel* lb_startslice; - QLabel* lb_endslice; - QLineEdit* le_startslice; - QLineEdit* le_endslice; - QPushButton* pushexec; - QPushButton* pushcancel; + Q3VBox *vboxoverall; + Q3HBox *hboxparams; + Q3VBox *vboxsliceselection; + Q3VBox *vboxdelimiter; + Q3HBox *hboxslicerange; + Q3VBox *vboxslicerangelabels; + Q3VBox *vboxslicerangelineedits; + Q3HBox *hboxpushbuttons; + QRadioButton *rb_currentslice; + QRadioButton *rb_multislices; + QButtonGroup *slicegroup; + QLabel *lb_startslice; + QLabel *lb_endslice; + QLineEdit *le_startslice; + QLineEdit *le_endslice; + QPushButton *pushexec; + QPushButton *pushcancel; private slots: void sliceselection_changed(); @@ -646,14 +646,14 @@ class extoverlay_widget : public QWidget { Q_OBJECT public: - extoverlay_widget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + extoverlay_widget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~extoverlay_widget(); void newloaded(); private: - bmphandler* bmphand; - SlicesHandler* handler3D; + bmphandler *bmphand; + SlicesHandler *handler3D; unsigned short activeslice; unsigned short selectedDataset; @@ -664,21 +664,21 @@ class extoverlay_widget : public QWidget int sliderMax; unsigned short sliderPrecision; - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxOverall; - Q3HBoxLayout* hboxAlpha; - Q3HBoxLayout* hboxDisplaySrcTgt; - QComboBox* datasetComboBox; - QPushButton* loadDatasetButton; - QLabel* lbAlpha; - QSlider* slAlpha; - QLineEdit* leAlpha; - QCheckBox* srcCheckBox; - QCheckBox* tgtCheckBox; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxOverall; + Q3HBoxLayout *hboxAlpha; + Q3HBoxLayout *hboxDisplaySrcTgt; + QComboBox *datasetComboBox; + QPushButton *loadDatasetButton; + QLabel *lbAlpha; + QSlider *slAlpha; + QLineEdit *leAlpha; + QCheckBox *srcCheckBox; + QCheckBox *tgtCheckBox; protected: void initialize(); - void add_dataset(const QString& path); + void add_dataset(const QString &path); void remove_dataset(unsigned short idx); void reload_overlay(); @@ -707,13 +707,13 @@ class MultiDataset_widget : public QWidget public: struct SDatasetInfo { - QRadioButton* m_RadioButton; + QRadioButton *m_RadioButton; QString m_RadioButtonText; QStringList m_DatasetFilepath; unsigned m_Width; unsigned m_Height; - std::vector m_BmpSlices; - std::vector m_WorkSlices; + std::vector m_BmpSlices; + std::vector m_WorkSlices; bool m_IsActive; }; @@ -730,20 +730,20 @@ class MultiDataset_widget : public QWidget RTDOSE }; - MultiDataset_widget(SlicesHandler* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + MultiDataset_widget(SlicesHandler *hand3D, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~MultiDataset_widget(); void NewLoaded(); int GetNumberOfDatasets(); bool IsActive(const int multiDS_index); bool IsChecked(const int multiDS_index); - std::vector GetBmpData(const int multiDS_index); - void SetBmpData(const int multiDS_index, std::vector bmp_bits_vc); + std::vector GetBmpData(const int multiDS_index); + void SetBmpData(const int multiDS_index, std::vector bmp_bits_vc); - std::vector GetWorkingData(const int multiDS_index); + std::vector GetWorkingData(const int multiDS_index); void SetWorkingData(const int multiDS_index, - std::vector work_bits_vc); + std::vector work_bits_vc); protected: void Initialize(); @@ -751,20 +751,20 @@ class MultiDataset_widget : public QWidget void ClearRadioButtons(); bool - CheckInfoAndAddToList(MultiDataset_widget::SDatasetInfo& newRadioButton, - QStringList loadfilenames, unsigned short width, - unsigned short height, unsigned short nrofslices); - bool AddDatasetToList(MultiDataset_widget::SDatasetInfo& newRadioButton, - QStringList loadfilenames); - void CopyImagesSlices(SlicesHandler* handler3D, - MultiDataset_widget::SDatasetInfo& newRadioButton, - const bool saveOnlyWorkingBits = false); + CheckInfoAndAddToList(MultiDataset_widget::SDatasetInfo &newRadioButton, + QStringList loadfilenames, unsigned short width, + unsigned short height, unsigned short nrofslices); + bool AddDatasetToList(MultiDataset_widget::SDatasetInfo &newRadioButton, + QStringList loadfilenames); + void CopyImagesSlices(SlicesHandler *handler3D, + MultiDataset_widget::SDatasetInfo &newRadioButton, + const bool saveOnlyWorkingBits = false); signals: - void begin_datachange(iseg::DataSelection& dataSelection, - QWidget* sender = NULL, bool beginUndo = true); - void end_datachange(QWidget* sender = NULL, - iseg::EndUndoAction undoAction = iseg::EndUndo); + void begin_datachange(iseg::DataSelection &dataSelection, + QWidget *sender = NULL, bool beginUndo = true); + void end_datachange(QWidget *sender = NULL, + iseg::EndUndoAction undoAction = iseg::EndUndo); void dataset_changed(); private slots: @@ -775,30 +775,30 @@ private slots: void DatasetSelectionChanged(); private: - SlicesHandler* m_Handler3D; + SlicesHandler *m_Handler3D; std::vector m_RadioButtons; - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxOverall; - Q3VBoxLayout* m_VboxOverall; - Q3VBoxLayout* m_VboxDatasets; - QGroupBox* m_DatasetsGroupBox; - QPushButton* m_AddDatasetButton; - QPushButton* m_LoadDatasetButton; - QPushButton* m_ChangeNameButton; - QPushButton* m_RemoveDatasetButton; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxOverall; + Q3VBoxLayout *m_VboxOverall; + Q3VBoxLayout *m_VboxDatasets; + QGroupBox *m_DatasetsGroupBox; + QPushButton *m_AddDatasetButton; + QPushButton *m_LoadDatasetButton; + QPushButton *m_ChangeNameButton; + QPushButton *m_RemoveDatasetButton; bool m_ItIsBeingLoaded; std::map m_MapDatasetValues; }; -class zoomer_widget : public QWidget +class ZoomWidget : public QWidget { Q_OBJECT public: - zoomer_widget(double zoom1, QDir picpath, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); - ~zoomer_widget(); + ZoomWidget(double zoom1, QDir picpath, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); + ~ZoomWidget(); double get_zoom(); public slots: @@ -806,13 +806,13 @@ public slots: private: double zoom; - Q3VBoxLayout* vbox1; - Q3HBoxLayout* hbox1; - QPushButton* pushzoomin; - QPushButton* pushzoomout; - QPushButton* pushunzoom; - QLineEdit* le_zoom_f; - QLabel* zoom_f; + Q3VBoxLayout *vbox1; + Q3HBoxLayout *hbox1; + QPushButton *pushzoomin; + QPushButton *pushzoomout; + QPushButton *pushunzoom; + QLineEdit *le_zoom_f; + QLabel *zoom_f; signals: void zoom_in(); @@ -832,22 +832,22 @@ class CleanerParams : public QDialog { Q_OBJECT public: - CleanerParams(int* rate1, int* minsize1, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + CleanerParams(int *rate1, int *minsize1, QWidget *parent = 0, + const char *name = 0, Qt::WindowFlags wFlags = 0); ~CleanerParams(); private: - int* rate; - int* minsize; - Q3HBox* hbox1; - Q3VBox* vbox1; - Q3VBox* vbox2; - QPushButton* pb_doit; - QPushButton* pb_dontdoit; - QLabel* lb_rate; - QLabel* lb_minsize; - QSpinBox* sb_rate; - QSpinBox* sb_minsize; + int *rate; + int *minsize; + Q3HBox *hbox1; + Q3VBox *vbox1; + Q3VBox *vbox2; + QPushButton *pb_doit; + QPushButton *pb_dontdoit; + QLabel *lb_rate; + QLabel *lb_minsize; + QSpinBox *sb_rate; + QSpinBox *sb_minsize; private slots: void doit_pressed(); @@ -858,25 +858,25 @@ class MergeProjectsDialog : public QDialog { Q_OBJECT public: - MergeProjectsDialog(QWidget* parent = 0, const char* name = 0, - Qt::WindowFlags wFlags = 0); + MergeProjectsDialog(QWidget *parent = 0, const char *name = 0, + Qt::WindowFlags wFlags = 0); ~MergeProjectsDialog(); - void get_filenames(std::vector& filenames); + void get_filenames(std::vector &filenames); private: - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxFileList; - Q3VBoxLayout* vboxButtons; - Q3VBoxLayout* vboxEditButtons; - Q3VBoxLayout* vboxExecuteButtons; - QListWidget* fileListWidget; - QPushButton* addButton; - QPushButton* removeButton; - QPushButton* moveUpButton; - QPushButton* moveDownButton; - QPushButton* executeButton; - QPushButton* cancelButton; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxFileList; + Q3VBoxLayout *vboxButtons; + Q3VBoxLayout *vboxEditButtons; + Q3VBoxLayout *vboxExecuteButtons; + QListWidget *fileListWidget; + QPushButton *addButton; + QPushButton *removeButton; + QPushButton *moveUpButton; + QPushButton *moveDownButton; + QPushButton *executeButton; + QPushButton *cancelButton; private slots: void add_pressed(); @@ -899,8 +899,8 @@ class CheckBoneConnectivityDialog : public QWidget struct BoneConnectionInfo { BoneConnectionInfo(const tissues_size_t tis1, const tissues_size_t tis2, - const int slice) - : TissueID1(tis1), TissueID2(tis2), SliceNumber(slice) + const int slice) + : TissueID1(tis1), TissueID2(tis2), SliceNumber(slice) { } @@ -908,7 +908,7 @@ class CheckBoneConnectivityDialog : public QWidget tissues_size_t TissueID2; int SliceNumber; - bool operator<(const BoneConnectionInfo& a) const + bool operator<(const BoneConnectionInfo &a) const { if (SliceNumber < a.SliceNumber) { @@ -924,59 +924,59 @@ class CheckBoneConnectivityDialog : public QWidget } } - bool operator==(const BoneConnectionInfo& a) const + bool operator==(const BoneConnectionInfo &a) const { return (SliceNumber == a.SliceNumber && - ((TissueID1 == a.TissueID1 && TissueID2 == a.TissueID2) || - (TissueID1 == a.TissueID2 && TissueID2 == a.TissueID1))); + ((TissueID1 == a.TissueID1 && TissueID2 == a.TissueID2) || + (TissueID1 == a.TissueID2 && TissueID2 == a.TissueID1))); } }; public: - CheckBoneConnectivityDialog(SlicesHandler* hand3D, const char* name, - QWidget* parent = 0, - Qt::WindowFlags wFlags = 0); + CheckBoneConnectivityDialog(SlicesHandler *hand3D, const char *name, + QWidget *parent = 0, + Qt::WindowFlags wFlags = 0); ~CheckBoneConnectivityDialog(); signals: void slice_changed(); private: - void ShowText(const std::string& text); + void ShowText(const std::string &text); void CheckBoneExist(); void LookForConnections(); void FillConnectionsTable(); - bool IsBone(const std::string& label_name) const; + bool IsBone(const std::string &label_name) const; private: - SlicesHandler* handler3D; + SlicesHandler *handler3D; - Q3HBox* mainBox; - Q3VBox* vbox1; - Q3HBox* hbox1; - Q3HBox* hbox2; - Q3HBox* hbox3; - Q3HBox* hbox4; + Q3HBox *mainBox; + Q3VBox *vbox1; + Q3HBox *hbox1; + Q3HBox *hbox2; + Q3HBox *hbox3; + Q3HBox *hbox4; - QCheckBox* bonesFoundCB; + QCheckBox *bonesFoundCB; - QPushButton* executeButton; - QPushButton* cancelButton; - QPushButton* exportButton; + QPushButton *executeButton; + QPushButton *cancelButton; + QPushButton *exportButton; - QTableWidget* foundConnectionsTable; + QTableWidget *foundConnectionsTable; - QLabel* progressText; + QLabel *progressText; std::vector foundConnections; - Q3HBoxLayout* hboxOverall; - Q3VBoxLayout* vboxFileList; - Q3VBoxLayout* vboxButtons; - Q3VBoxLayout* vboxEditButtons; - Q3VBoxLayout* vboxExecuteButtons; - QListWidget* fileListWidget; + Q3HBoxLayout *hboxOverall; + Q3VBoxLayout *vboxFileList; + Q3VBoxLayout *vboxButtons; + Q3VBoxLayout *vboxEditButtons; + Q3VBoxLayout *vboxExecuteButtons; + QListWidget *fileListWidget; private slots: void cellClicked(int row, int col); From 1836dc09d643e8a523e5b07989482175b00f79a3 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 11:42:12 +0200 Subject: [PATCH 7/9] fix several cases where slicenr_change api was not yet updated instead of calling cleanup for specific widgets, base class now has cleanup API, and Mainwindow calls it in generic block --- Plugins/BiasCorrection/BiasCorrection.cpp | 78 +++++---- Plugins/BiasCorrection/BiasCorrection.h | 14 +- Plugins/ConfidenceConnected/Confidence.cpp | 16 +- Plugins/ConfidenceConnected/Confidence.h | 52 +++--- Plugins/GraphCut/GraphCutBoneSegmentation.cpp | 40 ++--- Plugins/GraphCut/GraphCutBoneSegmentation.h | 47 +++-- Plugins/GraphCut/GraphCutTissueSeparator.cpp | 26 +-- Plugins/GraphCut/GraphCutTissueSeparator.h | 64 ++++--- Plugins/Levelset/Levelset.cpp | 16 +- Plugins/Levelset/Levelset.h | 43 +++-- iSeg/EdgeWidget.cpp | 47 +++-- iSeg/EdgeWidget.h | 67 ++++---- iSeg/FastmarchingFuzzyWidget.cpp | 161 ++++++++---------- iSeg/FastmarchingFuzzyWidget.h | 92 +++++----- iSeg/FeatureWidget.cpp | 37 ++-- iSeg/FeatureWidget.h | 70 ++++---- iSeg/HystereticGrowingWidget.cpp | 26 ++- iSeg/HystereticGrowingWidget.h | 88 +++++----- iSeg/LivewireWidget.cpp | 20 +-- iSeg/LivewireWidget.h | 59 ++++--- iSeg/MainWindow.cpp | 73 ++------ iSeg/MorphologyWidget.cpp | 43 +++-- iSeg/MorphologyWidget.h | 53 +++--- iSeg/OutlineCorrectionWidget.h | 132 +++++++------- iSeg/PickerWidget.cpp | 42 +++-- iSeg/PickerWidget.h | 59 ++++--- iSeg/SmoothingWidget.cpp | 123 +++++++------ iSeg/SmoothingWidget.h | 83 +++++---- iSeg/TransformWidget.cpp | 96 +++++------ iSeg/TransformWidget.h | 88 +++++----- iSeg/VesselWidget.cpp | 17 +- iSeg/VesselWidget.h | 46 ++--- iSeg/WatershedWidget.cpp | 44 +++-- iSeg/WatershedWidget.h | 35 ++-- 34 files changed, 945 insertions(+), 1052 deletions(-) diff --git a/Plugins/BiasCorrection/BiasCorrection.cpp b/Plugins/BiasCorrection/BiasCorrection.cpp index 7e8f487a..4b32a8ab 100755 --- a/Plugins/BiasCorrection/BiasCorrection.cpp +++ b/Plugins/BiasCorrection/BiasCorrection.cpp @@ -40,7 +40,7 @@ class CommandIterationUpdate : public itk::Command public: void SetProgressObject(QProgressDialog* progress, - const std::vector& num_iterations) + const std::vector& num_iterations) { m_NumberOfIterations = num_iterations; m_Progress = progress; @@ -52,7 +52,7 @@ class CommandIterationUpdate : public itk::Command } void Execute(const itk::Object* object, - const itk::EventObject& event) ITK_OVERRIDE + const itk::EventObject& event) ITK_OVERRIDE { const TFilter* filter = dynamic_cast(object); @@ -64,9 +64,9 @@ class CommandIterationUpdate : public itk::Command double current_level = filter->GetCurrentLevel(); double current_iteration = filter->GetElapsedIterations(); int percent = static_cast( - (current_level + - current_iteration / m_NumberOfIterations.at(current_level)) * - 100.0 / m_NumberOfIterations.size()); + (current_level + + current_iteration / m_NumberOfIterations.at(current_level)) * + 100.0 / m_NumberOfIterations.size()); m_Progress->setValue(std::min(percent, 100)); if (m_Progress->wasCanceled()) @@ -83,7 +83,7 @@ class CommandIterationUpdate : public itk::Command template typename ImageType::Pointer AllocImage( - const typename itk::ImageBase* exemplar) + const typename itk::ImageBase* exemplar) { typename ImageType::Pointer rval = ImageType::New(); // it may be the case that the output image might have a different @@ -110,17 +110,17 @@ inline QString Format(const char* tooltip) } // namespace BiasCorrectionWidget::BiasCorrectionWidget(iseg::SliceHandlerInterface* hand3D, - QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D), - m_CurrentFilter(nullptr) + QWidget* parent, const char* name, + Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D), + m_CurrentFilter(nullptr) { setToolTip(Format( - "Correct non-uniformity (especially in MRI) using the N4 Bias Correction " - "algorithm by " - "
" - "Tustison et al., 'N4ITK: Improved N3 Bias Correction', IEEE " - "Transactions on Medical Imaging, 29(6) : 1310 - 1320, June 2010")); + "Correct non-uniformity (especially in MRI) using the N4 Bias Correction " + "algorithm by " + "
" + "Tustison et al., 'N4ITK: Improved N3 Bias Correction', IEEE " + "Transactions on Medical Imaging, 29(6) : 1310 - 1320, June 2010")); activeslice = handler3D->get_activeslice(); @@ -147,8 +147,6 @@ BiasCorrectionWidget::BiasCorrectionWidget(iseg::SliceHandlerInterface* hand3D, vbox1->setMinimumWidth(std::max(300, vbox1->sizeHint().width())); QObject::connect(bias_exec, SIGNAL(clicked()), this, SLOT(do_work())); - - return; } void BiasCorrectionWidget::do_work() @@ -170,9 +168,9 @@ void BiasCorrectionWidget::do_work() try { auto output = DoBiasCorrection( - input, ITK_NULLPTR, - std::vector(num_levels, num_iterations), shrink_factor, - conv_threshold); + input, ITK_NULLPTR, + std::vector(num_levels, num_iterations), shrink_factor, + conv_threshold); if (output) { @@ -205,14 +203,14 @@ QSize BiasCorrectionWidget::sizeHint() const { return vbox1->sizeHint(); } BiasCorrectionWidget::~BiasCorrectionWidget() { delete vbox1; } -void BiasCorrectionWidget::slicenr_changed() +void BiasCorrectionWidget::on_slicenr_changed() { activeslice = handler3D->get_activeslice(); } void BiasCorrectionWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } @@ -233,9 +231,9 @@ QIcon BiasCorrectionWidget::GetIcon(QDir picdir) template ImagePointer BiasCorrectionWidget::DoBiasCorrection( - ImagePointer inputImage, ImagePointer maskImage, - const std::vector& numIters, int shrinkFactor, - double convergenceThreshold) + ImagePointer inputImage, ImagePointer maskImage, + const std::vector& numIters, int shrinkFactor, + double convergenceThreshold) { bool verbose = false; @@ -244,13 +242,13 @@ ImagePointer BiasCorrectionWidget::DoBiasCorrection( static const int ImageDimension = ImageType::ImageDimension; typedef itk::N4BiasFieldCorrectionImageFilter - CorrecterType; + ImageType> + CorrecterType; typename CorrecterType::Pointer correcter = CorrecterType::New(); m_CurrentFilter = correcter; QProgressDialog progress("Performing bias correction...", "Cancel", 0, 101, - this); + this); progress.setWindowModality(Qt::WindowModal); progress.setModal(true); progress.show(); @@ -267,22 +265,22 @@ ImagePointer BiasCorrectionWidget::DoBiasCorrection( if (verbose) { std::cout << "Mask not read. Using the entire image as the mask." - << std::endl - << std::endl; + << std::endl + << std::endl; } maskImage = MaskImageType::New(); maskImage->CopyInformation(inputImage); maskImage->SetRegions(inputImage->GetRequestedRegion()); maskImage->Allocate(false); maskImage->FillBuffer( - itk::NumericTraits::OneValue()); + itk::NumericTraits::OneValue()); } /** * convergence options */ typename CorrecterType::VariableSizeArrayType maximumNumberOfIterations( - numIters.size()); + numIters.size()); for (unsigned int d = 0; d < numIters.size(); d++) { maximumNumberOfIterations[d] = numIters[d]; @@ -361,9 +359,9 @@ ImagePointer BiasCorrectionWidget::DoBiasCorrection( * corrected image. */ typedef itk::BSplineControlPointImageFilter< - typename CorrecterType::BiasFieldControlPointLatticeType, - typename CorrecterType::ScalarImageType> - BSplinerType; + typename CorrecterType::BiasFieldControlPointLatticeType, + typename CorrecterType::ScalarImageType> + BSplinerType; typename BSplinerType::Pointer bspliner = BSplinerType::New(); bspliner->SetInput(correcter->GetLogBiasFieldControlPointLattice()); bspliner->SetSplineOrder(correcter->GetSplineOrder()); @@ -376,9 +374,9 @@ ImagePointer BiasCorrectionWidget::DoBiasCorrection( typename ImageType::Pointer logField = AllocImage(inputImage); itk::ImageRegionIterator ItB( - bspliner->GetOutput(), bspliner->GetOutput()->GetLargestPossibleRegion()); + bspliner->GetOutput(), bspliner->GetOutput()->GetLargestPossibleRegion()); itk::ImageRegionIterator ItF(logField, - logField->GetLargestPossibleRegion()); + logField->GetLargestPossibleRegion()); for (ItB.GoToBegin(), ItF.GoToBegin(); !ItB.IsAtEnd(); ++ItB, ++ItF) { ItF.Set(ItB.Get()[0]); @@ -398,13 +396,13 @@ ImagePointer BiasCorrectionWidget::DoBiasCorrection( if (isMaskImageSpecified) { itk::ImageRegionIteratorWithIndex ItD( - divider->GetOutput(), divider->GetOutput()->GetLargestPossibleRegion()); + divider->GetOutput(), divider->GetOutput()->GetLargestPossibleRegion()); itk::ImageRegionIterator ItI( - inputImage, inputImage->GetLargestPossibleRegion()); + inputImage, inputImage->GetLargestPossibleRegion()); for (ItD.GoToBegin(), ItI.GoToBegin(); !ItD.IsAtEnd(); ++ItD, ++ItI) { if (maskImage->GetPixel(ItD.GetIndex()) == - itk::NumericTraits::ZeroValue()) + itk::NumericTraits::ZeroValue()) { ItD.Set(ItI.Get()); } diff --git a/Plugins/BiasCorrection/BiasCorrection.h b/Plugins/BiasCorrection/BiasCorrection.h index dd5436ab..1a59fc3c 100755 --- a/Plugins/BiasCorrection/BiasCorrection.h +++ b/Plugins/BiasCorrection/BiasCorrection.h @@ -30,7 +30,7 @@ class BiasCorrectionWidget : public iseg::WidgetInterface Q_OBJECT public: BiasCorrectionWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent = 0, - const char* name = 0, Qt::WindowFlags wFlags = 0); + const char* name = 0, Qt::WindowFlags wFlags = 0); ~BiasCorrectionWidget(); QSize sizeHint() const override; @@ -41,12 +41,13 @@ class BiasCorrectionWidget : public iseg::WidgetInterface protected: template - ImagePointer - DoBiasCorrection(ImagePointer inputImage, ImagePointer maskImage, - const std::vector& numIters, - int shrinkFactor, double convergenceThreshold); + ImagePointer DoBiasCorrection(ImagePointer inputImage, ImagePointer maskImage, + const std::vector& numIters, + int shrinkFactor, double convergenceThreshold); private: + void on_slicenr_changed() override; + iseg::SliceHandlerInterface* handler3D; unsigned short activeslice; Q3VBox* vbox1; @@ -64,9 +65,6 @@ class BiasCorrectionWidget : public iseg::WidgetInterface itk::ProcessObject* m_CurrentFilter; -public slots: - void slicenr_changed(); - private slots: void do_work(); void cancel(); diff --git a/Plugins/ConfidenceConnected/Confidence.cpp b/Plugins/ConfidenceConnected/Confidence.cpp index 8c3fa1cb..709b3770 100755 --- a/Plugins/ConfidenceConnected/Confidence.cpp +++ b/Plugins/ConfidenceConnected/Confidence.cpp @@ -24,8 +24,8 @@ #include ConfidenceWidget::ConfidenceWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); @@ -33,8 +33,8 @@ ConfidenceWidget::ConfidenceWidget(iseg::SliceHandlerInterface* hand3D, QWidget* vbox1 = new Q3VBox(this); bias_header = new QLabel("ConfidenceConnected Algorithm:(Pick with OLC " - "Foreground 1 pixel to start) ", - vbox1); + "Foreground 1 pixel to start) ", + vbox1); hbox2 = new Q3HBox(vbox1); hbox3 = new Q3HBox(vbox1); hbox4 = new Q3HBox(vbox1); @@ -71,11 +71,11 @@ void ConfidenceWidget::do_work() typedef TMask TOutput; typedef itk::CurvatureFlowImageFilter - CurvatureFlowImageFilterType; + CurvatureFlowImageFilterType; CurvatureFlowImageFilterType::Pointer smoothing; smoothing = CurvatureFlowImageFilterType::New(); typedef itk::ConfidenceConnectedImageFilter - ConnectedFilterType; + ConnectedFilterType; ConnectedFilterType::Pointer confidenceConnected; confidenceConnected = ConnectedFilterType::New(); @@ -111,14 +111,14 @@ ConfidenceWidget::~ConfidenceWidget() free(usp); } -void ConfidenceWidget::slicenr_changed() +void ConfidenceWidget::on_slicenr_changed() { activeslice = handler3D->get_activeslice(); } void ConfidenceWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } diff --git a/Plugins/ConfidenceConnected/Confidence.h b/Plugins/ConfidenceConnected/Confidence.h index 5f647f91..a28b75a5 100755 --- a/Plugins/ConfidenceConnected/Confidence.h +++ b/Plugins/ConfidenceConnected/Confidence.h @@ -22,8 +22,8 @@ class ConfidenceWidget : public iseg::WidgetInterface { Q_OBJECT public: - ConfidenceWidget(iseg::SliceHandlerInterface *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + ConfidenceWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~ConfidenceWidget(); void init() override; void newloaded() override; @@ -32,37 +32,29 @@ class ConfidenceWidget : public iseg::WidgetInterface QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("Confidence.png"))); } protected: - virtual void on_tissuenr_changed(int i) override { std::cerr << "tissue " << i << std::endl; } - virtual void on_slicenr_changed() override { std::cerr << "slice changed " << std::endl; } - - virtual void on_mouse_clicked(iseg::Point p) override { std::cerr << "on_mouse_clicked" << std::endl; } - virtual void on_mouse_released(iseg::Point p) override { std::cerr << "on_mouse_released" << std::endl; } - virtual void on_mouse_moved(iseg::Point p) override { std::cerr << "on_mouse_moved" << std::endl; } + void on_slicenr_changed() override; private: - unsigned int *usp; - iseg::SliceHandlerInterface *handler3D; + unsigned int* usp; + iseg::SliceHandlerInterface* handler3D; unsigned short activeslice; - Q3VBox *vbox1; - QLabel *bias_header; - QPushButton *bias_exec; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3HBox *hbox4; - Q3HBox *hbox5; - QLabel *txt_h2; - QLabel *txt_h3; - QLabel *txt_h4; - QLabel *txt_h5; - QSpinBox *sl_h2; - QSpinBox *sl_h3; - QSpinBox *sl_h4; - QSpinBox *sl_h5; - QSpinBox *sl_h6; - QSpinBox *sl_h7; - -public slots: - void slicenr_changed(); + Q3VBox* vbox1; + QLabel* bias_header; + QPushButton* bias_exec; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3HBox* hbox4; + Q3HBox* hbox5; + QLabel* txt_h2; + QLabel* txt_h3; + QLabel* txt_h4; + QLabel* txt_h5; + QSpinBox* sl_h2; + QSpinBox* sl_h3; + QSpinBox* sl_h4; + QSpinBox* sl_h5; + QSpinBox* sl_h6; + QSpinBox* sl_h7; private slots: void do_work(); diff --git a/Plugins/GraphCut/GraphCutBoneSegmentation.cpp b/Plugins/GraphCut/GraphCutBoneSegmentation.cpp index 817b9d13..1554c03f 100755 --- a/Plugins/GraphCut/GraphCutBoneSegmentation.cpp +++ b/Plugins/GraphCut/GraphCutBoneSegmentation.cpp @@ -45,7 +45,7 @@ class CommandProgressUpdate : public itk::Command } void Execute(const itk::Object* object, - const itk::EventObject& event) ITK_OVERRIDE + const itk::EventObject& event) ITK_OVERRIDE { auto filter = dynamic_cast(object); @@ -72,18 +72,18 @@ inline QString Format(const char* tooltip) } // namespace BoneSegmentationWidget::BoneSegmentationWidget( - iseg::SliceHandlerInterface* hand3D, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), m_Handler3D(hand3D), - m_CurrentFilter(nullptr) + iseg::SliceHandlerInterface* hand3D, QWidget* parent, const char* name, + Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), m_Handler3D(hand3D), + m_CurrentFilter(nullptr) { setToolTip( - Format("A fully-automatic method for segmenting the femur from 3D CT " - "scans, based on the graph-cut segmentation framework and bone " - "enhancement filters " - "
" - "Krcah et al., 'Fully automatic and fast segmentation of the " - "femur bone from 3D-CT images with no shape prior', IEEE, 2011")); + Format("A fully-automatic method for segmenting the femur from 3D CT " + "scans, based on the graph-cut segmentation framework and bone " + "enhancement filters " + "
" + "Krcah et al., 'Fully automatic and fast segmentation of the " + "femur bone from 3D-CT images with no shape prior', IEEE, 2011")); m_CurrentSlice = m_Handler3D->get_activeslice(); @@ -93,7 +93,7 @@ BoneSegmentationWidget::BoneSegmentationWidget( m_LabelMaxFlowAlgorithm = new QLabel("Max-Flow Algorithm: ", m_HGrid1); m_MaxFlowAlgorithm = new QComboBox(m_HGrid1); m_MaxFlowAlgorithm->setToolTip( - QString("Choose Max-Flow algorithm used to perform Graph-Cut.")); + QString("Choose Max-Flow algorithm used to perform Graph-Cut.")); m_MaxFlowAlgorithm->insertItem(QString("Kohli")); m_MaxFlowAlgorithm->insertItem(QString("PushLabel-Fifo")); m_MaxFlowAlgorithm->insertItem(QString("PushLabel-H_PRF")); @@ -101,7 +101,7 @@ BoneSegmentationWidget::BoneSegmentationWidget( m_6Connectivity = new QCheckBox(QString("6-Connectivity"), m_VGrid); m_6Connectivity->setToolTip(QString("Use fully connected neighborhood or " - "only city-block neighbors (26 vs 6).")); + "only city-block neighbors (26 vs 6).")); // TODO: this should re-use active-slices m_UseSliceRange = new QCheckBox(QString("Use Slice Range"), m_VGrid); @@ -123,7 +123,7 @@ BoneSegmentationWidget::BoneSegmentationWidget( QObject::connect(m_Execute, SIGNAL(clicked()), this, SLOT(do_work())); QObject::connect(m_UseSliceRange, SIGNAL(clicked()), this, - SLOT(showsliders())); + SLOT(showsliders())); } void BoneSegmentationWidget::showsliders() @@ -157,7 +157,7 @@ void BoneSegmentationWidget::do_work() typedef itk::Image TOutput; typedef itk::Image TIntImage; typedef itk::ImageGraphCutFilter - GraphCutFilterType; + GraphCutFilterType; // get input image auto input = TInput::New(); @@ -173,8 +173,8 @@ void BoneSegmentationWidget::do_work() graphCutFilter->SetNumberOfRequiredInputs(1); graphCutFilter->SetInputImage(input); graphCutFilter->SetMaxFlowAlgorithm( - static_cast( - m_MaxFlowAlgorithm->currentItem())); + static_cast( + m_MaxFlowAlgorithm->currentItem())); graphCutFilter->SetForegroundPixelValue(255); graphCutFilter->SetBackgroundPixelValue(0); graphCutFilter->SetSigma(0.2); @@ -189,7 +189,7 @@ void BoneSegmentationWidget::do_work() auto observer = CommandProgressUpdate::New(); auto observer_id = - graphCutFilter->AddObserver(itk::ProgressEvent(), observer); + graphCutFilter->AddObserver(itk::ProgressEvent(), observer); observer->SetProgressObject(&progress); try @@ -226,14 +226,14 @@ QSize BoneSegmentationWidget::sizeHint() const BoneSegmentationWidget::~BoneSegmentationWidget() { delete m_VGrid; } -void BoneSegmentationWidget::slicenr_changed() +void BoneSegmentationWidget::on_slicenr_changed() { m_CurrentSlice = m_Handler3D->get_activeslice(); } void BoneSegmentationWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } diff --git a/Plugins/GraphCut/GraphCutBoneSegmentation.h b/Plugins/GraphCut/GraphCutBoneSegmentation.h index ebe755b2..971e720d 100755 --- a/Plugins/GraphCut/GraphCutBoneSegmentation.h +++ b/Plugins/GraphCut/GraphCutBoneSegmentation.h @@ -23,36 +23,35 @@ class BoneSegmentationWidget : public iseg::WidgetInterface { Q_OBJECT public: - BoneSegmentationWidget(iseg::SliceHandlerInterface *hand3D, - QWidget *parent = 0, const char *name = 0, Qt::WindowFlags wFlags = 0); + BoneSegmentationWidget(iseg::SliceHandlerInterface* hand3D, + QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~BoneSegmentationWidget(); QSize sizeHint() const override; - void init(); - void newloaded(); - std::string GetName() { return std::string("CT Auto-Bone"); } - QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("graphcut.png"))); } + void init() override; + void newloaded() override; + std::string GetName() override { return std::string("CT Auto-Bone"); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("graphcut.png"))); } private: - iseg::SliceHandlerInterface *m_Handler3D; - unsigned short m_CurrentSlice; - Q3VBox *m_VGrid; - Q3HBox *m_HGrid1; - Q3HBox *m_HGrid2; - Q3HBox *m_HGrid3; - QLabel *m_LabelMaxFlowAlgorithm; - QLabel *m_LabelStart; - QLabel *m_LabelEnd; - QComboBox *m_MaxFlowAlgorithm; - QPushButton *m_Execute; - QCheckBox *m_6Connectivity; - QCheckBox *m_UseSliceRange; - QSpinBox *m_Start; - QSpinBox *m_End; + void on_slicenr_changed() override; - itk::ProcessObject *m_CurrentFilter; + iseg::SliceHandlerInterface* m_Handler3D; + unsigned short m_CurrentSlice; + Q3VBox* m_VGrid; + Q3HBox* m_HGrid1; + Q3HBox* m_HGrid2; + Q3HBox* m_HGrid3; + QLabel* m_LabelMaxFlowAlgorithm; + QLabel* m_LabelStart; + QLabel* m_LabelEnd; + QComboBox* m_MaxFlowAlgorithm; + QPushButton* m_Execute; + QCheckBox* m_6Connectivity; + QCheckBox* m_UseSliceRange; + QSpinBox* m_Start; + QSpinBox* m_End; -public slots: - void slicenr_changed(); + itk::ProcessObject* m_CurrentFilter; private slots: void do_work(); diff --git a/Plugins/GraphCut/GraphCutTissueSeparator.cpp b/Plugins/GraphCut/GraphCutTissueSeparator.cpp index 862c85dd..ff185680 100755 --- a/Plugins/GraphCut/GraphCutTissueSeparator.cpp +++ b/Plugins/GraphCut/GraphCutTissueSeparator.cpp @@ -22,9 +22,9 @@ #include TissueSeparatorWidget::TissueSeparatorWidget( - iseg::SliceHandlerInterface* hand3D, QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), m_Handler3D(hand3D) + iseg::SliceHandlerInterface* hand3D, QWidget* parent, const char* name, + Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), m_Handler3D(hand3D) { m_CurrentSlice = m_Handler3D->get_activeslice(); @@ -75,7 +75,7 @@ TissueSeparatorWidget::TissueSeparatorWidget( QObject::connect(m_Execute, SIGNAL(clicked()), this, SLOT(do_work())); QObject::connect(m_UseSliceRange, SIGNAL(clicked()), this, - SLOT(showsliders())); + SLOT(showsliders())); /* activeslice = handler3D->get_activeslice(); @@ -155,7 +155,7 @@ void TissueSeparatorWidget::do_work() //Code for special GC for division typedef TMask TOutput; typedef itk::Image TIntImage; typedef itk::ImageGraphCutFilter - GraphCutFilterType; + GraphCutFilterType; auto graphCutFilter = GraphCutFilterType::New(); auto input = TInput::New(); @@ -173,9 +173,9 @@ void TissueSeparatorWidget::do_work() //Code for special GC for division if (m_UseSliceRange->isChecked() == true) { m_Handler3D->GetITKImageFB(foreground, m_Start->value() - 1, - m_End->value()); + m_End->value()); m_Handler3D->GetITKImageFB(background, m_Start->value() - 1, - m_End->value()); + m_End->value()); } else { @@ -189,8 +189,8 @@ void TissueSeparatorWidget::do_work() //Code for special GC for division graphCutFilter->SetBackgroundImage(background); // set parameters graphCutFilter->SetMaxFlowAlgorithm( - static_cast( - m_MaxFlowAlgorithm->currentItem())); + static_cast( + m_MaxFlowAlgorithm->currentItem())); graphCutFilter->SetForegroundPixelValue(255); graphCutFilter->SetBackgroundPixelValue(-255); graphCutFilter->SetSigma(0.2); @@ -219,7 +219,7 @@ void TissueSeparatorWidget::do_work() //Code for special GC for division IteratorType iterator(rad, output, output->GetLargestPossibleRegion()); IteratorType2 iterator2(rad, foreground, - foreground->GetLargestPossibleRegion()); + foreground->GetLargestPossibleRegion()); iterator.ClearActiveList(); iterator.ActivateOffset(center); iterator2.ClearActiveList(); @@ -245,7 +245,7 @@ void TissueSeparatorWidget::do_work() //Code for special GC for division output->Update(); if (m_UseSliceRange->isChecked() == true) m_Handler3D->ModifyWorkFloat(output, m_Start->value() - 1, - m_End->value()); + m_End->value()); else m_Handler3D->ModifyWorkFloat(output); } @@ -258,14 +258,14 @@ QSize TissueSeparatorWidget::sizeHint() const TissueSeparatorWidget::~TissueSeparatorWidget() { delete m_VerticalGrid; } -void TissueSeparatorWidget::slicenr_changed() +void TissueSeparatorWidget::on_slicenr_changed() { m_CurrentSlice = m_Handler3D->get_activeslice(); } void TissueSeparatorWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } diff --git a/Plugins/GraphCut/GraphCutTissueSeparator.h b/Plugins/GraphCut/GraphCutTissueSeparator.h index 60305eea..6d4c4570 100755 --- a/Plugins/GraphCut/GraphCutTissueSeparator.h +++ b/Plugins/GraphCut/GraphCutTissueSeparator.h @@ -23,46 +23,42 @@ class TissueSeparatorWidget : public iseg::WidgetInterface { Q_OBJECT public: - TissueSeparatorWidget(iseg::SliceHandlerInterface *hand3D, - QWidget *parent = 0, const char *name = 0, + TissueSeparatorWidget(iseg::SliceHandlerInterface* hand3D, + QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~TissueSeparatorWidget(); QSize sizeHint() const override; - void init(); - void newloaded(); - std::string GetName() { return std::string("Separate Tissue"); } - QIcon GetIcon(QDir picdir) - { - return QIcon(picdir.absFilePath(QString("graphcut.png")).ascii()); - } + void init() override; + void newloaded() override; + std::string GetName() override { return std::string("Separate Tissue"); } + QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("graphcut.png"))); } private: - iseg::SliceHandlerInterface *m_Handler3D; - unsigned short m_CurrentSlice; - Q3VBox *m_VerticalGrid; - Q3HBox *m_Horizontal1; - Q3HBox *m_Horizontal2; - Q3HBox *m_Horizontal3; - Q3HBox *m_Horizontal4; - Q3HBox *m_Horizontal5; - QLabel *m_LabelForeground; - QLabel *m_LabelBackground; - QLabel *m_LabelMaxFlowAlgorithm; - QLabel *m_LabelStart; - QLabel *m_LabelEnd; - QSpinBox *m_ForegroundValue; - QSpinBox *m_BackgroundValue; - QCheckBox *USE_FB; // ? - QCheckBox *m_UseIntensity; - QComboBox *m_MaxFlowAlgorithm; - QCheckBox *m_6Connectivity; - QCheckBox *m_UseSliceRange; - QSpinBox *m_Start; - QSpinBox *m_End; - QPushButton *m_Execute; + void on_slicenr_changed() override; -public slots: - void slicenr_changed(); + iseg::SliceHandlerInterface* m_Handler3D; + unsigned short m_CurrentSlice; + Q3VBox* m_VerticalGrid; + Q3HBox* m_Horizontal1; + Q3HBox* m_Horizontal2; + Q3HBox* m_Horizontal3; + Q3HBox* m_Horizontal4; + Q3HBox* m_Horizontal5; + QLabel* m_LabelForeground; + QLabel* m_LabelBackground; + QLabel* m_LabelMaxFlowAlgorithm; + QLabel* m_LabelStart; + QLabel* m_LabelEnd; + QSpinBox* m_ForegroundValue; + QSpinBox* m_BackgroundValue; + QCheckBox* USE_FB; // ? + QCheckBox* m_UseIntensity; + QComboBox* m_MaxFlowAlgorithm; + QCheckBox* m_6Connectivity; + QCheckBox* m_UseSliceRange; + QSpinBox* m_Start; + QSpinBox* m_End; + QPushButton* m_Execute; private slots: void do_work(); diff --git a/Plugins/Levelset/Levelset.cpp b/Plugins/Levelset/Levelset.cpp index 912f164b..c6eac7ef 100755 --- a/Plugins/Levelset/Levelset.cpp +++ b/Plugins/Levelset/Levelset.cpp @@ -19,8 +19,8 @@ #include LevelsetWidget::LevelsetWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { activeslice = handler3D->get_activeslice(); @@ -28,8 +28,8 @@ LevelsetWidget::LevelsetWidget(iseg::SliceHandlerInterface* hand3D, QWidget* par vbox1 = new Q3VBox(this); bias_header = new QLabel( - "LevelSetSegmentation: (Pick with OLC Foreground 1 pixel to start)", - vbox1); + "LevelSetSegmentation: (Pick with OLC Foreground 1 pixel to start)", + vbox1); hbox2 = new Q3HBox(vbox1); hbox3 = new Q3HBox(vbox1); hbox4 = new Q3HBox(vbox1); @@ -58,7 +58,7 @@ void LevelsetWidget::do_work() typedef itk::Image TMask; typedef TMask TOutput; typedef itk::ThresholdSegmentationLevelSetImageFilter - ThresholdSegmentationLevelSetImageFilterType; + ThresholdSegmentationLevelSetImageFilterType; ThresholdSegmentationLevelSetImageFilterType::Pointer thresholdSegmentation; thresholdSegmentation = ThresholdSegmentationLevelSetImageFilterType::New(); @@ -93,7 +93,7 @@ void LevelsetWidget::do_work() fastMarching->SetOutputDirection(input->GetDirection()); typedef itk::BinaryThresholdImageFilter - ThresholdingFilterType; + ThresholdingFilterType; ThresholdingFilterType::Pointer thresholder; thresholder = ThresholdingFilterType::New(); thresholder->SetLowerThreshold(-5000.0); @@ -128,14 +128,14 @@ LevelsetWidget::~LevelsetWidget() free(usp); } -void LevelsetWidget::slicenr_changed() +void LevelsetWidget::on_slicenr_changed() { activeslice = handler3D->get_activeslice(); } void LevelsetWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } diff --git a/Plugins/Levelset/Levelset.h b/Plugins/Levelset/Levelset.h index 66be21fc..2f09d60a 100755 --- a/Plugins/Levelset/Levelset.h +++ b/Plugins/Levelset/Levelset.h @@ -21,8 +21,8 @@ class LevelsetWidget : public iseg::WidgetInterface { Q_OBJECT public: - LevelsetWidget(iseg::SliceHandlerInterface *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + LevelsetWidget(iseg::SliceHandlerInterface* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~LevelsetWidget(); QSize sizeHint() const override; void init() override; @@ -31,27 +31,26 @@ class LevelsetWidget : public iseg::WidgetInterface QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("LevelSet.png"))); }; private: - unsigned int *usp; - iseg::SliceHandlerInterface *handler3D; - unsigned short activeslice; - Q3VBox *vbox1; - QLabel *bias_header; - QPushButton *bias_exec; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3HBox *hbox4; - Q3HBox *hbox5; - QLabel *txt_h2; - QLabel *txt_h3; - QLabel *txt_h4; - QSpinBox *sl_h2; - QSpinBox *sl_h3; - QSpinBox *sl_h4; - QLabel *txt_h5; - QSpinBox *sl_h5; + void on_slicenr_changed() override; -public slots: - void slicenr_changed(); + unsigned int* usp; + iseg::SliceHandlerInterface* handler3D; + unsigned short activeslice; + Q3VBox* vbox1; + QLabel* bias_header; + QPushButton* bias_exec; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3HBox* hbox4; + Q3HBox* hbox5; + QLabel* txt_h2; + QLabel* txt_h3; + QLabel* txt_h4; + QSpinBox* sl_h2; + QSpinBox* sl_h3; + QSpinBox* sl_h4; + QLabel* txt_h5; + QSpinBox* sl_h5; private slots: void do_work(); diff --git a/iSeg/EdgeWidget.cpp b/iSeg/EdgeWidget.cpp index 0a9461a0..c09a4b2e 100755 --- a/iSeg/EdgeWidget.cpp +++ b/iSeg/EdgeWidget.cpp @@ -31,12 +31,12 @@ using namespace iseg; EdgeWidget::EdgeWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip( - Format("Various edge extraction routines. These are mostly useful " - "as part of other segmentation techniques.")); + Format("Various edge extraction routines. These are mostly useful " + "as part of other segmentation techniques.")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -102,16 +102,14 @@ EdgeWidget::EdgeWidget(SlicesHandler* hand3D, QWidget* parent, method_changed(0); QObject::connect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::connect(btn_exec, SIGNAL(clicked()), this, SLOT(execute())); QObject::connect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_thresh1, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_thresh2, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); - - return; + SLOT(slider_changed(int))); } EdgeWidget::~EdgeWidget() @@ -120,18 +118,15 @@ EdgeWidget::~EdgeWidget() delete modegroup; } -void EdgeWidget::slicenr_changed() +void EdgeWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } void EdgeWidget::bmphand_changed(bmphandler* bmph) { bmphand = bmph; - return; } void EdgeWidget::execute() @@ -164,13 +159,13 @@ void EdgeWidget::execute() else if (rb_canny->isOn()) { bmphand->canny_line(sl_sigma->value() * 0.05f, - sl_thresh1->value() * 1.5f, - sl_thresh2->value() * 1.5f); + sl_thresh1->value() * 1.5f, + sl_thresh2->value() * 1.5f); } else { bmphand->laplacian_zero(sl_sigma->value() * 0.05f, - sl_thresh1->value() * 0.5f, false); + sl_thresh1->value() * 0.5f, false); } emit end_datachange(this); @@ -301,7 +296,7 @@ void EdgeWidget::newloaded() void EdgeWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } @@ -340,13 +335,13 @@ FILE* EdgeWidget::LoadParams(FILE* fp, int version) if (version >= 2) { QObject::disconnect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::disconnect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::disconnect(sl_thresh1, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::disconnect(sl_thresh2, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -373,13 +368,13 @@ FILE* EdgeWidget::LoadParams(FILE* fp, int version) method_changed(0); QObject::connect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::connect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_thresh1, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); QObject::connect(sl_thresh2, SIGNAL(valueChanged(int)), this, - SLOT(slider_changed(int))); + SLOT(slider_changed(int))); } return fp; } diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index ea80bb2f..eaf368de 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -36,52 +36,51 @@ class EdgeWidget : public WidgetInterface { Q_OBJECT public: - EdgeWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + EdgeWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~EdgeWidget(); QSize sizeHint() const override; void init() override; void newloaded() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Edge"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("edge.png"))); } private: - bmphandler *bmphand; - SlicesHandler *handler3D; - unsigned short activeslice; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3VBox *vbox1; - QLabel *txt_sigmal; - QLabel *txt_sigma2; - QLabel *txt_thresh11; - QLabel *txt_thresh12; - QLabel *txt_thresh21; - QLabel *txt_thresh22; - QSlider *sl_sigma; - QSlider *sl_thresh1; - QSlider *sl_thresh2; - QPushButton *btn_exec; - QRadioButton *rb_sobel; - QRadioButton *rb_laplacian; - QRadioButton *rb_interquartile; - QRadioButton *rb_momentline; - QRadioButton *rb_gaussline; - QRadioButton *rb_canny; - QRadioButton *rb_laplacianzero; - QButtonGroup *modegroup; + void on_slicenr_changed() override; -public slots: - void slicenr_changed(); + bmphandler* bmphand; + SlicesHandler* handler3D; + unsigned short activeslice; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3VBox* vbox1; + QLabel* txt_sigmal; + QLabel* txt_sigma2; + QLabel* txt_thresh11; + QLabel* txt_thresh12; + QLabel* txt_thresh21; + QLabel* txt_thresh22; + QSlider* sl_sigma; + QSlider* sl_thresh1; + QSlider* sl_thresh2; + QPushButton* btn_exec; + QRadioButton* rb_sobel; + QRadioButton* rb_laplacian; + QRadioButton* rb_interquartile; + QRadioButton* rb_momentline; + QRadioButton* rb_gaussline; + QRadioButton* rb_canny; + QRadioButton* rb_laplacianzero; + QButtonGroup* modegroup; private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void execute(); void method_changed(int); void slider_changed(int newval); diff --git a/iSeg/FastmarchingFuzzyWidget.cpp b/iSeg/FastmarchingFuzzyWidget.cpp index 9c466c3f..d7d5d42e 100755 --- a/iSeg/FastmarchingFuzzyWidget.cpp +++ b/iSeg/FastmarchingFuzzyWidget.cpp @@ -33,17 +33,17 @@ using namespace iseg; FastmarchingFuzzyWidget::FastmarchingFuzzyWidget(SlicesHandler* hand3D, - QWidget* parent, const char* name, - Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + QWidget* parent, const char* name, + Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip( - Format("The Fuzzy tab actually provides access to two different " - "segmentation techniques that have a very different " - "background but a similar user and interaction interface : " - "1) Fuzzy connectedness and 2) a Fast Marching " - "implementation of a levelset technique. Both methods " - "require a seed point to be specified.")); + Format("The Fuzzy tab actually provides access to two different " + "segmentation techniques that have a very different " + "background but a similar user and interaction interface : " + "1) Fuzzy connectedness and 2) a Fast Marching " + "implementation of a levelset technique. Both methods " + "require a seed point to be specified.")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -78,35 +78,35 @@ FastmarchingFuzzyWidget::FastmarchingFuzzyWidget(SlicesHandler* hand3D, sl_m1 = new QSlider(Qt::Horizontal, hbox3); sl_m1->setRange(0, 100); sl_m1->setToolTip( - Format("The average gray value of the region to be segmented.")); + Format("The average gray value of the region to be segmented.")); sl_s1 = new QSlider(Qt::Horizontal, hbox4); sl_s1->setRange(0, 100); sl_s1->setToolTip( - Format("A measure of how much the gray values are expected " - "to deviate from m1 (standard deviation).")); + Format("A measure of how much the gray values are expected " + "to deviate from m1 (standard deviation).")); sl_s2 = new QSlider(Qt::Horizontal, hbox5); sl_s2->setRange(0, 100); sl_s2->setToolTip(Format("Sudden changes larger than s2 are considered to " - "indicate boundaries.")); + "indicate boundaries.")); rb_fastmarch = new QRadioButton(QString("Fast Marching"), vboxmethods); rb_fastmarch->setToolTip(Format( - "Fuzzy connectedness computes for each image " - "point the likelihood of its belonging to the same region as the " - "starting " - "point. It achieves this by looking at each possible connecting path " - "between the two points and assigning the image point probability as " - "identical to the probability of this path lying entirely in the same " - "tissue " - "as the start point.")); + "Fuzzy connectedness computes for each image " + "point the likelihood of its belonging to the same region as the " + "starting " + "point. It achieves this by looking at each possible connecting path " + "between the two points and assigning the image point probability as " + "identical to the probability of this path lying entirely in the same " + "tissue " + "as the start point.")); rb_fuzzy = new QRadioButton(QString("Fuzzy Connect."), vboxmethods); rb_fuzzy->setToolTip( - Format("This tool simulates the evolution of a line (boundary) on a 2D " - "image in time. " - "The boundary is continuously expanding. The Sigma parameter " - "(Gaussian smoothing) controls the impact of noise.")); + Format("This tool simulates the evolution of a line (boundary) on a 2D " + "image in time. " + "The boundary is continuously expanding. The Sigma parameter " + "(Gaussian smoothing) controls the impact of noise.")); bg_method = new QButtonGroup(this); bg_method->insert(rb_fastmarch); @@ -117,10 +117,10 @@ FastmarchingFuzzyWidget::FastmarchingFuzzyWidget(SlicesHandler* hand3D, rb_drag = new QRadioButton(QString("Drag"), hbox7); rb_drag->setToolTip( - Format("Drag allows the user to drag the mouse (after clicking on " - "the start point and keeping the mouse button pressed down) " - "specifying the " - "extent of the region on the image.")); + Format("Drag allows the user to drag the mouse (after clicking on " + "the start point and keeping the mouse button pressed down) " + "specifying the " + "extent of the region on the image.")); rb_drag->setChecked(TRUE); rb_drag->show(); rb_slider = new QRadioButton(QString("Slider"), hbox7); @@ -168,35 +168,35 @@ FastmarchingFuzzyWidget::FastmarchingFuzzyWidget(SlicesHandler* hand3D, IFTfuzzy = NULL; QObject::connect(sl_extend, SIGNAL(valueChanged(int)), this, - SLOT(slextend_changed(int))); + SLOT(slextend_changed(int))); QObject::connect(sl_extend, SIGNAL(sliderPressed()), this, - SLOT(slextend_pressed())); + SLOT(slextend_pressed())); QObject::connect(sl_extend, SIGNAL(sliderReleased()), this, - SLOT(slextend_released())); + SLOT(slextend_released())); QObject::connect(sl_sigma, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_thresh, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_m1, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_s1, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(sl_s2, SIGNAL(sliderMoved(int)), this, - SLOT(slider_changed())); + SLOT(slider_changed())); QObject::connect(bg_method, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed())); + SLOT(method_changed())); QObject::connect(bg_interact, SIGNAL(buttonClicked(int)), this, - SLOT(interact_changed())); + SLOT(interact_changed())); QObject::connect(sb_thresh, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_m1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_s1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_s2, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); sigma = 1.0f; sigmamax = 5.0f; @@ -221,16 +221,12 @@ FastmarchingFuzzyWidget::~FastmarchingFuzzyWidget() delete IFTmarch; if (IFTfuzzy != NULL) delete IFTfuzzy; - // if(map!=NULL) free(map); - return; } -void FastmarchingFuzzyWidget::slicenr_changed() +void FastmarchingFuzzyWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } void FastmarchingFuzzyWidget::bmphand_changed(bmphandler* bmph) @@ -245,8 +241,6 @@ void FastmarchingFuzzyWidget::bmphand_changed(bmphandler* bmph) bmphand = bmph; sl_extend->setEnabled(false); - - return; } void FastmarchingFuzzyWidget::init() @@ -269,11 +263,6 @@ void FastmarchingFuzzyWidget::init() sl_extend->setEnabled(false); hideparams_changed(); - - // Point p; - // p.px=p.py=0; - // IFTmarch=bmphand->fastmarching_init(p,1.4f,20); - // IFTfuzzy } void FastmarchingFuzzyWidget::newloaded() @@ -322,8 +311,8 @@ void FastmarchingFuzzyWidget::on_mouse_clicked(Point p) { IFTfuzzy = new ImageForestingTransformAdaptFuzzy; IFTfuzzy->fuzzy_init(bmphand->return_width(), - bmphand->return_height(), - bmphand->return_bmp(), p, m1, s1, s2); + bmphand->return_height(), + bmphand->return_bmp(), p, m1, s1, s2); } else { @@ -391,7 +380,7 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) unsigned pos = 0; if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend)) + (map[pos] <= extend && map[pos + width] > extend)) { p.px = 0; p.py = 0; @@ -401,8 +390,8 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) for (unsigned short j = 1; j + 1 < width; j++) { if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos - 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend)) + (map[pos] <= extend && map[pos - 1] > extend) || + (map[pos] <= extend && map[pos + width] > extend)) { p.px = j; p.py = 0; @@ -411,7 +400,7 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) pos++; } if ((map[pos] <= extend && map[pos - 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend)) + (map[pos] <= extend && map[pos + width] > extend)) { p.px = width - 1; p.py = 0; @@ -422,8 +411,8 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) for (unsigned short i = 1; i + 1 < height; i++) { if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos + width] > extend) || + (map[pos] <= extend && map[pos - width] > extend)) { p.px = 0; p.py = i; @@ -433,9 +422,9 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) for (unsigned short j = 1; j + 1 < width; j++) { if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos - 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos - 1] > extend) || + (map[pos] <= extend && map[pos + width] > extend) || + (map[pos] <= extend && map[pos - width] > extend)) { p.px = j; p.py = i; @@ -444,8 +433,8 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) pos++; } if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos + width] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos + width] > extend) || + (map[pos] <= extend && map[pos - width] > extend)) { p.px = width - 1; p.py = i; @@ -454,7 +443,7 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) pos++; } if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos - width] > extend)) { p.px = 0; p.py = height - 1; @@ -464,8 +453,8 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) for (unsigned short j = 1; j + 1 < width; j++) { if ((map[pos] <= extend && map[pos + 1] > extend) || - (map[pos] <= extend && map[pos - 1] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos - 1] > extend) || + (map[pos] <= extend && map[pos - width] > extend)) { p.px = j; p.py = height - 1; @@ -474,7 +463,7 @@ void FastmarchingFuzzyWidget::on_mouse_moved(Point p) pos++; } if ((map[pos] <= extend && map[pos - 1] > extend) || - (map[pos] <= extend && map[pos - width] > extend)) + (map[pos] <= extend && map[pos - width] > extend)) { p.px = width - 1; p.py = height - 1; @@ -700,19 +689,19 @@ FILE* FastmarchingFuzzyWidget::LoadParams(FILE* fp, int version) if (version >= 2) { QObject::disconnect(sl_extend, SIGNAL(valueChanged(int)), this, - SLOT(slextend_changed(int))); + SLOT(slextend_changed(int))); QObject::disconnect(bg_method, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed())); + SLOT(method_changed())); QObject::disconnect(bg_interact, SIGNAL(buttonClicked(int)), this, - SLOT(interact_changed())); + SLOT(interact_changed())); QObject::disconnect(sb_thresh, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::disconnect(sb_m1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::disconnect(sb_s1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::disconnect(sb_s2, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -757,19 +746,19 @@ FILE* FastmarchingFuzzyWidget::LoadParams(FILE* fp, int version) interact_changed(); QObject::connect(sl_extend, SIGNAL(valueChanged(int)), this, - SLOT(slextend_changed(int))); + SLOT(slextend_changed(int))); QObject::connect(bg_method, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed())); + SLOT(method_changed())); QObject::connect(bg_interact, SIGNAL(buttonClicked(int)), this, - SLOT(interact_changed())); + SLOT(interact_changed())); QObject::connect(sb_thresh, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_m1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_s1, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); QObject::connect(sb_s2, SIGNAL(valueChanged(int)), this, - SLOT(spinbox_changed())); + SLOT(spinbox_changed())); } return fp; } diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index e6316841..60dba511 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -38,65 +38,66 @@ class FastmarchingFuzzyWidget : public WidgetInterface { Q_OBJECT public: - FastmarchingFuzzyWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + FastmarchingFuzzyWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~FastmarchingFuzzyWidget(); void init() override; void newloaded() override; void cleanup() override; QSize sizeHint() const override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Fuzzy"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("fuzzy.png"))); } protected: + void on_slicenr_changed() override; void on_mouse_clicked(Point p) override; void on_mouse_released(Point p) override; void on_mouse_moved(Point p) override; private: - float *map; - ImageForestingTransformFastMarching *IFTmarch; - ImageForestingTransformAdaptFuzzy *IFTfuzzy; - bmphandler *bmphand; - SlicesHandler *handler3D; + float* map; + ImageForestingTransformFastMarching* IFTmarch; + ImageForestingTransformAdaptFuzzy* IFTfuzzy; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3HBox *hbox4; - Q3HBox *hbox5; - Q3HBox *hbox7; - Q3VBox *vbox1; - Q3VBox *vboxfast; - Q3VBox *vboxfuzzy; - QLabel *txt_sigma; - QLabel *txt_thresh; - QLabel *txt_m1; - QLabel *txt_s1; - QLabel *txt_s2; - QLabel *txt_extend; - QSlider *sl_sigma; - QSlider *sl_thresh; - QSlider *sl_m1; - QSlider *sl_s1; - QSlider *sl_s2; - QSlider *sl_extend; - QSpinBox *sb_thresh; - QSpinBox *sb_m1; - QSpinBox *sb_s1; - QSpinBox *sb_s2; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3HBox* hbox4; + Q3HBox* hbox5; + Q3HBox* hbox7; + Q3VBox* vbox1; + Q3VBox* vboxfast; + Q3VBox* vboxfuzzy; + QLabel* txt_sigma; + QLabel* txt_thresh; + QLabel* txt_m1; + QLabel* txt_s1; + QLabel* txt_s2; + QLabel* txt_extend; + QSlider* sl_sigma; + QSlider* sl_thresh; + QSlider* sl_m1; + QSlider* sl_s1; + QSlider* sl_s2; + QSlider* sl_extend; + QSpinBox* sb_thresh; + QSpinBox* sb_m1; + QSpinBox* sb_s1; + QSpinBox* sb_s2; // QPushButton *pushexec; - QRadioButton *rb_fastmarch; - QRadioButton *rb_fuzzy; - QRadioButton *rb_drag; - QRadioButton *rb_slider; - QButtonGroup *bg_method; - QButtonGroup *bg_interact; + QRadioButton* rb_fastmarch; + QRadioButton* rb_fuzzy; + QRadioButton* rb_drag; + QRadioButton* rb_slider; + QButtonGroup* bg_method; + QButtonGroup* bg_interact; void getrange(); float sigma, thresh, m1, s1, s2; float sigmamax; @@ -106,13 +107,10 @@ class FastmarchingFuzzyWidget : public WidgetInterface std::vector vpdyn_arg; signals: - void vpdyn_changed(std::vector *vpdyn_arg); - -public slots: - void slicenr_changed(); + void vpdyn_changed(std::vector* vpdyn_arg); private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); //void mouse_clicked(Point p); //void mouse_released(Point p); //void mouse_moved(Point p); diff --git a/iSeg/FeatureWidget.cpp b/iSeg/FeatureWidget.cpp index 4366e947..78fbc6d1 100755 --- a/iSeg/FeatureWidget.cpp +++ b/iSeg/FeatureWidget.cpp @@ -40,14 +40,14 @@ using namespace iseg; FeatureWidget::FeatureWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format( - "Obtain information about the gray value and tissue distribution." - "
" - "A rectangular area is marked by pressing down the left mouse " - "button and moving the mouse.")); + "Obtain information about the gray value and tissue distribution." + "
" + "A rectangular area is marked by pressing down the left mouse " + "button and moving the mouse.")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -87,7 +87,7 @@ FeatureWidget::FeatureWidget(SlicesHandler* hand3D, QWidget* parent, vbox2->setFixedSize(vbox2->sizeHint()); // BL: hack to make layout wide enought to show very long tissue names vbox3->setFixedSize(3 * vbox3->sizeHint().width(), - vbox3->sizeHint().height()); + vbox3->sizeHint().height()); hbox1->setFixedSize(hbox1->sizeHint()); lb_map_value->setText("Source:"); @@ -125,20 +125,20 @@ void FeatureWidget::on_mouse_moved(Point p) Pair psize = handler3D->get_pixelsize(); lb_pt_value->setText(QString::number(handler3D->return_width() - 1 - p.px) + - QString(":") + QString::number(p.py)); + QString(":") + QString::number(p.py)); lb_work_pt_value->setText( - QString("(") + - QString::number((handler3D->return_width() - 1 - p.px) * psize.high) + - QString(":") + QString::number(p.py * psize.low) + QString(" mm)")); + QString("(") + + QString::number((handler3D->return_width() - 1 - p.px) * psize.high) + + QString(":") + QString::number(p.py * psize.low) + QString(" mm)")); lb_grey_value->setText(QString::number(bmphand->bmp_pt(p))); lb_work_grey_value->setText(QString::number(bmphand->work_pt(p))); tissues_size_t tnr = - bmphand->tissues_pt(handler3D->get_active_tissuelayer(), p); + bmphand->tissues_pt(handler3D->get_active_tissuelayer(), p); if (tnr == 0) lb_tissuename->setText("- (0)"); else lb_tissuename->setText(TissueInfos::GetTissueName(tnr) + QString(" (") + - QString::number((int)tnr) + QString(")")); + QString::number((int)tnr) + QString(")")); return; } @@ -166,19 +166,18 @@ void FeatureWidget::on_mouse_released(Point p) lb_work_stddev_value->setText(QString::number(stddev)); lb_work_min_value->setText(QString::number(extrema.low)); lb_work_max_value->setText(QString::number(extrema.high)); - - return; } -void FeatureWidget::slicenr_changed() +void FeatureWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); - // } } -void FeatureWidget::init() { slicenr_changed(); } +void FeatureWidget::init() +{ + on_slicenr_changed(); +} void FeatureWidget::newloaded() { diff --git a/iSeg/FeatureWidget.h b/iSeg/FeatureWidget.h index 183cc699..d5ba07bf 100755 --- a/iSeg/FeatureWidget.h +++ b/iSeg/FeatureWidget.h @@ -42,8 +42,8 @@ class FeatureWidget : public WidgetInterface { Q_OBJECT public: - FeatureWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + FeatureWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); void init(); void newloaded(); QSize sizeHint() const override; @@ -51,50 +51,48 @@ class FeatureWidget : public WidgetInterface QIcon GetIcon(QDir picdir) { return QIcon(picdir.absFilePath(QString("feature.png")).ascii()); } private: + void on_slicenr_changed() override; void on_mouse_clicked(Point p) override; void on_mouse_moved(Point p) override; void on_mouse_released(Point p) override; bool selecting; std::vector dynamic; - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; - Q3VBox *vbox1; - Q3VBox *vbox2; - Q3VBox *vbox3; - Q3HBox *hbox1; - QLabel *lb_map; - QLabel *lb_av; - QLabel *lb_stddev; - QLabel *lb_min; - QLabel *lb_max; - QLabel *lb_pt; - QLabel *lb_tissue; - QLabel *lb_grey; - QLabel *lb_map_value; - QLabel *lb_av_value; - QLabel *lb_stddev_value; - QLabel *lb_min_value; - QLabel *lb_max_value; - QLabel *lb_pt_value; - QLabel *lb_grey_value; - QLabel *lb_work_map_value; - QLabel *lb_work_av_value; - QLabel *lb_work_stddev_value; - QLabel *lb_work_min_value; - QLabel *lb_work_max_value; - QLabel *lb_work_pt_value; - QLabel *lb_work_grey_value; - QLabel *lb_tissuename; - QLabel *lb_dummy; + Q3VBox* vbox1; + Q3VBox* vbox2; + Q3VBox* vbox3; + Q3HBox* hbox1; + QLabel* lb_map; + QLabel* lb_av; + QLabel* lb_stddev; + QLabel* lb_min; + QLabel* lb_max; + QLabel* lb_pt; + QLabel* lb_tissue; + QLabel* lb_grey; + QLabel* lb_map_value; + QLabel* lb_av_value; + QLabel* lb_stddev_value; + QLabel* lb_min_value; + QLabel* lb_max_value; + QLabel* lb_pt_value; + QLabel* lb_grey_value; + QLabel* lb_work_map_value; + QLabel* lb_work_av_value; + QLabel* lb_work_stddev_value; + QLabel* lb_work_min_value; + QLabel* lb_work_max_value; + QLabel* lb_work_pt_value; + QLabel* lb_work_grey_value; + QLabel* lb_tissuename; + QLabel* lb_dummy; Point pstart; signals: - void vpdyn_changed(std::vector *vpdyn); - -public slots: - void slicenr_changed(); + void vpdyn_changed(std::vector* vpdyn); }; } // namespace iseg diff --git a/iSeg/HystereticGrowingWidget.cpp b/iSeg/HystereticGrowingWidget.cpp index 06c8d890..0bef4c0e 100755 --- a/iSeg/HystereticGrowingWidget.cpp +++ b/iSeg/HystereticGrowingWidget.cpp @@ -39,8 +39,8 @@ using namespace std; using namespace iseg; -HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler *hand3D, QWidget *parent, - const char *name, Qt::WindowFlags wFlags) +HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* parent, + const char* name, Qt::WindowFlags wFlags) : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Segment a tissue by picking seed points and adding " @@ -164,25 +164,19 @@ HystereticGrowingWidget::HystereticGrowingWidget(SlicesHandler *hand3D, QWidget init1(); } -HystereticGrowingWidget::~HystereticGrowingWidget() { delete vbox1; } - -void HystereticGrowingWidget::slicenr_changed() +void HystereticGrowingWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } -void HystereticGrowingWidget::bmphand_changed(bmphandler *bmph) +void HystereticGrowingWidget::bmphand_changed(bmphandler* bmph) { bmphand = bmph; getrange(); init1(); - - return; } void HystereticGrowingWidget::on_mouse_clicked(Point p) @@ -425,7 +419,7 @@ void HystereticGrowingWidget::newloaded() bmphand = handler3D->get_activebmphandler(); getrange(); - vector> *vvp = bmphand->return_limits(); + vector>* vvp = bmphand->return_limits(); vp1.clear(); for (vector>::iterator it = vvp->begin(); it != vvp->end(); it++) @@ -440,7 +434,7 @@ void HystereticGrowingWidget::init1() limitdrawing = false; drawlimit->setDown(false); - vector> *vvp = bmphand->return_limits(); + vector>* vvp = bmphand->return_limits(); vp1.clear(); for (vector>::iterator it = vvp->begin(); it != vvp->end(); it++) @@ -548,7 +542,7 @@ void HystereticGrowingWidget::saveborders_execute() (upper_limit - lower_limit) * 0.005f * sl_upper->value(); float ul = ll + (uu - ll) * 0.005f * sl_lowerhyster->value(); float lu = ll + (uu - ll) * 0.005f * sl_upperhyster->value(); - FILE *fp = fopen(savefilename.ascii(), "w"); + FILE* fp = fopen(savefilename.ascii(), "w"); fprintf(fp, "%f %f %f %f \n", ll, ul, lu, uu); fclose(fp); } @@ -563,7 +557,7 @@ void HystereticGrowingWidget::loadborders_execute() if (!loadfilename.isEmpty()) { - FILE *fp = fopen(loadfilename.ascii(), "r"); + FILE* fp = fopen(loadfilename.ascii(), "r"); if (fp != NULL) { float ll, uu, lu, ul; @@ -758,7 +752,7 @@ void HystereticGrowingWidget::le_bordervaluh_returnpressed() } } -FILE *HystereticGrowingWidget::SaveParams(FILE *fp, int version) +FILE* HystereticGrowingWidget::SaveParams(FILE* fp, int version) { if (version >= 2) { @@ -783,7 +777,7 @@ FILE *HystereticGrowingWidget::SaveParams(FILE *fp, int version) return fp; } -FILE *HystereticGrowingWidget::LoadParams(FILE *fp, int version) +FILE* HystereticGrowingWidget::LoadParams(FILE* fp, int version) { if (version >= 2) { diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index 9ab24b88..d9e9cac5 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -41,20 +41,21 @@ class HystereticGrowingWidget : public WidgetInterface { Q_OBJECT public: - HystereticGrowingWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); - ~HystereticGrowingWidget(); + HystereticGrowingWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); + ~HystereticGrowingWidget() {} void init() override; void newloaded() override; void cleanup() override; QSize sizeHint() const override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Growing"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("growing.png"))); } private: + void on_slicenr_changed() override; void on_mouse_clicked(Point p) override; void on_mouse_moved(Point p) override; void on_mouse_released(Point p) override; @@ -62,60 +63,57 @@ class HystereticGrowingWidget : public WidgetInterface void init1(); Point p1; Point last_pt; - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; float upper_limit; float lower_limit; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox2a; - Q3HBox *hbox3; - Q3VBox *vbox1; - Q3VBox *vbox2; - Q3VBox *vbox3; - Q3VBox *vbox4; - Q3VBox *vbox5; - Q3VBox *vbox6; - Q3VBox *vbox7; - QLabel *txt_lower; - QLabel *txt_upper; - QLabel *txt_lowerhyster; - QLabel *txt_upperhyster; - QSlider *sl_lower; - QSlider *sl_upper; - QSlider *sl_lowerhyster; - QSlider *sl_upperhyster; - QPushButton *pushexec; - QPushButton *drawlimit; - QPushButton *clearlimit; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox2a; + Q3HBox* hbox3; + Q3VBox* vbox1; + Q3VBox* vbox2; + Q3VBox* vbox3; + Q3VBox* vbox4; + Q3VBox* vbox5; + Q3VBox* vbox6; + Q3VBox* vbox7; + QLabel* txt_lower; + QLabel* txt_upper; + QLabel* txt_lowerhyster; + QLabel* txt_upperhyster; + QSlider* sl_lower; + QSlider* sl_upper; + QSlider* sl_lowerhyster; + QSlider* sl_upperhyster; + QPushButton* pushexec; + QPushButton* drawlimit; + QPushButton* clearlimit; bool limitdrawing; - QCheckBox *autoseed; - QCheckBox *allslices; + QCheckBox* autoseed; + QCheckBox* allslices; void getrange(); void getrange_sub(float ll, float uu, float ul, float lu); std::vector vp1; std::vector vpdyn; void execute1(); bool dontundo; - QLineEdit *le_bordervall; - QLineEdit *le_bordervalu; - QLineEdit *le_bordervallh; - QLineEdit *le_bordervaluh; - QPushButton *pb_saveborders; - QPushButton *pb_loadborders; + QLineEdit* le_bordervall; + QLineEdit* le_bordervalu; + QLineEdit* le_bordervallh; + QLineEdit* le_bordervaluh; + QPushButton* pb_saveborders; + QPushButton* pb_loadborders; signals: - void vpdyn_changed(std::vector *vpdyn_arg); - void vp1_changed(std::vector *vp1_arg); - void vp1dyn_changed(std::vector *vp1_arg, - std::vector *vpdyn_arg); - -public slots: - void slicenr_changed(); + void vpdyn_changed(std::vector* vpdyn_arg); + void vp1_changed(std::vector* vp1_arg); + void vp1dyn_changed(std::vector* vp1_arg, + std::vector* vpdyn_arg); private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void auto_toggled(); void update_visible(); void execute(); diff --git a/iSeg/LivewireWidget.cpp b/iSeg/LivewireWidget.cpp index ac7e28b8..65c2f570 100755 --- a/iSeg/LivewireWidget.cpp +++ b/iSeg/LivewireWidget.cpp @@ -38,8 +38,8 @@ using namespace std; using namespace iseg; -LivewireWidget::LivewireWidget(SlicesHandler *hand3D, QWidget *parent, - const char *name, Qt::WindowFlags wFlags) +LivewireWidget::LivewireWidget(SlicesHandler* hand3D, QWidget* parent, + const char* name, Qt::WindowFlags wFlags) : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Use the Auto Trace to follow ideal contour path or draw " @@ -571,21 +571,13 @@ void LivewireWidget::bmp_changed() init1(); } -/*void livewire_widget::mode_changed() +void LivewireWidget::on_slicenr_changed() { - if(autotrace->isOn()){ - } -}*/ - -void LivewireWidget::slicenr_changed() -{ - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } -void LivewireWidget::bmphand_changed(bmphandler *bmph) +void LivewireWidget::bmphand_changed(bmphandler* bmph) { bmphand = bmph; @@ -661,7 +653,7 @@ void LivewireWidget::sbfreezing_changed(int i) tlimit2 = (float(i) + 0.5f) * 1000; } -FILE *LivewireWidget::SaveParams(FILE *fp, int version) +FILE* LivewireWidget::SaveParams(FILE* fp, int version) { if (version >= 2) { @@ -683,7 +675,7 @@ FILE *LivewireWidget::SaveParams(FILE *fp, int version) return fp; } -FILE *LivewireWidget::LoadParams(FILE *fp, int version) +FILE* LivewireWidget::LoadParams(FILE* fp, int version) { if (version >= 2) { diff --git a/iSeg/LivewireWidget.h b/iSeg/LivewireWidget.h index 9f22c6a5..0305fd27 100755 --- a/iSeg/LivewireWidget.h +++ b/iSeg/LivewireWidget.h @@ -45,28 +45,30 @@ class LivewireWidget : public WidgetInterface { Q_OBJECT public: - LivewireWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + LivewireWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~LivewireWidget(); void init() override; void newloaded() override; void cleanup() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; QSize sizeHint() const override; std::string GetName() override { return std::string("Contour"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("contour.png"))); } private: + void on_slicenr_changed() override; + void on_mouse_clicked(Point p) override; void on_mouse_moved(Point p) override; void on_mouse_released(Point p) override; void init1(); - ImageForestingTransformLivewire *lw; - ImageForestingTransformLivewire *lwfirst; + ImageForestingTransformLivewire* lw; + ImageForestingTransformLivewire* lwfirst; // bool isactive; bool drawing; @@ -79,38 +81,35 @@ class LivewireWidget : public WidgetInterface int tlimit1; int tlimit2; bool cooling; - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; - Q3VBox *vbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - QCheckBox *cb_freezing; - QCheckBox *cb_closing; - QSpinBox *sb_freezing; - QLabel *lb_freezing1; - QLabel *lb_freezing2; - QPushButton *pushexec; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; + Q3VBox* vbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + QCheckBox* cb_freezing; + QCheckBox* cb_closing; + QSpinBox* sb_freezing; + QLabel* lb_freezing1; + QLabel* lb_freezing2; + QPushButton* pushexec; bool straightmode; - QRadioButton *autotrace; - QRadioButton *straight; - QRadioButton *freedraw; - QButtonGroup *drawmode; + QRadioButton* autotrace; + QRadioButton* straight; + QRadioButton* freedraw; + QButtonGroup* drawmode; Point p1, p2; std::vector establishedlengths; signals: - void vp1_changed(std::vector *vp1); - void vpdyn_changed(std::vector *vpdyn); - void vp1dyn_changed(std::vector *vp1, std::vector *vpdyn); - -public slots: - void slicenr_changed(); + void vp1_changed(std::vector* vp1); + void vpdyn_changed(std::vector* vpdyn); + void vp1dyn_changed(std::vector* vp1, std::vector* vpdyn); private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); // void bmphand_changed(bmphandler *bmph); void pt_doubleclicked(Point p); void pt_midclicked(Point p); diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 8eb561be..3cf462ec 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -7262,6 +7262,8 @@ void MainWindow::tab_changed(QWidget* qw) if (tab_old) // generic slots from WidgetInterface { + tab_old->cleanup(); + QObject::disconnect(bmp_show, SIGNAL(mousepressed_sign(Point)), tab_old, SLOT(mouse_clicked(Point))); QObject::disconnect(bmp_show, SIGNAL(mousemoved_sign(Point)), tab_old, @@ -7283,8 +7285,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == measurement_widget) { - measurement_widget->cleanup(); - // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, SLOT(marks_changed())); QObject::disconnect(measurement_widget, @@ -7299,25 +7299,18 @@ void MainWindow::tab_changed(QWidget* qw) QObject::disconnect(measurement_widget, SIGNAL(vpdyn_changed(std::vector*)), work_show, SLOT(set_vpdyn(std::vector*))); - QObject::disconnect( - measurement_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*, bool)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); - QObject::disconnect( - measurement_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*, bool)), - work_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); + QObject::disconnect(measurement_widget, + SIGNAL(vp1dyn_changed(std::vector*, std::vector*, bool)), + bmp_show, SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); + QObject::disconnect(measurement_widget, + SIGNAL(vp1dyn_changed(std::vector*, std::vector*, bool)), + work_show, SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); work_show->setMouseTracking(false); bmp_show->setMouseTracking(false); } else if (tab_old == vesselextr_widget) { - vesselextr_widget->cleanup(); QObject::disconnect(this, SIGNAL(marks_changed()), measurement_widget, SLOT(marks_changed())); QObject::disconnect(vesselextr_widget, @@ -7326,14 +7319,11 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == wshed_widget) { - // QObject::connect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::disconnect(this, SIGNAL(marks_changed()), wshed_widget, SLOT(marks_changed())); } else if (tab_old == hyst_widget) { - hyst_widget->cleanup(); - QObject::disconnect(this, SIGNAL(bmp_changed()), hyst_widget, SLOT(bmp_changed())); @@ -7351,8 +7341,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == lw_widget) { - lw_widget->cleanup(); - QObject::disconnect(this, SIGNAL(bmp_changed()), lw_widget, SLOT(bmp_changed())); QObject::disconnect(bmp_show, SIGNAL(mousedoubleclick_sign(Point)), @@ -7376,8 +7364,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == iftrg_widget) { - iftrg_widget->cleanup(); - QObject::disconnect(this, SIGNAL(bmp_changed()), iftrg_widget, SLOT(bmp_changed())); @@ -7389,8 +7375,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == FMF_widget) { - FMF_widget->cleanup(); - QObject::disconnect(this, SIGNAL(bmp_changed()), FMF_widget, SLOT(bmp_changed())); @@ -7400,8 +7384,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == OutlineCorrect_widget) { - OutlineCorrect_widget->cleanup(); - QObject::disconnect(this, SIGNAL(work_changed()), OutlineCorrect_widget, SLOT(workbits_changed())); @@ -7431,8 +7413,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == pickerwidget) { - pickerwidget->cleanup(); - QObject::disconnect(pickerwidget, SIGNAL(vp1_changed(std::vector*)), bmp_show, SLOT(set_vp1(std::vector*))); @@ -7442,8 +7422,6 @@ void MainWindow::tab_changed(QWidget* qw) } else if (tab_old == transfrmWidget) { - transfrmWidget->cleanup(); - QObject::disconnect(this, SIGNAL(bmp_changed()), transfrmWidget, SLOT(bmp_changed())); QObject::disconnect(this, SIGNAL(work_changed()), transfrmWidget, @@ -7454,7 +7432,7 @@ void MainWindow::tab_changed(QWidget* qw) // connect signal-slots new widget - if (qw) // generic slots from WidgetInterface + if (auto widget = dynamic_cast(qw)) // generic slots from WidgetInterface { QObject::connect(bmp_show, SIGNAL(mousepressed_sign(Point)), qw, SLOT(mouse_clicked(Point))); @@ -7491,18 +7469,12 @@ void MainWindow::tab_changed(QWidget* qw) QObject::connect(measurement_widget, SIGNAL(vpdyn_changed(std::vector*)), work_show, SLOT(set_vpdyn(std::vector*))); - QObject::connect( - measurement_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*, bool)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); - QObject::connect( - measurement_widget, - SIGNAL( - vp1dyn_changed(std::vector*, std::vector*, bool)), - work_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); + QObject::connect(measurement_widget, + SIGNAL(vp1dyn_changed(std::vector*, std::vector*, bool)), + bmp_show, SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); + QObject::connect(measurement_widget, + SIGNAL(vp1dyn_changed(std::vector*, std::vector*, bool)), + work_show, SLOT(set_vp1_dyn(std::vector*, std::vector*, bool))); work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); @@ -7517,10 +7489,8 @@ void MainWindow::tab_changed(QWidget* qw) } else if (qw == wshed_widget) { - // QObject::disconnect(this,SIGNAL(marks_changed()),work_show,SLOT(mark_changed())); QObject::connect(this, SIGNAL(marks_changed()), wshed_widget, SLOT(marks_changed())); - // wshed_widget->init(); } else if (qw == hyst_widget) { @@ -7536,8 +7506,6 @@ void MainWindow::tab_changed(QWidget* qw) SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), bmp_show, SLOT(set_vp1_dyn(std::vector*, std::vector*))); - - // hyst_widget->init(); } else if (qw == lw_widget) { @@ -7553,13 +7521,10 @@ void MainWindow::tab_changed(QWidget* qw) bmp_show, SLOT(set_vp1(std::vector*))); QObject::connect(lw_widget, SIGNAL(vpdyn_changed(std::vector*)), bmp_show, SLOT(set_vpdyn(std::vector*))); - QObject::connect( - lw_widget, + QObject::connect(lw_widget, SIGNAL(vp1dyn_changed(std::vector*, std::vector*)), - bmp_show, - SLOT(set_vp1_dyn(std::vector*, std::vector*))); + bmp_show, SLOT(set_vp1_dyn(std::vector*, std::vector*))); - // lw_widget->init(); bmp_show->setMouseTracking(true); } else if (qw == iftrg_widget) @@ -7606,12 +7571,10 @@ void MainWindow::tab_changed(QWidget* qw) work_show->setMouseTracking(true); bmp_show->setMouseTracking(true); - // feature_widget->init(); } else if (qw == interpolwidget) { - // QObject::connect(tissueTreeWidget,SIGNAL(activated(int)),interpolwidget,SLOT(tissuenr_changed(int))); - // QObject::connect(tissueTreeWidget,SIGNAL(activated(int)),this,SLOT(tissuenr_changed(int))); + // anything? } else if (qw == pickerwidget) { diff --git a/iSeg/MorphologyWidget.cpp b/iSeg/MorphologyWidget.cpp index fdadeba1..1b4d5dd0 100755 --- a/iSeg/MorphologyWidget.cpp +++ b/iSeg/MorphologyWidget.cpp @@ -34,17 +34,17 @@ using namespace iseg; MorphologyWidget::MorphologyWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip( - Format("Apply morphological operations to the Target image. " - "Morphological operations are " - "based on expanding or shrinking (Dilate/Erode) regions by " - "a given number of pixel layers (n)." - "
" - "The functions act on the Target image (to modify a tissue " - "use Get Tissue and Adder).")); + Format("Apply morphological operations to the Target image. " + "Morphological operations are " + "based on expanding or shrinking (Dilate/Erode) regions by " + "a given number of pixel layers (n)." + "
" + "The functions act on the Target image (to modify a tissue " + "use Get Tissue and Adder).")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -63,30 +63,30 @@ MorphologyWidget::MorphologyWidget(SlicesHandler* hand3D, QWidget* parent, connectgroup = new QButtonGroup(this); connectgroup->insert( - rb_4connect = new QRadioButton(QString("4-connectivity"), hbox2)); + rb_4connect = new QRadioButton(QString("4-connectivity"), hbox2)); connectgroup->insert( - rb_8connect = new QRadioButton(QString("8-connectivity"), hbox2)); + rb_8connect = new QRadioButton(QString("8-connectivity"), hbox2)); rb_4connect->setChecked(TRUE); modegroup = new QButtonGroup(this); modegroup->insert(rb_open = new QRadioButton(QString("Open"), vboxmethods)); modegroup->insert(rb_close = - new QRadioButton(QString("Close"), vboxmethods)); + new QRadioButton(QString("Close"), vboxmethods)); modegroup->insert(rb_erode = - new QRadioButton(QString("Erode"), vboxmethods)); + new QRadioButton(QString("Erode"), vboxmethods)); modegroup->insert(rb_dilate = - new QRadioButton(QString("Dilate"), vboxmethods)); + new QRadioButton(QString("Dilate"), vboxmethods)); rb_open->setChecked(TRUE); rb_open->setToolTip(Format( - "First shrinking before growing is called Open and results in the " - "deletion of small islands and thin links between structures.")); + "First shrinking before growing is called Open and results in the " + "deletion of small islands and thin links between structures.")); rb_close->setToolTip(Format("Growing followed by shrinking results in the " - "closing of small (< 2n) gaps and holes.")); + "closing of small (< 2n) gaps and holes.")); rb_erode->setToolTip(Format( - "Erode or shrink the boundaries of regions of foreground pixels.")); + "Erode or shrink the boundaries of regions of foreground pixels.")); rb_dilate->setToolTip( - Format("Enlarge the boundaries of regions of foreground pixels.")); + Format("Enlarge the boundaries of regions of foreground pixels.")); vboxmethods->setMargin(5); vbox1->setMargin(5); @@ -169,18 +169,15 @@ void MorphologyWidget::execute() QSize MorphologyWidget::sizeHint() const { return vbox1->sizeHint(); } -void MorphologyWidget::slicenr_changed() +void MorphologyWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } void MorphologyWidget::bmphand_changed(bmphandler* bmph) { bmphand = bmph; - return; } void MorphologyWidget::init() diff --git a/iSeg/MorphologyWidget.h b/iSeg/MorphologyWidget.h index c6f06569..a5a2a44a 100755 --- a/iSeg/MorphologyWidget.h +++ b/iSeg/MorphologyWidget.h @@ -35,45 +35,44 @@ class MorphologyWidget : public WidgetInterface { Q_OBJECT public: - MorphologyWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + MorphologyWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~MorphologyWidget(); QSize sizeHint() const override; void init() override; void newloaded() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Morpho"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("morphology.png"))); } private: - bmphandler *bmphand; - SlicesHandler *handler3D; - unsigned short activeslice; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3VBox *vbox1; - QLabel *txt_n; - QSpinBox *sb_n; - QPushButton *btn_exec; - QRadioButton *rb_8connect; - QRadioButton *rb_4connect; - QButtonGroup *connectgroup; - QRadioButton *rb_open; - QRadioButton *rb_close; - QRadioButton *rb_erode; - QRadioButton *rb_dilate; - QButtonGroup *modegroup; - QCheckBox *allslices; + void on_slicenr_changed() override; -public slots: - void slicenr_changed(); + bmphandler* bmphand; + SlicesHandler* handler3D; + unsigned short activeslice; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3VBox* vbox1; + QLabel* txt_n; + QSpinBox* sb_n; + QPushButton* btn_exec; + QRadioButton* rb_8connect; + QRadioButton* rb_4connect; + QButtonGroup* connectgroup; + QRadioButton* rb_open; + QRadioButton* rb_close; + QRadioButton* rb_erode; + QRadioButton* rb_dilate; + QButtonGroup* modegroup; + QCheckBox* allslices; private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void execute(); }; diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index e38f7b49..c9ee4952 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -36,16 +36,16 @@ class OutlineCorrectionWidget : public WidgetInterface { Q_OBJECT public: - OutlineCorrectionWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + OutlineCorrectionWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~OutlineCorrectionWidget(); QSize sizeHint() const override; void cleanup() override; void init() override; void newloaded() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("OLC"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("olc.png"))); } @@ -53,7 +53,7 @@ class OutlineCorrectionWidget : public WidgetInterface void Select_selected_tissue_BG(QString tissueName, tissues_size_t nr); void Select_selected_tissue_TS(QString tissueName, tissues_size_t nr); -protected: +private: void on_tissuenr_changed(int i) override; void on_slicenr_changed() override; @@ -61,86 +61,86 @@ class OutlineCorrectionWidget : public WidgetInterface void on_mouse_released(Point p) override; void on_mouse_moved(Point p) override; -private: + void draw_circle(Point p); + tissues_size_t tissuenr; tissues_size_t tissuenrnew; float f; bool draw; bool selectobj; - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; float spacing[3]; Point last_pt; - Q3VBox *vbox1; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox2a; - Q3HBox *hbox3a; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; + Q3VBox* vbox1; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox2a; + Q3HBox* hbox3a; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; // Q3HBox *hbox3; // Q3HBox *hbox3cont; - Q3HBox *hbox4; - Q3HBox *hbox5o; - Q3HBox *hbox5; - Q3HBox *hbox6; - Q3HBox *hboxpixormm; - QRadioButton *brush; - QRadioButton *olcorr; - QRadioButton *holefill; - QRadioButton *removeislands; - QRadioButton *gapfill; - QRadioButton *allfill; - QRadioButton *addskin; - QRadioButton *fillskin; - QButtonGroup *method; - QRadioButton *tissue; - QRadioButton *work; - QButtonGroup *target; - QRadioButton *erasebrush; - QRadioButton *drawbrush; - QRadioButton *modifybrush; - QRadioButton *adapt; - QButtonGroup *brushtype; - QRadioButton *inside; - QRadioButton *outside; - QButtonGroup *in_or_out; - QRadioButton *pixel; - QRadioButton *mm; - QButtonGroup *pixelormm; - QLabel *txt_unit; - QLabel *txt_radius; - QSpinBox *sb_radius; - QLineEdit *mm_radius; - QLabel *txt_holesize; - QLabel *txt_gapsize; - QSpinBox *sb_holesize; - QSpinBox *sb_gapsize; - QPushButton *pb_removeholes; - QPushButton *pb_selectobj; - QCheckBox *allslices; - void draw_circle(Point p); + Q3HBox* hbox4; + Q3HBox* hbox5o; + Q3HBox* hbox5; + Q3HBox* hbox6; + Q3HBox* hboxpixormm; + QRadioButton* brush; + QRadioButton* olcorr; + QRadioButton* holefill; + QRadioButton* removeislands; + QRadioButton* gapfill; + QRadioButton* allfill; + QRadioButton* addskin; + QRadioButton* fillskin; + QButtonGroup* method; + QRadioButton* tissue; + QRadioButton* work; + QButtonGroup* target; + QRadioButton* erasebrush; + QRadioButton* drawbrush; + QRadioButton* modifybrush; + QRadioButton* adapt; + QButtonGroup* brushtype; + QRadioButton* inside; + QRadioButton* outside; + QButtonGroup* in_or_out; + QRadioButton* pixel; + QRadioButton* mm; + QButtonGroup* pixelormm; + QLabel* txt_unit; + QLabel* txt_radius; + QSpinBox* sb_radius; + QLineEdit* mm_radius; + QLabel* txt_holesize; + QLabel* txt_gapsize; + QSpinBox* sb_holesize; + QSpinBox* sb_gapsize; + QPushButton* pb_removeholes; + QPushButton* pb_selectobj; + QCheckBox* allslices; std::vector vpdyn; bool dontundo; - Q3HBox *tissuesListBackground; - Q3HBox *tissuesListSkin; - QPushButton *getCurrentTissueBackground; - QPushButton *getCurrentTissueSkin; - QLineEdit *backgroundText; - QLineEdit *skinText; + Q3HBox* tissuesListBackground; + Q3HBox* tissuesListSkin; + QPushButton* getCurrentTissueBackground; + QPushButton* getCurrentTissueSkin; + QLineEdit* backgroundText; + QLineEdit* skinText; tissues_size_t selectedBacgroundID; tissues_size_t selectedSkinID; bool backgroundSelected; bool skinSelected; -public: - QCheckBox *fb; - QCheckBox *bg; + //public: + QCheckBox* fb; + QCheckBox* bg; signals: - void vpdyn_changed(std::vector *vpdyn_arg); + void vpdyn_changed(std::vector* vpdyn_arg); void signal_request_selected_tissue_TS(); // TODO BL hack void signal_request_selected_tissue_BG(); @@ -153,7 +153,7 @@ public slots: void request_selected_tissue_TS(); private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void method_changed(); void removeholes_pushed(); void selectobj_pushed(); diff --git a/iSeg/PickerWidget.cpp b/iSeg/PickerWidget.cpp index 37a7b60e..a448ea17 100755 --- a/iSeg/PickerWidget.cpp +++ b/iSeg/PickerWidget.cpp @@ -22,12 +22,12 @@ using namespace iseg; PickerWidget::PickerWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Copy and erase regions. Copying can be used to transfer " - "segmented regions from one slice to another. All the " - "functions are based on the current region selection.")); + "segmented regions from one slice to another. All the " + "functions are based on the current region selection.")); bmphand = handler3D->get_activebmphandler(); @@ -54,7 +54,7 @@ PickerWidget::PickerWidget(SlicesHandler* hand3D, QWidget* parent, rb_erase->setToolTip(Format("The deleted regions will be left empty.")); rb_fill = new QRadioButton(QString("Fill"), hbox2); rb_fill->setToolTip( - Format("Fill the resulting hole based on the neighboring regions.")); + Format("Fill the resulting hole based on the neighboring regions.")); erasefillgroup = new QButtonGroup(this); erasefillgroup->insert(rb_erase); erasefillgroup->insert(rb_fill); @@ -66,13 +66,13 @@ PickerWidget::PickerWidget(SlicesHandler* hand3D, QWidget* parent, pb_paste->setToolTip(Format("Clip-board is pasted into the current slice")); pb_cut = new QPushButton("Cut", hbox3); pb_cut->setToolTip( - Format("Tissues or target image pixels inside the region " - "selection are erased but a copy " - "is placed on the clipboard.")); + Format("Tissues or target image pixels inside the region " + "selection are erased but a copy " + "is placed on the clipboard.")); pb_delete = new QPushButton("Delete", hbox3); pb_delete->setToolTip( - Format("Tissues (resp. target image pixels) inside the " - "region selection are erased.")); + Format("Tissues (resp. target image pixels) inside the " + "region selection are erased.")); hbox1->setFixedSize(hbox1->sizeHint()); hbox2->setFixedSize(hbox2->sizeHint()); @@ -85,12 +85,12 @@ PickerWidget::PickerWidget(SlicesHandler* hand3D, QWidget* parent, showborder(); QObject::connect(worktissuegroup, SIGNAL(buttonClicked(int)), this, - SLOT(worktissue_changed(int))); + SLOT(worktissue_changed(int))); QObject::connect(pb_copy, SIGNAL(clicked()), this, SLOT(copy_pressed())); QObject::connect(pb_paste, SIGNAL(clicked()), this, SLOT(paste_pressed())); QObject::connect(pb_cut, SIGNAL(clicked()), this, SLOT(cut_pressed())); QObject::connect(pb_delete, SIGNAL(clicked()), this, - SLOT(delete_pressed())); + SLOT(delete_pressed())); } PickerWidget::~PickerWidget() @@ -128,11 +128,9 @@ void PickerWidget::bmphand_changed(bmphandler* bmph) hasclipboard = false; showborder(); } - - return; } -void PickerWidget::slicenr_changed() +void PickerWidget::on_slicenr_changed() { bmphand = handler3D->get_activebmphandler(); } @@ -172,7 +170,7 @@ FILE* PickerWidget::LoadParams(FILE* fp, int version) if (version >= 6) { QObject::disconnect(worktissuegroup, SIGNAL(buttonClicked(int)), this, - SLOT(worktissue_changed(int))); + SLOT(worktissue_changed(int))); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -187,7 +185,7 @@ FILE* PickerWidget::LoadParams(FILE* fp, int version) worktissue_changed(0); QObject::connect(worktissuegroup, SIGNAL(buttonClicked(int)), this, - SLOT(worktissue_changed(int))); + SLOT(worktissue_changed(int))); } return fp; } @@ -207,7 +205,7 @@ void PickerWidget::on_mouse_clicked(Point p) bmphand->change2mask_connectedwork(currentselection, p, addorsub); else bmphand->change2mask_connectedtissue( - handler3D->get_active_tissuelayer(), currentselection, p, addorsub); + handler3D->get_active_tissuelayer(), currentselection, p, addorsub); showborder(); } @@ -319,7 +317,7 @@ void PickerWidget::copy_pressed() else { tissues_size_t* tissues = - bmphand->return_tissues(handler3D->get_active_tissuelayer()); + bmphand->return_tissues(handler3D->get_active_tissuelayer()); for (unsigned int i = 0; i < area; i++) { valuedistrib[i] = (float)tissues[i]; @@ -359,7 +357,7 @@ void PickerWidget::paste_pressed() valuedistrib2[i] = (tissues_size_t)valuedistrib[i]; } bmphand->copy2tissue(handler3D->get_active_tissuelayer(), valuedistrib2, - mask); + mask); delete[] valuedistrib2; } @@ -385,10 +383,10 @@ void PickerWidget::delete_pressed() { if (rb_erase->isOn()) bmphand->erasetissue(handler3D->get_active_tissuelayer(), - currentselection); + currentselection); else bmphand->floodtissue(handler3D->get_active_tissuelayer(), - currentselection); + currentselection); } emit end_datachange(this); diff --git a/iSeg/PickerWidget.h b/iSeg/PickerWidget.h index 5624b327..78c7b635 100755 --- a/iSeg/PickerWidget.h +++ b/iSeg/PickerWidget.h @@ -35,11 +35,11 @@ class PickerWidget : public WidgetInterface { Q_OBJECT public: - PickerWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + PickerWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~PickerWidget(); - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const override; void init() override; void cleanup() override; @@ -48,43 +48,42 @@ class PickerWidget : public WidgetInterface QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("picker.png"))); } private: + void on_slicenr_changed() override; + void on_mouse_clicked(Point p) override; void update_active(); void showborder(); - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned int width; unsigned int height; bool hasclipboard; bool shiftpressed; bool clipboardworkortissue; - bool *mask; - bool *currentselection; - float *valuedistrib; + bool* mask; + bool* currentselection; + float* valuedistrib; unsigned char mode; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3VBox *vbox1; - QPushButton *pb_copy; - QPushButton *pb_paste; - QPushButton *pb_cut; - QPushButton *pb_delete; - QRadioButton *rb_work; - QRadioButton *rb_tissue; - QButtonGroup *worktissuegroup; - QRadioButton *rb_erase; - QRadioButton *rb_fill; - QButtonGroup *erasefillgroup; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3VBox* vbox1; + QPushButton* pb_copy; + QPushButton* pb_paste; + QPushButton* pb_cut; + QPushButton* pb_delete; + QRadioButton* rb_work; + QRadioButton* rb_tissue; + QButtonGroup* worktissuegroup; + QRadioButton* rb_erase; + QRadioButton* rb_fill; + QButtonGroup* erasefillgroup; std::vector selection; signals: - void vp1_changed(std::vector *vp1); - -public slots: - void slicenr_changed(); + void vp1_changed(std::vector* vp1); private slots: void copy_pressed(); @@ -93,11 +92,11 @@ private slots: void delete_pressed(); void worktissue_changed(int); - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); protected: - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); + void keyPressEvent(QKeyEvent* event); + void keyReleaseEvent(QKeyEvent* event); }; } // namespace iseg diff --git a/iSeg/SmoothingWidget.cpp b/iSeg/SmoothingWidget.cpp index c9399d4a..1b416633 100755 --- a/iSeg/SmoothingWidget.cpp +++ b/iSeg/SmoothingWidget.cpp @@ -34,8 +34,8 @@ using namespace iseg; SmoothingWidget::SmoothingWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Smoothing and noise removal filters.")); @@ -65,8 +65,8 @@ SmoothingWidget::SmoothingWidget(SlicesHandler* hand3D, QWidget* parent, sl_sigma->setRange(1, 100); sl_sigma->setValue(20); sl_sigma->setToolTip( - "Sigma gives the radius of the smoothing filter. Larger " - "values remove more details."); + "Sigma gives the radius of the smoothing filter. Larger " + "values remove more details."); txt_sigma2 = new QLabel(" 5", hbox2); txt_dt = new QLabel("dt: 1 ", hbox3); @@ -79,12 +79,12 @@ SmoothingWidget::SmoothingWidget(SlicesHandler* hand3D, QWidget* parent, sl_k->setRange(0, 100); sl_k->setValue(50); sl_k->setToolTip( - "Together with value on the right, defines the Sigma of the " - "smoothing filter."); + "Together with value on the right, defines the Sigma of the " + "smoothing filter."); sb_kmax = new QSpinBox(1, 100, 1, hbox4); sb_kmax->setValue(10); sb_kmax->setToolTip("Gives the max. radius of the smoothing filter. This " - "value defines the scale used in the slider bar."); + "value defines the scale used in the slider bar."); txt_restrain1 = new QLabel("Restraint: 0 ", hbox5); sl_restrain = new QSlider(Qt::Horizontal, hbox5); @@ -94,22 +94,22 @@ SmoothingWidget::SmoothingWidget(SlicesHandler* hand3D, QWidget* parent, rb_gaussian = new QRadioButton(QString("Gaussian"), vboxmethods); rb_gaussian->setToolTip("Gaussian smoothing blurs the image and can remove " - "noise and details (high frequency)."); + "noise and details (high frequency)."); rb_average = new QRadioButton(QString("Average"), vboxmethods); rb_average->setToolTip( - "Mean smoothing blurs the image and can remove noise and details."); + "Mean smoothing blurs the image and can remove noise and details."); rb_median = new QRadioButton(QString("Median"), vboxmethods); rb_median->setToolTip( - "Median filtering can remove (speckle or salt-and-pepper) noise."); + "Median filtering can remove (speckle or salt-and-pepper) noise."); rb_sigmafilter = new QRadioButton(QString("Sigma Filter"), vboxmethods); rb_sigmafilter->setToolTip( - "Sigma filtering is a mixture between Gaussian and Average filtering. " - "It " - "preserves edges better than Average filtering."); + "Sigma filtering is a mixture between Gaussian and Average filtering. " + "It " + "preserves edges better than Average filtering."); rb_anisodiff = - new QRadioButton(QString("Anisotropic Diffusion"), vboxmethods); + new QRadioButton(QString("Anisotropic Diffusion"), vboxmethods); rb_anisodiff->setToolTip("Anisotropic diffusion can remove noise, while " - "preserving significant details, such as edges."); + "preserving significant details, such as edges."); modegroup = new QButtonGroup(this); modegroup->insert(rb_gaussian); @@ -143,25 +143,25 @@ SmoothingWidget::SmoothingWidget(SlicesHandler* hand3D, QWidget* parent, method_changed(0); QObject::connect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::connect(pushexec, SIGNAL(clicked()), this, SLOT(execute())); QObject::connect(contdiff, SIGNAL(clicked()), this, SLOT(continue_diff())); QObject::connect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(sigmaslider_changed(int))); + SLOT(sigmaslider_changed(int))); QObject::connect(sl_sigma, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_sigma, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sl_k, SIGNAL(valueChanged(int)), this, - SLOT(kslider_changed(int))); + SLOT(kslider_changed(int))); QObject::connect(sl_k, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_k, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sb_n, SIGNAL(valueChanged(int)), this, - SLOT(n_changed(int))); + SLOT(n_changed(int))); QObject::connect(sb_kmax, SIGNAL(valueChanged(int)), this, - SLOT(kmax_changed(int))); + SLOT(kmax_changed(int))); return; } @@ -197,14 +197,14 @@ void SmoothingWidget::execute() else if (rb_sigmafilter->isOn()) { handler3D->sigmafilter( - (sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); + (sl_k->value() + 1) * 0.01f * sb_kmax->value(), + (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); } else { handler3D->aniso_diff(1.0f, sb_iter->value(), f2, - sl_k->value() * 0.01f * sb_kmax->value(), - sl_restrain->value() * 0.01f); + sl_k->value() * 0.01f * sb_kmax->value(), + sl_restrain->value() * 0.01f); } } else @@ -224,14 +224,14 @@ void SmoothingWidget::execute() else if (rb_sigmafilter->isOn()) { bmphand->sigmafilter((sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), - (short unsigned)sb_n->value()); + (short unsigned)sb_n->value(), + (short unsigned)sb_n->value()); } else { bmphand->aniso_diff(1.0f, sb_iter->value(), f2, - sl_k->value() * 0.01f * sb_kmax->value(), - sl_restrain->value() * 0.01f); + sl_k->value() * 0.01f * sb_kmax->value(), + sl_restrain->value() * 0.01f); } } emit end_datachange(this); @@ -321,14 +321,14 @@ void SmoothingWidget::continue_diff() if (allslices->isChecked()) { handler3D->cont_anisodiff(1.0f, sb_iter->value(), f2, - sl_k->value() * 0.01f * sb_kmax->value(), - sl_restrain->value() * 0.01f); + sl_k->value() * 0.01f * sb_kmax->value(), + sl_restrain->value() * 0.01f); } else { bmphand->cont_anisodiff(1.0f, sb_iter->value(), f2, - sl_k->value() * 0.01f * sb_kmax->value(), - sl_restrain->value() * 0.01f); + sl_k->value() * 0.01f * sb_kmax->value(), + sl_restrain->value() * 0.01f); } emit end_datachange(this); @@ -356,12 +356,12 @@ void SmoothingWidget::kslider_changed(int newval) { if (allslices->isChecked()) handler3D->sigmafilter( - (sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); + (sl_k->value() + 1) * 0.01f * sb_kmax->value(), + (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); else bmphand->sigmafilter((sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), - (short unsigned)sb_n->value()); + (short unsigned)sb_n->value(), + (short unsigned)sb_n->value()); emit end_datachange(this, iseg::NoUndo); } @@ -383,14 +383,14 @@ void SmoothingWidget::n_changed(int newval) if (allslices->isChecked()) { handler3D->sigmafilter( - (sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); + (sl_k->value() + 1) * 0.01f * sb_kmax->value(), + (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); } else { bmphand->sigmafilter((sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), - (short unsigned)sb_n->value()); + (short unsigned)sb_n->value(), + (short unsigned)sb_n->value()); } } else if (rb_average) @@ -422,14 +422,14 @@ void SmoothingWidget::kmax_changed(int newval) if (allslices->isChecked()) { handler3D->sigmafilter( - (sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); + (sl_k->value() + 1) * 0.01f * sb_kmax->value(), + (short unsigned)sb_n->value(), (short unsigned)sb_n->value()); } else { bmphand->sigmafilter((sl_k->value() + 1) * 0.01f * sb_kmax->value(), - (short unsigned)sb_n->value(), - (short unsigned)sb_n->value()); + (short unsigned)sb_n->value(), + (short unsigned)sb_n->value()); } } emit end_datachange(this); @@ -437,23 +437,20 @@ void SmoothingWidget::kmax_changed(int newval) QSize SmoothingWidget::sizeHint() const { return vbox1->sizeHint(); } -void SmoothingWidget::slicenr_changed() +void SmoothingWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } void SmoothingWidget::bmphand_changed(bmphandler* bmph) { bmphand = bmph; - return; } void SmoothingWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } @@ -522,15 +519,15 @@ FILE* SmoothingWidget::LoadParams(FILE* fp, int version) if (version >= 2) { QObject::disconnect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::disconnect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(sigmaslider_changed(int))); + SLOT(sigmaslider_changed(int))); QObject::disconnect(sl_k, SIGNAL(valueChanged(int)), this, - SLOT(kslider_changed(int))); + SLOT(kslider_changed(int))); QObject::disconnect(sb_n, SIGNAL(valueChanged(int)), this, - SLOT(n_changed(int))); + SLOT(n_changed(int))); QObject::disconnect(sb_kmax, SIGNAL(valueChanged(int)), this, - SLOT(kmax_changed(int))); + SLOT(kmax_changed(int))); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -561,15 +558,15 @@ FILE* SmoothingWidget::LoadParams(FILE* fp, int version) method_changed(0); QObject::connect(modegroup, SIGNAL(buttonClicked(int)), this, - SLOT(method_changed(int))); + SLOT(method_changed(int))); QObject::connect(sl_sigma, SIGNAL(valueChanged(int)), this, - SLOT(sigmaslider_changed(int))); + SLOT(sigmaslider_changed(int))); QObject::connect(sl_k, SIGNAL(valueChanged(int)), this, - SLOT(kslider_changed(int))); + SLOT(kslider_changed(int))); QObject::connect(sb_n, SIGNAL(valueChanged(int)), this, - SLOT(n_changed(int))); + SLOT(n_changed(int))); QObject::connect(sb_kmax, SIGNAL(valueChanged(int)), this, - SLOT(kmax_changed(int))); + SLOT(kmax_changed(int))); } return fp; } diff --git a/iSeg/SmoothingWidget.h b/iSeg/SmoothingWidget.h index 23b806cf..84528148 100755 --- a/iSeg/SmoothingWidget.h +++ b/iSeg/SmoothingWidget.h @@ -37,63 +37,62 @@ class SmoothingWidget : public WidgetInterface { Q_OBJECT public: - SmoothingWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + SmoothingWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~SmoothingWidget(); QSize sizeHint() const override; void init() override; void newloaded() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Smooth"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("smoothing.png"))); } private: - bmphandler *bmphand; - SlicesHandler *handler3D; + void on_slicenr_changed() override; + + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; - Q3HBox *hboxoverall; - Q3VBox *vboxmethods; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3HBox *hbox4; - Q3HBox *hbox5; + Q3HBox* hboxoverall; + Q3VBox* vboxmethods; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3HBox* hbox4; + Q3HBox* hbox5; // Q3HBox *hbox6; - Q3VBox *vbox1; - Q3VBox *vbox2; - QLabel *txt_n; - QLabel *txt_sigma1; - QLabel *txt_sigma2; - QLabel *txt_dt; - QLabel *txt_iter; - QLabel *txt_k; - QLabel *txt_restrain1; - QLabel *txt_restrain2; - QSlider *sl_sigma; - QSlider *sl_k; - QSlider *sl_restrain; - QSpinBox *sb_n; - QSpinBox *sb_iter; - QSpinBox *sb_kmax; + Q3VBox* vbox1; + Q3VBox* vbox2; + QLabel* txt_n; + QLabel* txt_sigma1; + QLabel* txt_sigma2; + QLabel* txt_dt; + QLabel* txt_iter; + QLabel* txt_k; + QLabel* txt_restrain1; + QLabel* txt_restrain2; + QSlider* sl_sigma; + QSlider* sl_k; + QSlider* sl_restrain; + QSpinBox* sb_n; + QSpinBox* sb_iter; + QSpinBox* sb_kmax; // QSpinBox *sb_restrainmax; - QPushButton *pushexec; - QPushButton *contdiff; - QRadioButton *rb_gaussian; - QRadioButton *rb_average; - QRadioButton *rb_median; - QRadioButton *rb_sigmafilter; - QRadioButton *rb_anisodiff; - QButtonGroup *modegroup; - QCheckBox *allslices; + QPushButton* pushexec; + QPushButton* contdiff; + QRadioButton* rb_gaussian; + QRadioButton* rb_average; + QRadioButton* rb_median; + QRadioButton* rb_sigmafilter; + QRadioButton* rb_anisodiff; + QButtonGroup* modegroup; + QCheckBox* allslices; bool dontundo; -public slots: - void slicenr_changed(); - private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void execute(); void continue_diff(); void method_changed(int); diff --git a/iSeg/TransformWidget.cpp b/iSeg/TransformWidget.cpp index 9a059d2f..a9e872fc 100755 --- a/iSeg/TransformWidget.cpp +++ b/iSeg/TransformWidget.cpp @@ -31,8 +31,8 @@ using namespace std; using namespace iseg; TransformWidget::TransformWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip(Format("Shift/rotate/scale the Source, Target or Tissue.")); @@ -54,7 +54,7 @@ TransformWidget::TransformWidget(SlicesHandler* hand3D, QWidget* parent, // Transformation selection radio buttons translateRadioButton = - new QRadioButton(QString("Translate"), vBoxTransforms); + new QRadioButton(QString("Translate"), vBoxTransforms); rotateRadioButton = new QRadioButton(QString("Rotate"), vBoxTransforms); scaleRadioButton = new QRadioButton(QString("Scale"), vBoxTransforms); shearRadioButton = new QRadioButton(QString("Shear"), vBoxTransforms); @@ -73,7 +73,7 @@ TransformWidget::TransformWidget(SlicesHandler* hand3D, QWidget* parent, transformSourceCheckBox = new QCheckBox(QString("Source"), hBoxSelectData); transformTargetCheckBox = new QCheckBox(QString("Target"), hBoxSelectData); transformTissuesCheckBox = - new QCheckBox(QString("Tissues"), hBoxSelectData); + new QCheckBox(QString("Tissues"), hBoxSelectData); transformSourceCheckBox->setChecked(TRUE); transformTargetCheckBox->setChecked(TRUE); transformTissuesCheckBox->setChecked(TRUE); @@ -110,7 +110,7 @@ TransformWidget::TransformWidget(SlicesHandler* hand3D, QWidget* parent, hBoxExecute = new Q3HBox(vBoxParams); executePushButton = new QPushButton("Execute", hBoxExecute); allSlicesCheckBox = - new QCheckBox(QString("Apply to all slices"), hBoxExecute); + new QCheckBox(QString("Apply to all slices"), hBoxExecute); allSlicesCheckBox->setLayoutDirection(Qt::RightToLeft); cancelPushButton = new QPushButton("Cancel", vBoxParams); @@ -149,31 +149,31 @@ TransformWidget::TransformWidget(SlicesHandler* hand3D, QWidget* parent, // Signals QObject::connect(transformButtonGroup, SIGNAL(buttonClicked(int)), this, - SLOT(TransformChanged(int))); + SLOT(TransformChanged(int))); QObject::connect(transformSourceCheckBox, SIGNAL(stateChanged(int)), this, - SLOT(SelectSourceChanged(int))); + SLOT(SelectSourceChanged(int))); QObject::connect(transformTargetCheckBox, SIGNAL(stateChanged(int)), this, - SLOT(SelectTargetChanged(int))); + SLOT(SelectTargetChanged(int))); QObject::connect(transformTissuesCheckBox, SIGNAL(stateChanged(int)), this, - SLOT(SelectTissuesChanged(int))); + SLOT(SelectTissuesChanged(int))); QObject::connect(slider1, SIGNAL(valueChanged(int)), this, - SLOT(Slider1Changed(int))); + SLOT(Slider1Changed(int))); QObject::connect(slider2, SIGNAL(valueChanged(int)), this, - SLOT(Slider2Changed(int))); + SLOT(Slider2Changed(int))); QObject::connect(lineEdit1, SIGNAL(editingFinished()), this, - SLOT(LineEdit1Edited())); + SLOT(LineEdit1Edited())); QObject::connect(lineEdit2, SIGNAL(editingFinished()), this, - SLOT(LineEdit2Edited())); + SLOT(LineEdit2Edited())); QObject::connect(flipPushButton, SIGNAL(clicked()), this, - SLOT(FlipPushButtonClicked())); + SLOT(FlipPushButtonClicked())); QObject::connect(executePushButton, SIGNAL(clicked()), this, - SLOT(ExecutePushButtonClicked())); + SLOT(ExecutePushButtonClicked())); QObject::connect(cancelPushButton, SIGNAL(clicked()), this, - SLOT(CancelPushButtonClicked())); + SLOT(CancelPushButtonClicked())); } TransformWidget::~TransformWidget() { delete sliceTransform; } @@ -201,7 +201,7 @@ void TransformWidget::Slider1Changed(int value) // Scale: Logarithmic scale: y = 10^(x/50-1), x in [0, 100] updateParameter1 = std::pow(10, value / 50.0 - 1.0); updateParameter1 = std::floor(updateParameter1 * 100) / - 100.0; // Round to two fractional digits + 100.0; // Round to two fractional digits lineEdit1->setText(QString("%1").arg(updateParameter1, 0, 'f', 2)); } else if (shearRadioButton->isChecked()) @@ -234,7 +234,7 @@ void TransformWidget::Slider2Changed(int value) // Scale: Logarithmic scale: y = 10^(x/50-1), x in [0, 100] updateParameter2 = std::pow(10, value / 50.0 - 1.0); updateParameter2 = std::floor(updateParameter2 * 100) / - 100.0; // Round to two fractional digits + 100.0; // Round to two fractional digits lineEdit2->setText(QString("%1").arg(updateParameter2, 0, 'f', 2)); } @@ -252,13 +252,13 @@ void TransformWidget::LineEdit1Edited() double value = lineEdit1->text().toDouble(); if (translateRadioButton->isChecked() || rotateRadioButton->isChecked() || - shearRadioButton->isChecked()) + shearRadioButton->isChecked()) { // Translate: Linear scale: y = x, x in [-width, width] // Rotate: Linear scale: y = x, x in [-180, 180] // Shear: Linear scale: y = x, x in [-45, 45] updateParameter1 = max((double)slider1->minimum(), - min(value, (double)slider1->maximum())); + min(value, (double)slider1->maximum())); slider1->setValue(std::floor(updateParameter1 + 0.5)); lineEdit1->setText(QString("%1").arg(updateParameter1, 0, 'f', 2)); } @@ -267,7 +267,7 @@ void TransformWidget::LineEdit1Edited() // Scale: Logarithmic scale: y = 10^(x/50-1), x in [0, 100] updateParameter1 = max(0.1, min(value, 10.0)); slider1->setValue( - std::floor((std::log10(updateParameter1) + 1) * 50.0 + 0.5)); + std::floor((std::log10(updateParameter1) + 1) * 50.0 + 0.5)); lineEdit1->setText(QString("%1").arg(updateParameter1, 0, 'f', 2)); } @@ -288,7 +288,7 @@ void TransformWidget::LineEdit2Edited() { // Translate: Linear scale: y = x, x in [-height, height] updateParameter2 = max((double)slider2->minimum(), - min(value, (double)slider2->maximum())); + min(value, (double)slider2->maximum())); slider2->setValue(std::floor(updateParameter2 + 0.5)); lineEdit2->setText(QString("%1").arg(updateParameter2, 0, 'f', 2)); } @@ -297,7 +297,7 @@ void TransformWidget::LineEdit2Edited() // Scale: Logarithmic scale: y = 10^(x/50-1), x in [0, 100] updateParameter2 = max(0.1, min(value, 10.0)); slider2->setValue( - std::floor((std::log10(updateParameter2) + 1) * 50.0 + 0.5)); + std::floor((std::log10(updateParameter2) + 1) * 50.0 + 0.5)); lineEdit2->setText(QString("%1").arg(updateParameter2, 0, 'f', 2)); } @@ -326,8 +326,8 @@ void TransformWidget::UpdatePreview() { // Translate sliceTransform->Translate( - updateParameter1 - transformParameters.translationOffset[0], - updateParameter2 - transformParameters.translationOffset[1]); + updateParameter1 - transformParameters.translationOffset[0], + updateParameter2 - transformParameters.translationOffset[1]); transformParameters.translationOffset[0] = updateParameter1; transformParameters.translationOffset[1] = updateParameter2; } @@ -335,19 +335,19 @@ void TransformWidget::UpdatePreview() { // Rotate sliceTransform->Rotate(updateParameter1 - - transformParameters.rotationAngle, - transformParameters.transformCenter[0], - transformParameters.transformCenter[1]); + transformParameters.rotationAngle, + transformParameters.transformCenter[0], + transformParameters.transformCenter[1]); transformParameters.rotationAngle = updateParameter1; } else if (scaleRadioButton->isOn()) { // Scale sliceTransform->Scale( - updateParameter1 / transformParameters.scalingFactor[0], - updateParameter2 / transformParameters.scalingFactor[1], - transformParameters.transformCenter[0], - transformParameters.transformCenter[1]); + updateParameter1 / transformParameters.scalingFactor[0], + updateParameter2 / transformParameters.scalingFactor[1], + transformParameters.transformCenter[0], + transformParameters.transformCenter[1]); transformParameters.scalingFactor[0] = updateParameter1; transformParameters.scalingFactor[1] = updateParameter2; } @@ -357,14 +357,14 @@ void TransformWidget::UpdatePreview() if (xAxisRadioButton->isChecked()) { sliceTransform->Shear(updateParameter1 - - transformParameters.shearingAngle, - true, transformParameters.transformCenter[0]); + transformParameters.shearingAngle, + true, transformParameters.transformCenter[0]); } else { sliceTransform->Shear( - updateParameter1 - transformParameters.shearingAngle, false, - transformParameters.transformCenter[1]); + updateParameter1 - transformParameters.shearingAngle, false, + transformParameters.transformCenter[1]); } transformParameters.shearingAngle = updateParameter1; } @@ -462,8 +462,8 @@ void TransformWidget::SelectSourceChanged(int state) // Set data to be transformed sliceTransform->SelectTransformData(transformSourceCheckBox->isChecked(), - transformTargetCheckBox->isChecked(), - transformTissuesCheckBox->isChecked()); + transformTargetCheckBox->isChecked(), + transformTissuesCheckBox->isChecked()); // Signal data change emit end_datachange(this, iseg::NoUndo); @@ -478,8 +478,8 @@ void TransformWidget::SelectTargetChanged(int state) // Set data to be transformed sliceTransform->SelectTransformData(transformSourceCheckBox->isChecked(), - transformTargetCheckBox->isChecked(), - transformTissuesCheckBox->isChecked()); + transformTargetCheckBox->isChecked(), + transformTissuesCheckBox->isChecked()); // Signal data change emit end_datachange(this, iseg::NoUndo); @@ -494,8 +494,8 @@ void TransformWidget::SelectTissuesChanged(int state) // Set data to be transformed sliceTransform->SelectTransformData(transformSourceCheckBox->isChecked(), - transformTargetCheckBox->isChecked(), - transformTissuesCheckBox->isChecked()); + transformTargetCheckBox->isChecked(), + transformTissuesCheckBox->isChecked()); // Signal data change emit end_datachange(this, iseg::NoUndo); @@ -503,7 +503,7 @@ void TransformWidget::SelectTissuesChanged(int state) QSize TransformWidget::sizeHint() const { return hBoxOverall->sizeHint(); } -void TransformWidget::slicenr_changed() +void TransformWidget::on_slicenr_changed() { iseg::DataSelection dataSelection; dataSelection.sliceNr = handler3D->get_activeslice(); @@ -569,7 +569,7 @@ bool TransformWidget::GetIsIdentityTransform() } void TransformWidget::GetDataSelection(bool& source, bool& target, - bool& tissues) + bool& tissues) { source = transformSourceCheckBox->isChecked(); target = transformTargetCheckBox->isChecked(); @@ -614,10 +614,10 @@ void TransformWidget::ResetWidgets() // Reset transform parameters transformParameters.translationOffset[0] = - transformParameters.translationOffset[1] = 0; + transformParameters.translationOffset[1] = 0; transformParameters.rotationAngle = 0.0; transformParameters.scalingFactor[0] = - transformParameters.scalingFactor[1] = 1.0; + transformParameters.scalingFactor[1] = 1.0; transformParameters.shearingAngle = 0.0; // Reset sliders @@ -625,12 +625,12 @@ void TransformWidget::ResetWidgets() { // Translate: Range = [-width, width], value = 0 slider1->setRange(-(int)handler3D->return_width(), - handler3D->return_width()); + handler3D->return_width()); slider1->setSteps(1, 10); slider1->setValue(0); Slider1Changed(slider1->value()); slider2->setRange(-(int)handler3D->return_height(), - handler3D->return_height()); + handler3D->return_height()); slider2->setSteps(1, 10); slider2->setValue(0); Slider2Changed(slider2->value()); diff --git a/iSeg/TransformWidget.h b/iSeg/TransformWidget.h index 5822e5a5..b09eb782 100755 --- a/iSeg/TransformWidget.h +++ b/iSeg/TransformWidget.h @@ -35,8 +35,8 @@ class TransformWidget : public WidgetInterface Q_OBJECT public: - TransformWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + TransformWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~TransformWidget(); void init() override; @@ -48,7 +48,7 @@ class TransformWidget : public WidgetInterface std::string GetName() override { return std::string("Transform"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("transform.png"))); } - void GetDataSelection(bool &source, bool &target, bool &tissues); + void GetDataSelection(bool& source, bool& target, bool& tissues); private: struct TransformParametersStruct @@ -69,58 +69,59 @@ class TransformWidget : public WidgetInterface void BitsChanged(); private: + void on_slicenr_changed() override; void on_mouse_clicked(Point p) override; // Image data - SlicesHandler *handler3D; + SlicesHandler* handler3D; // Slice transform - SliceTransform *sliceTransform; + SliceTransform* sliceTransform; // Widgets - Q3HBox *hBoxOverall; - Q3VBox *vBoxTransforms; - Q3VBox *vBoxParams; - Q3HBox *hBoxSelectData; - Q3HBox *hBoxSlider1; - Q3HBox *hBoxSlider2; - Q3HBox *hBoxFlip; - Q3HBox *hBoxAxisSelection; - Q3HBox *hBoxCenter; - Q3HBox *hBoxExecute; - - QCheckBox *transformSourceCheckBox; - QCheckBox *transformTargetCheckBox; - QCheckBox *transformTissuesCheckBox; - - QCheckBox *allSlicesCheckBox; - QPushButton *executePushButton; - QPushButton *cancelPushButton; - - QRadioButton *translateRadioButton; - QRadioButton *rotateRadioButton; - QRadioButton *scaleRadioButton; - QRadioButton *shearRadioButton; - QRadioButton *flipRadioButton; + Q3HBox* hBoxOverall; + Q3VBox* vBoxTransforms; + Q3VBox* vBoxParams; + Q3HBox* hBoxSelectData; + Q3HBox* hBoxSlider1; + Q3HBox* hBoxSlider2; + Q3HBox* hBoxFlip; + Q3HBox* hBoxAxisSelection; + Q3HBox* hBoxCenter; + Q3HBox* hBoxExecute; + + QCheckBox* transformSourceCheckBox; + QCheckBox* transformTargetCheckBox; + QCheckBox* transformTissuesCheckBox; + + QCheckBox* allSlicesCheckBox; + QPushButton* executePushButton; + QPushButton* cancelPushButton; + + QRadioButton* translateRadioButton; + QRadioButton* rotateRadioButton; + QRadioButton* scaleRadioButton; + QRadioButton* shearRadioButton; + QRadioButton* flipRadioButton; //QRadioButton *matrixRadioButton; - QButtonGroup *transformButtonGroup; + QButtonGroup* transformButtonGroup; - QLabel *slider1Label; - QLabel *slider2Label; - QSlider *slider1; - QSlider *slider2; - QLineEdit *lineEdit1; - QLineEdit *lineEdit2; + QLabel* slider1Label; + QLabel* slider2Label; + QSlider* slider1; + QSlider* slider2; + QLineEdit* lineEdit1; + QLineEdit* lineEdit2; - QRadioButton *xAxisRadioButton; - QRadioButton *yAxisRadioButton; - QButtonGroup *axisButtonGroup; + QRadioButton* xAxisRadioButton; + QRadioButton* yAxisRadioButton; + QButtonGroup* axisButtonGroup; - QPushButton *flipPushButton; + QPushButton* flipPushButton; - QLabel *centerLabel; - QLabel *centerCoordsLabel; - QPushButton *centerSelectPushButton; + QLabel* centerLabel; + QLabel* centerCoordsLabel; + QPushButton* centerSelectPushButton; // Transform parameters bool disableUpdatePreview; @@ -129,7 +130,6 @@ class TransformWidget : public WidgetInterface TransformParametersStruct transformParameters; public slots: - void slicenr_changed(); void bmp_changed(); void work_changed(); void tissues_changed(); diff --git a/iSeg/VesselWidget.cpp b/iSeg/VesselWidget.cpp index 6c3c8c9e..ca09ec5e 100755 --- a/iSeg/VesselWidget.cpp +++ b/iSeg/VesselWidget.cpp @@ -25,8 +25,8 @@ using namespace std; using namespace iseg; -VesselWidget::VesselWidget(SlicesHandler *hand3D, QWidget *parent, - const char *name, Qt::WindowFlags wFlags) +VesselWidget::VesselWidget(SlicesHandler* hand3D, QWidget* parent, + const char* name, Qt::WindowFlags wFlags) : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { vbox1 = new Q3VBox(this); @@ -95,13 +95,13 @@ void VesselWidget::init() emit vp1_changed(&vp); } -FILE *VesselWidget::SaveParams(FILE *fp, int version) +FILE* VesselWidget::SaveParams(FILE* fp, int version) { UNREFERENCED_PARAMETER(version); return fp; } -FILE *VesselWidget::LoadParams(FILE *fp, int version) +FILE* VesselWidget::LoadParams(FILE* fp, int version) { UNREFERENCED_PARAMETER(version); return fp; @@ -250,10 +250,7 @@ void VesselWidget::execute() { _world.dijkstra(seeds, end, &branchTree); pb_store->setEnabled(true); - slicenr_changed(); - /*FILE *fp=fopen("D:\\test100.txt","a"); - _world.outputBranchTree(branchTree.getItem(),"vessel",fp); - fclose(fp);*/ + on_slicenr_changed(); // BL Why? } } @@ -320,7 +317,7 @@ void VesselWidget::reset_branchTree() pb_store->setEnabled(false); } -void VesselWidget::slicenr_changed() +void VesselWidget::on_slicenr_changed() { branchTree.resetIterator(); vp.clear(); @@ -348,7 +345,7 @@ void VesselWidget::savevessel() float epsilon = max(max(pair1.high, pair1.low), thick); branchTree.getItem()->doug_peuck_inclchildren(epsilon, pair1.high, pair1.low, thick, vp); - FILE *fp = fopen(savefilename.ascii(), "w"); + FILE* fp = fopen(savefilename.ascii(), "w"); int version = 2; unsigned short w = handler3D->return_width(); unsigned short h = handler3D->return_height(); diff --git a/iSeg/VesselWidget.h b/iSeg/VesselWidget.h index 91fc0650..65e6b42d 100755 --- a/iSeg/VesselWidget.h +++ b/iSeg/VesselWidget.h @@ -31,45 +31,47 @@ class VesselWidget : public WidgetInterface { Q_OBJECT public: - VesselWidget(SlicesHandler *hand3D, QWidget *parent = 0, const char *name = 0, + VesselWidget(SlicesHandler* hand3D, QWidget* parent = 0, const char* name = 0, Qt::WindowFlags wFlags = 0); ~VesselWidget(); - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; QSize sizeHint() const override; void init() override; void newloaded() override; - void slicenr_changed(); std::string GetName() override { return std::string("Vessel"); } QIcon GetIcon(QDir picdir) override; void cleanup() override; private: - BranchTree branchTree; + void on_slicenr_changed() override; + void getlabels(); void reset_branchTree(); - SlicesHandler *handler3D; + + BranchTree branchTree; + SlicesHandler* handler3D; std::vector labels; std::vector selectedlabels; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3VBox *vbox1; - QLabel *txt_start; - QLabel *txt_nrend; - QLabel *txt_endnr; - QLabel *txt_end; - QLabel *txt_info; - QComboBox *cbb_lb1; - QComboBox *cbb_lb2; - QSpinBox *sb_nrend; - QSpinBox *sb_endnr; - QPushButton *pb_exec; - QPushButton *pb_store; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3VBox* vbox1; + QLabel* txt_start; + QLabel* txt_nrend; + QLabel* txt_endnr; + QLabel* txt_end; + QLabel* txt_info; + QComboBox* cbb_lb1; + QComboBox* cbb_lb2; + QSpinBox* sb_nrend; + QSpinBox* sb_endnr; + QPushButton* pb_exec; + QPushButton* pb_store; std::vector vp; signals: - void vp1_changed(std::vector *vp1); + void vp1_changed(std::vector* vp1); private slots: void marks_changed(); diff --git a/iSeg/WatershedWidget.cpp b/iSeg/WatershedWidget.cpp index 467ff7d5..51346642 100755 --- a/iSeg/WatershedWidget.cpp +++ b/iSeg/WatershedWidget.cpp @@ -32,18 +32,18 @@ using namespace iseg; WatershedWidget::WatershedWidget(SlicesHandler* hand3D, QWidget* parent, - const char* name, Qt::WindowFlags wFlags) - : WidgetInterface(parent, name, wFlags), handler3D(hand3D) + const char* name, Qt::WindowFlags wFlags) + : WidgetInterface(parent, name, wFlags), handler3D(hand3D) { setToolTip( - Format("Segment a tissue (2D) by selecting points in the current slice " - "based on the Watershed method." - "
" - "The method: the gradient of the slightly smoothed image is " - "calculated. High values are interpreted as mountains and " - "low values as valleys. Subsequently, a flooding with water is " - "simulated resulting in thousands of basins. " - "Higher water causes adjacent basins to merge. ")); + Format("Segment a tissue (2D) by selecting points in the current slice " + "based on the Watershed method." + "
" + "The method: the gradient of the slightly smoothed image is " + "calculated. High values are interpreted as mountains and " + "low values as valleys. Subsequently, a flooding with water is " + "simulated resulting in thousands of basins. " + "Higher water causes adjacent basins to merge. ")); activeslice = handler3D->get_activeslice(); bmphand = handler3D->get_activebmphandler(); @@ -69,13 +69,13 @@ WatershedWidget::WatershedWidget(SlicesHandler* hand3D, QWidget* parent, sbh_old = sb_h->value(); QObject::connect(sl_h, SIGNAL(valueChanged(int)), this, - SLOT(hsl_changed())); + SLOT(hsl_changed())); QObject::connect(sl_h, SIGNAL(sliderPressed()), this, - SLOT(slider_pressed())); + SLOT(slider_pressed())); QObject::connect(sl_h, SIGNAL(sliderReleased()), this, - SLOT(slider_released())); + SLOT(slider_released())); QObject::connect(sb_h, SIGNAL(valueChanged(int)), this, - SLOT(hsb_changed(int))); + SLOT(hsb_changed(int))); QObject::connect(btn_exec, SIGNAL(clicked()), this, SLOT(execute())); } @@ -156,7 +156,7 @@ void WatershedWidget::recalc1() if (usp != NULL) { bmphand->construct_regions( - (unsigned int)(sb_h->value() * sl_h->value() * 0.005f), usp); + (unsigned int)(sb_h->value() * sl_h->value() * 0.005f), usp); } return; @@ -171,12 +171,10 @@ WatershedWidget::~WatershedWidget() free(usp); } -void WatershedWidget::slicenr_changed() +void WatershedWidget::on_slicenr_changed() { - // if(activeslice!=handler3D->get_activeslice()){ activeslice = handler3D->get_activeslice(); bmphand_changed(handler3D->get_activebmphandler()); - // } } void WatershedWidget::bmphand_changed(bmphandler* bmph) @@ -193,7 +191,7 @@ void WatershedWidget::bmphand_changed(bmphandler* bmph) void WatershedWidget::init() { - slicenr_changed(); + on_slicenr_changed(); hideparams_changed(); } @@ -240,9 +238,9 @@ FILE* WatershedWidget::LoadParams(FILE* fp, int version) if (version >= 2) { QObject::disconnect(sl_h, SIGNAL(valueChanged(int)), this, - SLOT(hsl_changed())); + SLOT(hsl_changed())); QObject::disconnect(sb_h, SIGNAL(valueChanged(int)), this, - SLOT(hsb_changed(int))); + SLOT(hsb_changed(int))); int dummy; fread(&dummy, sizeof(int), 1, fp); @@ -253,9 +251,9 @@ FILE* WatershedWidget::LoadParams(FILE* fp, int version) fread(&sbh_old, sizeof(float), 1, fp); QObject::connect(sl_h, SIGNAL(valueChanged(int)), this, - SLOT(hsl_changed())); + SLOT(hsl_changed())); QObject::connect(sb_h, SIGNAL(valueChanged(int)), this, - SLOT(hsb_changed(int))); + SLOT(hsb_changed(int))); } return fp; } diff --git a/iSeg/WatershedWidget.h b/iSeg/WatershedWidget.h index 15d594ce..ffd620f2 100755 --- a/iSeg/WatershedWidget.h +++ b/iSeg/WatershedWidget.h @@ -35,41 +35,42 @@ class WatershedWidget : public WidgetInterface { Q_OBJECT public: - WatershedWidget(SlicesHandler *hand3D, QWidget *parent = 0, - const char *name = 0, Qt::WindowFlags wFlags = 0); + WatershedWidget(SlicesHandler* hand3D, QWidget* parent = 0, + const char* name = 0, Qt::WindowFlags wFlags = 0); ~WatershedWidget(); QSize sizeHint() const override; void init() override; void newloaded() override; - FILE *SaveParams(FILE *fp, int version) override; - FILE *LoadParams(FILE *fp, int version) override; + FILE* SaveParams(FILE* fp, int version) override; + FILE* LoadParams(FILE* fp, int version) override; void hideparams_changed() override; std::string GetName() override { return std::string("Watershed"); } QIcon GetIcon(QDir picdir) override { return QIcon(picdir.absFilePath(QString("watershed.png"))); } private: + void on_slicenr_changed() override; + void recalc1(); - unsigned int *usp; + unsigned int* usp; int sbh_old; - bmphandler *bmphand; - SlicesHandler *handler3D; + bmphandler* bmphand; + SlicesHandler* handler3D; unsigned short activeslice; - Q3HBox *hbox1; - Q3HBox *hbox2; - Q3HBox *hbox3; - Q3VBox *vbox1; - QLabel *txt_h; - QSpinBox *sb_h; - QSlider *sl_h; - QPushButton *btn_exec; + Q3HBox* hbox1; + Q3HBox* hbox2; + Q3HBox* hbox3; + Q3VBox* vbox1; + QLabel* txt_h; + QSpinBox* sb_h; + QSlider* sl_h; + QPushButton* btn_exec; public slots: - void slicenr_changed(); void marks_changed(); private slots: - void bmphand_changed(bmphandler *bmph); + void bmphand_changed(bmphandler* bmph); void hsl_changed(); void slider_pressed(); void slider_released(); From 8f84707f9dd503ef115d91c08ecbd3a0ed09b70c Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 11:57:24 +0200 Subject: [PATCH 8/9] renamed folder (and project) Plugin to Interface (iSegInterface respectively) --- CMakeLists.txt | 2 +- Core/BranchItem.h | 2 +- Core/Contour.h | 2 +- Core/FeatureExtractor.h | 2 +- Core/ImageForestingTransform.h | 2 +- Core/Mark.h | 2 +- Core/Outline.h | 2 +- Core/UndoElem.h | 4 ++-- Core/addLine.h | 2 +- {Plugin => Interface}/CMakeLists.txt | 7 +++--- {Plugin => Interface}/DataSelection.h | 0 .../PluginApi.h => Interface/InterfaceApi.h | 8 +++---- {Plugin => Interface}/Plugin.cpp | 0 {Plugin => Interface}/Plugin.h | 10 ++++----- {Plugin => Interface}/Point.h | 0 .../SlicesHandlerInterface.h | 4 ++-- {Plugin => Interface}/WidgetInterface.cpp | 0 {Plugin => Interface}/WidgetInterface.h | 22 +++++++++---------- .../testsuite/CMakeLists.txt | 8 +++---- .../testsuite/test_PluginMain.cpp | 4 ++-- .../testsuite/test_iSegImageAdaptor.cpp | 0 Plugins/BiasCorrection/BiasCorrection.h | 11 +++++----- Plugins/BiasCorrection/BiasCorrectionAddon.h | 2 +- Plugins/BiasCorrection/CMakeLists.txt | 2 +- Plugins/ConfidenceConnected/CMakeLists.txt | 2 +- Plugins/ConfidenceConnected/Confidence.h | 4 ++-- Plugins/ConfidenceConnected/ConfidenceAddon.h | 2 +- Plugins/GraphCut/CMakeLists.txt | 2 +- Plugins/GraphCut/GraphCutAddon.h | 2 +- Plugins/GraphCut/GraphCutBoneSegmentation.h | 4 ++-- Plugins/GraphCut/GraphCutTissueSeparator.h | 4 ++-- Plugins/Levelset/CMakeLists.txt | 2 +- Plugins/Levelset/Levelset.h | 4 ++-- Plugins/Levelset/LevelsetAddon.h | 2 +- iSeg/AtlasViewer.h | 2 +- iSeg/AtlasWidget.h | 2 +- iSeg/CMakeLists.txt | 2 +- iSeg/DicomReader.h | 2 +- iSeg/EdgeWidget.cpp | 2 +- iSeg/EdgeWidget.h | 2 +- iSeg/FastmarchingFuzzyWidget.h | 2 +- iSeg/FeatureWidget.h | 2 +- iSeg/HystereticGrowingWidget.h | 2 +- ...ageForestingTransformRegionGrowingWidget.h | 2 +- iSeg/InterpolationWidget.h | 2 +- iSeg/Levelset.h | 2 +- iSeg/LivewireWidget.h | 2 +- iSeg/LoaderWidgets.cpp | 2 +- iSeg/LoaderWidgets.h | 2 +- iSeg/MainWindow.cpp | 2 +- iSeg/MainWindow.h | 4 ++-- iSeg/MeasurementWidget.cpp | 2 +- iSeg/MeasurementWidget.h | 2 +- iSeg/MorphologyWidget.cpp | 2 +- iSeg/MorphologyWidget.h | 2 +- iSeg/OutlineCorrectionWidget.cpp | 2 +- iSeg/OutlineCorrectionWidget.h | 2 +- iSeg/PickerWidget.h | 2 +- iSeg/SliceViewerWidget.h | 2 +- iSeg/SlicesHandler.h | 2 +- iSeg/SmoothingWidget.h | 2 +- iSeg/ThresholdWidget.h | 2 +- iSeg/TransformWidget.h | 2 +- iSeg/VesselWidget.h | 2 +- iSeg/WatershedWidget.h | 2 +- iSeg/WidgetCollection.h | 4 ++-- iSeg/bmpshower.cpp | 2 +- 67 files changed, 96 insertions(+), 100 deletions(-) rename {Plugin => Interface}/CMakeLists.txt (75%) rename {Plugin => Interface}/DataSelection.h (100%) rename Plugin/PluginApi.h => Interface/InterfaceApi.h (68%) mode change 100755 => 100644 rename {Plugin => Interface}/Plugin.cpp (100%) rename {Plugin => Interface}/Plugin.h (81%) rename {Plugin => Interface}/Point.h (100%) rename {Plugin => Interface}/SlicesHandlerInterface.h (96%) rename {Plugin => Interface}/WidgetInterface.cpp (100%) rename {Plugin => Interface}/WidgetInterface.h (74%) rename {Plugin => Interface}/testsuite/CMakeLists.txt (72%) rename {Plugin => Interface}/testsuite/test_PluginMain.cpp (84%) rename {Plugin => Interface}/testsuite/test_iSegImageAdaptor.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index febccc57..38660077 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,8 +70,8 @@ INCLUDE_DIRECTORIES( ) ADD_SUBDIRECTORY(Thirdparty) +ADD_SUBDIRECTORY(Interface) ADD_SUBDIRECTORY(Core) -ADD_SUBDIRECTORY(Plugin) ADD_SUBDIRECTORY(iSeg) ADD_SUBDIRECTORY(Plugins) diff --git a/Core/BranchItem.h b/Core/BranchItem.h index a82d76fe..126087e6 100755 --- a/Core/BranchItem.h +++ b/Core/BranchItem.h @@ -13,7 +13,7 @@ #include "Vec3.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/Core/Contour.h b/Core/Contour.h index a669c12b..21cf2004 100755 --- a/Core/Contour.h +++ b/Core/Contour.h @@ -11,7 +11,7 @@ #include "iSegCore.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/Core/FeatureExtractor.h b/Core/FeatureExtractor.h index d2214a70..e35602d4 100755 --- a/Core/FeatureExtractor.h +++ b/Core/FeatureExtractor.h @@ -13,7 +13,7 @@ #include "Pair.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" namespace iseg { diff --git a/Core/ImageForestingTransform.h b/Core/ImageForestingTransform.h index 5551015d..4476e068 100755 --- a/Core/ImageForestingTransform.h +++ b/Core/ImageForestingTransform.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/IndexPriorityQueue.h" diff --git a/Core/Mark.h b/Core/Mark.h index 9e43e8ef..3d7ceb01 100755 --- a/Core/Mark.h +++ b/Core/Mark.h @@ -11,7 +11,7 @@ #include "iSegCore.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include diff --git a/Core/Outline.h b/Core/Outline.h index 4a5dca46..3237cfe1 100755 --- a/Core/Outline.h +++ b/Core/Outline.h @@ -14,7 +14,7 @@ #include "Pair.h" #include "Types.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/Core/UndoElem.h b/Core/UndoElem.h index c2a1c72b..27e29a72 100755 --- a/Core/UndoElem.h +++ b/Core/UndoElem.h @@ -14,8 +14,8 @@ #include "Mark.h" #include "Types.h" -#include "Plugin/Point.h" -#include "Plugin/DataSelection.h" +#include "Interface/Point.h" +#include "Interface/DataSelection.h" #include diff --git a/Core/addLine.h b/Core/addLine.h index cae1665e..f2f9fb7c 100755 --- a/Core/addLine.h +++ b/Core/addLine.h @@ -11,7 +11,7 @@ #include "iSegCore.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include diff --git a/Plugin/CMakeLists.txt b/Interface/CMakeLists.txt similarity index 75% rename from Plugin/CMakeLists.txt rename to Interface/CMakeLists.txt index 661f4725..06178668 100755 --- a/Plugin/CMakeLists.txt +++ b/Interface/CMakeLists.txt @@ -15,13 +15,12 @@ USE_ITK() SET(SOURCES Plugin.cpp Plugin.h - PluginApi.h + InterfaceApi.h SlicesHandlerInterface.h WidgetInterface.h WidgetInterface.cpp ) QT4_WRAP_CPP(MOCSrcs WidgetInterface.h) -ADD_LIBRARY(Plugin SHARED ${SOURCES} ${MOCSrcs}) -TARGET_LINK_LIBRARIES(Plugin ${MY_EXTERNAL_LINK_LIBRARIES} ) -VS_SET_PROPERTY(Plugin "Plugins") +ADD_LIBRARY(iSegInterface SHARED ${SOURCES} ${MOCSrcs}) +TARGET_LINK_LIBRARIES(iSegInterface ${MY_EXTERNAL_LINK_LIBRARIES} ) diff --git a/Plugin/DataSelection.h b/Interface/DataSelection.h similarity index 100% rename from Plugin/DataSelection.h rename to Interface/DataSelection.h diff --git a/Plugin/PluginApi.h b/Interface/InterfaceApi.h old mode 100755 new mode 100644 similarity index 68% rename from Plugin/PluginApi.h rename to Interface/InterfaceApi.h index 404e808c..3331794c --- a/Plugin/PluginApi.h +++ b/Interface/InterfaceApi.h @@ -10,11 +10,11 @@ #pragma once #if defined(WIN32) -# ifdef Plugin_EXPORTS -# define ISEG_PLUGIN_API __declspec(dllexport) +# ifdef iSegInterface_EXPORTS +# define ISEG_INTERFACE_API __declspec(dllexport) # else -# define ISEG_PLUGIN_API __declspec(dllimport) +# define ISEG_INTERFACE_API __declspec(dllimport) # endif #else -# define ISEG_PLUGIN_API +# define ISEG_INTERFACE_API #endif diff --git a/Plugin/Plugin.cpp b/Interface/Plugin.cpp similarity index 100% rename from Plugin/Plugin.cpp rename to Interface/Plugin.cpp diff --git a/Plugin/Plugin.h b/Interface/Plugin.h similarity index 81% rename from Plugin/Plugin.h rename to Interface/Plugin.h index f87ac3d5..2b215f0f 100755 --- a/Plugin/Plugin.h +++ b/Interface/Plugin.h @@ -9,7 +9,7 @@ */ #pragma once -#include "PluginApi.h" +#include "InterfaceApi.h" #include "SlicesHandlerInterface.h" #include "WidgetInterface.h" @@ -23,7 +23,7 @@ class SliceHandlerInterface; namespace iseg { namespace plugin { -class ISEG_PLUGIN_API Plugin +class ISEG_INTERFACE_API Plugin { public: Plugin(); @@ -36,14 +36,14 @@ class ISEG_PLUGIN_API Plugin virtual std::string description() const = 0; - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const = 0; + virtual WidgetInterface* create_widget(QWidget* parent, + const char* name, Qt::WindowFlags wFlags) const = 0; private: SliceHandlerInterface* _slice_handler; }; -class ISEG_PLUGIN_API PluginRegistry +class ISEG_INTERFACE_API PluginRegistry { public: static std::vector registered_plugins(); diff --git a/Plugin/Point.h b/Interface/Point.h similarity index 100% rename from Plugin/Point.h rename to Interface/Point.h diff --git a/Plugin/SlicesHandlerInterface.h b/Interface/SlicesHandlerInterface.h similarity index 96% rename from Plugin/SlicesHandlerInterface.h rename to Interface/SlicesHandlerInterface.h index 3101cca4..905315b9 100755 --- a/Plugin/SlicesHandlerInterface.h +++ b/Interface/SlicesHandlerInterface.h @@ -9,7 +9,7 @@ */ #pragma once -#include "PluginApi.h" +#include "InterfaceApi.h" #include // BL TODO get rid of this #include @@ -20,7 +20,7 @@ class SliceHandlerInterface { public: typedef unsigned short tissue_type; - typedef float pixel_type; + typedef float pixel_type; virtual unsigned short return_startslice() = 0; virtual unsigned short return_endslice() = 0; diff --git a/Plugin/WidgetInterface.cpp b/Interface/WidgetInterface.cpp similarity index 100% rename from Plugin/WidgetInterface.cpp rename to Interface/WidgetInterface.cpp diff --git a/Plugin/WidgetInterface.h b/Interface/WidgetInterface.h similarity index 74% rename from Plugin/WidgetInterface.h rename to Interface/WidgetInterface.h index a01efb06..558009a5 100755 --- a/Plugin/WidgetInterface.h +++ b/Interface/WidgetInterface.h @@ -9,7 +9,7 @@ */ #pragma once -#include "PluginApi.h" +#include "InterfaceApi.h" #include "DataSelection.h" #include "Point.h" @@ -19,20 +19,18 @@ #include #include -#define UNREFERENCED_PARAMETER(P) (P) - namespace iseg { -class ISEG_PLUGIN_API WidgetInterface : public QWidget +class ISEG_INTERFACE_API WidgetInterface : public QWidget { Q_OBJECT public: - WidgetInterface(QWidget *parent, const char *name, Qt::WindowFlags wFlags); + WidgetInterface(QWidget* parent, const char* name, Qt::WindowFlags wFlags); virtual void init() {} virtual void newloaded() {} virtual void cleanup() {} - virtual FILE *SaveParams(FILE *fp, int version) { return fp; }; - virtual FILE *LoadParams(FILE *fp, int version) { return fp; }; + virtual FILE* SaveParams(FILE* fp, int version) { return fp; }; + virtual FILE* LoadParams(FILE* fp, int version) { return fp; }; virtual void hideparams_changed() {} static void set_hideparams(bool hide) { hideparams = hide; } static bool get_hideparams() { return hideparams; } @@ -46,12 +44,12 @@ class ISEG_PLUGIN_API WidgetInterface : public QWidget virtual void on_mouse_released(Point p) {} virtual void on_mouse_moved(Point p) {} - QCursor *get_cursor() { return m_cursor; } + QCursor* get_cursor() { return m_cursor; } signals: - void begin_datachange(iseg::DataSelection &dataSelection, - QWidget *sender = NULL, bool beginUndo = true); - void end_datachange(QWidget *sender = NULL, + void begin_datachange(iseg::DataSelection& dataSelection, + QWidget* sender = NULL, bool beginUndo = true); + void end_datachange(QWidget* sender = NULL, iseg::EndUndoAction undoAction = iseg::EndUndo); private slots: @@ -64,7 +62,7 @@ private slots: void mouse_moved(Point p) { on_mouse_moved(p); } protected: - QCursor *m_cursor; + QCursor* m_cursor; static bool hideparams; }; diff --git a/Plugin/testsuite/CMakeLists.txt b/Interface/testsuite/CMakeLists.txt similarity index 72% rename from Plugin/testsuite/CMakeLists.txt rename to Interface/testsuite/CMakeLists.txt index bbf9aca6..7299a855 100755 --- a/Plugin/testsuite/CMakeLists.txt +++ b/Interface/testsuite/CMakeLists.txt @@ -18,10 +18,10 @@ IF(ISEG_BUILD_TESTING) test_iSegImageAdaptor.cpp ) - ADD_LIBRARY(TestSuite_Plugin ${SOURCES} ${HEADERS}) - TARGET_LINK_LIBRARIES(TestSuite_Plugin - Plugin + ADD_LIBRARY(TestSuite_iSegInterface ${SOURCES} ${HEADERS}) + TARGET_LINK_LIBRARIES(TestSuite_iSegInterface + iSegInterface ${MY_EXTERNAL_LINK_LIBRARIES} ) - VS_SET_PROPERTY(TestSuite_Plugin "TestSuite") + VS_SET_PROPERTY(TestSuite_iSegInterface "TestSuite") ENDIF() diff --git a/Plugin/testsuite/test_PluginMain.cpp b/Interface/testsuite/test_PluginMain.cpp similarity index 84% rename from Plugin/testsuite/test_PluginMain.cpp rename to Interface/testsuite/test_PluginMain.cpp index e087ceb6..5773afd1 100755 --- a/Plugin/testsuite/test_PluginMain.cpp +++ b/Interface/testsuite/test_PluginMain.cpp @@ -7,8 +7,8 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#define BOOST_TEST_MODULE Plugin +#define BOOST_TEST_MODULE Interface #define BOOST_TEST_NO_MAIN #include -#include "../PluginApi.h" +#include "../InterfaceApi.h" diff --git a/Plugin/testsuite/test_iSegImageAdaptor.cpp b/Interface/testsuite/test_iSegImageAdaptor.cpp similarity index 100% rename from Plugin/testsuite/test_iSegImageAdaptor.cpp rename to Interface/testsuite/test_iSegImageAdaptor.cpp diff --git a/Plugins/BiasCorrection/BiasCorrection.h b/Plugins/BiasCorrection/BiasCorrection.h index 1a59fc3c..444e2c39 100755 --- a/Plugins/BiasCorrection/BiasCorrection.h +++ b/Plugins/BiasCorrection/BiasCorrection.h @@ -11,8 +11,8 @@ #include -#include "Plugin/SlicesHandlerInterface.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/SlicesHandlerInterface.h" +#include "Interface/WidgetInterface.h" #include #include @@ -39,15 +39,14 @@ class BiasCorrectionWidget : public iseg::WidgetInterface std::string GetName() override; QIcon GetIcon(QDir picdir) override; -protected: +private: + void on_slicenr_changed() override; + template ImagePointer DoBiasCorrection(ImagePointer inputImage, ImagePointer maskImage, const std::vector& numIters, int shrinkFactor, double convergenceThreshold); -private: - void on_slicenr_changed() override; - iseg::SliceHandlerInterface* handler3D; unsigned short activeslice; Q3VBox* vbox1; diff --git a/Plugins/BiasCorrection/BiasCorrectionAddon.h b/Plugins/BiasCorrection/BiasCorrectionAddon.h index 00f69fa2..1fdd1e35 100755 --- a/Plugins/BiasCorrection/BiasCorrectionAddon.h +++ b/Plugins/BiasCorrection/BiasCorrectionAddon.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Plugin.h" +#include "Interface/Plugin.h" namespace iseg { namespace plugin { diff --git a/Plugins/BiasCorrection/CMakeLists.txt b/Plugins/BiasCorrection/CMakeLists.txt index f96ee724..7aebc7a6 100755 --- a/Plugins/BiasCorrection/CMakeLists.txt +++ b/Plugins/BiasCorrection/CMakeLists.txt @@ -20,7 +20,7 @@ IF(PLUGIN_BIAS) ) TARGET_LINK_LIBRARIES( BiasCorrection.ext - Plugin + iSegInterface ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(BiasCorrection.ext "Plugins") diff --git a/Plugins/ConfidenceConnected/CMakeLists.txt b/Plugins/ConfidenceConnected/CMakeLists.txt index 4af1688c..760b15e2 100755 --- a/Plugins/ConfidenceConnected/CMakeLists.txt +++ b/Plugins/ConfidenceConnected/CMakeLists.txt @@ -20,7 +20,7 @@ IF(PLUGIN_CONFIDENCE) ) TARGET_LINK_LIBRARIES( Confidence.ext - Plugin + iSegInterface ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(Confidence.ext "Plugins") diff --git a/Plugins/ConfidenceConnected/Confidence.h b/Plugins/ConfidenceConnected/Confidence.h index a28b75a5..f2f1bc5c 100755 --- a/Plugins/ConfidenceConnected/Confidence.h +++ b/Plugins/ConfidenceConnected/Confidence.h @@ -9,8 +9,8 @@ */ #pragma once -#include "Plugin/SlicesHandlerInterface.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/SlicesHandlerInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/Plugins/ConfidenceConnected/ConfidenceAddon.h b/Plugins/ConfidenceConnected/ConfidenceAddon.h index aa26a26d..330d2dd9 100755 --- a/Plugins/ConfidenceConnected/ConfidenceAddon.h +++ b/Plugins/ConfidenceConnected/ConfidenceAddon.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Plugin.h" +#include "Interface/Plugin.h" namespace iseg { namespace plugin { diff --git a/Plugins/GraphCut/CMakeLists.txt b/Plugins/GraphCut/CMakeLists.txt index 208e8e1d..1059eee9 100755 --- a/Plugins/GraphCut/CMakeLists.txt +++ b/Plugins/GraphCut/CMakeLists.txt @@ -31,7 +31,7 @@ IF(PLUGIN_GRAPHCUT) # todo check libs in linker command TARGET_LINK_LIBRARIES( GraphCut.ext - Plugin + iSegInterface Gc ${MY_EXTERNAL_LINK_LIBRARIES} ) diff --git a/Plugins/GraphCut/GraphCutAddon.h b/Plugins/GraphCut/GraphCutAddon.h index 2e711312..96845c56 100755 --- a/Plugins/GraphCut/GraphCutAddon.h +++ b/Plugins/GraphCut/GraphCutAddon.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Plugin.h" +#include "Interface/Plugin.h" namespace iseg { namespace plugin { diff --git a/Plugins/GraphCut/GraphCutBoneSegmentation.h b/Plugins/GraphCut/GraphCutBoneSegmentation.h index 971e720d..2842508a 100755 --- a/Plugins/GraphCut/GraphCutBoneSegmentation.h +++ b/Plugins/GraphCut/GraphCutBoneSegmentation.h @@ -9,8 +9,8 @@ */ #pragma once -#include "Plugin/SlicesHandlerInterface.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/SlicesHandlerInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/Plugins/GraphCut/GraphCutTissueSeparator.h b/Plugins/GraphCut/GraphCutTissueSeparator.h index 6d4c4570..b13f7f01 100755 --- a/Plugins/GraphCut/GraphCutTissueSeparator.h +++ b/Plugins/GraphCut/GraphCutTissueSeparator.h @@ -9,8 +9,8 @@ */ #pragma once -#include "Plugin/SlicesHandlerInterface.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/SlicesHandlerInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/Plugins/Levelset/CMakeLists.txt b/Plugins/Levelset/CMakeLists.txt index cde721a7..9f004442 100755 --- a/Plugins/Levelset/CMakeLists.txt +++ b/Plugins/Levelset/CMakeLists.txt @@ -20,7 +20,7 @@ IF(PLUGIN_LEVELSET) ) TARGET_LINK_LIBRARIES( Levelset.ext - Plugin + iSegInterface ${MY_EXTERNAL_LINK_LIBRARIES} ) VS_SET_PROPERTY(Levelset.ext "Plugins") diff --git a/Plugins/Levelset/Levelset.h b/Plugins/Levelset/Levelset.h index 2f09d60a..1ae5aa2e 100755 --- a/Plugins/Levelset/Levelset.h +++ b/Plugins/Levelset/Levelset.h @@ -9,8 +9,8 @@ */ #pragma once -#include "Plugin/SlicesHandlerInterface.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/SlicesHandlerInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/Plugins/Levelset/LevelsetAddon.h b/Plugins/Levelset/LevelsetAddon.h index 980ca66a..72c14361 100755 --- a/Plugins/Levelset/LevelsetAddon.h +++ b/Plugins/Levelset/LevelsetAddon.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Plugin.h" +#include "Interface/Plugin.h" namespace iseg { namespace plugin { diff --git a/iSeg/AtlasViewer.h b/iSeg/AtlasViewer.h index 8e2cdedd..96cdf00d 100755 --- a/iSeg/AtlasViewer.h +++ b/iSeg/AtlasViewer.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/Pair.h" #include "Core/Types.h" diff --git a/iSeg/AtlasWidget.h b/iSeg/AtlasWidget.h index 2ee7af77..97731b84 100755 --- a/iSeg/AtlasWidget.h +++ b/iSeg/AtlasWidget.h @@ -12,7 +12,7 @@ #include "WidgetCollection.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/Pair.h" diff --git a/iSeg/CMakeLists.txt b/iSeg/CMakeLists.txt index dd1c08a3..69605fe1 100755 --- a/iSeg/CMakeLists.txt +++ b/iSeg/CMakeLists.txt @@ -162,8 +162,8 @@ ENDIF() ADD_EXECUTABLE(iSeg WIN32 MACOSX_BUNDLE ${ViewerSrcs} ${MOCSrcs} ${ViewerHeaders} ${RCCSrcs} ${CMAKE_BINARY_DIR}/config.h iSeg.rc ${ICON_FILES}) TARGET_COMPILE_DEFINITIONS(iSeg PRIVATE ${ISEG_DEFINITIONS}) TARGET_LINK_LIBRARIES(iSeg + iSegInterface iSegCore - Plugin QVTK predicates vtkGDCM diff --git a/iSeg/DicomReader.h b/iSeg/DicomReader.h index 0bc49d79..e95caccd 100755 --- a/iSeg/DicomReader.h +++ b/iSeg/DicomReader.h @@ -10,7 +10,7 @@ #ifndef dicomread_22Juli05 #define dicomread_22Juli05 -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/Pair.h" diff --git a/iSeg/EdgeWidget.cpp b/iSeg/EdgeWidget.cpp index c09a4b2e..880fb3bd 100755 --- a/iSeg/EdgeWidget.cpp +++ b/iSeg/EdgeWidget.cpp @@ -14,7 +14,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/EdgeWidget.h b/iSeg/EdgeWidget.h index eaf368de..678a03a4 100755 --- a/iSeg/EdgeWidget.h +++ b/iSeg/EdgeWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/FastmarchingFuzzyWidget.h b/iSeg/FastmarchingFuzzyWidget.h index 60dba511..cb4ab05d 100755 --- a/iSeg/FastmarchingFuzzyWidget.h +++ b/iSeg/FastmarchingFuzzyWidget.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/FeatureWidget.h b/iSeg/FeatureWidget.h index d5ba07bf..a3d77e4e 100755 --- a/iSeg/FeatureWidget.h +++ b/iSeg/FeatureWidget.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include "SlicesHandler.h" #include "bmp_read_1.h" diff --git a/iSeg/HystereticGrowingWidget.h b/iSeg/HystereticGrowingWidget.h index d9e9cac5..6a2cf864 100755 --- a/iSeg/HystereticGrowingWidget.h +++ b/iSeg/HystereticGrowingWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/ImageForestingTransformRegionGrowingWidget.h b/iSeg/ImageForestingTransformRegionGrowingWidget.h index 0545f06a..a062e41a 100755 --- a/iSeg/ImageForestingTransformRegionGrowingWidget.h +++ b/iSeg/ImageForestingTransformRegionGrowingWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/InterpolationWidget.h b/iSeg/InterpolationWidget.h index b84e628c..aabb63eb 100755 --- a/iSeg/InterpolationWidget.h +++ b/iSeg/InterpolationWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/Levelset.h b/iSeg/Levelset.h index d88ddb21..cd2099fb 100755 --- a/iSeg/Levelset.h +++ b/iSeg/Levelset.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/SliceProvider.h" diff --git a/iSeg/LivewireWidget.h b/iSeg/LivewireWidget.h index 0305fd27..e14b92fe 100755 --- a/iSeg/LivewireWidget.h +++ b/iSeg/LivewireWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include "Core/ImageForestingTransform.h" diff --git a/iSeg/LoaderWidgets.cpp b/iSeg/LoaderWidgets.cpp index 8424ff98..e24f13d1 100755 --- a/iSeg/LoaderWidgets.cpp +++ b/iSeg/LoaderWidgets.cpp @@ -13,7 +13,7 @@ #include "CImg.h" #include "LoaderWidgets.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/LoaderWidgets.h b/iSeg/LoaderWidgets.h index a80b1761..ec5b0df3 100755 --- a/iSeg/LoaderWidgets.h +++ b/iSeg/LoaderWidgets.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/MainWindow.cpp b/iSeg/MainWindow.cpp index 3cf462ec..e827502e 100755 --- a/iSeg/MainWindow.cpp +++ b/iSeg/MainWindow.cpp @@ -45,7 +45,7 @@ # include "RadiotherapyStructureSetImporter.h" #endif -#include "Plugin/Plugin.h" +#include "Interface/Plugin.h" #include "Core/LoadPlugin.h" #include "Core/ProjectVersion.h" diff --git a/iSeg/MainWindow.h b/iSeg/MainWindow.h index 5abdaebd..dd607705 100755 --- a/iSeg/MainWindow.h +++ b/iSeg/MainWindow.h @@ -12,8 +12,8 @@ #include "Atlas.h" #include "Project.h" -#include "Plugin/DataSelection.h" -#include "Plugin/Point.h" +#include "Interface/DataSelection.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/MeasurementWidget.cpp b/iSeg/MeasurementWidget.cpp index bef9f609..05eb7575 100755 --- a/iSeg/MeasurementWidget.cpp +++ b/iSeg/MeasurementWidget.cpp @@ -15,7 +15,7 @@ #include "TissueInfos.h" #include "bmp_read_1.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/Pair.h" #include "Core/addLine.h" diff --git a/iSeg/MeasurementWidget.h b/iSeg/MeasurementWidget.h index 88d93704..75944eef 100755 --- a/iSeg/MeasurementWidget.h +++ b/iSeg/MeasurementWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/MorphologyWidget.cpp b/iSeg/MorphologyWidget.cpp index 1b4d5dd0..b19ea4f5 100755 --- a/iSeg/MorphologyWidget.cpp +++ b/iSeg/MorphologyWidget.cpp @@ -14,7 +14,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/MorphologyWidget.h b/iSeg/MorphologyWidget.h index a5a2a44a..0adbb3a9 100755 --- a/iSeg/MorphologyWidget.h +++ b/iSeg/MorphologyWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/OutlineCorrectionWidget.cpp b/iSeg/OutlineCorrectionWidget.cpp index 71f1906f..a18cc423 100755 --- a/iSeg/OutlineCorrectionWidget.cpp +++ b/iSeg/OutlineCorrectionWidget.cpp @@ -14,7 +14,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/addLine.h" diff --git a/iSeg/OutlineCorrectionWidget.h b/iSeg/OutlineCorrectionWidget.h index c9ee4952..101c653d 100755 --- a/iSeg/OutlineCorrectionWidget.h +++ b/iSeg/OutlineCorrectionWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/PickerWidget.h b/iSeg/PickerWidget.h index 78c7b635..9cff3bed 100755 --- a/iSeg/PickerWidget.h +++ b/iSeg/PickerWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/SliceViewerWidget.h b/iSeg/SliceViewerWidget.h index e0da3923..98ad697e 100755 --- a/iSeg/SliceViewerWidget.h +++ b/iSeg/SliceViewerWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include #include diff --git a/iSeg/SlicesHandler.h b/iSeg/SlicesHandler.h index fe3532d5..a1296fda 100755 --- a/iSeg/SlicesHandler.h +++ b/iSeg/SlicesHandler.h @@ -10,7 +10,7 @@ #ifndef HANDLER3DSLICES #define HANDLER3DSLICES -#include "Plugin/SlicesHandlerInterface.h" +#include "Interface/SlicesHandlerInterface.h" #include "Core/Outline.h" // BL TODO get rid of this #include "Core/RGB.h" diff --git a/iSeg/SmoothingWidget.h b/iSeg/SmoothingWidget.h index 84528148..a0407a9d 100755 --- a/iSeg/SmoothingWidget.h +++ b/iSeg/SmoothingWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/ThresholdWidget.h b/iSeg/ThresholdWidget.h index e26a23b6..9e5fbe14 100755 --- a/iSeg/ThresholdWidget.h +++ b/iSeg/ThresholdWidget.h @@ -12,7 +12,7 @@ #include "SlicesHandler.h" #include "bmp_read_1.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/TransformWidget.h b/iSeg/TransformWidget.h index b09eb782..ccf6c359 100755 --- a/iSeg/TransformWidget.h +++ b/iSeg/TransformWidget.h @@ -11,7 +11,7 @@ #include "SliceTransform.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/VesselWidget.h b/iSeg/VesselWidget.h index 65e6b42d..f637d28f 100755 --- a/iSeg/VesselWidget.h +++ b/iSeg/VesselWidget.h @@ -13,7 +13,7 @@ #include "SlicesHandler.h" #include "World.h" -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/WatershedWidget.h b/iSeg/WatershedWidget.h index ffd620f2..97f3eed4 100755 --- a/iSeg/WatershedWidget.h +++ b/iSeg/WatershedWidget.h @@ -9,7 +9,7 @@ */ #pragma once -#include "Plugin/WidgetInterface.h" +#include "Interface/WidgetInterface.h" #include #include diff --git a/iSeg/WidgetCollection.h b/iSeg/WidgetCollection.h index 161a1aef..c2176254 100755 --- a/iSeg/WidgetCollection.h +++ b/iSeg/WidgetCollection.h @@ -10,8 +10,8 @@ #ifndef WIDGETCOLLECTION #define WIDGETCOLLECTION -#include "Plugin/DataSelection.h" -#include "Plugin/Point.h" +#include "Interface/DataSelection.h" +#include "Interface/Point.h" #include "Core/Types.h" diff --git a/iSeg/bmpshower.cpp b/iSeg/bmpshower.cpp index 3ec11084..020c0230 100755 --- a/iSeg/bmpshower.cpp +++ b/iSeg/bmpshower.cpp @@ -14,7 +14,7 @@ #include "bmpshower.h" #include "TissueInfos.h" -#include "Plugin/Point.h" +#include "Interface/Point.h" #include "Core/ColorLookupTable.h" From 8af0897f55734c8d9f8de886e560b51d37a66d85 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Tue, 10 Apr 2018 12:03:20 +0200 Subject: [PATCH 9/9] rename XAddon.* to XPlugin.* --- ...tionAddon.cpp => BiasCorrectionPlugin.cpp} | 4 ++-- ...rrectionAddon.h => BiasCorrectionPlugin.h} | 10 ++++------ Plugins/BiasCorrection/CMakeLists.txt | 4 ++-- Plugins/ConfidenceConnected/CMakeLists.txt | 4 ++-- ...nfidenceAddon.cpp => ConfidencePlugin.cpp} | 4 ++-- .../{ConfidenceAddon.h => ConfidencePlugin.h} | 10 ++++------ Plugins/GraphCut/CMakeLists.txt | 4 ++-- .../{GraphCutAddon.cpp => GraphCutPlugin.cpp} | 10 +++++----- .../{GraphCutAddon.h => GraphCutPlugin.h} | 20 ++++++++----------- Plugins/Levelset/CMakeLists.txt | 4 ++-- .../{LevelsetAddon.cpp => LevelsetPlugin.cpp} | 4 ++-- .../{LevelsetAddon.h => LevelsetPlugin.h} | 10 ++++------ 12 files changed, 39 insertions(+), 49 deletions(-) rename Plugins/BiasCorrection/{BiasCorrectionAddon.cpp => BiasCorrectionPlugin.cpp} (90%) mode change 100755 => 100644 rename Plugins/BiasCorrection/{BiasCorrectionAddon.h => BiasCorrectionPlugin.h} (67%) mode change 100755 => 100644 rename Plugins/ConfidenceConnected/{ConfidenceAddon.cpp => ConfidencePlugin.cpp} (90%) mode change 100755 => 100644 rename Plugins/ConfidenceConnected/{ConfidenceAddon.h => ConfidencePlugin.h} (66%) mode change 100755 => 100644 rename Plugins/GraphCut/{GraphCutAddon.cpp => GraphCutPlugin.cpp} (88%) mode change 100755 => 100644 rename Plugins/GraphCut/{GraphCutAddon.h => GraphCutPlugin.h} (58%) mode change 100755 => 100644 rename Plugins/Levelset/{LevelsetAddon.cpp => LevelsetPlugin.cpp} (90%) mode change 100755 => 100644 rename Plugins/Levelset/{LevelsetAddon.h => LevelsetPlugin.h} (66%) mode change 100755 => 100644 diff --git a/Plugins/BiasCorrection/BiasCorrectionAddon.cpp b/Plugins/BiasCorrection/BiasCorrectionPlugin.cpp old mode 100755 new mode 100644 similarity index 90% rename from Plugins/BiasCorrection/BiasCorrectionAddon.cpp rename to Plugins/BiasCorrection/BiasCorrectionPlugin.cpp index 5b5ef6d9..d7048ce2 --- a/Plugins/BiasCorrection/BiasCorrectionAddon.cpp +++ b/Plugins/BiasCorrection/BiasCorrectionPlugin.cpp @@ -7,7 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#include "BiasCorrectionAddon.h" +#include "BiasCorrectionPlugin.h" #include "BiasCorrection.h" @@ -22,7 +22,7 @@ BiasCorrectionPlugin::BiasCorrectionPlugin() {} BiasCorrectionPlugin::~BiasCorrectionPlugin() {} WidgetInterface* BiasCorrectionPlugin::create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const + Qt::WindowFlags wFlags) const { return new BiasCorrectionWidget(slice_handler(), parent, name, wFlags); } diff --git a/Plugins/BiasCorrection/BiasCorrectionAddon.h b/Plugins/BiasCorrection/BiasCorrectionPlugin.h old mode 100755 new mode 100644 similarity index 67% rename from Plugins/BiasCorrection/BiasCorrectionAddon.h rename to Plugins/BiasCorrection/BiasCorrectionPlugin.h index 1fdd1e35..59695c9e --- a/Plugins/BiasCorrection/BiasCorrectionAddon.h +++ b/Plugins/BiasCorrection/BiasCorrectionPlugin.h @@ -19,11 +19,9 @@ class BiasCorrectionPlugin : public Plugin BiasCorrectionPlugin(); ~BiasCorrectionPlugin(); - virtual std::string name() const { return "Bias Addon "; } - - virtual std::string description() const { return "Bias Plugin"; } - - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const; + std::string name() const override { return "Bias Addon "; } + std::string description() const override { return "Bias Plugin"; } + WidgetInterface* create_widget(QWidget* parent, const char* name, + Qt::WindowFlags wFlags) const override; }; }} // namespace iseg::plugin diff --git a/Plugins/BiasCorrection/CMakeLists.txt b/Plugins/BiasCorrection/CMakeLists.txt index 7aebc7a6..6e948057 100755 --- a/Plugins/BiasCorrection/CMakeLists.txt +++ b/Plugins/BiasCorrection/CMakeLists.txt @@ -12,8 +12,8 @@ IF(PLUGIN_BIAS) QT4_WRAP_CPP(MOCSrcsbias BiasCorrection.h) ADD_LIBRARY(BiasCorrection.ext SHARED - BiasCorrectionAddon.cpp - BiasCorrectionAddon.h + BiasCorrectionPlugin.cpp + BiasCorrectionPlugin.h BiasCorrection.cpp BiasCorrection.h ${MOCSrcsbias} diff --git a/Plugins/ConfidenceConnected/CMakeLists.txt b/Plugins/ConfidenceConnected/CMakeLists.txt index 760b15e2..0707c25e 100755 --- a/Plugins/ConfidenceConnected/CMakeLists.txt +++ b/Plugins/ConfidenceConnected/CMakeLists.txt @@ -12,8 +12,8 @@ IF(PLUGIN_CONFIDENCE) QT4_WRAP_CPP(MOCSrcscon Confidence.h) ADD_LIBRARY(Confidence.ext SHARED - ConfidenceAddon.cpp - ConfidenceAddon.h + ConfidencePlugin.cpp + ConfidencePlugin.h Confidence.cpp Confidence.h ${MOCSrcscon} diff --git a/Plugins/ConfidenceConnected/ConfidenceAddon.cpp b/Plugins/ConfidenceConnected/ConfidencePlugin.cpp old mode 100755 new mode 100644 similarity index 90% rename from Plugins/ConfidenceConnected/ConfidenceAddon.cpp rename to Plugins/ConfidenceConnected/ConfidencePlugin.cpp index 46e38ec7..3a71f4f3 --- a/Plugins/ConfidenceConnected/ConfidenceAddon.cpp +++ b/Plugins/ConfidenceConnected/ConfidencePlugin.cpp @@ -7,7 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#include "ConfidenceAddon.h" +#include "ConfidencePlugin.h" #include "Confidence.h" @@ -22,7 +22,7 @@ ConfidencePlugin::ConfidencePlugin() {} ConfidencePlugin::~ConfidencePlugin() {} WidgetInterface* ConfidencePlugin::create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const + Qt::WindowFlags wFlags) const { return new ConfidenceWidget(slice_handler(), parent, name, wFlags); } diff --git a/Plugins/ConfidenceConnected/ConfidenceAddon.h b/Plugins/ConfidenceConnected/ConfidencePlugin.h old mode 100755 new mode 100644 similarity index 66% rename from Plugins/ConfidenceConnected/ConfidenceAddon.h rename to Plugins/ConfidenceConnected/ConfidencePlugin.h index 330d2dd9..b41188c5 --- a/Plugins/ConfidenceConnected/ConfidenceAddon.h +++ b/Plugins/ConfidenceConnected/ConfidencePlugin.h @@ -19,11 +19,9 @@ class ConfidencePlugin : public Plugin ConfidencePlugin(); ~ConfidencePlugin(); - virtual std::string name() const { return "Example Addon 1"; } - - virtual std::string description() const { return "Hello World"; } - - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const; + std::string name() const override { return "Example Addon 1"; } + std::string description() const override { return "Hello World"; } + WidgetInterface* create_widget(QWidget* parent, const char* name, + Qt::WindowFlags wFlags) const override; }; }} // namespace iseg::plugin diff --git a/Plugins/GraphCut/CMakeLists.txt b/Plugins/GraphCut/CMakeLists.txt index 1059eee9..f9eaf190 100755 --- a/Plugins/GraphCut/CMakeLists.txt +++ b/Plugins/GraphCut/CMakeLists.txt @@ -19,8 +19,8 @@ IF(PLUGIN_GRAPHCUT) ) ADD_LIBRARY(GraphCut.ext SHARED - GraphCutAddon.cpp - GraphCutAddon.h + GraphCutPlugin.cpp + GraphCutPlugin.h GraphCutBoneSegmentation.cpp GraphCutBoneSegmentation.h GraphCutTissueSeparator.cpp diff --git a/Plugins/GraphCut/GraphCutAddon.cpp b/Plugins/GraphCut/GraphCutPlugin.cpp old mode 100755 new mode 100644 similarity index 88% rename from Plugins/GraphCut/GraphCutAddon.cpp rename to Plugins/GraphCut/GraphCutPlugin.cpp index ed9a2a4b..9c356b39 --- a/Plugins/GraphCut/GraphCutAddon.cpp +++ b/Plugins/GraphCut/GraphCutPlugin.cpp @@ -7,7 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#include "GraphCutAddon.h" +#include "GraphCutPlugin.h" #include "GraphCutBoneSegmentation.h" #include "GraphCutTissueSeparator.h" @@ -29,8 +29,8 @@ std::string GCBoneSegmentationPlugin::description() const } WidgetInterface* GCBoneSegmentationPlugin::create_widget(QWidget* parent, - const char* name, - Qt::WindowFlags wFlags) const + const char* name, + Qt::WindowFlags wFlags) const { return new BoneSegmentationWidget(slice_handler(), parent, name, wFlags); } @@ -46,8 +46,8 @@ std::string CGCTissueSeparatorPlugin::description() const } WidgetInterface* CGCTissueSeparatorPlugin::create_widget(QWidget* parent, - const char* name, - Qt::WindowFlags wFlags) const + const char* name, + Qt::WindowFlags wFlags) const { return new TissueSeparatorWidget(slice_handler(), parent, name, wFlags); } diff --git a/Plugins/GraphCut/GraphCutAddon.h b/Plugins/GraphCut/GraphCutPlugin.h old mode 100755 new mode 100644 similarity index 58% rename from Plugins/GraphCut/GraphCutAddon.h rename to Plugins/GraphCut/GraphCutPlugin.h index 96845c56..a50d37ac --- a/Plugins/GraphCut/GraphCutAddon.h +++ b/Plugins/GraphCut/GraphCutPlugin.h @@ -19,12 +19,10 @@ class GCBoneSegmentationPlugin : public Plugin GCBoneSegmentationPlugin(); ~GCBoneSegmentationPlugin(); - virtual std::string name() const { return "CT Auto-Bone"; } - - virtual std::string description() const; - - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const; + std::string name() const override { return "CT Auto-Bone"; } + std::string description() const override; + WidgetInterface* create_widget(QWidget* parent, const char* name, + Qt::WindowFlags wFlags) const override; }; class CGCTissueSeparatorPlugin : public Plugin @@ -33,12 +31,10 @@ class CGCTissueSeparatorPlugin : public Plugin CGCTissueSeparatorPlugin(); ~CGCTissueSeparatorPlugin(); - virtual std::string name() const { return "Tissue Separator"; } - - virtual std::string description() const; - - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const; + std::string name() const override { return "Tissue Separator"; } + std::string description() const override; + WidgetInterface* create_widget(QWidget* parent, const char* name, + Qt::WindowFlags wFlags) const override; }; }} // namespace iseg::plugin diff --git a/Plugins/Levelset/CMakeLists.txt b/Plugins/Levelset/CMakeLists.txt index 9f004442..a36f1ad5 100755 --- a/Plugins/Levelset/CMakeLists.txt +++ b/Plugins/Levelset/CMakeLists.txt @@ -12,8 +12,8 @@ IF(PLUGIN_LEVELSET) QT4_WRAP_CPP(MOCSrcslevel Levelset.h) ADD_LIBRARY(Levelset.ext SHARED - LevelsetAddon.cpp - LevelsetAddon.h + LevelsetPlugin.cpp + LevelsetPlugin.h Levelset.cpp Levelset.h ${MOCSrcslevel} diff --git a/Plugins/Levelset/LevelsetAddon.cpp b/Plugins/Levelset/LevelsetPlugin.cpp old mode 100755 new mode 100644 similarity index 90% rename from Plugins/Levelset/LevelsetAddon.cpp rename to Plugins/Levelset/LevelsetPlugin.cpp index 298e3c0f..7e37faa1 --- a/Plugins/Levelset/LevelsetAddon.cpp +++ b/Plugins/Levelset/LevelsetPlugin.cpp @@ -7,7 +7,7 @@ * This software is released under the MIT License. * https://opensource.org/licenses/MIT */ -#include "LevelsetAddon.h" +#include "LevelsetPlugin.h" #include "Levelset.h" @@ -22,7 +22,7 @@ LevelsetPlugin::LevelsetPlugin() {} LevelsetPlugin::~LevelsetPlugin() {} WidgetInterface* LevelsetPlugin::create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const + Qt::WindowFlags wFlags) const { return new LevelsetWidget(slice_handler(), parent, name, wFlags); } diff --git a/Plugins/Levelset/LevelsetAddon.h b/Plugins/Levelset/LevelsetPlugin.h old mode 100755 new mode 100644 similarity index 66% rename from Plugins/Levelset/LevelsetAddon.h rename to Plugins/Levelset/LevelsetPlugin.h index 72c14361..fc6519f3 --- a/Plugins/Levelset/LevelsetAddon.h +++ b/Plugins/Levelset/LevelsetPlugin.h @@ -19,11 +19,9 @@ class LevelsetPlugin : public Plugin LevelsetPlugin(); ~LevelsetPlugin(); - virtual std::string name() const { return "Levelset"; } - - virtual std::string description() const { return "LevelSet Plugin"; } - - virtual WidgetInterface* create_widget(QWidget* parent, const char* name, - Qt::WindowFlags wFlags) const; + std::string name() const override { return "Levelset"; } + std::string description() const override { return "LevelSet Plugin"; } + WidgetInterface* create_widget(QWidget* parent, const char* name, + Qt::WindowFlags wFlags) const override; }; }} // namespace iseg::plugin