diff --git a/Modules/Chart/src/QmitkChartWidget.cpp b/Modules/Chart/src/QmitkChartWidget.cpp index c4c21ca825..d4de5e15af 100644 --- a/Modules/Chart/src/QmitkChartWidget.cpp +++ b/Modules/Chart/src/QmitkChartWidget.cpp @@ -1,753 +1,753 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include #include "mitkExceptionMacro.h" #include #include class CustomPage : public QWebEnginePage { public: CustomPage(QObject *parent = 0) : QWebEnginePage(parent) {} - virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel /*level*/, + void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel /*level*/, const QString &message, int lineNumber, - const QString & /*sourceID*/) + const QString & /*sourceID*/) override { MITK_INFO << "JS > " << lineNumber << ": " << message.toStdString(); } }; class QmitkChartWidget::Impl final { public: explicit Impl(QWidget *parent); ~Impl(); Impl(const Impl &) = delete; Impl &operator=(const Impl &) = delete; void AddData1D(const std::vector &data1D, const std::string &label, QmitkChartWidget::ChartType chartType); void AddData2D(const std::map &data2D, const std::string &label, QmitkChartWidget::ChartType chartType); void UpdateData1D(const std::vector &data1D, const std::string &label); void UpdateData2D(const std::map &data2D, const std::string &label); void RemoveData(const std::string &label); void UpdateLabel(const std::string &existingLabel, const std::string &newLabel); void ClearData(); void SetColor(const std::string &label, const std::string &colorName); void SetLineStyle(const std::string &label, LineStyle style); void SetYAxisScale(AxisScale scale); void SetXAxisLabel(const std::string &label); void SetYAxisLabel(const std::string &label); void SetPieLabels(const std::vector &pieLabels, const std::string &label); void SetTitle(const std::string &title); void SetXErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus = std::vector()); void SetYErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus = std::vector()); std::string GetThemeName() const; void SetThemeName(ColorTheme style); void SetLegendPosition(LegendPosition position); void Show(bool showSubChart); void SetShowLegend(bool show); void SetShowErrorBars(bool show); void SetStackedData(bool stacked); void SetShowDataPoints(bool showDataPoints = false); void SetShowSubchart(bool showSubChart); void SetChartType(const std::string &label, QmitkChartWidget::ChartType chartType); void SetMinMaxValueXView(double minValueX, double maxValueX); void SetMinMaxValueYView(double minValueY, double maxValueY); QList ConvertErrorVectorToQList(const std::vector &error); QList ConvertVectorToQList(const std::vector &vec); std::string ConvertChartTypeToString(QmitkChartWidget::ChartType chartType) const; void ClearJavaScriptChart(); void InitializeJavaScriptChart(); void CallJavaScriptFuntion(const QString &command); QSize sizeHint() const; private: using ChartxyDataVector = std::vector>; std::string GetUniqueLabelName(const QList &labelList, const std::string &label) const; QmitkChartxyData *GetDataElementByLabel(const std::string &label) const; QList GetDataLabels(const ChartxyDataVector &c3xyData) const; QWebChannel *m_WebChannel; QWebEngineView *m_WebEngineView; QmitkChartData m_C3Data; ChartxyDataVector m_C3xyData; std::map m_ChartTypeToName; std::map m_ColorThemeToName; std::map m_LegendPositionToName; std::map m_LineStyleToName; std::map m_AxisScaleToName; }; std::string QmitkChartWidget::Impl::GetThemeName() const { return m_C3Data.GetThemeName().toString().toStdString(); } QmitkChartWidget::Impl::Impl(QWidget *parent) : m_WebChannel(new QWebChannel(parent)), m_WebEngineView(new QWebEngineView(parent)) { // disable context menu for QWebEngineView m_WebEngineView->setContextMenuPolicy(Qt::NoContextMenu); m_WebEngineView->setPage(new CustomPage()); // Set the webengineview to an initial empty page. The actual chart will be loaded once the data is calculated. m_WebEngineView->load(QUrl(QStringLiteral("qrc:///Chart/empty.html"))); m_WebEngineView->page()->setWebChannel(m_WebChannel); m_WebEngineView->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false); connect(m_WebEngineView, SIGNAL(loadFinished(bool)), parent, SLOT(OnLoadFinished(bool))); auto layout = new QGridLayout(parent); layout->setMargin(0); layout->addWidget(m_WebEngineView); m_ChartTypeToName.emplace(ChartType::bar, "bar"); m_ChartTypeToName.emplace(ChartType::line, "line"); m_ChartTypeToName.emplace(ChartType::spline, "spline"); m_ChartTypeToName.emplace(ChartType::pie, "pie"); m_ChartTypeToName.emplace(ChartType::area, "area"); m_ChartTypeToName.emplace(ChartType::area_spline, "area-spline"); m_ChartTypeToName.emplace(ChartType::scatter, "scatter"); m_LegendPositionToName.emplace(LegendPosition::bottomMiddle, "bottomMiddle"); m_LegendPositionToName.emplace(LegendPosition::bottomRight, "bottomRight"); m_LegendPositionToName.emplace(LegendPosition::topRight, "topRight"); m_LegendPositionToName.emplace(LegendPosition::topLeft, "topLeft"); m_LegendPositionToName.emplace(LegendPosition::middleRight, "middleRight"); m_LineStyleToName.emplace(LineStyle::solid, "solid"); m_LineStyleToName.emplace(LineStyle::dashed, "dashed"); m_AxisScaleToName.emplace(AxisScale::linear, ""); m_AxisScaleToName.emplace(AxisScale::log, "log"); m_ColorThemeToName.emplace(ColorTheme::lightstyle, "light"); m_ColorThemeToName.emplace(ColorTheme::darkstyle, "dark"); } QmitkChartWidget::Impl::~Impl() {} std::string CheckForCorrectHex(const std::string &colorName) { std::regex rgx("([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})"); std::smatch match; if (!colorName.empty() && colorName.at(0) != '#' && std::regex_search(colorName.begin(), colorName.end(), match, rgx)) { return "#" + colorName; } else { return colorName; } } void QmitkChartWidget::Impl::AddData1D(const std::vector &data1D, const std::string &label, QmitkChartWidget::ChartType type) { std::map transformedData2D; unsigned int count = 0; // transform the 1D data to 2D data for (const auto &ele : data1D) { transformedData2D[count] = ele; count++; } AddData2D(transformedData2D, label, type); } void QmitkChartWidget::Impl::AddData2D(const std::map &data2D, const std::string &label, QmitkChartWidget::ChartType type) { QMap data2DConverted; for (const auto &aValue : data2D) { data2DConverted.insert(aValue.first, aValue.second); } const std::string chartTypeName(m_ChartTypeToName.at(type)); auto definedLabels = GetDataLabels(m_C3xyData); auto uniqueLabel = GetUniqueLabelName(definedLabels, label); if (type == ChartType::scatter) { SetShowDataPoints(true); MITK_INFO << "Enabling data points for all because of scatter plot"; } unsigned int sizeOfC3xyData = static_cast(m_C3xyData.size()); m_C3xyData.push_back(std::make_unique(data2DConverted, QVariant(QString::fromStdString(uniqueLabel)), QVariant(QString::fromStdString(chartTypeName)), QVariant(sizeOfC3xyData))); } void QmitkChartWidget::Impl::UpdateData1D(const std::vector &data1D, const std::string &label) { std::map transformedData2D; unsigned int count = 0; // transform the 1D data to 2D data for (const auto &ele : data1D) { transformedData2D[count] = ele; count++; } UpdateData2D(transformedData2D, label); } void QmitkChartWidget::Impl::UpdateData2D(const std::map &data2D, const std::string &label) { auto element = GetDataElementByLabel(label); if (element) { QMap data2DConverted; for (const auto &aValue : data2D) { data2DConverted.insert(aValue.first, aValue.second); } element->SetData(data2DConverted); } } void QmitkChartWidget::Impl::RemoveData(const std::string &label) { for (ChartxyDataVector::iterator iter = m_C3xyData.begin(); iter != m_C3xyData.end(); ++iter) { if ((*iter)->GetLabel().toString().toStdString() == label) { m_C3xyData.erase(iter); return; } } throw std::invalid_argument("Cannot Remove Data because the label does not exist."); } void QmitkChartWidget::Impl::ClearData() { for (auto &xyData : m_C3xyData) { m_WebChannel->deregisterObject(xyData.get()); } m_C3xyData.clear(); } void QmitkChartWidget::Impl::UpdateLabel(const std::string &existingLabel, const std::string &newLabel) { auto element = GetDataElementByLabel(existingLabel); if (element) { auto definedLabels = GetDataLabels(m_C3xyData); auto uniqueLabel = GetUniqueLabelName(definedLabels, newLabel); element->SetLabel(QString::fromStdString(uniqueLabel)); } } void QmitkChartWidget::Impl::SetColor(const std::string &label, const std::string &colorName) { auto element = GetDataElementByLabel(label); if (element) { auto colorChecked = CheckForCorrectHex(colorName); element->SetColor(QVariant(QString::fromStdString(colorChecked))); } } void QmitkChartWidget::Impl::SetLineStyle(const std::string &label, LineStyle style) { auto element = GetDataElementByLabel(label); const std::string lineStyleName(m_LineStyleToName.at(style)); element->SetLineStyle(QVariant(QString::fromStdString(lineStyleName))); } void QmitkChartWidget::Impl::SetYAxisScale(AxisScale scale) { const std::string axisScaleName(m_AxisScaleToName.at(scale)); m_C3Data.SetYAxisScale(QString::fromStdString(axisScaleName)); } QmitkChartxyData *QmitkChartWidget::Impl::GetDataElementByLabel(const std::string &label) const { for (const auto &qmitkChartxyData : m_C3xyData) { if (qmitkChartxyData->GetLabel().toString() == label.c_str()) { return qmitkChartxyData.get(); } } MITK_WARN << "label " << label << " not found in QmitkChartWidget"; return nullptr; } QList QmitkChartWidget::Impl::GetDataLabels(const ChartxyDataVector &c3xyData) const { QList dataLabels; for (auto element = c3xyData.begin(); element != c3xyData.end(); ++element) { dataLabels.push_back((*element)->GetLabel()); } return dataLabels; } void QmitkChartWidget::Impl::SetXAxisLabel(const std::string &label) { m_C3Data.SetXAxisLabel(QString::fromStdString(label)); } void QmitkChartWidget::Impl::SetYAxisLabel(const std::string &label) { m_C3Data.SetYAxisLabel(QString::fromStdString(label)); } void QmitkChartWidget::Impl::SetPieLabels(const std::vector &pieLabels, const std::string &label) { auto element = GetDataElementByLabel(label); if (element) { if (element->GetChartType() == QVariant("pie")) { auto dataY = element->GetYData(); element->SetPieLabels(ConvertVectorToQList(pieLabels)); if (static_cast(dataY.size()) != pieLabels.size()) { MITK_INFO << "data has " << dataY.size() << " entries whereas pie labels have " << pieLabels.size() << " entries. Unnamed pie labels automatically get a numerical label."; } } else { MITK_INFO << "label" << label << "has chart type " << element->GetChartType().toString().toStdString() << ", but pie is required"; } } } void QmitkChartWidget::Impl::SetTitle(const std::string &title) { m_C3Data.SetTitle(QString::fromStdString(title)); } void QmitkChartWidget::Impl::SetThemeName(QmitkChartWidget::ColorTheme style) { const std::string themeName(m_ColorThemeToName.at(style)); m_C3Data.SetThemeName(QString::fromStdString(themeName)); } void QmitkChartWidget::Impl::SetLegendPosition(QmitkChartWidget::LegendPosition legendPosition) { const std::string legendPositionName(m_LegendPositionToName.at(legendPosition)); m_C3Data.SetLegendPosition(QString::fromStdString(legendPositionName)); } void QmitkChartWidget::Impl::Show(bool showSubChart) { if (m_C3xyData.empty()) { MITK_WARN << "no data available for display in chart"; } else { m_C3Data.SetAppearance(showSubChart, m_C3xyData.front()->GetChartType() == QVariant("pie")); } InitializeJavaScriptChart(); } void QmitkChartWidget::Impl::SetShowLegend(bool show) { m_C3Data.SetShowLegend(show); } void QmitkChartWidget::Impl::SetStackedData(bool stacked) { m_C3Data.SetStackedData(stacked); } void QmitkChartWidget::Impl::SetShowErrorBars(bool show) { m_C3Data.SetShowErrorBars(show); } void QmitkChartWidget::Impl::SetShowDataPoints(bool showDataPoints) { if (showDataPoints == true) { m_C3Data.SetDataPointSize(6.5); } else { m_C3Data.SetDataPointSize(0); } } void QmitkChartWidget::Impl::SetShowSubchart(bool showSubChart) { m_C3Data.SetShowSubchart(showSubChart); } void QmitkChartWidget::Impl::SetChartType(const std::string &label, QmitkChartWidget::ChartType chartType) { auto element = GetDataElementByLabel(label); if (element) { if (chartType == ChartType::scatter) { SetShowDataPoints(true); MITK_INFO << "Enabling data points for all because of scatter plot"; } const std::string chartTypeName(m_ChartTypeToName.at(chartType)); element->SetChartType(QVariant(QString::fromStdString(chartTypeName))); } } void QmitkChartWidget::Impl::SetMinMaxValueXView(double minValueX, double maxValueX) { m_C3Data.SetMinValueXView(minValueX); m_C3Data.SetMaxValueXView(maxValueX); } void QmitkChartWidget::Impl::SetMinMaxValueYView(double minValueY, double maxValueY) { m_C3Data.SetMinValueYView(minValueY); m_C3Data.SetMaxValueYView(maxValueY); } QList QmitkChartWidget::Impl::ConvertErrorVectorToQList(const std::vector &error) { QList errorConverted; for (const auto &aValue : error) { errorConverted.append(aValue); } return errorConverted; } QList QmitkChartWidget::Impl::ConvertVectorToQList(const std::vector &vec) { QList vecConverted; for (const auto &aValue : vec) { vecConverted.append(QString::fromStdString(aValue)); } return vecConverted; } void QmitkChartWidget::Impl::SetXErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus) { auto element = GetDataElementByLabel(label); if (element) { auto errorConvertedPlus = ConvertErrorVectorToQList(errorPlus); auto errorConvertedMinus = ConvertErrorVectorToQList(errorMinus); element->SetXErrorDataPlus(errorConvertedPlus); element->SetXErrorDataMinus(errorConvertedMinus); } } void QmitkChartWidget::Impl::SetYErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus) { auto element = GetDataElementByLabel(label); if (element) { auto errorConvertedPlus = ConvertErrorVectorToQList(errorPlus); auto errorConvertedMinus = ConvertErrorVectorToQList(errorMinus); element->SetYErrorDataPlus(errorConvertedPlus); element->SetYErrorDataMinus(errorConvertedMinus); } } std::string QmitkChartWidget::Impl::ConvertChartTypeToString(QmitkChartWidget::ChartType chartType) const { return m_ChartTypeToName.at(chartType); } QSize QmitkChartWidget::Impl::sizeHint() const { return QSize(400, 300); } void QmitkChartWidget::Impl::CallJavaScriptFuntion(const QString &command) { m_WebEngineView->page()->runJavaScript(command); } void QmitkChartWidget::Impl::ClearJavaScriptChart() { m_WebEngineView->load(QUrl(QStringLiteral("qrc:///Chart/empty.html"))); } void QmitkChartWidget::Impl::InitializeJavaScriptChart() { auto alreadyRegisteredObjects = m_WebChannel->registeredObjects(); auto alreadyRegisteredObjectsValues = alreadyRegisteredObjects.values(); // only register objects that have not been registered yet if (alreadyRegisteredObjectsValues.indexOf(&m_C3Data) == -1) { m_WebChannel->registerObject(QStringLiteral("chartData"), &m_C3Data); } unsigned count = 0; for (auto &xyData : m_C3xyData) { // only register objects that have not been registered yet if (alreadyRegisteredObjectsValues.indexOf(xyData.get()) == -1) { QString variableName = "xyData" + QString::number(count); m_WebChannel->registerObject(variableName, xyData.get()); } count++; } m_WebEngineView->load(QUrl(QStringLiteral("qrc:///Chart/QmitkChartWidget.html"))); } std::string QmitkChartWidget::Impl::GetUniqueLabelName(const QList &labelList, const std::string &label) const { QString currentLabel = QString::fromStdString(label); int counter = 0; while (labelList.contains(currentLabel)) { currentLabel = QString::fromStdString(label + std::to_string(counter)); counter++; } return currentLabel.toStdString(); } QmitkChartWidget::QmitkChartWidget(QWidget *parent) : QWidget(parent), m_Impl(new Impl(this)) { connect(this, &QmitkChartWidget::PageSuccessfullyLoaded, this, &QmitkChartWidget::OnPageSuccessfullyLoaded); } QmitkChartWidget::~QmitkChartWidget() {} void QmitkChartWidget::AddData2D(const std::map &data2D, const std::string &label, ChartType type) { m_Impl->AddData2D(data2D, label, type); } void QmitkChartWidget::SetColor(const std::string &label, const std::string &colorName) { m_Impl->SetColor(label, colorName); } void QmitkChartWidget::SetLineStyle(const std::string &label, LineStyle style) { m_Impl->SetLineStyle(label, style); } void QmitkChartWidget::SetYAxisScale(AxisScale scale) { m_Impl->SetYAxisScale(scale); } void QmitkChartWidget::AddData1D(const std::vector &data1D, const std::string &label, ChartType type) { m_Impl->AddData1D(data1D, label, type); } void QmitkChartWidget::UpdateData1D(const std::vector &data1D, const std::string &label) { m_Impl->UpdateData1D(data1D, label); } void QmitkChartWidget::UpdateData2D(const std::map &data2D, const std::string &label) { m_Impl->UpdateData2D(data2D, label); } void QmitkChartWidget::RemoveData(const std::string &label) { m_Impl->RemoveData(label); } void QmitkChartWidget::UpdateLabel(const std::string &existingLabel, const std::string &newLabel) { m_Impl->UpdateLabel(existingLabel, newLabel); } void QmitkChartWidget::SetXAxisLabel(const std::string &label) { m_Impl->SetXAxisLabel(label); } void QmitkChartWidget::SetYAxisLabel(const std::string &label) { m_Impl->SetYAxisLabel(label); } void QmitkChartWidget::SetPieLabels(const std::vector &pieLabels, const std::string &label) { m_Impl->SetPieLabels(pieLabels, label); } void QmitkChartWidget::SetTitle(const std::string &title) { m_Impl->SetTitle(title); } void QmitkChartWidget::SetShowDataPoints(bool showDataPoints) { m_Impl->SetShowDataPoints(showDataPoints); } void QmitkChartWidget::SetChartType(const std::string &label, ChartType type) { m_Impl->SetChartType(label, type); } void QmitkChartWidget::SetXErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus) { m_Impl->SetXErrorBars(label, errorPlus, errorMinus); } void QmitkChartWidget::SetYErrorBars(const std::string &label, const std::vector &errorPlus, const std::vector &errorMinus) { m_Impl->SetYErrorBars(label, errorPlus, errorMinus); } void QmitkChartWidget::SetLegendPosition(LegendPosition position) { m_Impl->SetLegendPosition(position); } void QmitkChartWidget::SetShowLegend(bool show) { m_Impl->SetShowLegend(show); } void QmitkChartWidget::SetStackedData(bool stacked) { m_Impl->SetStackedData(stacked); } void QmitkChartWidget::Show(bool showSubChart) { m_Impl->Show(showSubChart); } void QmitkChartWidget::Clear() { m_Impl->ClearData(); m_Impl->ClearJavaScriptChart(); } void QmitkChartWidget::OnLoadFinished(bool isLoadSuccessful) { if (isLoadSuccessful) { emit PageSuccessfullyLoaded(); } } void QmitkChartWidget::OnPageSuccessfullyLoaded() { auto themeName = m_Impl->GetThemeName(); QString command; if (themeName == "dark") { command = QString("changeTheme('dark')"); } else { command = QString("changeTheme('light')"); } m_Impl->CallJavaScriptFuntion(command); } void QmitkChartWidget::SetTheme(ColorTheme themeEnabled) { m_Impl->SetThemeName(themeEnabled); } void QmitkChartWidget::SetShowSubchart(bool showSubChart) { m_Impl->SetShowSubchart(showSubChart); } void QmitkChartWidget::SetShowErrorBars(bool showErrorBars) { m_Impl->SetShowErrorBars(showErrorBars); } void QmitkChartWidget::SetMinMaxValueXView(double minValueX, double maxValueX) { m_Impl->SetMinMaxValueXView(minValueX, maxValueX); } void QmitkChartWidget::SetMinMaxValueYView(double minValueY, double maxValueY) { m_Impl->SetMinMaxValueYView(minValueY, maxValueY); } void QmitkChartWidget::Reload() { const QString command = QString("Reload()"); m_Impl->CallJavaScriptFuntion(command); } QSize QmitkChartWidget::sizeHint() const { return m_Impl->sizeHint(); } diff --git a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h index 306848c10b..ee7facfe7c 100644 --- a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h +++ b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkIntensityQuantifier_h #define mitkIntensityQuantifier_h #include #include #include namespace mitk { class MITKCLCORE_EXPORT IntensityQuantifier : public BaseData { public: mitkClassMacro(IntensityQuantifier, BaseData) itkFactorylessNewMacro(Self) itkCloneMacro(Self) IntensityQuantifier(); void InitializeByMinimumMaximum(double minimum, double maximum, unsigned int bins); void InitializeByBinsizeAndBins(double minimum, unsigned int bins, double binsize); void InitializeByBinsizeAndMaximum(double minimum, double maximum, double binsize); void InitializeByImage(mitk::Image::Pointer image, unsigned int bins); void InitializeByImageAndMaximum(mitk::Image::Pointer image, double maximum, unsigned int bins); void InitializeByImageAndMinimum(mitk::Image::Pointer image, double minimum, unsigned int bins); void InitializeByImageRegion(mitk::Image::Pointer image, mitk::Image::Pointer mask, unsigned int bins); void InitializeByImageRegionAndMinimum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double minimum, unsigned int bins); void InitializeByImageRegionAndMaximum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double maximum, unsigned int bins); void InitializeByImageAndBinsize(mitk::Image::Pointer image, double binsize); void InitializeByImageAndBinsizeAndMinimum(mitk::Image::Pointer image, double minimum, double binsize); void InitializeByImageAndBinsizeAndMaximum(mitk::Image::Pointer image, double maximum, double binsize); void InitializeByImageRegionAndBinsize(mitk::Image::Pointer image, mitk::Image::Pointer mask, double binsize); void InitializeByImageRegionAndBinsizeAndMinimum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double minimum, double binsize); void InitializeByImageRegionAndBinsizeAndMaximum(mitk::Image::Pointer image, mitk::Image::Pointer mask, double maximum, double binsize); unsigned int IntensityToIndex(double intensity); double IndexToMinimumIntensity(unsigned int index); double IndexToMeanIntensity(unsigned int index); double IndexToMaximumIntensity(unsigned int index); itkGetConstMacro(Initialized, bool); itkGetConstMacro(Bins, unsigned int); itkGetConstMacro(Binsize, double); itkGetConstMacro(Minimum, double); itkGetConstMacro(Maximum, double); public: //#ifndef DOXYGEN_SKIP - virtual void SetRequestedRegionToLargestPossibleRegion() override {}; - virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; }; - virtual bool VerifyRequestedRegion() override { return false; }; - virtual void SetRequestedRegion (const itk::DataObject * /*data*/) override {}; + void SetRequestedRegionToLargestPossibleRegion() override {}; + bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; }; + bool VerifyRequestedRegion() override { return false; }; + void SetRequestedRegion (const itk::DataObject * /*data*/) override {}; // Override - virtual bool IsEmpty() const override + bool IsEmpty() const override { if(IsInitialized() == false) return true; const TimeGeometry* timeGeometry = const_cast(this)->GetUpdatedTimeGeometry(); if(timeGeometry == nullptr) return true; return false; } private: bool m_Initialized; unsigned int m_Bins; double m_Binsize; double m_Minimum; double m_Maximum; }; } #endif //mitkIntensityQuantifier_h diff --git a/Modules/Classification/CLUtilities/include/itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h b/Modules/Classification/CLUtilities/include/itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h index c3952de08c..2393b74a2f 100644 --- a/Modules/Classification/CLUtilities/include/itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h +++ b/Modules/Classification/CLUtilities/include/itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h @@ -1,188 +1,188 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ /*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter_h #define __itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter_h #include "itkHistogram.h" #include "itkMacro.h" #include "itkProcessObject.h" #include "itkSimpleDataObjectDecorator.h" namespace itk { namespace Statistics { /** \class EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter * \brief This class computes texture feature coefficients from a grey level * Zone-length matrix. * * By default, Zone length features are computed for each spatial * direction and then averaged afterward, so it is possible to access the * standard deviations of the texture features. These values give a clue as * to texture anisotropy. However, doing this is much more work, because it * involved computing one for each offset given. To compute a single matrix * using the first offset, call FastCalculationsOn(). If this is called, * then the texture standard deviations will not be computed (and will be set * to zero), but texture computation will be much faster. * * This class is templated over the input histogram type. * * Print references: * M. M. Galloway. Texture analysis using gray level Zone lengths. Computer * Graphics and Image Processing, 4:172-179, 1975. * * A. Chu, C. M. Sehgal, and J. F. Greenleaf. Use of gray value distribution of * Zone lengths for texture analysis. Pattern Recognition Letters, 11:415-420, * 1990. * * B. R. Dasarathy and E. B. Holder. Image characterizations based on joint * gray-level Zone-length distributions. Pattern Recognition Letters, 12:490-502, * 1991. * * IJ article: http://hdl.handle.net/1926/1374 * * \sa ScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter * \sa ScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter * \sa EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter * * \author: Nick Tustison * \ingroup ITKStatistics */ template< typename THistogram > class EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter : public ProcessObject { public: /** Standard typedefs */ typedef EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter Self; typedef ProcessObject Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Zone-time type information (and related methods). */ itkTypeMacro( EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter, ProcessObject ); /** standard New() method support */ itkNewMacro( Self ); typedef THistogram HistogramType; typedef typename HistogramType::Pointer HistogramPointer; typedef typename HistogramType::ConstPointer HistogramConstPointer; typedef typename HistogramType::MeasurementType MeasurementType; typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; typedef typename HistogramType::IndexType IndexType; typedef typename HistogramType:: TotalAbsoluteFrequencyType FrequencyType; /** Method to Set/Get the input Histogram */ using Superclass::SetInput; void SetInput (const HistogramType * histogram ); const HistogramType * GetInput() const; /** Smart Pointer type to a DataObject. */ typedef DataObject::Pointer DataObjectPointer; /** Type of DataObjects used for scalar outputs */ typedef SimpleDataObjectDecorator MeasurementObjectType; /** Methods to return the short Zone emphasis. */ MeasurementType GetCoarseness() const; const MeasurementObjectType* GetCoarsenessOutput() const; /** Methods to return the long Zone emphasis. */ MeasurementType GetContrast() const; const MeasurementObjectType* GetContrastOutput() const; /** Methods to return the grey level nonuniformity. */ MeasurementType GetBusyness() const; const MeasurementObjectType* GetBusynessOutput() const; /** Methods to return the Zone length nonuniformity. */ MeasurementType GetComplexity() const; const MeasurementObjectType* GetComplexityOutput() const; /** Methods to return the low grey level Zone emphasis. */ MeasurementType GetStrength() const; const MeasurementObjectType* GetStrengthOutput() const; itkGetMacro( TotalNumberOfValidVoxels, unsigned long ); itkGetConstMacro(NumberOfVoxels, unsigned long); itkSetMacro(NumberOfVoxels, unsigned long); void SetSiMatrix(double* matrix) { m_siMatrix = matrix; } /** Zone-length feature types */ typedef enum { Coarseness, Contrast, Busyness, Complexity, Strength } NeighbourhoodGreyLevelDifferenceFeatureName; /** convenience method to access the Zone length values */ MeasurementType GetFeature( NeighbourhoodGreyLevelDifferenceFeatureName name ); protected: EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter(); - ~EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter() {}; - virtual void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE; + ~EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter() override {}; + void PrintSelf(std::ostream& os, Indent indent) const ITK_OVERRIDE; /** Make a DataObject to be used for output output. */ typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; using Superclass::MakeOutput; - virtual DataObjectPointer MakeOutput( DataObjectPointerArraySizeType ) ITK_OVERRIDE; + DataObjectPointer MakeOutput( DataObjectPointerArraySizeType ) ITK_OVERRIDE; - virtual void GenerateData() ITK_OVERRIDE; + void GenerateData() ITK_OVERRIDE; private: EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented unsigned long m_TotalNumberOfValidVoxels; unsigned long m_NumberOfVoxels; double* m_siMatrix; }; } // end of namespace Statistics } // end of namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.hxx" #endif #endif diff --git a/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h b/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h index 29c801ebd6..a9c824e30f 100644 --- a/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h +++ b/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h @@ -1,245 +1,245 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ /*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter_h #define __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter_h #include "itkDataObjectDecorator.h" #include "itkEnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter.h" #include "itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h" namespace itk { namespace Statistics { /** \class EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter * \brief This class computes run length descriptions from an image. * * By default, run length features are computed for each spatial * direction and then averaged afterward, so it is possible to access the * standard deviations of the texture features. These values give a clue as * to texture anisotropy. However, doing this is much more work, because it * involved computing one for each offset given. To compute a single * matrix using the first offset, call FastCalculationsOn(). If this is called, * then the texture standard deviations will not be computed (and will be set * to zero), but texture computation will be much faster. * * This class is templated over the input image type. * * Template Parameters: * The image type, and the type of histogram frequency container. If you are * using a large number of bins per axis, a sparse frequency container may be * advisable. The default is to use a dense frequency container. * * Inputs and parameters: * -# An image * -# A mask defining the region over which texture features will be * calculated. (Optional) * -# The pixel value that defines the "inside" of the mask. (Optional, defaults * to 1 if a mask is set.) * -# The set of features to be calculated. These features are defined * in the HistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter class. * -# The number of intensity bins. (Optional, defaults to 256.) * -# The set of directions (offsets) to average across. (Optional, defaults to * {(-1, 0), (-1, -1), (0, -1), (1, -1)} for 2D images and scales analogously * for ND images.) * -# The pixel intensity range over which the features will be calculated. * (Optional, defaults to the full dynamic range of the pixel type.) * -# The distance range over which the features will be calculated. * (Optional, defaults to the full dynamic range of double type.) * * In general, the default parameter values should be sufficient. * * Outputs: * (1) The average value of each feature. * (2) The standard deviation in the values of each feature. * * Print references: * M. M. Galloway. Texture analysis using gray level run lengths. Computer * Graphics and Image Processing, 4:172-179, 1975. * * A. Chu, C. M. Sehgal, and J. F. Greenleaf. Use of gray value distribution of * run lengths for texture analysis. Pattern Recognition Letters, 11:415-420, * 1990. * * B. R. Dasarathy and E. B. Holder. Image characterizations based on joint * gray-level run-length distributions. Pattern Recognition Letters, 12:490-502, * 1991. * * IJ article: http://hdl.handle.net/1926/1374 * * \sa EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter * \sa ScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter * \sa HistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter * * \author: Nick Tustison * \ingroup ITKStatistics */ template< typename TImageType, typename THistogramFrequencyContainer = DenseFrequencyContainer2 > class EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter:public ProcessObject { public: /** Standard typedefs */ typedef EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter Self; typedef ProcessObject Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Run-time type information (and related methods). */ itkTypeMacro(EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter, ProcessObject); /** standard New() method support */ itkNewMacro(Self); typedef THistogramFrequencyContainer FrequencyContainerType; typedef TImageType ImageType; typedef typename ImageType::Pointer ImagePointer; typedef typename ImageType::PixelType PixelType; typedef typename ImageType::OffsetType OffsetType; typedef VectorContainer< unsigned char, OffsetType > OffsetVector; typedef typename OffsetVector::Pointer OffsetVectorPointer; typedef typename OffsetVector::ConstPointer OffsetVectorConstPointer; typedef EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter< ImageType, FrequencyContainerType > NeighbourhoodGreyLevelDifferenceMatrixFilterType; typedef typename NeighbourhoodGreyLevelDifferenceMatrixFilterType::HistogramType HistogramType; typedef EnhancedHistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter< HistogramType > NeighbourhoodGreyLevelDifferenceFeaturesFilterType; typedef short NeighbourhoodGreyLevelDifferenceFeatureName; typedef VectorContainer FeatureNameVector; typedef typename FeatureNameVector::Pointer FeatureNameVectorPointer; typedef typename FeatureNameVector::ConstPointer FeatureNameVectorConstPointer; typedef VectorContainer< unsigned char, double > FeatureValueVector; typedef typename FeatureValueVector::Pointer FeatureValueVectorPointer; /** Smart Pointer type to a DataObject. */ typedef DataObject::Pointer DataObjectPointer; /** Type of DataObjects used for scalar outputs */ typedef DataObjectDecorator< FeatureValueVector > FeatureValueVectorDataObjectType; const FeatureValueVectorDataObjectType * GetFeatureMeansOutput() const; const FeatureValueVectorDataObjectType * GetFeatureStandardDeviationsOutput() const; /** Connects the input image for which the features are going to be computed */ using Superclass::SetInput; void SetInput(const ImageType *); const ImageType * GetInput() const; /** Return the feature means and deviations. */ itkGetConstReferenceObjectMacro(FeatureMeans, FeatureValueVector); itkGetConstReferenceObjectMacro(FeatureStandardDeviations, FeatureValueVector); /** Set the desired feature set. Optional, for default value see above. */ itkSetConstObjectMacro(RequestedFeatures, FeatureNameVector); itkGetConstObjectMacro(RequestedFeatures, FeatureNameVector); /** Set the offsets over which the co-occurrence pairs will be computed. Optional; for default value see above. */ itkSetConstObjectMacro(Offsets, OffsetVector); itkGetConstObjectMacro(Offsets, OffsetVector); /** Set number of histogram bins along each axis. Optional; for default value see above. */ void SetNumberOfBinsPerAxis(unsigned int); /** Set the min and max (inclusive) pixel value that will be used for feature calculations. Optional; for default value see above. */ void SetPixelValueMinMax(PixelType min, PixelType max); /** Set the min and max (inclusive) pixel value that will be used for feature calculations. Optional; for default value see above. */ void SetDistanceValueMinMax( double min, double max ); /** Connects the mask image for which the histogram is going to be computed. Optional; for default value see above. */ void SetMaskImage(const ImageType *); const ImageType * GetMaskImage() const; /** Set the pixel value of the mask that should be considered "inside" the object. Optional; for default value see above. */ void SetInsidePixelValue(PixelType InsidePixelValue); itkGetConstMacro(FastCalculations, bool); itkSetMacro(FastCalculations, bool); itkBooleanMacro(FastCalculations); protected: EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter(); - virtual ~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter() {} - virtual void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE; + ~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter() override {} + void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE; void FastCompute(); void FullCompute(); /** This method causes the filter to generate its output. */ - virtual void GenerateData() ITK_OVERRIDE; + void GenerateData() ITK_OVERRIDE; /** Make a DataObject to be used for output output. */ typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; using Superclass::MakeOutput; - virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE; + DataObjectPointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE; private: typename NeighbourhoodGreyLevelDifferenceMatrixFilterType::Pointer m_NeighbourhoodGreyLevelDifferenceMatrixGenerator; FeatureValueVectorPointer m_FeatureMeans; FeatureValueVectorPointer m_FeatureStandardDeviations; FeatureNameVectorConstPointer m_RequestedFeatures; OffsetVectorConstPointer m_Offsets; bool m_FastCalculations; }; } // end of namespace Statistics } // end of namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter.hxx" #endif #endif diff --git a/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h b/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h index 697f13028f..2b44f4e41b 100644 --- a/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h +++ b/Modules/Classification/CLUtilities/include/itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.h @@ -1,299 +1,299 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ /*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter_h #define __itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter_h #include "itkImage.h" #include "itkHistogram.h" #include "itkNumericTraits.h" #include "itkVectorContainer.h" namespace itk { namespace Statistics { /** \class EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter * \brief This class computes a run length matrix (histogram) from * a given image and a mask image if provided. Run length matrces are * used for image texture description. * * This filters creates a grey-level run length matrix from a N-D scalar * image. This is another possible texture description. See the following * references. * M. M. Galloway. Texture analysis using gray level run lengths. Computer * Graphics and Image Processing, 4:172-179, 1975. * * A. Chu, C. M. Sehgal, and J. F. Greenleaf. Use of gray value distribution of * run lengths for texture analysis. Pattern Recognition Letters, 11:415-420, * 1990. * * B. R. Dasarathy and E. B. Holder. Image characterizations based on joint * gray-level run-length distributions. Pattern Recognition Letters, 12:490-502, * 1991. * * The basic idea is as follows: * Given an image and an offset (e.g. (1, -1) for a 2-d image), each element * in the joint histogram describes the frequency for a particular distance/ * intensity pair within a given image. This distance/intensity pair can be * described as follows: we start at a given voxel which has some intensity. * We then "jump" to neighboring pixels in increments provided by the offset(s) * as long as the pixel to which we are jumping is within the same intensity * bin as the original voxel. The distance component is given by the distance * from the original to the final voxel satisfying our jumping criteria. * * The offset (or offsets) along which the co-occurences are calculated can be * set by the user. Traditionally, only one offset is used per histogram, and * offset components in the range [-1, 1] are used. For rotation-invariant * features averages of features computed over several histograms with different * offsets are generally used, instead of computing features from one histogram * create with several offsets. Additionally, instead of using offsets of two or * more pixels in any direction, multi-resolution techniques (e.g. image * pyramids) are generally used to deal with texture at different spatial * resolutions. * * This class calculates a 2-d histogram of all the intensity/distance pairs in * the given image's requested region, for a given set of offsets. That is, if * a given offset falls outside of the requested region (or outside the mask) * at a particular point, that distance/intensity pair will not be added to * the matrix. * * The number of histogram bins on each axis can be set (defaults to 256). Also, * by default the histogram min and max corresponds to the largest and smallest * possible pixel value of that pixel type. To customize the histogram bounds * for a given image, the max and min pixel values that will be placed in the * histogram can be set manually. NB: The min and max are INCLUSIVE. * * Further, the type of histogram frequency container used is an optional * template parameter. By default, a dense container is used, but for images * with little texture or in cases where the user wants more histogram bins, * a sparse container can be used for the histogram instead. * * WARNING: This probably won't work for pixels of double or long-double type * unless you set the histogram min and max manually. This is because the largest * histogram bin by default has max value of the largest possible pixel value * plus 1. For double and long-double types, whose "RealType" as defined by the * NumericTraits class is the same, and thus cannot hold any larger values, * this would cause a float overflow. * * IJ article: http://hdl.handle.net/1926/1374 * * \sa ScalarImageToNeighbourhoodGreyLevelDifferenceFeaturesFilter * \sa EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter * \sa HistogramToNeighbourhoodGreyLevelDifferenceFeaturesFilter * * \author: Nick Tustison * \ingroup ITKStatistics */ template class EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter : public ProcessObject { public: /** Standard typedefs */ typedef EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter Self; typedef ProcessObject Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Run-time type information (and related methods). */ itkTypeMacro( EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter, ProcessObject ); /** standard New() method support */ itkNewMacro( Self ); typedef TImageType ImageType; typedef typename ImageType::Pointer ImagePointer; typedef typename ImageType::ConstPointer ImageConstPointer; typedef typename ImageType::PixelType PixelType; typedef typename ImageType::IndexType IndexType; typedef typename ImageType::RegionType RegionType; typedef typename ImageType::SizeType RadiusType; typedef typename ImageType::OffsetType OffsetType; typedef VectorContainer OffsetVector; typedef typename OffsetVector::Pointer OffsetVectorPointer; typedef typename ImageType::PointType PointType; typedef typename NumericTraits::RealType MeasurementType; typedef typename NumericTraits::RealType RealType; typedef Histogram HistogramType; typedef typename HistogramType::Pointer HistogramPointer; typedef typename HistogramType::ConstPointer HistogramConstPointer; typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; /** ImageDimension constants */ itkStaticConstMacro( ImageDimension, unsigned int, TImageType::ImageDimension ); /** Specify the default number of bins per axis */ itkStaticConstMacro( DefaultBinsPerAxis, unsigned int, 256 ); /** * Set the offsets over which the intensity/distance pairs will be computed. * Invoking this function clears the previous offsets. * Note: for each individual offset in the OffsetVector, the rightmost non-zero * offset element must be positive. For example, in the offset list of a 2D image, * (1, 0) means the offset along x-axis. (1, 0) has to be set instead * of (-1, 0). This is required from the iterating order of pixel iterator. * */ itkSetObjectMacro( Offsets, OffsetVector ); /** * Set offset over which the intensity/distance pairs will be computed. * Invoking this function clears the previous offset(s). * Note: for each individual offset, the rightmost non-zero * offset element must be positive. For example, in the offset list of a 2D image, * (1, 0) means the offset along x-axis. (1, 0) has to be set instead * of (-1, 0). This is required from the iterating order of pixel iterator. * */ void SetOffset( const OffsetType offset ); void AddOffsets( const std::vector offset ); /** * Get the current offset(s). */ itkGetModifiableObjectMacro(Offsets, OffsetVector ); /** Set number of histogram bins along each axis */ itkSetMacro( NumberOfBinsPerAxis, unsigned int ); /** Get number of histogram bins along each axis */ itkGetConstMacro( NumberOfBinsPerAxis, unsigned int ); /** * Set the min and max (inclusive) pixel value that will be used in * generating the histogram. */ void SetPixelValueMinMax( PixelType min, PixelType max ); /** Get the min pixel value defining one dimension of the joint histogram. */ itkGetConstMacro( Min, PixelType ); /** Get the max pixel value defining one dimension of the joint histogram. */ itkGetConstMacro( Max, PixelType ); /** * Set the min and max (inclusive) pixel value that will be used in * generating the histogram. */ void SetDistanceValueMinMax( RealType min, RealType max ); /** * Get the min distance value defining one dimension of the joint histogram. */ itkGetConstMacro( MinDistance, RealType ); /** * Get the max distance value defining one dimension of the joint histogram. */ itkGetConstMacro( MaxDistance, RealType ); /** Method to set the input image */ using Superclass::SetInput; void SetInput( const ImageType *image ); /** Method to get the input image */ const ImageType * GetInput() const; /** Method to set the mask image */ void SetMaskImage( const ImageType *image ); /** Method to get the mask image */ const ImageType * GetMaskImage() const; /** method to get the Histogram */ const HistogramType * GetOutput() const; /** method to get the Histogram */ double* GetSiMatrix() const; /** * Set the pixel value of the mask that should be considered "inside" the * object. Defaults to 1. */ itkSetMacro( InsidePixelValue, PixelType ); itkGetConstMacro( InsidePixelValue, PixelType ); protected: EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter(); - virtual ~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter() {}; - virtual void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE; + ~EnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter() override {}; + void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE; /** Standard itk::ProcessObject subclass method. */ typedef DataObject::Pointer DataObjectPointer; typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; using Superclass::MakeOutput; - virtual DataObjectPointer MakeOutput( DataObjectPointerArraySizeType idx ) ITK_OVERRIDE; + DataObjectPointer MakeOutput( DataObjectPointerArraySizeType idx ) ITK_OVERRIDE; /** This method causes the filter to generate its output. */ - virtual void GenerateData() ITK_OVERRIDE; + void GenerateData() ITK_OVERRIDE; /** * Normalize the direction of the offset before it is applied. * The last non-zero dimension of the offest has to be positive in order * to match to scanning order of the iterator. Only the sign is changed. * For example, the input offset (-1, 0) will be normalized as * (1, 0). * */ void NormalizeOffsetDirection(OffsetType &offset); private: unsigned int m_NumberOfBinsPerAxis; PixelType m_Min; PixelType m_Max; RealType m_MinDistance; RealType m_MaxDistance; PixelType m_InsidePixelValue; MeasurementVectorType m_LowerBound; MeasurementVectorType m_UpperBound; OffsetVectorPointer m_Offsets; double * m_siMatrix; }; } // end of namespace Statistics } // end of namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkEnhancedScalarImageToNeighbourhoodGreyLevelDifferenceMatrixFilter.hxx" #endif #endif diff --git a/Modules/Classification/CLUtilities/include/itkLocalIntensityFilter.h b/Modules/Classification/CLUtilities/include/itkLocalIntensityFilter.h index 51ae412c48..624357222d 100644 --- a/Modules/Classification/CLUtilities/include/itkLocalIntensityFilter.h +++ b/Modules/Classification/CLUtilities/include/itkLocalIntensityFilter.h @@ -1,162 +1,162 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef itkLocalIntensityFilter_h #define itkLocalIntensityFilter_h #include "itkImageToImageFilter.h" #include "itkNumericTraits.h" #include "itkArray.h" #include "itkSimpleDataObjectDecorator.h" namespace itk { template< typename TInputImage > class ITK_TEMPLATE_EXPORT LocalIntensityFilter : public ImageToImageFilter< TInputImage, TInputImage > { public: /** Standard Self typedef */ typedef LocalIntensityFilter Self; typedef ImageToImageFilter< TInputImage, TInputImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(LocalIntensityFilter, ImageToImageFilter); /** Image related typedefs. */ typedef typename TInputImage::Pointer InputImagePointer; typedef typename TInputImage::RegionType RegionType; typedef typename TInputImage::SizeType SizeType; typedef typename TInputImage::IndexType IndexType; typedef typename TInputImage::PixelType PixelType; typedef Image MaskImageType; /** Image related typedefs. */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); /** Type to use for computations. */ typedef typename NumericTraits< PixelType >::RealType RealType; /** Smart Pointer type to a DataObject. */ typedef typename DataObject::Pointer DataObjectPointer; /** Type of DataObjects used for scalar outputs */ typedef SimpleDataObjectDecorator< RealType > RealObjectType; typedef SimpleDataObjectDecorator< PixelType > PixelObjectType; /** Return the computed Mean. */ RealType GetLocalPeak() const { return this->GetLocalPeakOutput()->Get(); } RealObjectType * GetLocalPeakOutput(); const RealObjectType * GetLocalPeakOutput() const; /** Return the computed Standard Deviation. */ RealType GetGlobalPeak() const { return this->GetGlobalPeakOutput()->Get(); } RealObjectType * GetGlobalPeakOutput(); const RealObjectType * GetGlobalPeakOutput() const; /** Return the computed Variance. */ RealType GetLocalMaximum() const { return this->GetLocalMaximumOutput()->Get(); } RealObjectType * GetLocalMaximumOutput(); const RealObjectType * GetLocalMaximumOutput() const; void SetMask(typename MaskImageType::Pointer mask) { m_Mask = mask; } itkSetMacro(Range, double); itkGetMacro(Range, double); itkGetConstMacro(Range, double); /** Make a DataObject of the correct type to be used as the specified * output. */ typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; using Superclass::MakeOutput; - virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE; + DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) ITK_OVERRIDE; #ifdef ITK_USE_CONCEPT_CHECKING // Begin concept checking itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits< PixelType >)); // End concept checking #endif protected: LocalIntensityFilter(); ~LocalIntensityFilter() ITK_OVERRIDE {} void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE; /** Pass the input through unmodified. Do this by Grafting in the * AllocateOutputs method. */ void AllocateOutputs() ITK_OVERRIDE; /** Initialize some accumulators before the threads run. */ void BeforeThreadedGenerateData() ITK_OVERRIDE; /** Do final mean and variance computation from data accumulated in threads. */ void AfterThreadedGenerateData() ITK_OVERRIDE; /** Multi-thread version GenerateData. */ void ThreadedGenerateData(const RegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE; // Override since the filter needs all the data for the algorithm void GenerateInputRequestedRegion() ITK_OVERRIDE; // Override since the filter produces all of its output void EnlargeOutputRequestedRegion(DataObject *data) ITK_OVERRIDE; private: ITK_DISALLOW_COPY_AND_ASSIGN(LocalIntensityFilter); Array< RealType > m_ThreadLocalMaximum; Array< RealType > m_ThreadLocalPeakValue; Array< RealType > m_ThreadGlobalPeakValue; typename MaskImageType::Pointer m_Mask; double m_Range; }; // end of class } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkLocalIntensityFilter.hxx" #endif #endif diff --git a/Modules/Classification/CLUtilities/include/itkMultiHistogramFilter.h b/Modules/Classification/CLUtilities/include/itkMultiHistogramFilter.h index 3f2fcfa147..744868a274 100644 --- a/Modules/Classification/CLUtilities/include/itkMultiHistogramFilter.h +++ b/Modules/Classification/CLUtilities/include/itkMultiHistogramFilter.h @@ -1,66 +1,66 @@ #ifndef itkMultiHistogramFilter_h #define itkMultiHistogramFilter_h #include "itkImageToImageFilter.h" namespace itk { template class MultiHistogramFilter : public ImageToImageFilter< TInputImageType, TOuputImageType> { public: typedef MultiHistogramFilter Self; typedef ImageToImageFilter< TInputImageType, TOuputImageType > Superclass; typedef SmartPointer< Self > Pointer; typedef typename TInputImageType::ConstPointer InputImagePointer; typedef typename TOuputImageType::Pointer OutputImagePointer; typedef typename TOuputImageType::RegionType OutputImageRegionType; itkNewMacro (Self); itkTypeMacro(MultiHistogramFilter, ImageToImageFilter); itkSetMacro(Delta, double); itkGetConstMacro(Delta, double); itkSetMacro(Offset, double); itkGetConstMacro(Offset, double); itkSetMacro(Bins, int); itkGetConstMacro(Bins, int); itkSetMacro(Size, int); itkGetConstMacro(Size, int); itkSetMacro(UseImageIntensityRange, bool); itkGetConstMacro(UseImageIntensityRange, bool); protected: MultiHistogramFilter(); - ~MultiHistogramFilter(){}; + ~MultiHistogramFilter() override{}; - virtual void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override; - virtual void BeforeThreadedGenerateData(void) override; + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override; + void BeforeThreadedGenerateData(void) override; using itk::ProcessObject::MakeOutput; itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType /*idx*/) override; void CreateOutputImage(InputImagePointer input, OutputImagePointer output); private: MultiHistogramFilter(const Self &); // purposely not implemented void operator=(const Self &); // purposely not implemented double m_Delta; double m_Offset; int m_Bins; int m_Size; bool m_UseImageIntensityRange; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "itkMultiHistogramFilter.cpp" #endif #endif // itkMultiHistogramFilter_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h index 65793f1b18..ab8f9d9daf 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h @@ -1,62 +1,62 @@ #ifndef mitkGIFCooccurenceMatrix_h #define mitkGIFCooccurenceMatrix_h #include #include #include namespace mitk { class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix : public AbstractGlobalImageFeature { /** * \brief Calculates features based on the co-occurence matrix. * * This filter calculates features based on the Co-Occurence Matrix. * * \warning{ This is a legacy class only. If possible, avoid to use it. Use * GIFCooccurenceMatrix2 instead.} */ public: mitkClassMacro(GIFCooccurenceMatrix,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFCooccurenceMatrix(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ FeatureNameListType GetFeatureNames() override; itkGetConstMacro(Range,double); itkSetMacro(Range, double); - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; struct GIFCooccurenceMatrixConfiguration { double range; unsigned int direction; double MinimumIntensity; bool UseMinimumIntensity; double MaximumIntensity; bool UseMaximumIntensity; int Bins; }; private: double m_Range; }; } #endif //mitkGIFCooccurenceMatrix_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h index f64972c487..466539abeb 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h @@ -1,162 +1,162 @@ #ifndef mitkGIFCooccurenceMatrix2_h #define mitkGIFCooccurenceMatrix2_h #include #include #include #include namespace mitk { /** * \brief Calculates features based on the co-occurence matrix. * * The co-occurence matrix describes the relations between voxels in a specific direction. The elements \f$m_{i,k} \f$ of the * matrix count how often a voxel with the intensity \f$i \f$ has a neighbour in a certain direction with the intensity \f$ k \f$. * The direction for each matrix is given by a directed vector \f$ \overrightarrow{d} \f$. * * It is important to calculate the matrices for all possible directions in order to obtain a rotation invariant feature. * For the 3D case, this means that there are 26 possible directions. Using the symmetrical properties of the co-occurence * matrix, it is then possible to calculate the features in all directions looking at 13 different directions. * * The standard length of the vector is 1, e.g. looking at direct neighbours. It is possible to look at more * distance neighbours. This is achieved using the parameter range which defines the distance between * two neighbouring voxels in number of voxels. The default value for this is 1. It can be changes using the Method * SetRange() or by passing the option cooc2::range. * * There are two possible ways of combining the information obtained from the multiple directions. The first option * is to calculate a common matrix for all directions and then use this matrix to calculate the describing features. * The second method is to calculate a matrix for each direction, obtain the features and then report the mean and * standard value of these features. Both mehtods are calcuated by this filters and reported, distinguisehd by either * an "Overall" if a single matrix is used, a "Mean" for the mean Value, or an "Std.Dev." for the standard deviation. * * The connected areas are based on the binned image, the binning parameters can be set via the default * parameters as described in AbstractGlobalImageFeature. The intensity used for the calculation is * always equal to the bin number. It is also possible to determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * This feature calculator is activated by the option -cooccurence2 or -cooc2. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. All voxels with the value 1 are treated as masked. * * The following features are defined. We always give the notation for the overall matrix feature * although those for the mean and std.dev. are basically equal. In the name, is replace * by the distance of the neighbours. For the definitions of the feature, the probability of each * intensity pair (i,k) \f$ p_{i,k} = \frac{m_{i,k}}{\sum_i \sum_k m_{i,k}} \f$. * * In addition, the marginal sum \f$ p_{i,\cdot} = p_{\cdot,k=i} = \sum_k p_{i,k} \f$, which is * identical for both axis due to the symetrical nature of the matrix. Furthermore, the diagonal and * cross diagnoal features are used: * \f[ p_{i-k}(l) = \sum_i \sum_k p_{i,k} \delta(l - \| i -k \| ) \enspace \enspace l = 0, \dots, N_g -1 \f] * \f[ p_{i+k}(l) = \sum_i \sum_k p_{i,k} \delta(l - ( i + k ) ) \enspace \enspace l = 2, \dots, 2 N_g \f] * Here, \f$ \delta(x) \f$ is the dirac function, which is one for \f$x=0 \f$ and zero otherwise. * - Co-occurenced Based Features ()::Overall Joint Maximum: * \f[ \textup{Joint Maximum}= \textup{max}(p_{i,k}) \f] * - Co-occurenced Based Features ()::Overall Joint Average: * \f[ \textup{Joint Average} = \mu_{ja} = \sum_i \sum_k i p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Joint Variance: * \f[ \textup{Joint Variance} = \sum_i \sum_k (i - \mu_{ja})^2 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Joint Entropy: * \f[ \textup{Joint Entropy} = e_j = - \sum_i \sum_k p_{i,k} \textup{log}_2 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Row Maximum: * \f[ \textup{Row Maximum}= \textup{max}(p_{i,\cdot}) \f] * - Co-occurenced Based Features ()::Overall Row Average: * \f[ \textup{Row Average} = \mu_{ra} = \sum_i i p_{i,\cdot} \f] * - Co-occurenced Based Features ()::Overall Row Variance: * \f[ \textup{Row Variance} = \sigma^2_{i, \cdot} = \sum_i (i - \mu_{ra})^2 p_{i,\cdot} \f] * - Co-occurenced Based Features ()::Overall Row Entropy: * \f[ \textup{Row Entropy} = e_r = - \sum_i p_{i,\cdot} \textup{log}_2 p_{i,\cdot} \f] * - Co-occurenced Based Features ()::Overall First Row-Column Entropy: * \f[ \textup{First Row-Column Entropy} = e_1 = - \sum_i \sum_k p_{i,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f] * - Co-occurenced Based Features ()::Overall Second Row-Column Entropy: * \f[ \textup{Second Row-Column Entropy} = e_2 = - \sum_i \sum_k p_{i,\cdot} p_{\cdot,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f] * - Co-occurenced Based Features ()::Overall Difference Average: * \f[ \textup{Difference Average} = \mu_{da} = \sum_l l p_{i-k}(l) \f] * - Co-occurenced Based Features ()::Overall Difference Variance: * \f[ \textup{Difference Variance} = \sum_l (i - \mu_{da})^2 p_{i-k}(l) \f] * - Co-occurenced Based Features ()::Overall Difference Entropy: * \f[ \textup{Difference Entropy} = - \sum_l p_{i-k}(l) \textup{log}_2 p_{i-k}(l) \f] * - Co-occurenced Based Features ()::Overall Sum Average: * \f[ \textup{Sum Average} = \mu_{sa} = \sum_l l p_{i+k}(l) \f] * - Co-occurenced Based Features ()::Overall Sum Variance: * \f[ \textup{Sum Variance} = \sum_l (i - \mu_{sa})^2 p_{i+k}(l) \f] * - Co-occurenced Based Features ()::Overall Sum Entropy: * \f[ \textup{Sum Entropy} = - \sum_l p_{i+k}(l) \textup{log}_2 p_{i+k}(l) \f] * - Co-occurenced Based Features ()::Overall Angular Second Moment: * \f[ \textup{Angular Second Moment} = \sum_i \sum_k p^2_{i,k} \f] * - Co-occurenced Based Features ()::Overall Contrast: * \f[ \textup{Contrast} = \sum_i \sum_k (i-k)^2 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Dissimilarity: * \f[ \textup{Dissimilarity} = \sum_i \sum_k \| i-k\| p^2_{i,k} \f] * - Co-occurenced Based Features ()::Overall Inverse Difference: * \f[ \textup{Inverse Difference} = \sum_i \sum_k \frac{p_{i,k}}{1+\| i-k\|} \f] * - Co-occurenced Based Features ()::Overall Inverse Difference Normalized: * \f[ \textup{Inverse Difference Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{\| i-k\|}{N_g}} \f] * - Co-occurenced Based Features ()::Overall Inverse Difference Moment: * \f[ \textup{Inverse Difference Moment} = \sum_i \sum_k \frac{p_{i,k}}{1+ ( i-k )^2} \f] * - Co-occurenced Based Features ()::Overall Inverse Difference Moment Normalized: * \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{( i-k ) ^2}{N_g}} \f] * - Co-occurenced Based Features ()::Overall Inverse Variance: * \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{(i-k)^2} \f] * - Co-occurenced Based Features ()::Overall Correlation: * \f[ \textup{Correlation} = \frac{1}{\sigma^2_{i,\cdot}} \sum_i \sum_k (i - \mu_{ra})(k - \mu_{ra}) p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Autocorrelation: * \f[ \textup{Autocorrelation} = \sum_i \sum_k i k p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Cluster Tendency: * \f[ \textup{Cluster Tendency} = \sum_i \sum_k (i + k - 2\mu_{ra})^2 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Cluster Shade: * \f[ \textup{Cluster Shade} = \sum_i \sum_k (i + k - 2\mu_{ra})^3 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall Cluster Prominence: * \f[ \textup{Cluster Prominence} = \sum_i \sum_k (i + k - 2\mu_{ra})^4 p_{i,k} \f] * - Co-occurenced Based Features ()::Overall First Measure of Information Correlation: * \f[ \textup{First Measure of Information Correlation} = \frac{ e_j- e_1}{e_r} \f] * - Co-occurenced Based Features ()::Overall Second Measure of Information Correlation: * \f[ \textup{Second Measure of Information Correlation} = \sqrt{1- \exp(-2 (e_2 - e_j)} \f] */ class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix2 : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFCooccurenceMatrix2, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFCooccurenceMatrix2(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); - virtual std::string GetCurrentFeatureEncoding() override; + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; + std::string GetCurrentFeatureEncoding() override; itkGetConstMacro(Range,double); itkSetMacro(Range, double); struct GIFCooccurenceMatrix2Configuration { double range; unsigned int direction; double MinimumIntensity; double MaximumIntensity; int Bins; std::string prefix; }; private: double m_Range; }; } #endif //mitkGIFCooccurenceMatrix2_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h index 12cd15ce98..555dad228a 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFCurvatureStatistic_h #define mitkGIFCurvatureStatistic_h #include #include #include namespace mitk { /** * \brief Calculates features based on the co-occurence matrix. * * The Curvature is a measure for the bending of a surface and is therefore a measure for the description of the * surface of an segmentation. * * THe curvature is calculated for each point of the surface of the given object and then a combined measure is * produced. It measures the divergence of the orientation of an curve from the * tangent of the curve. There are multiple ways to calculate the Curvature: * * Gaussian Curvature: The discrete gaussian curvature (K) is computed as \f$K(\textup{Corner Point v}) = 2 * \pi - \sum_{\textup{Neighoubring Voxel Surfaces f of v}} (\textup{Angle}_f \textup{at} v) \f$. * Mean Curvature:The mean curvature (H) is computed as \f$H(\textup{Corner Point v}) = \textup{average over edges e neighbouring v of H(e)} \f$. * with \f$H(edge e) = length(e)*dihedral_angle(e)\f$ * Maximum (\f$k_max\f$) and Minimum (\f$k_min\f$) Principal Curvatures * \f$k_max = H + sqrt(H^2 - K)\f$ * \f$k_min = H - sqrt(H^2 - K)\f$ * Excepting spherical and planar surfaces which have equal principal curvatures, * the curvature at a point on a surface varies with the direction one "sets off" * from the point. For all directions, the curvature will pass through two extrema: * a minimum (\f$k_min\f$) and a maximum (\f$k_max\f$) which occur at mutually orthogonal * directions to each other. * * This method does not take any parameters. * * This feature calculator is activated by the option -curvature or -cur. * * The features are calculated based on a mask, which is converted into a mesh. * * The following features are defined. All features are calculated for all four possible * curvation calculation methods (Gaussian, Mean, Minimum, Maximum). The principal way * of calculating these features is the same, the used curvation is indicated by in the * feature name: * * - Curvature Feature::Minimum Curvature: * The minimum curvature for the whole given mask * - Curvature Feature::Maximum Curvature: * The maximum curvature for the whole given mask * - Curvature Feature::Mean Curvature: * The mean curvature for the whole given mask * - Curvature Feature::Standard Deviation Curvature: * The standard deviation curvature for the whole given mask * - Curvature Feature::Skewness Curvature: * The skewness curvature for the whole given mask * - Curvature Feature::Mean Positive Curvature: * The mean curvature of all positive curvatures from the whole given mask * - Curvature Feature::Standard Deviation Positive Curvature: * The Standard Deviation curvature of all positive curvatures from the whole given mask * - Curvature Feature::Skewness Positive Curvature: * The Skewness curvature of all positive curvatures from the whole given mask * - Curvature Feature::Mean Negative Curvature: * The mean curvature of all Negative curvatures from the whole given mask * - Curvature Feature::Standard Deviation Negative Curvature: * The Standard Deviation curvature of all Negative curvatures from the whole given mask * - Curvature Feature::Skewness Negative Curvature: * The Skewness curvature of all Negative curvatures from the whole given mask */ class MITKCLUTILITIES_EXPORT GIFCurvatureStatistic : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFCurvatureStatistic,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFCurvatureStatistic(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature); + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames(); + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; private: }; } #endif //mitkGIFCurvatureStatistic_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h index a8b8f27298..1fc11dceb2 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h @@ -1,130 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFFirstOrderHistogramStatistics_h #define mitkGIFFirstOrderHistogramStatistics_h #include #include #include namespace mitk { /** * \brief Calulates first order features based on a histogram. * * This class can be used to calculate first order features based on a histogram. * For each feature, two variations are given, once the value of the feature that is * obtained if the mean intensity of the histogram bins is used and the * histogram bin that corresponds to the feature value. See AbstractGlobalImageFeature for more * information on the histogram initialization. The histogram gives a probability \f$p_i\f$ for the * intensity \f$x_i\f$ that is linked to the bin \f$i\f$. The histogram bins start at index 1. * * This feature calculator is activated by the option "-first-order-histogram" or "-foh". * Beside the options for the histogram definitions, which are given in the description of AbstractGlobalImageFeature , no * additional parameters are available. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value of 1 * are treated as masked. * * The resulting features are: * - First Order Histogram::Mean Value: The mean intensity of all voxels, calulated by \f$ \mu_x = \sum p_i x_i\f$. * - First Order Histogram::Variance Value The variance intensity is calculated as : \f$ \sigma^2 = \sum p_i (x_i - \mu_x)^2\f$. * - First Order Histogram::Skewness Value: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^3}{\sigma^3} \f] * - First Order Histogram::Excess Kurtosis Value: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^4}{\sigma^4} - 3 \f] * - First Order Histogram::Median Value: The median intensity value based on the histogram values. * - First Order Histogram::Minimum Value: The minimum observed intensity value. * - First Order Histogram::Percentile 10 Value: The intensity that is equal or greater than 10% of all observed intensities. * - First Order Histogram::Percentile 90 Value: The intensity that is equal or greater than 90% of all observed intensities. * - First Order Histogram::Maximum Value: The maximum observerd intensity value. * - First Order Histogram::Mode Value: The most common intensity value, i.e. the value of the bin with the highest probability. * - First Order Histogram::Interquantile Range Value: The intensity difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$). * - First Order Histogram::Range Value: The difference between the observed maximum and minimum intensity. * - First Order Histogram::Mean Absolute Deviation Value: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \mu_x) \right \| \f] * - First Order Histogram::Robust Mean Value: The mean of all intensities between the 10% and 90% quantile. * - First Order Histogram::Robust Mean Absolute Deviation Value: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value. * - First Order Histogram::Median Absolute Deviation Value: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \textup{median}) \right \| \f] * - First Order Histogram::Coefficient of Variation Value: \f[ \frac{\sigma_x}{\mu_x} \f] * - First Order Histogram::Quantile coefficient of Dispersion Value: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f] * - First Order Histogram::Entropy Value: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f[ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f] * - First Order Histogram::Uniformity Value: \f$ \sum p_i^2 \f$ * - First Order Histogram::Mean Index: The mean index of all voxels, calulated by \f$ \mu_i = \sum p_i i\f$. * - First Order Histogram::Variance Index: The variance index is calculated as : \f$ \sigma_i^2 = \sum p_i (i - \mu_i)^2\f$. * - First Order Histogram::Skewness Index: \f[ skewness = \frac{\sum p_i (i - \mu_i)^3}{\sigma_i^3} \f] * - First Order Histogram::Excess Kurtosis Index: \f[ skewness = \frac{\sum p_i (i - \mu_i)^4}{\sigma_i^4} - 3 \f] * - First Order Histogram::Median Index: The median index value based on the histogram values. * - First Order Histogram::Minimum Index: The index of the minimum observed intensity value. * - First Order Histogram::Percentile 10 Index: The index oft the intensity that is equal or greater than 10% of all observed intensities. * - First Order Histogram::Percentile 90 Index: The index of the intensity that is equal or greater than 90% of all observed intensities. * - First Order Histogram::Maximum Index: The index of the maximum observerd intensity value. * - First Order Histogram::Mode Index: The index of the most common intensity value, i.e. the index of the bin with the highest probability. * - First Order Histogram::Interquantile Range Index: The index difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$). * - First Order Histogram::Range Index: The index difference between the index of the observed maximum and minimum intensity. * - First Order Histogram::Mean Absolute Deviation Index: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \mu_i) \right \| \f] * - First Order Histogram::Robust Mean Absolute Deviation Index: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value. * - First Order Histogram::Median Absolute Deviation Index: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \textup{median}) \right \| \f] * - First Order Histogram::Coefficient of Variation Index: \f[ \frac{\sigma_i}{\mu_i} \f] * - First Order Histogram::Quantile coefficient of Dispersion Index: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f] * - First Order Histogram::Entropy Index: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f$ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f$. Note that this is the same as the entropy value. * - First Order Histogram::Uniformity Index: \f$ \sum p_i^2 \f$. Note that this is the same as the uniformity value. * - First Order Histogram::Maximum Gradient: The maximum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation. * - First Order Histogram::Maximum Gradient Index: The index of the bin that belongs to the maximum gradient. * - First Order Histogram::Minimum Gradient: The minimum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation. * - First Order Histogram::Minimum Gradient Index:The index of the bin that belongs to the minimum gradient. * - First Order Histogram::Robust Mean Index: The mean index of all intensities between the 10% and 90% quantile. * - First Order Histogram::Number of Bins: The number of bins in the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image. * - First Order Histogram::Bin Size: The binsize of the bins from the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image. */ class MITKCLUTILITIES_EXPORT GIFFirstOrderHistogramStatistics : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFFirstOrderHistogramStatistics,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFFirstOrderHistogramStatistics(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; itkGetConstMacro(Range,double); itkSetMacro(Range, double); - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); - virtual std::string GetCurrentFeatureEncoding() override; + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; + std::string GetCurrentFeatureEncoding() override; struct ParameterStruct { double MinimumIntensity; double MaximumIntensity; int Bins; std::string prefix; }; private: double m_Range; }; } #endif //mitkGIFFirstOrderHistogramStatistics_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h index 2b5b56fc15..4025d3ad89 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h @@ -1,156 +1,156 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFFirstNumericOrderStatistics_h #define mitkGIFFirstNumericOrderStatistics_h #include #include #include namespace mitk { class MITKCLUTILITIES_EXPORT GIFFirstOrderNumericStatistics : public AbstractGlobalImageFeature { public: /** * \brief Calculates first order statistics of the given image. * * The first order statistics for the intensity distribution within a given Region of Interest (ROI) * is caluclated. The ROI is defined using a mask. * * The features are calculated on a quantified image. If the bin-size is too big, the obtained values * can be errornous and missleading. It is therefore important to use enough bins. The binned approach is * used in order to avoid floating-point related errors. * * This feature calculator is activated by the option -first-order or -fo. * * The connected areas are based on the binned image, the binning parameters can be set via the default * parameters as described in AbstractGlobalImageFeature. It is also possible to determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. All voxels with the value 1 are treated as masked. * * The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability * an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$: * - First Order::Mean: The mean intensity within the ROI * \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f] * - First Order::Unbiased Variance: An unbiased estimation of the variance: * \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f] * - First Order::Biased Variance: An biased estimation of the variance. If not specified otherwise, this is * used as the variance: * \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f] * - First Order::Unbiased Standard Deviation: Estimation of diversity within the intensity values * \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f] * - First Order::Biased Standard Deviation: Estimation of diversity within the intensity values * \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f] * - First Order::Skewness: * \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f] * - First Order::Kurtosis: The kurtosis is a measurement of the peakness of the given * distirbution: * \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f] * - First Order::Excess Kurtosis: The kurtosis is a measurement of the peakness of the given * distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction, * ensuring that a gaussian distribution has an excess kurtosis of 0. * \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f] * - First Order::Median: The median is defined as the median of the all intensities in the ROI. * - First Order::Minimum: The minimum is defined as the minimum of the all intensities in the ROI. * - First Order::05th Percentile: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity. * - First Order::10th Percentile: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity. * - First Order::15th Percentile: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity. * - First Order::20th Percentile: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity. * - First Order::25th Percentile: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity. * - First Order::30th Percentile: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity. * - First Order::35th Percentile: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity. * - First Order::40th Percentile: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity. * - First Order::45th Percentile: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity. * - First Order::50th Percentile: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity. * - First Order::55th Percentile: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity. * - First Order::60th Percentile: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity. * - First Order::65th Percentile: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity. * - First Order::70th Percentile: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity. * - First Order::75th Percentile: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity. * - First Order::80th Percentile: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity. * - First Order::85th Percentile: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity. * - First Order::90th Percentile: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity. * - First Order::95th Percentile: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity. * - First Order::Maximum: The maximum is defined as the minimum of the all intensities in the ROI. * - First Order::Range: The range of intensity values is defined as the difference between the maximum * and minimum intensity in the ROI. * - First Order::Interquartile Range: The difference between the 75% and 25% quantile. * - First Order::Mean Absolute Deviation: The mean absolute deviation gives the mean distance of each * voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the * mean value: * \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f] * - First Order::Robust Mean: The mean intensity within the ROI for all voxels between the 10% and 90% quantile: * \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f] * - First Order::Robust Mean Absolute Deviation: The absolute deviation of all intensities within the ROI for * all voxels between the 10% and 90% quantilefrom the robust mean intensity: * \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f] * - First Order::Median Absolute Deviation: Similar to the mean absolute deviation, but uses the median * instead of the mean to measure the center of the distribution. * - First Order::Coefficient Of Variation: Measures the dispersion of the intensity distribution: * \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f] * - First Order::Quantile Coefficient Of Dispersion: A robust alternative to teh coefficient of variance: * \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f] * - First Order::Energy: The intensity energy: * \f[ \textup{Energy} = \sum x_i ^2 \f] * - First Order::Root Mean Square: Root mean square is an important measure for the error. * \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f] * - First Order::Uniformity: * \f[ \textup{Uniformity} = \sum p_x^2 \f] * - First Order::Entropy: * \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f] * - First Order::Entropy: * \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f] * - First Order::Covered Image Intensity Range: Percentage of the image intensity range (maximum - minimum in whole * image) that is covered by the ROI. * - First Order::Sum: The sum of all intensities. It is correlated to the mean intensity. * \f[ \textup{Sum} = \sum x_i \f] * - First Order::Mode: The most common intensity. * - First Order::Mode Probability: The likelihood of the most common intensity. * - First Order::Number Of Voxels: \f$ N_v \f$ the number of voxels covered by the ROI. * - First Order::Image Dimension: The dimensionality of the image (e.g. 2D, 3D, etc.). * - First Order::Number Of Voxels: The product of all spacing along all dimensions. In 3D, this is equal to the * volume. * - First Order::Number Of Voxels: The volume of a single voxel. If the dimensionality is only 2D, this is the * surface of an voxel. */ mitkClassMacro(GIFFirstOrderNumericStatistics,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFFirstOrderNumericStatistics(); /** * \brief Calculates the First Order Features based on a binned version of the image. */ FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ FeatureNameListType GetFeatureNames() override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; }; } #endif //mitkGIFFirstNumericOrderStatistics_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h index 12f6bcd227..c9d2cf9312 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h @@ -1,164 +1,164 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFFirstOrderStatistics_h #define mitkGIFFirstOrderStatistics_h #include #include #include namespace mitk { class MITKCLUTILITIES_EXPORT GIFFirstOrderStatistics : public AbstractGlobalImageFeature { public: /** * \brief Calculates first order statistics of the given image. * * The first order statistics for the intensity distribution within a given Region of Interest (ROI) * is caluclated. The ROI is defined using a mask. * * The features are calculated on a quantified image. If the bin-size is too big, the obtained values * can be errornous and missleading. It is therefore important to use enough bins. The binned approach is * used in order to avoid floating-point related errors. * * This feature calculator is activated by the option -first-order or -fo. * * The connected areas are based on the binned image, the binning parameters can be set via the default * parameters as described in AbstractGlobalImageFeature. It is also possible to determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. All voxels with the value 1 are treated as masked. * * The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability * an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$: * - First Order::Mean: The mean intensity within the ROI * \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f] * - First Order::Unbiased Variance: An unbiased estimation of the variance: * \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f] * - First Order::Biased Variance: An biased estimation of the variance. If not specified otherwise, this is * used as the variance: * \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f] * - First Order::Unbiased Standard Deviation: Estimation of diversity within the intensity values * \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f] * - First Order::Biased Standard Deviation: Estimation of diversity within the intensity values * \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f] * - First Order::Skewness: * \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f] * - First Order::Kurtosis: The kurtosis is a measurement of the peakness of the given * distirbution: * \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f] * - First Order::Excess Kurtosis: The kurtosis is a measurement of the peakness of the given * distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction, * ensuring that a gaussian distribution has an excess kurtosis of 0. * \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f] * - First Order::Median: The median is defined as the median of the all intensities in the ROI. * - First Order::Minimum: The minimum is defined as the minimum of the all intensities in the ROI. * - First Order::05th Percentile: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity. * - First Order::10th Percentile: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity. * - First Order::15th Percentile: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity. * - First Order::20th Percentile: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity. * - First Order::25th Percentile: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity. * - First Order::30th Percentile: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity. * - First Order::35th Percentile: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity. * - First Order::40th Percentile: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity. * - First Order::45th Percentile: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity. * - First Order::50th Percentile: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity. * - First Order::55th Percentile: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity. * - First Order::60th Percentile: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity. * - First Order::65th Percentile: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity. * - First Order::70th Percentile: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity. * - First Order::75th Percentile: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity. * - First Order::80th Percentile: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity. * - First Order::85th Percentile: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity. * - First Order::90th Percentile: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity. * - First Order::95th Percentile: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity. * - First Order::Maximum: The maximum is defined as the minimum of the all intensities in the ROI. * - First Order::Range: The range of intensity values is defined as the difference between the maximum * and minimum intensity in the ROI. * - First Order::Interquartile Range: The difference between the 75% and 25% quantile. * - First Order::Mean Absolute Deviation: The mean absolute deviation gives the mean distance of each * voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the * mean value: * \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f] * - First Order::Robust Mean: The mean intensity within the ROI for all voxels between the 10% and 90% quantile: * \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f] * - First Order::Robust Mean Absolute Deviation: The absolute deviation of all intensities within the ROI for * all voxels between the 10% and 90% quantilefrom the robust mean intensity: * \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f] * - First Order::Median Absolute Deviation: Similar to the mean absolute deviation, but uses the median * instead of the mean to measure the center of the distribution. * - First Order::Coefficient Of Variation: Measures the dispersion of the intensity distribution: * \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f] * - First Order::Quantile Coefficient Of Dispersion: A robust alternative to teh coefficient of variance: * \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f] * - First Order::Energy: The intensity energy: * \f[ \textup{Energy} = \sum x_i ^2 \f] * - First Order::Root Mean Square: Root mean square is an important measure for the error. * \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f] * - First Order::Uniformity: * \f[ \textup{Uniformity} = \sum p_x^2 \f] * - First Order::Entropy: * \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f] * - First Order::Entropy: * \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f] * - First Order::Covered Image Intensity Range: Percentage of the image intensity range (maximum - minimum in whole * image) that is covered by the ROI. * - First Order::Sum: The sum of all intensities. It is correlated to the mean intensity. * \f[ \textup{Sum} = \sum x_i \f] * - First Order::Mode: The most common intensity. * - First Order::Mode Probability: The likelihood of the most common intensity. * - First Order::Number Of Voxels: \f$ N_v \f$ the number of voxels covered by the ROI. * - First Order::Image Dimension: The dimensionality of the image (e.g. 2D, 3D, etc.). * - First Order::Number Of Voxels: The product of all spacing along all dimensions. In 3D, this is equal to the * volume. * - First Order::Number Of Voxels: The volume of a single voxel. If the dimensionality is only 2D, this is the * surface of an voxel. */ mitkClassMacro(GIFFirstOrderStatistics,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFFirstOrderStatistics(); /** * \brief Calculates the First Order Features based on a binned version of the image. */ FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ FeatureNameListType GetFeatureNames() override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; struct ParameterStruct { double MinimumIntensity; double MaximumIntensity; int Bins; std::string prefix; }; }; } #endif //mitkGIFFirstOrderStatistics_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h index 870e556978..ffc43e624b 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h @@ -1,178 +1,178 @@ #ifndef mitkGIFGreyLevelDistanceZone_h #define mitkGIFGreyLevelDistanceZone_h #include #include #include #include namespace mitk { struct GreyLevelDistanceZoneFeatures { GreyLevelDistanceZoneFeatures() : SmallDistanceEmphasis(0), LargeDistanceEmphasis(0), LowGreyLevelEmphasis(0), HighGreyLevelEmphasis(0), SmallDistanceLowGreyLevelEmphasis(0), SmallDistanceHighGreyLevelEmphasis(0), LargeDistanceLowGreyLevelEmphasis(0), LargeDistanceHighGreyLevelEmphasis(0), GreyLevelNonUniformity(0), GreyLevelNonUniformityNormalized(0), ZoneDistanceNonUniformity(0), ZoneDistanceNoneUniformityNormalized(0), ZonePercentage(0), GreyLevelMean(0), GreyLevelVariance(0), ZoneDistanceMean(0), ZoneDistanceVariance(0), ZoneDistanceEntropy(0) { } public: double SmallDistanceEmphasis; double LargeDistanceEmphasis; double LowGreyLevelEmphasis; double HighGreyLevelEmphasis; double SmallDistanceLowGreyLevelEmphasis; double SmallDistanceHighGreyLevelEmphasis; double LargeDistanceLowGreyLevelEmphasis; double LargeDistanceHighGreyLevelEmphasis; double GreyLevelNonUniformity; double GreyLevelNonUniformityNormalized; double ZoneDistanceNonUniformity; double ZoneDistanceNoneUniformityNormalized; double ZonePercentage; double GreyLevelMean; double GreyLevelVariance; double ZoneDistanceMean; double ZoneDistanceVariance; double ZoneDistanceEntropy; }; class MITKCLUTILITIES_EXPORT GIFGreyLevelDistanceZone : public AbstractGlobalImageFeature { /** * \brief Calculates the Grey Level Distance Zone * * This class can be used to calculate Grey Level Distance Zone as presented in Thibault et al. 2014. * * The basic idea behind the Grey Level Distance Zone based features is to count the connected areas * with a given intensity value \f$x_i\f$ and a given distance to the border of each segmentation \f$d_i\f$. * Several features are then calculated based on a matrix, that gives the number of occurence for each * combination of \f$x_i\f$ and \f$ d_i \f$ as \f$m_{x,d}\f$. * * This feature calculator is activated by the option -grey-level-distance-zone or -gldz. * * The connected areas are based on the binned image, the binning parameters can be set via the default * parameters as described in AbstractGlobalImageFeature. It is also possible to determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. It is expected that the image contains only voxels with value 0 and 1, * of which all voxels with an value equal to one are treated as masked. * * The features depend on the distance to the border of the segmentation ROI. In some cases, the border * definition might be different from the definition of the masked area, for example, if small openings * in the mask should not influence the distance. Due to that, it is possible to submit a second mask, * named Morphological Mask to the features that is then used to calculate the distance of each voxel to * border of the segmented area. The morpological mask can be either set by the function call SetMorphMask() * or by the corresponding global option. (Not parsed by the filter itself, but by the command line tool). * * Beside the complete matrix, which is represented by its individual elements \f$m_{x,d}\f$, som eadditional * values are used for the definition. \f$N_g\f$ is the number of discrete grey levels, \f$ N_d\f$ the number * (or maximum value) of possible distances, and \f$N_s\f$ the total number of zones. * \f$m_{x,d}\f$ gives the number of connected areas with the discrete * grey level x and distance to the boarder of d. Corresponding, \f$p_{x,d} = \frac{m_{x,d}}{N_s} gives the relativ * probability of this matrix cell. \f$ \f$N_v\f$ is the number of voxels. In addition, the marginal * sums \f$m_{x,\cdot} = m_x = \sum_d m_{x,d} \f$ , representing the sum of all zones with a given intensity, and * sums \f$m_{\cdot, d} = m_d = \sum_x m_{x,d} \f$ , representing the sum of all zones with a given distance, are used. * The distance are given as the number of voxels to the border and the voxel intensity is given as the * bin number of the binned image, starting with 1. * * The following features are then defined: * - Grey Level Distance Zone::Small Distance Emphasis: * \f[ \textup{Small Distance Emphasis}= \frac{1}{N_s} \sum_d \frac{m_d}{d^2} \f] * - Grey Level Distance Zone::Large Distance Emphasis: * \f[ \textup{Large Distance Emphasis}= \frac{1}{N_s} \sum_d d^2 m_d \f] * - Grey Level Distance Zone::Low Grey Level Emphasis: * \f[ \textup{Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \frac{m_x}{x^2} \f] * - Grey Level Distance Zone::High Grey Level Emphasis: * \f[ \textup{High Grey Level Emphasis}= \frac{1}{N_s} \sum_x x^2 m_x \f] * - Grey Level Distance Zone::Small Distance Low Grey Level Emphasis: * \f[ \textup{Small Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{ m_{x,d}}{x^2 d^2}\f] * - Grey Level Distance Zone::Small Distance High Grey Level Emphasis: * \f[ \textup{Small Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{x^2 m_{x,d}}{d^2}\f] * - Grey Level Distance Zone::Large Distance Low Grey Level Emphasis: * \f[ \textup{Large Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{d^2 m_{x,d}}{x^2}\f] * - Grey Level Distance Zone::Large Distance High Grey Level Emphasis: * \f[ \textup{Large Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \x^2 d^2 m_{x,d} \f] * - Grey Level Distance Zone::Grey Level Non-Uniformity: * \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_x^2 \f] * - Grey Level Distance Zone::Grey Level Non-Uniformity Normalized: * \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_x^2 \f] * - Grey Level Distance Zone::Zone Distance Non-Uniformity: * \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_d m_d^2 \f] * - Grey Level Distance Zone::Zone Distance Non-Uniformity Normalized: * \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_d m_d^2 \f] * - Grey Level Distance Zone::Zone Percentage: The ratio of zones to the possible zones: * \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f] * - Grey Level Distance Zone::Grey Level Mean: * \f[ \textup{Grey Level Mean}= \mu_x = \sum_x \sum_d x p_{x,d} \f] * - Grey Level Distance Zone::Grey Level Variance: * \f[ \textup{Grey Level Variance} = \sum_x \sum_d \left(x - \mu_x \right)^2 p_{x,d} \f] * - Grey Level Distance Zone::Zone Distance Mean: * \f[ \textup{Zone Distance Mean}= \mu_d = \sum_x \sum_d d p_{x,d} \f] * - Grey Level Distance Zone::Zone Distance Variance: * \f[ \textup{Zone Distance Variance} = \sum_x \sum_d \left(d - \mu_d \right)^2 p_{x,d} \f] * - Grey Level Distance Zone::Zone Distance Entropy : * \f[ \textup{Zone Distance Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f] * - Grey Level Distance Zone::Grey Level Entropy : * \f[ \textup{Grey Level Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f] */ public: mitkClassMacro(GIFGreyLevelDistanceZone, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFGreyLevelDistanceZone(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; struct GIFGreyLevelDistanceZoneConfiguration { mitk::Image::Pointer distanceMask; mitk::IntensityQuantifier::Pointer Quantifier; unsigned int direction; double MinimumIntensity; double MaximumIntensity; int Bins; std::string prefix; }; private: }; } #endif //mitkGIFGreyLevelDistanceZone_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h index 8e7298afff..b48adb9dce 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h @@ -1,119 +1,119 @@ #ifndef mitkGIFGreyLevelRunLength_h #define mitkGIFGreyLevelRunLength_h #include #include #include namespace mitk { /** * \brief Calculates the Run Length based features. * * Grey Level Run Length based features are calcualted using the Run-Length-Matrix and were originally * defined by Galloway (1975). The basic idea behind this feature is to measure the length of * lines with similar intensity in an image. This allows to asses line-based structures in an image. * For this, the Run-Length-Matrix created that gives the number of lines \f$ m_{x,l} \f$ with the intensity \f$ x \f$ and * the length of \f$ l \f$ with the given intensity. * * The image is quantified prior to the calculation of the features. This reduces the number of * available intensity values. Instead of using the pure intensity value, the features are * calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the * quantification of the image can be controlled using the general binning parameters as defined * in AbstractGlobalImageFeature. * * By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further * possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a * 3D image is passed. This is controlled by determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * This feature calculator is activated by the option -run-length or -rl. * * The features are calculated based on a mask. It is assumed that the mask is * of the same type as the input image. All voxels with a value greater 0.5 are treated as masked. * * Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels, * \f$N_s \f$ is the number of different lines, \f$ m_{x,\cdot} = \sum_l m{x,l} \f$ is the number of all lines * with a given intensity value, and likewise \f$ m_{\cdot, l} = \sum_x m{x,l} \f$ is the number of all lines * with a given length. There are two options how to make this feature orientation-invariant. Either calculating a * single matrix for all directions and then extracting the features or by calculating a matrix per direction, * calculating all features and then reporting the mean and standard deviation for each feature. The result * of the first option is given with the extension "Comb.", the results for the second with "Std." and "Means". * All three options are always calculated, although we state only one in the following list: * - Run Length::Short run emphasis Comb.: * \f[ \textup{Short run emphasis}= \frac{1}{N_s} \sum_l { \frac{m_{\cdot, l}}{l^2} } \f] * - Run Length::Long run emphasis Comb.: * \f[ \textup{Long run emphasis}= \frac{1}{N_s} \sum_l { m_{\cdot, l} l^2} \f] * - Run Length::Low grey level run emphasis Comb.: * \f[ \textup{Low grey level run emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f] * - Run Length::High grey level run emphasis Comb.: * \f[ \textup{High grey level run emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f] * - Run Length::Short run low grey level emphasis Comb.: * \f[ \textup{Short run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{m_{x,l}}{x^2 l^2} } \f] * - Run Length::Short run high grey level emphasis Comb.: * \f[ \textup{Short run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{x^2 m_{x,s}}{l^2} } \f] * - Run Length::Long run low grey level emphasis Comb.: * \f[ \textup{Long run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{l^2 m_{x,l}}{x^2} } \f] * - Run Length::Long run high grey level emphasis Comb.: * \f[ \textup{Long run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { x^2 l^2 m_{x,l} } \f] * - Run Length::Grey level nonuniformity Comb.: * \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f] * - Run Length::Grey level nonuniformity normalized Comb.: * \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f] * - Run Length::Run length nonuniformity: * \f[ \textup{Run length nonuniformity}= \frac{1}{N_s} \sum_l m_{\cdot, l}^2 \f] * - Run Length::Run length nonuniformity normalized: * \f[ \textup{Run length nonuniformity normalized}= \frac{1}{N_s^2} \sum_l m_{\cdot, l}^2 \f] * - Run Length::Run percentage: The ratio of realized runs to the theoretical limit of zones: * \f[ \textup{Run percentage}= \frac{N_s}{N_v} \f] * - Run Length::Grey level variance: * \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f] * - Run Length::Run length variance: * \f[ \textup{Run length variance} = \frac{1}{N_s} \sum_l (l -mu_l)^2 m_{\cdot, l} \f] * - Run Length::Run length entropy: This feature would be equivalent with * the Grey Level Entropy, which is therefore not included. It is based on the likelihood * for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. : * \f[ \textup{Run length entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f] * - Run Length::Number of runs: The overall number of realized runs: * \f[ \textup{Number of runs} = \sum m_{x, l} \f] */ class MITKCLUTILITIES_EXPORT GIFGreyLevelRunLength : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFGreyLevelRunLength,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFGreyLevelRunLength(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; struct ParameterStruct { unsigned int m_Direction; double MinimumIntensity; double MaximumIntensity; int Bins; std::string featurePrefix; }; private: }; } #endif //mitkGIFGreyLevelRunLength_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h index d42a9aa35a..3ee2a23635 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h @@ -1,115 +1,115 @@ #ifndef mitkGIFGreyLevelSizeZone_h #define mitkGIFGreyLevelSizeZone_h #include #include #include #include namespace mitk { class MITKCLUTILITIES_EXPORT GIFGreyLevelSizeZone : public AbstractGlobalImageFeature { /** * \brief Calculates the Grey level size zone based features. * * Grey level size zone based features are similar to Grey Level Cooccurence features. But instead * of measuring the similarity within a given neighbourhood, the size of areas with the same intensity * is assessed. For this, a matrix is created that gives the number of areas \f$ m_{x,s} \f$ with the intensity \f$ x \f$ and * the size of \f$ s \f$. Each area is specified as connected voxels with the given intensity. * * The image is quantified prior to the calculation of the features. This reduces the number of * available intensity values. Instead of using the pure intensity value, the features are * calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the * quantification of the image can be controlled using the general binning parameters as defined * in AbstractGlobalImageFeature. * * By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further * possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a * 3D image is passed. This is controlled by determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * No other options are possible beside these two options. * * This feature calculator is activated by the option -grey-level-sizezone or -glsz. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. All voxels with the value 1 are treated as masked. * * Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels, * \f$N_s \f$ is the number of different zones, \f$ m_{x,\cdot} = \sum_s m{x,s} \f$ is the number of all areas * with a given intensity value, and likewise \f$ m_{\cdot, s} = \sum_x m{x,s} \f$ is the number of all areas * with a given size. The features are then defined as: * - Grey Level Size Zone::Small Zone Emphasis: * \f[ \textup{Small Zone Emphasis}= \frac{1}{N_s} \sum_s { \frac{m_{\cdot, s}}{s^2} } \f] * - Grey Level Size Zone::Large Zone Emphasis: * \f[ \textup{Large Zone Emphasis}= \frac{1}{N_s} \sum_s { m_{\cdot, s} s^2} \f] * - Grey Level Size Zone::Low Grey Level Zone Emphasis: * \f[ \textup{Low Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f] * - Grey Level Size Zone::High Grey Level Zone Emphasis: * \f[ \textup{High Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f] * - Grey Level Size Zone::Small Zone Low Grey Level Emphasis: * \f[ \textup{Small Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{m_{x,s}}{x^2 s^2} } \f] * - Grey Level Size Zone::Small Zone High Grey Level Emphasis: * \f[ \textup{Small Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{x^2 m_{x,s}}{s^2} } \f] * - Grey Level Size Zone::Large Zone Low Grey Level Emphasis: * \f[ \textup{Large Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{s^2 m_{x,s}}{x^2} } \f] * - Grey Level Size Zone::Large Zone High Grey Level Emphasis: * \f[ \textup{Large Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { x^2 s^2 m_{x,s} } \f] * - Grey Level Size Zone::Grey Level Non-Uniformity: * \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f] * - Grey Level Size Zone::Grey Level Non-Uniformity Normalized: * \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f] * - Grey Level Size Zone::Zone Size Non-Uniformity: * \f[ \textup{Zone Size Non-Uniformity}= \frac{1}{N_s} \sum_s m_{\cdot, s}^2 \f] * - Grey Level Size Zone::Zone Size Non-Uniformity Normalized: * \f[ \textup{Zone Size Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_s m_{\cdot, s}^2 \f] * - Grey Level Size Zone::Zone Percentage: The ratio of realized areas to the theoretical limit of zones: * \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f] * - Grey Level Size Zone::Grey Level Mean: * \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x, \cdot} \f] * - Grey Level Size Zone::Grey Level Variance: * \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f] * - Grey Level Size Zone::Zone Size Mean: * \f[ \textup{Zone Size Mean} = \mu_s = \frac{1}{N_s} \sum_s s m_{\cdot, s} \f] * - Grey Level Size Zone::Grey Level Variance: * \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_s (s -mu_s)^2 m_{\cdot, s} \f] * - Grey Level Size Zone::Zone Size Entropy: This feature would be equivalent with * the Grey Level Entropy, which is therefore not included. It is based on the likelihood * for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. : * \f[ \textup{Zone Size Entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f] */ public: mitkClassMacro(GIFGreyLevelSizeZone, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFGreyLevelSizeZone(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); - virtual std::string GetCurrentFeatureEncoding() override; + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; + std::string GetCurrentFeatureEncoding() override; struct GIFGreyLevelSizeZoneConfiguration { unsigned int direction; double MinimumIntensity; double MaximumIntensity; int Bins; std::string prefix; }; }; } #endif //mitkGIFGreyLevelSizeZone_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h index f6b0e0f2e7..0301c83455 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFImageDescriptionFeatures_h #define mitkGIFImageDescriptionFeatures_h #include #include #include namespace mitk { /** * \brief Calculates simple features that describe the given image / mask * * This class can be used to calculated simple image describing features that * can be used to compare different images. * * This feature calculator is activated by the option "-image-diagnostic" or "-id". * There are no parameters to further define the behavior of this feature calculator. * * The paramters for this image are calculated from two images, a mask and an intenstiy * image. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value larger or equal * to one are treated as masked. (Standard MITK mask) * * The definition of X, Y, and Z axis depends on the image format and does not necessarily * correlates with axial, coronal, and sagittal. * * The features of this calculator are: * - Diagnostic::Dimension X: The number of voxels in the intensity image along the first image dimension. * - Diagnostic::Image Dimension Y: The number of voxels in the intensity image along the second image dimension. * - Diagnostic::Image Dimension Z: The number of voxels in the intensity image along the third image dimension. * - Diagnostic::Image Spacing X: The spacing of the intensity image in the first image dimension. * - Diagnostic::Image Spacing Y: The spacing of the intensity image in the second image dimension. * - Diagnostic::Image Spacing Z: The spacing of the intensity image in the third image dimension. * - Diagnostic::Image Mean intensity: The mean intensity of the whole image. * - Diagnostic::Image Minimum intensity: The minimum intensity that occurs in the whole image. * - Diagnostic::Image Maximum intensity: The maximum intensity that occurs in the whole image. * - Diagnostic::Mask Dimension X: The number of voxels in the mask image along the first image dimension. * - Diagnostic::Mask Dimension Y: The number of voxels in the mask image along the second image dimension. * - Diagnostic::Mask Dimension Z: The number of voxels in the mask image along the third image dimension. * - Diagnostic::Mask bounding box X: The distance between the maximum and minimum position of a masked voxel along the first axis. * - Diagnostic::Mask bounding box X: The distance between the maximum and minimum position of a masked voxel along the second axis. * - Diagnostic::Mask bounding box X: The distance between the maximum and minimum position of a masked voxel along the third axis. * - Diagnostic::Mask Spacing X: The spacing of the mask image in the first image dimension. * - Diagnostic::Mask Spacing Y: The spacing of the mask image in the second image dimension. * - Diagnostic::Mask Spacing Z: The spacing of the mask image in the third image dimension. * - Diagnostic::Mask Voxel count: The number of voxels that are masked. * - Diagnostic::Mask Mean intensity: The mean intensity of all voxel that are masked. Also depends on the intensity image. * - Diagnostic::Mask Minimum intensity The minimum masked intensity in the intensity image. * - Diagnostic::Mask Maximum intensity The maximum masked intensity in the intensity image. */ class MITKCLUTILITIES_EXPORT GIFImageDescriptionFeatures : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFImageDescriptionFeatures,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFImageDescriptionFeatures(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &mask) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &mask) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; }; } #endif //mitkGIFImageDescriptionFeatures_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h index e1e30f5edc..db266c951d 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFIntensityVolumeHistogramFeatures_h #define mitkGIFIntensityVolumeHistogramFeatures_h #include #include #include namespace mitk { /** * \brief Calculates the Intensity Volume Histogram features * * This class can be used to calculate the volume histogram and features that are calculated from * it. It is based on the intensity-volume histogram (IVH) which describes the relation between the * grey level index i (and the corresponding intensity \f§x_i\f$) and the volume fraction \f$f\f$ that * with an intensity that is equal or greater than \f$x_i\f$. This feature is original proposed in * El Naqa et al. Exploring feature-based approaches in PET images for prediciting cancer treatment outcomes. * Pattern recognition 2009. * * This feature calculator is activated by the option "-intensity-volume-histogram" or "-ivoh". * Beside the configuration of the histogram, which follows the describtion given in AbstractGlobalImageFeature * there are no additional parameters to configure this feature. Remark that, different from other features, * the number of bins is 1000 by default and not 256. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value of greater than zero * are treated as masked. * * The resulting features are: * - Intensity Volume Histogram::Volume fration at 0.10 intensity: The volume fraction with an intensity * of greater or equal to 10% of the maximum intensity. * - Intensity Volume Histogram::Volume fration at 0.90 intensity: The volume fraction with an intensity * of greater or equal to 90% of the maximum intensity. * - Intensity Volume Histogram::Intensity at 0.10 volume: The highest intensity so that at least * 10% of the masked image area has the same or higher intensity. * - Intensity Volume Histogram::Intensity at 0.90 volume: The highest intensity so that at least * 10% of the masked image area has the same or higher intensity. * - Intensity Volume Histogram::Difference volume fration at 0.10 and 0.90 intensity: The difference * between the volume fraction at 10% intensity and 90% intensity. * - Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume: The intensity difference * between the intenstiy of 90% of the volume and 10% volume. * - Intensity Volume Histogram::Area under IVH curve: If the IVH is interpreted as curve, this value represents * the area under the curve. It is calculated using the bin indexes rather than the intensity values. */ class MITKCLUTILITIES_EXPORT GIFIntensityVolumeHistogramFeatures : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFIntensityVolumeHistogramFeatures, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFIntensityVolumeHistogramFeatures(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature); + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames(); - virtual void AddArguments(mitkCommandLineParser &parser); + FeatureNameListType GetFeatureNames() override; + void AddArguments(mitkCommandLineParser &parser) override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; private: }; } #endif //mitkGIFIntensityVolumeHistogramFeatures_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h index 3e2344ff12..a295391a1f 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h @@ -1,82 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFLocalIntensity_h #define mitkGIFLocalIntensity_h #include #include #include namespace mitk { /** * \brief Calculates the local intensity features * * This class can be used to calcualte the local intensity. The local intensity is defined as the * mean intensity in a cube with the volume \f$ 1 \textup{cm}^3\f$ which correspond to a radius * of approximate 0.62 cm. * * This feature calculator is activated by the option -local-intensity or -loci. * * The range that is used to calculate the local intensity can be set using the function SetRange. * To set it with parameters set the option loci::range which expects an float value that is * interpreted as mm length of the radius. The default value is 6.2. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value of greater than zero * are treated as masked. * * The resulting features are: * - Local Intensity::Local Intensity Peak: This value is defined as the local intensity of the * voxel with the highest intensity. If there are multiple voxels with the highest intensity, the mean * of all local intensites of these voxels are reported. * - Local Intensity::Global Intensity Peak: This value is defined as the highest local intensity * that occur for all voxels within the mask. */ class MITKCLUTILITIES_EXPORT GIFLocalIntensity : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFLocalIntensity, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFLocalIntensity(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature); + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames(); + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; itkGetConstMacro(Range, double); itkSetMacro(Range, double); private: double m_Range; }; } #endif //mitkGIFLocalIntensity_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h index 8913832535..cc10b5b7c3 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h @@ -1,51 +1,51 @@ #ifndef mitkGIFNeighbourhoodGreyLevelDifference_h #define mitkGIFNeighbourhoodGreyLevelDifference_h #include #include #include namespace mitk { class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyLevelDifference : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFNeighbourhoodGreyLevelDifference,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFNeighbourhoodGreyLevelDifference(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ FeatureNameListType GetFeatureNames() override; itkGetConstMacro(Range,double); itkSetMacro(Range, double); itkGetConstMacro(UseCtRange, bool); itkSetMacro(UseCtRange, bool); - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; struct ParameterStruct { bool m_UseCtRange; double m_Range; unsigned int m_Direction; }; private: double m_Range; bool m_UseCtRange; }; } #endif //mitkGIFNeighbourhoodGreyLevelDifference_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h index 6ebf4da4fd..bc230042d2 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h #define mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h #include #include #include namespace mitk { /** * \brief Calculates the Neighbourhood Grey Tone Difference Features. * * This class can be used to calculate Neighbourhood Grey Tone Difference Features which have been introduced in * Amadasun and King: Textural features corresponding to textural properties. IEEE Transactions on Systems, Man and Cybernetricy, 1989. * * The Neighbourhood Grey Tone Difference (NGTD) is based on a table and is calcualted using * a defined neighbourhood for each voxel. Within this neighbourhood, the mean intensity of the neighbouring * voxel is calculated \f$A_i\f$, i.e. the mean intensity of the neighbourhood excluding the center voxel. * Based on this a table with four columns is calculated. The first column represents the voxel * value, or in our implementation, the histogram bin index \f$i\f$. The second column represents the * number of voxel with this intensity value \f$n_i\f$. The proability for each intensity value \f$p_i\f$, which * is equal to the bin probability. And the sum of the absolut differences of the intensity of all voxels with this * intensity and the mean intensity of their neighbourhood: \f[s_i = \sum \left \| i- A_i \right \| \f]. * Additional \f$ N_v\f$ is the number of voxels, \f$ N_g \f$ the number of bins, and \f$N_{g,p}\f$ the number of * bins with a non-zero probability. * * This feature calculator is activated by the option -neighbourhood-grey-tone-difference or -ngtd. * * The range that is used to calculate the local intensity can be set using the function SetRange. * To set it with parameters set the option ngtd::range which expects an int value n that is * interpreted as voxel count. The neighbourhood includes symetrical n voxels additional * to the center voxel in each directions. The default value for this parameter is 1. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value of greater than zero * are treated as masked. * * For the definition of the features we use the sum, this is always the sum over the bins of the histogram. * If the denominator of a feature evaluates to zero, the feature is defined as zero. * The resulting features are: * - Neighbourhood Grey Tone Difference::Coarsness: The coarsness is defined as : * \f[ \textup{Coarsness}= \frac{1}{\sum p_i s_i} \f] * - Neighbourhood Grey Tone Difference::Contrast: The contrast is defined as : * \f[ \textup{contrast}= \left( \frac{1}{N_{g,p} ( N_{g,p} - 1) } \sum_i \sum_j p_i p_j (i-j)^2 \right) \left( \frac{1}{N_v} \sum s_i \right) \f] * - Neighbourhood Grey Tone Difference::Busyness: for all bins with a non-zero probability * \f[ \textup{busyness} = \frac{\sum p_i s_i}{\sum_i \sum_j \left \| i p_i - j p_j \right \| } \f] * - Neighbourhood Grey Tone Difference::Complexity: for all bins with a non-zero probability * \f[ \textup{complexity} = \frac{1}{N_v} \sum_i \sum_j \left \| i - j \right \| \frac{p_i s_i + p_j s_j}{p_i + p_j} \f] * - Neighbourhood Grey Tone Difference::Strength: for all bins with a non-zero probability * \f[ \textup{strength} = \frac{\sum_i \sum_j (p_i + p_j) (i + j)^2}{\sum_i s_i } \f] */ class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyToneDifferenceFeatures : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFNeighbourhoodGreyToneDifferenceFeatures, AbstractGlobalImageFeature); itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFNeighbourhoodGreyToneDifferenceFeatures(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature); + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames(); + FeatureNameListType GetFeatureNames() override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; itkSetMacro(Range, int); itkGetConstMacro(Range, int); private: int m_Range; }; } #endif //mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h index 881d1677eb..25bfb28d6d 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h @@ -1,152 +1,152 @@ #ifndef mitkGIFNeighbouringGreyLevelDependenceFeatures_h #define mitkGIFNeighbouringGreyLevelDependenceFeatures_h #include #include #include #include namespace mitk { /** * \brief Calculates the Neighbouring Grey Level Dependence Features * * The Neighbouring Grey Level Dependence Features were proposed by Sun and Wee (1983) and * capture the coarsness of the image texture. They are rotational invariant. * * The features are calculated on a matrix \f$ m \f$. To obtain the matrix, a neighbourhood * around each feature is calculated and the number of voxels within the neighbourhood that * are greater than the center voxel plus \f$ \alpha \f$ is counted. This is called the * number of dependence voxels. The matrix gives the * number of voxels with an intesity \f$ x \f$ and $\f d \f$ dependence neighbourhood voxels. * * The image is quantified prior to the calculation of the features. This reduces the number of * available intensity values. Instead of using the pure intensity value, the features are * calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the * quantification of the image can be controlled using the general binning parameters as defined * in AbstractGlobalImageFeature. * * By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further * possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a * 3D image is passed. This is controlled by determine the * dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature. * * In addition to this, the size of the neighbourhood can be controlled by setting the parameter * ngld::range. By default it is one. To pass more than one range, separate the ranges with * a semicolon. E.g. 1;2;3 would calculate the features for the ranges 1, 2, and 3. * * This feature calculator is activated by the option -neighbouring-grey-level-dependence * or -ngld. * * The features are calculated based on a mask. It is assumed that the mask is * a unsigned short image. All voxels with a value greater 0 are treated as masked. * * Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels, * \f$N_s \f$ is the number of neighbourhoods, \f$ m_{x,\cdot} = \sum_d m{x,d} \f$ is the number of neighbourhoods * with a given intensity value, and likewise \f$ m_{\cdot, d} = \sum_x m{x,d} \f$ is the number of neighbourhoods * with a given number of dependence features: * - Neighbouring Grey Level Dependence::Low Dependence Emphasis: * \f[ \textup{Low dependence emphasis}= \frac{1}{N_s} \sum_d { \frac{m_{\cdot, d}}{d^2} } \f] * - Neighbouring Grey Level Dependence::High Dependence Emphasis: * \f[ \textup{High dependence emphasis}= \frac{1}{N_s} \sum_d { m_{\cdot, d} d^2} \f] * - Neighbouring Grey Level Dependence::Low Grey Level Count Emphasis: * \f[ \textup{Low grey level count emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f] * - Neighbouring Grey Level Dependence::High Grey Level Count Emphasis: * \f[ \textup{High grey level count emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f] * - Neighbouring Grey Level Dependence::Low Dependence Low Grey Level Emphasis: * \f[ \textup{Low Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{m_{x,d}}{x^2 d^2} } \f] * - Neighbouring Grey Level Dependence::Low Dependence High Grey Level Emphasis: * \f[ \textup{Low dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{x^2 m_{x,d}}{d^2} } \f] * - Neighbouring Grey Level Dependence::High Dependence Low Grey Level Emphasis: * \f[ \textup{High Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{d^2 m_{x,d}}{x^2} } \f] * - Neighbouring Grey Level Dependence::High Dependence High Grey Level Emphasis: * \f[ \textup{High dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { x^2 d^2 m_{x,d} } \f] * - Neighbouring Grey Level Dependence::Grey level nonuniformity: * \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f] * - Neighbouring Grey Level Dependence::Grey level nonuniformity normalized: * \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f] * - Neighbouring Grey Level Dependence::Dependence Count Nonuniformity: * \f[ \textup{Dependence count nonuniformity}= \frac{1}{N_s} \sum_d m_{\cdot, d}^2 \f] * - Neighbouring Grey Level Dependence::Dependence Count Nonuniformity Normalized: * \f[ \textup{Dependence count nonuniformity normalized}= \frac{1}{N_s^2} \sum_d m_{\cdot, d}^2 \f] * - Neighbouring Grey Level Dependence::DEpendence Count Percentage THe number of realized * neighbourhoods relativ to the theoretical maximum of realized neighbourhoods. This feature is always * one for this implementation as partial neighbourhoods are still considered. * - Neighbouring Grey Level Dependence::Grey Level Mean: The mean value of all grey level. * \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x,\cdot} \f] * - Neighbouring Grey Level Dependence::Grey Level Variance: * \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f] * - Neighbouring Grey Level Dependence::Dependence Count Mean: The mean value of all dependence counts. * \f[ \textup{Dependence count mean} = \mu_d = \frac{1}{N_s} \sum_d d m_{\cdot,d} \f] * - Neighbouring Grey Level Dependence::Dependence Count Variance: * \f[ \textup{Dependence count variance} = \frac{1}{N_s} \sum_d (d -mu_d)^2 m_{\cdot, d} \f] * - Neighbouring Grey Level Dependence::Dependence Count Entropy: This feature would be equivalent with * the Grey Level Entropy, which is therefore not included. It is based on the likelihood * for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. : * \f[ \textup{Dependence count entropy} = \sum_x \sum_d p_{x,d} \textup{log}_2 \left( p_{x,d} \right) \f] * - Neighbouring Grey Level Dependence::Dependence Count Energy: This feature would be equivalent with * the Grey Level Energy, which is therefore not included. It is based on the likelihood * for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. : * \f[ \textup{Dependence count energy} = \sum_x \sum_d p_{x,d}^2 \f] * - Neighbouring Grey Level Dependence::Expected Neighbourhood Size: The expected size of a * full neighbourhood. It depends on the dimension of the area that is looked at. * - Neighbouring Grey Level Dependence::Average Neighbourhood Size: The feature calculation * allows to consider partially masked neighbourhoods. Due to that, some neighbourhoods might be smaller. * This feature gives not the theoretical neighbourhood size but the average realized neighbourhood sizes. * - Neighbouring Grey Level Dependence::Average Incomplete Neighbourhood Size: Gives the average * size of all neighbourhoods that are not complete. * - Neighbouring Grey Level Dependence::Percentage of complete Neighbourhoods: Gives the percentage * of all complete neighbourhoods from all realized neighbourhoods. * - Neighbouring Grey Level Dependence::Percentage of Dependence Neighbour Voxels: Gives the * percentage of voxels in all neighbourhoods compared to the expected number of voxels. */ class MITKCLUTILITIES_EXPORT GIFNeighbouringGreyLevelDependenceFeature : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFNeighbouringGreyLevelDependenceFeature, AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFNeighbouringGreyLevelDependenceFeature(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames() override; + FeatureNameListType GetFeatureNames() override; - virtual std::string GetCurrentFeatureEncoding() override; + std::string GetCurrentFeatureEncoding() override; itkGetConstMacro(Range,double); itkSetMacro(Range, double); itkGetConstMacro(Alpha, int); itkSetMacro(Alpha, int); - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; struct GIFNeighbouringGreyLevelDependenceFeatureConfiguration { double range; unsigned int direction; int alpha; double MinimumIntensity; double MaximumIntensity; int Bins; std::string FeatureEncoding; }; private: double m_Range; int m_Alpha; }; } #endif //mitkGIFNeighbouringGreyLevelDependenceFeature_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h index 4099809e5f..6e914da84c 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h @@ -1,132 +1,132 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFVolumetricDensityStatistics_h #define mitkGIFVolumetricDensityStatistics_h #include #include #include namespace mitk { /** * \brief Calculates Volumetric Density Features * * These features characterize the compactness of the volume and shape by comparing the volumes * of different volume and shape estimation methods. * * This feature calculator is activated by the option -volume-density or -volden. * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image. All voxels with the value equal or greater than 1 are treated as masked. * * The volume and surface are compared to the volume \f$ V \f$ and surface \f$ A \f$ that is calculated * directly from the mask. The following features are then defined: * - Morphological Density::Volume density axis-aligned bounding box: The axis-aligned bounding * box is defined as the minimum axis aligned box in 3D space that encloses all masked voxels. * It is calculated by using the maximum spacial extension of the mask. Based on the volume of the * bounding box, \f$ V_{aabb} \f$, the feature is defined as: * \f[ \textup{Volume density axis-aligned bounding box}= \frac{V}{V_{aabb}} \f] * - Morphological Density::Surface density axis-aligned bounding box: As for the previous * feature, the axis-aligned bounding box is compared to the mask, this time using the surface of the * bounding box \f$ A_{aabb} \f$: * \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{aabb}} \f] * - Morphological Density::Volume density oriented minimum bounding box: A three-dimensional * bounding box is defined using the box with the minimum volume. We do not use an estimation * for this feature, which makes the calculation of this feature slow. Based on the volume of the * bounding box, \f$ V_{ombb} \f$, the feature is defined as: * \f[ \textup{Volume density oriented minimum bounding box}= \frac{V}{V_{ombb}} \f] * - Morphological Density::Surface density axis-aligned bounding box: As for the previous * feature, theminimum oriented bounding box is compared to the mask, this time using the surface of the * bounding box \f$ A_{ombb} \f$: * \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{ombb}} \f] * - Morphological Density::Volume density approx. enclosing ellipsoid: Using a Principal Component Analysis (PCA) * of the spacial coordinates gives the three main axis of the mask. They correspond to the length of * a eclipse enclosing the mask. The length of the axis of the eclipse are given by the eigenvalues of the * decomposition: \f$ a = 2 \sqrt{\lambda_1} \f$, \f$ b = 2 \sqrt{\lambda_2} \f$, and \f$ c = 2 \sqrt{\lambda_3} \f$ * with \f$\lambda_x\f$ being the sorted eigenvalues (higher number indicates larger values). The volume * of the enclosing eclipse can be estimated by \f$ V_{aee} = 4 \pi a b c \f$: * \f[ \textup{Volume density approx. enclosing ellipsoid}= \frac{V}{V_{aee}} \f] * - Morphological Density::Surface density approx. enclosing ellipsoid: As for the previous * feature, the surface of the enclosing ellipsoid is used. To simplify the calulation of it, an approximation (20 iterations) * for the surface is used (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$): * \f[ A_{aee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f] * \f[ \textup{Surface density approx. enclosing ellipsoid}= \frac{A}{A_{aee}} \f] * - Morphological Density::Volume density approx. minimum volume enclosing ellipsoid: * The volume is compared to the volume of the minimum enclosing ellipsoid. While this ellipsoid can be * found by brute-force calculation, this is quite time-consuming. It is therefore estimated using * Khachiyan's Algorithm (Khachiyan, Rounding of Polytopes in the Real Number Model of Computation. Mathematics of Operations Research 1996) * The so-found ellipsoid is described by the lengths \f$a, b, c \f$ of its axis. The volume is then * defined as \f$ V_{mvee} = 4 \pi a b c \f$ and the feature given by: * \f[ \textup{Volume density approx. minimum volume enclosing ellipsoid}= \frac{V}{V_{mvee}} \f] * - Morphological Density::Surface density approx. minimum volume enclosing ellipsoid: As for the previous * feature, the surface of the minimum volume enclosing ellipsoid is used. To simplify the calulation of it, * an approximation with 20 iterations instead of infinite iterations is used for the calculation of the * the surface (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$): * \f[ A_{mvee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f] * \f[ \textup{Surface density approx. minimum volume enclosing ellipsoid}= \frac{A}{A_{mvee}} \f] * - Morphological Density::Volume density convex hull: The volume of the density * hull is calculated using a convex mesh and then calculating the volume of this mesh \f$V_{convex} \f$. * The feature is then calculated using: * \f[ \textup{Volume density convex hull}= \frac{V}{V_{convex}} \f] * - Morphological Density::Surface density convex hull: The surface of the density * hull is calculated using a convex mesh and then calculating the surface of this mesh \f$A_{convex} \f$. * The feature is then calculated using: * \f[ \textup{Volume density convex hull}= \frac{A}{A_{convex}} \f] * - Morphological Density::Volume integrated intensity: Integrated intensity is the * average intensity times the volume. It is often used in conjunction with PET-images, where * this feature is also called "total legion glycolysis". It is defined using the volume \f$V \f$, the * number of masked voxels \f$ N_v \f$ and the intensity of each voxel \f$ x_i \f$: * \f[ \textup{Volume integrated intensity}= V \frac{1}{N_v} \sum x_i \f] * - Morphological Density::Volume Moran's I index: Moran's I index is an measure for * the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$, * the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$, * and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$: * \f[ \textup{Volume Moran's I index}= \frac{N_v}{\sum_i \sum_j w_{ij}} \frac{\sum_i \sum_j (x_i - \mu) (x_j -\mu)}{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f] * - Morphological Density::Volume Geary's C measure: Geary's C meansure is similar to Moran's I index. * However, it is more sensitive to grey level differences and spacial autocorrelation: * the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$, * the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$, * and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$: * \f[ \textup{Volume Geary's C measure}= \frac{N_v - 1}{2 \sum_i \sum_j w_{ij}} \frac{ \sum_i \sum_j w_{ij} (x_i - x_j)^2 }{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f] */ class MITKCLUTILITIES_EXPORT GIFVolumetricDensityStatistics : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFVolumetricDensityStatistics,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFVolumetricDensityStatistics(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ - virtual FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature); + FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ - virtual FeatureNameListType GetFeatureNames(); + FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; private: }; } #endif //mitkGIFVolumetricDensityStatistics_h diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h index d9a89e36e1..89a713e588 100644 --- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h +++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h @@ -1,137 +1,137 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGIFVolumetricStatistics_h #define mitkGIFVolumetricStatistics_h #include #include #include namespace mitk { /** * \brief Calulates simpel shape-related features. * * This class can be used to calculate simple, shape-related features describing * a given segmentation. There are no parameters that can be externaly set. * * This feature calculator is activated by the option "-volume" or "-vol" * * The features are calculated based on a mask. It is assumed that the mask is * of the type of an unsigned short image and all voxels with an value larger or equal * to one are treated as masked. (Standard MITK mask) * * Some of the features are calculated twice using different methods. For voxel- * based approaches, the corresponding parameter is calcualted using the voxel, * for example the volume is then calculated by multiplying the volume of a * single volume with the number of voxels in the mask. In the second method, the * mesh based appraoch, a mesh is created prior to the feature calculation which * is then done using the features. * * Another difference between two features might be the evaluation of invalid * values within the image. There are two possibilities: By default, only those * voxels are used with an valid intensity value, i.e. where the value is not * infinite or NaN. The second possibility is not correcting for these voxels * and only looking at the mask. Features that use these method are marked as * "(uncorrected)" * * The resulting features are: * - Volumetric Features:: Voxel Volume: \f$ V_{single\_voxel} \f$ , the volume of an single volume, calculated as the * multiplication of the voxel spacing in all directions. * - Volumetric Features:: Volume (voxel based): \f$ V_{voxel} \f$, the volume of the masked area. Calulated by * multiplying the numer of voxels with the Voxel Volume. * - Volumetric Features:: Volume (mesh based): \f$ V_{shape} \f$, The volume based on the mesh-representation of * the mask. * - Volumetric Features:: Surface (voxel based): \f$ A_{voxel} \f$, the surface of the given mask. It is calulated * by summing the surfaces between a masked and an unmasked voxel. * - Volumetric Features:: Surface (mesh based): \f$ A_{mesh} \f$, the surface of the given mask calculated using * the mask representation * - Volumetric Features:: Surface to volume ration (voxel based): The ratio between voxel based surface and voxel based * volume given as: \f[ F_{av\_voxel}=\frac{A_{voxel}}{V_{voxel}} \f] * - Volumetric Features:: Surface to volume ration (mesh based): The ratio between voxel based surface and voxel based * volume given as: \f[ F_{av\_mesh}=\frac{A_{mesh}}{V_{mesh}} \f] * - Volumetric Features:: Compactness 1 (voxel based): * - Volumetric Features:: Compactness 1 (mesh based): The compatness is a measure how spheric a shape is given. * Compactness 1 is defined as: * \f[ F_{compactness\_1} = \frac{V}{\pi^{1/2} A^{3/2}}\f] * - Volumetric Features:: Compactness 1 old (voxel based): * - Volumetric Features:: Compactness 1 old (mesh based): Some implementations use a slightly different definition of * compactness 1. Although this is most likely an error and leads to an non-dimensionless feature, * this defition is still calculated as: * \f[ F_{compactness\_1\_old} = \frac{V}{\pi^{1/2} A^{2/3}}\f] * - Volumetric Features:: Compactness 2 (voxel based): * - Volumetric Features:: Compactness 2 (mesh based): The compatness is a measure how spheric a shape is given. * Compactness 2 is defined as: * \f[ F_{compactness\_1} = 36 \pi \frac{V^2}{A^3}\f] * - Volumetric Features::Sphericity (voxel based): * - Volumetric Features::Sphericity (mesh based): Sphericity is measure of how sphere-like a shape is: * \f[ F_{sphericity} = \frac{(36 \pi V^2)^{1/3}}{A} \f] * - Volumetric Features::Asphericity (voxel based): * - Volumetric Features::Asphericity (mesh based): Sphericity is measure of how sphere-like a shape is: * \f[ F_{asphericity} = \left(\frac{1}{36 \pi }\frac{(A^3}{V^2}\right)^{1/3} - 1 \f] * - Volumetric Features::Spherical disproportion (voxel based): * - Volumetric Features::Spherical disproportion (mesh based): Sphericity is measure of how sphere-like a shape is: * \f[ F_{spherical\_disproportion} = \frac{A}{4\pi R^2}= \frac{A}{\left(36\pi V^2\right)^{1/3}} \f] * - Volumetric Features:: Maximum 3D diameter: This is the largest distance between the centers of two voxels that * are masked. * - Volumetric Features::Bounding box volume: The bounding box volume is the volume of the smallest axis-aligned box * that encapuslates all voxel centres. * - Volumetric Features::Centre of mass shift: * - Volumetric Features::Centre of mass shift (uncorrected): This is the distance between two centres of mass, * namely the geometric centre and the weighted centre. The geometric centre is the mean position * of all masked voxels, and the weighted centre is the mean position if the position of each * voxel is weighted according to its intensity. * - Volumetric Features::PCA Major Axis length: * - Volumetric Features::PCA Major Axis length (uncorrected): A Principal component analysis (PCA) of the masekd voxel * positions will give the main orientation and elongation of the masked area. The resulting * eigenvectors of the PCA are sorted so that \f$ \lambda_{major}\geq \lambda_{minor} \geq \lambda_{least}\f$. * The major axis length is defined as: * \f[ F_{pca\_major} = 4 \sqrt{\lambda_{major}} \f] * - Volumetric Features::PCA Minor axis length: * - Volumetric Features::PCA Minor axis length: The Minor axis length is defined as: * \f[ F_{pca\_minor} = 4 \sqrt{\lambda_{minor}} \f] * - Volumetric Features::PCA Least axis length: * - Volumetric Features::PCA Least axis length: The Minor axis length is defined as: * \f[ F_{pca\_Least} = 4 \sqrt{\lambda_{Least}} \f] */ class MITKCLUTILITIES_EXPORT GIFVolumetricStatistics : public AbstractGlobalImageFeature { public: mitkClassMacro(GIFVolumetricStatistics,AbstractGlobalImageFeature) itkFactorylessNewMacro(Self) itkCloneMacro(Self) GIFVolumetricStatistics(); /** * \brief Calculates the Cooccurence-Matrix based features for this class. */ FeatureListType CalculateFeatures(const Image::Pointer & image, const Image::Pointer &feature) override; /** * \brief Returns a list of the names of all features that are calculated from this class */ FeatureNameListType GetFeatureNames() override; - virtual void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList); - virtual void AddArguments(mitkCommandLineParser &parser); + void CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &maskNoNAN, FeatureListType &featureList) override; + void AddArguments(mitkCommandLineParser &parser) override; private: }; } #endif //mitkGIFVolumetricStatistics_h diff --git a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h index f2f11a6bbd..a94785eb02 100644 --- a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h +++ b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h @@ -1,121 +1,121 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkRandomImageSampler_h #define __mitkRandomImageSampler_h #include "MitkCLUtilitiesExports.h" //MITK #include #include "mitkImageToImageFilter.h" #include namespace mitk { enum RandomImageSamplerMode { SINGLE_ACCEPTANCE_RATE, CLASS_DEPENDEND_ACCEPTANCE_RATE, SINGLE_NUMBER_OF_ACCEPTANCE, CLASS_DEPENDEND_NUMBER_OF_ACCEPTANCE }; class MITKCLUTILITIES_EXPORT RandomImageSampler : public ImageToImageFilter { public: mitkClassMacro( RandomImageSampler , ImageToImageFilter ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkSetMacro(SamplingMode, RandomImageSamplerMode); itkGetConstMacro(SamplingMode, RandomImageSamplerMode); itkSetMacro(AcceptanceRate, double); itkGetConstMacro(AcceptanceRate, double); //itkSetMacro(AcceptanceRateVector, std::vector); void SetAcceptanceRateVector(std::vector arg) { m_AcceptanceRateVector = arg; } itkGetConstMacro(AcceptanceRateVector, std::vector); itkSetMacro(NumberOfSamples, unsigned int); itkGetConstMacro(NumberOfSamples, unsigned int); //itkSetMacro(NumberOfSamplesVector, std::vector); void SetNumberOfSamplesVector(std::vector arg) { m_NumberOfSamplesVector = arg; } itkGetConstMacro(NumberOfSamplesVector, std::vector); private: /*! \brief standard constructor */ RandomImageSampler(); /*! \brief standard destructor */ - ~RandomImageSampler(); + ~RandomImageSampler() override; /*! \brief Method generating the output information of this filter (e.g. image dimension, image type, etc.). The interface ImageToImageFilter requires this implementation. Everything is taken from the input image. */ - virtual void GenerateOutputInformation() override; + void GenerateOutputInformation() override; /*! \brief Method generating the output of this filter. Called in the updated process of the pipeline. This method generates the smoothed output image. */ - virtual void GenerateData() override; + void GenerateData() override; /*! \brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed. */ template void ItkImageProcessing(const itk::Image* itkImage); /*! \brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed. */ template void ItkImageProcessingClassDependendSampling(const itk::Image* itkImage); /*! \brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed. */ template void ItkImageProcessingFixedNumberSampling(const itk::Image* itkImage); /*! \brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed. */ template void ItkImageProcessingClassDependendNumberSampling(const itk::Image* itkImage); double m_AcceptanceRate; std::vector m_AcceptanceRateVector; unsigned int m_NumberOfSamples; std::vector m_NumberOfSamplesVector; RandomImageSamplerMode m_SamplingMode; }; } //END mitk namespace #endif diff --git a/Modules/Classification/CLUtilities/src/mitkCLResultWritter.cpp b/Modules/Classification/CLUtilities/src/mitkCLResultWritter.cpp index b2b5fa14e6..ff3f0d92b9 100644 --- a/Modules/Classification/CLUtilities/src/mitkCLResultWritter.cpp +++ b/Modules/Classification/CLUtilities/src/mitkCLResultWritter.cpp @@ -1,188 +1,188 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include template class punct_facet : public std::numpunct { public: punct_facet(charT sep) : m_Sep(sep) { } protected: - charT do_decimal_point() const { return m_Sep; } + charT do_decimal_point() const override { return m_Sep; } private: charT m_Sep; }; mitk::cl::FeatureResultWritter::FeatureResultWritter(std::string file, int mode) : m_Mode(mode), m_CurrentRow(0), m_CurrentElement(0), m_Separator(";"), m_SubjectInformation(""), m_UsedSubjectInformation(false), m_UseSpecialDecimalPoint(false), m_DecimalPoint('.') { std::string str; m_List.push_back(str); m_Output.open(file, std::ios::app); } mitk::cl::FeatureResultWritter::~FeatureResultWritter() { for (std::size_t i = 0; i < m_List.size() - 1; ++i) { m_Output << m_List[i] << std::endl; } //m_Output << "EndOfFile" << std::endl; m_Output.close(); } void mitk::cl::FeatureResultWritter::SetDecimalPoint(char decimal) { m_Output.imbue(std::locale(std::cout.getloc(), new punct_facet(decimal))); m_UseSpecialDecimalPoint = true; m_DecimalPoint = decimal; } void mitk::cl::FeatureResultWritter::AddColumn(double value) { std::ostringstream ss; if (m_UseSpecialDecimalPoint) { ss.imbue(std::locale(std::cout.getloc(), new punct_facet(m_DecimalPoint))); } ss << value; AddColumn(ss.str()); } void mitk::cl::FeatureResultWritter::AddSubjectInformation(std::string value) { if ((m_Mode == 0) || (m_Mode == 1)) { AddColumn(value); } else { if (m_UsedSubjectInformation) { m_SubjectInformation = ""; } m_SubjectInformation += value + m_Separator; m_UsedSubjectInformation = false; } } void mitk::cl::FeatureResultWritter::AddColumn(std::string value) { if ((m_Mode == 0) || (m_Mode == 2)) { m_List[m_CurrentRow] = m_List[m_CurrentRow] + value + m_Separator; } else { m_CurrentRow++; while (m_List.size() <= m_CurrentRow) { std::string str; m_List.push_back(str); } m_List[m_CurrentRow] = m_List[m_CurrentRow] + value + m_Separator; } } void mitk::cl::FeatureResultWritter::NewRow(std::string endName) { AddColumn(endName); if ((m_Mode == 0) || (m_Mode == 2)) { m_CurrentRow++; while (m_List.size() <= m_CurrentRow) { std::string str; m_List.push_back(str); } } else { m_CurrentRow = 0; } } void mitk::cl::FeatureResultWritter::AddResult(std::string desc, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool, bool withDescription) { if (m_Mode == 2) { for (std::size_t i = 0; i < stats.size(); ++i) { if (withDescription) { AddColumn(desc); } if (slice >= 0) { AddColumn(slice); } AddColumn(m_SubjectInformation + stats[i].first); AddColumn(stats[i].second); NewRow(""); ++m_CurrentElement; } m_UsedSubjectInformation = true; } else { if (withDescription) { AddColumn(desc); } if (slice >= 0) { AddColumn(slice); } for (std::size_t i = 0; i < stats.size(); ++i) { AddColumn(stats[i].second); } NewRow("EndOfMeasurement"); ++m_CurrentElement; } } void mitk::cl::FeatureResultWritter::AddHeader(std::string, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool withHeader, bool withDescription) { if ((withHeader) && (m_CurrentElement == 0)) { if (withDescription) { AddColumn("Description"); } if (slice >= 0) { AddColumn("SliceNumber"); } for (std::size_t i = 0; i < stats.size(); ++i) { AddColumn(stats[i].first); } NewRow("EndOfMeasurement"); } } \ No newline at end of file diff --git a/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h b/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h index 0d351070f8..0c63915ad0 100644 --- a/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h +++ b/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h @@ -1,146 +1,146 @@ #ifndef mitkCollectionStatistic_h #define mitkCollectionStatistic_h #include #include #include namespace mitk { struct MITKDATACOLLECTION_EXPORT StatisticData { unsigned int m_TruePositive; unsigned int m_FalsePositive; unsigned int m_TrueNegative; unsigned int m_FalseNegative; double m_DICE; double m_Jaccard; double m_Sensitivity; double m_Specificity; double m_RMSD; StatisticData() : m_TruePositive(0), m_FalsePositive(0), m_TrueNegative(0), m_FalseNegative(0), m_DICE(0), m_Jaccard(0), m_Sensitivity(0), m_Specificity(0), m_RMSD(-1.0) {} }; class ValueToIndexMapper { public: virtual unsigned char operator() (unsigned char value) const = 0; }; class BinaryValueminusOneToIndexMapper : public virtual ValueToIndexMapper { public: - unsigned char operator() (unsigned char value) const + unsigned char operator() (unsigned char value) const override { return value-1; } }; class BinaryValueToIndexMapper : public virtual ValueToIndexMapper { public: unsigned char operator() (unsigned char value) const override { return value; } }; class MultiClassValueToIndexMapper : public virtual ValueToIndexMapper { public: unsigned char operator() (unsigned char value) const override { if (value == 1 || value == 5) return 0; else return 1; } }; class ProgressionValueToIndexMapper : public virtual ValueToIndexMapper { public: unsigned char operator() (unsigned char value) const override { if (value == 1 || value == 0) return 0; else return 1; } }; class MITKDATACOLLECTION_EXPORT CollectionStatistic { public: CollectionStatistic(); ~CollectionStatistic(); typedef std::vector DataVector; typedef std::vector MultiDataVector; void SetCollection(DataCollection::Pointer collection); DataCollection::Pointer GetCollection(); void SetClassCount (size_t count); size_t GetClassCount(); void SetGoldName(std::string name); std::string GetGoldName(); void SetTestName(std::string name); std::string GetTestName(); void SetMaskName(std::string name) {m_MaskName = name; } void SetGroundTruthValueToIndexMapper(const ValueToIndexMapper* mapper); const ValueToIndexMapper* GetGroundTruthValueToIndexMapper(void) const; void SetTestValueToIndexMapper(const ValueToIndexMapper* mapper); const ValueToIndexMapper* GetTestValueToIndexMapper(void) const; void Print(std::ostream& out, std::ostream& sout = std::cout, bool withHeader = false, std::string label = "None"); bool Update(); int IsInSameVirtualClass(unsigned char gold, unsigned char test); /** * @brief mitk::CollectionStatistic::GetStatisticData * @param c The class for which to retrieve the statistic data. * @return */ std::vector GetStatisticData(unsigned char c) const; /** * @brief Computes root-mean-square distance of two binary images. */ void ComputeRMSD(); private: size_t m_ClassCount; std::string m_GroundTruthName; std::string m_TestName; std::string m_MaskName; DataCollection::Pointer m_Collection; std::vector m_ConnectionGold; std::vector m_ConnectionTest; std::vector m_ConnectionClass; MultiDataVector m_ImageClassStatistic; std::vector m_ImageNames; DataVector m_ImageStatistic; StatisticData m_MeanCompleteStatistic; StatisticData m_CompleteStatistic; const ValueToIndexMapper* m_GroundTruthValueToIndexMapper; const ValueToIndexMapper* m_TestValueToIndexMapper; }; } #endif // mitkCollectionStatistic_h diff --git a/Modules/Core/include/mitkDisplayActionEventBroadcast.h b/Modules/Core/include/mitkDisplayActionEventBroadcast.h index ec3e59ba11..5b197910ef 100644 --- a/Modules/Core/include/mitkDisplayActionEventBroadcast.h +++ b/Modules/Core/include/mitkDisplayActionEventBroadcast.h @@ -1,224 +1,224 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKDISPLAYACTIONEVENTBROADCAST_H #define MITKDISPLAYACTIONEVENTBROADCAST_H #include "mitkInteractionEventObserver.h" #include namespace mitk { /** * @brief This class serves as an event state machine while simultaneously observing interaction events. * It connects the actions from the event state machine .xml-file with concrete functions of this class. * * The observed interaction events are mouse events that trigger certain actions, according to an event configuration (e.g. PACS mode). * These actions are defined and connected inside this broadcast class. * They typically contain some preprocessing steps and use the results of the preprocessing to broadcast a specific display event. * * Any instance that wants to react on the invoked events can call 'AddObserver' on a specific broadcast instance, * given an itkEventObject and an itkCommand. */ class MITKCORE_EXPORT DisplayActionEventBroadcast : public EventStateMachine, public InteractionEventObserver { public: mitkClassMacro(DisplayActionEventBroadcast, EventStateMachine) itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** * By this function this observer is notified about about every 'InteractionEvent'. * The interaction event is passed to the state machine in order to use its infrastructure. * For more information see @see InteractionEventObserver. * * @par interactionEvent The event that was observed and triggered this notification. * @par isHandled Flag that indicates if a 'DataInteractor' has already handled the event. */ - virtual void Notify(InteractionEvent* interactionEvent, bool isHandled) override; + void Notify(InteractionEvent* interactionEvent, bool isHandled) override; protected: DisplayActionEventBroadcast(); - virtual ~DisplayActionEventBroadcast() override; + ~DisplayActionEventBroadcast() override; /** * @brief Connects the action names used in the state machine pattern with functions implemented within this InteractionEventObserver. */ void ConnectActionsAndFunctions() override; /** * @brief This function is executed when a config object is set / changed (via 'SetEventConfig' or 'AddEventConfig' in 'InteractionEventObserver'). * It is used to read out the parameters set in the configuration file and to set the member variables accordingly. */ - virtual void ConfigurationChanged() override; + void ConfigurationChanged() override; /** * @brief Filters the event resp. the sender of the event. * * @par interactionEvent The event whose sender has to be checked * @par data node The data node is ignored in this specific implementation. * * @return True, if the sender of the event is a valid sender and the sending renderer is a 2D-renderer. False, if not. */ - virtual bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode) override; + bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode) override; ////////////////////////////////////////////////////////////////////////// // Functions to react to interaction events (actions) ////////////////////////////////////////////////////////////////////////// /** * @brief Check if the given interaction event is actually an 'InteractionPositionEvent'. * * @par interactionEvent The interaction event that is checked. * * @return True, if the given event can be dynamically cast to an 'InteractionPositionEvent'. False, if not. */ bool CheckPositionEvent(const InteractionEvent* interactionEvent); bool CheckRotationPossible(const InteractionEvent* interactionEvent); bool CheckSwivelPossible(const InteractionEvent* interactionEvent); void Init(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void Move(StateMachineAction* stateMachineAction , InteractionEvent* interactionEvent); void SetCrosshair(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void Zoom(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void Scroll(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void ScrollOneUp(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void ScrollOneDown(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void AdjustLevelWindow(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void StartRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void EndRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void Rotate(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); void Swivel(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); private: void UpdateStatusbar(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent); bool GetBoolProperty(PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue); /** * @brief Reference to the service registration of the observer. * This is needed to unregister the observer on unload. */ us::ServiceRegistration m_ServiceRegistration; /** * @brief Determines if this broadcast class reacts to events that already have been processed by a DataInteractor. * The default value is false. */ bool m_AlwaysReact; /** * @brief Coordinate of the mouse pointer at beginning of an interaction (translated to mm unit). */ Point2D m_StartCoordinateInMM; /** * @brief Coordinate of the mouse pointer in the last step within an interaction. */ Point2D m_LastDisplayCoordinate; /** * @brief Coordinate of the mouse pointer in the last step within an interaction (translated to mm unit). */ Point2D m_LastCoordinateInMM; /** * \brief Current coordinates of the pointer. */ Point2D m_CurrentDisplayCoordinate; /** * @brief Defines the behavior at the end of a data set. * If set to true, it will restart at end of data set from the beginning. */ bool m_AutoRepeat; /** * @brief Defines how many slices are scrolled per pixel that the mouse pointer was moved. * By default the modifier is 4. This means that when the user moves the cursor by 4 pixels in Y-direction, * the scene is scrolled by one slice. If the user has moved the the cursor by 20 pixels, the scene is * scrolled by 5 slices. * * If the cursor has moved less than m_IndexToSliceModifier pixels, the scene is scrolled by one slice. */ int m_IndexToSliceModifier; /** * @brief Defines the scroll behavior. * Default is up/down movement of pointer performs scrolling */ std::string m_ScrollDirection; /** * @brief Defines how the axis of interaction influences scroll behavior. */ bool m_InvertScrollDirection; /** * @brief Defines the zoom behavior. * Default is up/down movement of pointer performs zooming */ std::string m_ZoomDirection; /** * @brief Defines how the axis of interaction influences zoom behavior. */ bool m_InvertZoomDirection; /** * @brief Factor to adjust zooming speed. */ float m_ZoomFactor; /** * @brief Defines how the axis of interaction influences move behavior. */ bool m_InvertMoveDirection; /** * @brief Defines the level-window behavior. * Default is left/right movement of pointer modifies the level. */ std::string m_LevelDirection; /** * @brief Defines how the axis of interaction influences level-window behavior. */ bool m_InvertLevelWindowDirection; /** * @brief Determines if the angle between crosshair remains fixed when rotating. */ bool m_LinkPlanes; typedef std::vector SNCVector; SNCVector m_RotatableSNCs; SNCVector m_SNCsToBeRotated; Point3D m_LastCursorPosition; Point3D m_CenterOfRotation; Point2D m_ReferenceCursor; Vector3D m_RotationPlaneNormal; Vector3D m_RotationPlaneXVector; Vector3D m_RotationPlaneYVector; Vector3D m_PreviousRotationAxis; ScalarType m_PreviousRotationAngle; }; } // end namespace #endif // MITKDISPLAYACTIONEVENTBROADCAST_H diff --git a/Modules/Core/include/mitkDisplayActionEvents.h b/Modules/Core/include/mitkDisplayActionEvents.h index 22c61e1248..ba1c89775c 100644 --- a/Modules/Core/include/mitkDisplayActionEvents.h +++ b/Modules/Core/include/mitkDisplayActionEvents.h @@ -1,188 +1,188 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKDISPLAYACTIONEVENTS_H #define MITKDISPLAYACTIONEVENTS_H #include // mitk core #include "mitkInteractionEvent.h" // itk #include #include #include namespace mitk { class MITKCORE_EXPORT DisplayActionEvent : public itk::AnyEvent { public: typedef DisplayActionEvent Self; typedef itk::AnyEvent Superclass; DisplayActionEvent() : m_InteractionEvent(nullptr) {} DisplayActionEvent(InteractionEvent* interactionEvent) : m_InteractionEvent(interactionEvent) {} - virtual ~DisplayActionEvent() {} - virtual const char* GetEventName() const override { return "DisplayActionEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplayActionEvent() override {} + const char* GetEventName() const override { return "DisplayActionEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(m_InteractionEvent); } + itk::EventObject* MakeObject() const override { return new Self(m_InteractionEvent); } InteractionEvent* GetInteractionEvent() const { return m_InteractionEvent; } BaseRenderer* GetSender() const { return m_InteractionEvent != nullptr ? m_InteractionEvent->GetSender() : nullptr; } DisplayActionEvent(const Self& s) : Superclass(s), m_InteractionEvent(s.GetInteractionEvent()) {}; private: InteractionEvent* m_InteractionEvent; void operator=(const Self &); }; class MITKCORE_EXPORT DisplayMoveEvent : public DisplayActionEvent { public: typedef DisplayMoveEvent Self; typedef DisplayActionEvent Superclass; DisplayMoveEvent() : Superclass() {} DisplayMoveEvent(InteractionEvent* interactionEvent, const Vector2D& moveVector) : Superclass(interactionEvent) , m_MoveVector(moveVector) { } - virtual ~DisplayMoveEvent() {} - virtual const char* GetEventName() const override { return "DisplayMoveEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplayMoveEvent() override {} + const char* GetEventName() const override { return "DisplayMoveEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_MoveVector); } + itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_MoveVector); } const Vector2D& GetMoveVector() const { return m_MoveVector; } DisplayMoveEvent(const Self& s) : Superclass(s), m_MoveVector(s.GetMoveVector()) {}; private: Vector2D m_MoveVector; }; class MITKCORE_EXPORT DisplaySetCrosshairEvent : public DisplayActionEvent { public: typedef DisplaySetCrosshairEvent Self; typedef DisplayActionEvent Superclass; DisplaySetCrosshairEvent() : Superclass() {} DisplaySetCrosshairEvent(InteractionEvent* interactionEvent, const Point3D& position) : Superclass(interactionEvent) , m_Position(position) { } - virtual ~DisplaySetCrosshairEvent() {} - virtual const char* GetEventName() const override { return "DisplaySetCrosshairEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplaySetCrosshairEvent() override {} + const char* GetEventName() const override { return "DisplaySetCrosshairEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Position); } + itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Position); } const Point3D& GetPosition() const { return m_Position; } DisplaySetCrosshairEvent(const Self& s) : Superclass(s), m_Position(s.GetPosition()) {}; private: Point3D m_Position; }; class MITKCORE_EXPORT DisplayZoomEvent : public DisplayActionEvent { public: typedef DisplayZoomEvent Self; typedef DisplayActionEvent Superclass; DisplayZoomEvent() : Superclass() {} DisplayZoomEvent(InteractionEvent* interactionEvent, float zoomFactor, const Point2D& startCoordinate) : Superclass(interactionEvent) , m_ZoomFactor(zoomFactor) , m_StartCoordinate(startCoordinate) { } - virtual ~DisplayZoomEvent() {} - virtual const char* GetEventName() const override { return "DisplayZoomEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplayZoomEvent() override {} + const char* GetEventName() const override { return "DisplayZoomEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_ZoomFactor, m_StartCoordinate); } + itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_ZoomFactor, m_StartCoordinate); } float GetZoomFactor() const { return m_ZoomFactor; } const Point2D& GetStartCoordinate() const { return m_StartCoordinate; } DisplayZoomEvent(const Self& s) : Superclass(s), m_ZoomFactor(s.GetZoomFactor()), m_StartCoordinate(s.GetStartCoordinate()) {}; private: float m_ZoomFactor; Point2D m_StartCoordinate; }; class MITKCORE_EXPORT DisplayScrollEvent : public DisplayActionEvent { public: typedef DisplayScrollEvent Self; typedef DisplayActionEvent Superclass; DisplayScrollEvent() : Superclass() {} DisplayScrollEvent(InteractionEvent* interactionEvent, int sliceDelta) : Superclass(interactionEvent) , m_SliceDelta(sliceDelta) { } - virtual ~DisplayScrollEvent() {} - virtual const char* GetEventName() const override { return "DisplayScrollEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplayScrollEvent() override {} + const char* GetEventName() const override { return "DisplayScrollEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_SliceDelta); } + itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_SliceDelta); } int GetSliceDelta() const { return m_SliceDelta; } DisplayScrollEvent(const Self& s) : Superclass(s), m_SliceDelta(s.GetSliceDelta()) {}; private: int m_SliceDelta; }; class MITKCORE_EXPORT DisplaySetLevelWindowEvent : public DisplayActionEvent { public: typedef DisplaySetLevelWindowEvent Self; typedef DisplayActionEvent Superclass; DisplaySetLevelWindowEvent() : Superclass() {} DisplaySetLevelWindowEvent(InteractionEvent* interactionEvent, ScalarType level, ScalarType window) : Superclass(interactionEvent) , m_Level(level) , m_Window(window) { } - virtual ~DisplaySetLevelWindowEvent() {} - virtual const char* GetEventName() const override { return "DisplaySetLevelWindowEvent"; } - virtual bool CheckEvent(const itk::EventObject* e) const override + ~DisplaySetLevelWindowEvent() override {} + const char* GetEventName() const override { return "DisplaySetLevelWindowEvent"; } + bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast(e) != nullptr; } - virtual itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Level, m_Window); } + itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Level, m_Window); } ScalarType GetLevel() const { return m_Level; } ScalarType GetWindow() const { return m_Window; } DisplaySetLevelWindowEvent(const Self& s) : Superclass(s), m_Level(s.GetLevel()), m_Window(s.GetWindow()) {}; private: ScalarType m_Level; ScalarType m_Window; }; } // end namespace #endif // MITKDISPLAYACTIONEVENTS_H diff --git a/Modules/Core/include/mitkDisplayInteractor.h b/Modules/Core/include/mitkDisplayInteractor.h index 26aae0c67f..9b1aa18389 100644 --- a/Modules/Core/include/mitkDisplayInteractor.h +++ b/Modules/Core/include/mitkDisplayInteractor.h @@ -1,283 +1,283 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDisplayInteractor_h #define mitkDisplayInteractor_h #include "mitkInteractionEventObserver.h" #include namespace mitk { /** *\class DisplayInteractor *@brief Observer that manages the interaction with the display. * * This includes the interaction of Zooming, Panning, Scrolling and adjusting the LevelWindow. * * @ingroup Interaction **/ /** * Inherits from mitk::InteractionEventObserver since it doesn't alter any data (only their representation), * and its actions cannot be associated with a DataNode. Also inherits from EventStateMachine */ class MITKCORE_EXPORT DisplayInteractor : public EventStateMachine, public InteractionEventObserver { public: mitkClassMacro(DisplayInteractor, EventStateMachine) itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** * By this function the Observer gets notified about new events. * Here it is adapted to pass the events to the state machine in order to use * its infrastructure. * It also checks if event is to be accepted when it already has been processed by a DataInteractor. */ - virtual void Notify(InteractionEvent *interactionEvent, bool isHandled) override; + void Notify(InteractionEvent *interactionEvent, bool isHandled) override; protected: DisplayInteractor(); ~DisplayInteractor() override; /** * Derived function. * Connects the action names used in the state machine pattern with functions implemented within * this InteractionEventObserver. This is only necessary here because the events are processed by the state machine. */ void ConnectActionsAndFunctions() override; /** * Derived function. * Is executed when config object is set / changed. * Here it is used to read out the parameters set in the configuration file, * and set the member variables accordingly. */ void ConfigurationChanged() override; /** * Derived function. * Is executed when config object is set / changed. * Here it is used to read out the parameters set in the configuration file, * and set the member variables accordingly. */ bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode) override; virtual bool CheckPositionEvent(const InteractionEvent *interactionEvent); virtual bool CheckRotationPossible(const InteractionEvent *interactionEvent); virtual bool CheckSwivelPossible(const InteractionEvent *interactionEvent); /** * \brief Initializes an interaction, saves the pointers start position for further reference. */ virtual void Init(StateMachineAction *, InteractionEvent *); /** * \brief Performs panning of the data set in the render window. */ virtual void Move(StateMachineAction *, InteractionEvent *); /** * \brief Sets crosshair at clicked position* */ virtual void SetCrosshair(StateMachineAction *, InteractionEvent *); /** * \brief Increases the time step in 3d+t data */ virtual void IncreaseTimeStep(StateMachineAction *, InteractionEvent *); /** * \brief Decreases the time step in 3d+t data */ virtual void DecreaseTimeStep(StateMachineAction *, InteractionEvent *); /** * \brief Performs zooming relative to mouse/pointer movement. * * Behavior is determined by \see m_ZoomDirection and \see m_ZoomFactor. * */ virtual void Zoom(StateMachineAction *, InteractionEvent *); /** * \brief Performs scrolling relative to mouse/pointer movement. * * Behavior is determined by \see m_ScrollDirection and \see m_AutoRepeat. * */ virtual void Scroll(StateMachineAction *, InteractionEvent *); /** * \brief Scrolls one layer up */ virtual void ScrollOneDown(StateMachineAction *, InteractionEvent *); /** * \brief Scrolls one layer down */ virtual void ScrollOneUp(StateMachineAction *, InteractionEvent *); /** * \brief Adjusts the level windows relative to mouse/pointer movement. */ virtual void AdjustLevelWindow(StateMachineAction *, InteractionEvent *); /** * \brief Starts crosshair rotation */ virtual void StartRotation(StateMachineAction *, InteractionEvent *); /** * \brief Ends crosshair rotation */ virtual void EndRotation(StateMachineAction *, InteractionEvent *); /** * \brief */ virtual void Rotate(StateMachineAction *, InteractionEvent *event); virtual void Swivel(StateMachineAction *, InteractionEvent *event); /** * \brief Updates the Statusbar information with the information about the clicked position */ virtual void UpdateStatusbar(StateMachineAction *, InteractionEvent *event); /** * \brief Method to retrieve bool-value for given property from string-property * in given propertylist. */ bool GetBoolProperty(mitk::PropertyList::Pointer propertyList, const char *propertyName, bool defaultValue); private: /** * @brief UpdateStatusBar * @param image3D * @param idx * @param time * @param component If the PixelType of image3D is a vector (for example a 2D velocity vector), then only one of the vector components can be * displayed at once. Setting this parameter will determine which of the vector's components will be used to determine the displayed PixelValue. * Set this to 0 for scalar images */ void UpdateStatusBar(itk::SmartPointer image3D, itk::Index<3> idx, TimeStepType time=0, int component=0); /** * \brief Coordinate of the pointer at begin of an interaction translated to mm unit */ mitk::Point2D m_StartCoordinateInMM; /** * \brief Coordinate of the pointer in the last step within an interaction. */ mitk::Point2D m_LastDisplayCoordinate; /** * \brief Coordinate of the pointer in the last step within an interaction translated to mm unit */ mitk::Point2D m_LastCoordinateInMM; /** * \brief Current coordinates of the pointer. */ mitk::Point2D m_CurrentDisplayCoordinate; /** * \brief Modifier that defines how many slices are scrolled per pixel that the mouse has moved * * This modifier defines how many slices the scene is scrolled per pixel that the mouse cursor has moved. * By default the modifier is 4. This means that when the user moves the cursor by 4 pixels in Y-direction * the scene is scrolled by one slice. If the user has moved the the cursor by 20 pixels, the scene is * scrolled by 5 slices. * * If the cursor has moved less than m_IndexToSliceModifier pixels the scene is scrolled by one slice. */ int m_IndexToSliceModifier; /** Defines behavior at end of data set. * If set to true it will restart at end of data set from the beginning. */ bool m_AutoRepeat; /** * Defines scroll behavior. * Default is up/down movement of pointer performs scrolling */ std::string m_ScrollDirection; /** * Defines how the axis of interaction influences scroll behavior. */ bool m_InvertScrollDirection; /** * Defines scroll behavior. * Default is up/down movement of pointer performs zooming */ std::string m_ZoomDirection; /** * Defines how the axis of interaction influences zoom behavior. */ bool m_InvertZoomDirection; /** * Defines how the axis of interaction influences move behavior. */ bool m_InvertMoveDirection; /** * Defines level/window behavior. * Default is left/right movement of pointer modifies the level. */ std::string m_LevelDirection; /** * Defines how the axis of interaction influences level/window behavior. */ bool m_InvertLevelWindowDirection; /** * Determines if the Observer reacts to events that already have been processed by a DataInteractor. * The default value is false. */ bool m_AlwaysReact; /** * Factor to adjust zooming speed. */ float m_ZoomFactor; ///// Members to deal with rotating slices /** * @brief m_LinkPlanes Determines if angle between crosshair remains fixed when rotating */ bool m_LinkPlanes; typedef std::vector SNCVector; SNCVector m_RotatableSNCs; /// all SNCs that currently have CreatedWorldGeometries, that can be rotated. SNCVector m_SNCsToBeRotated; /// all SNCs that will be rotated (exceptions are the ones parallel to the one being clicked) Point3D m_LastCursorPosition; /// used for calculation of the rotation angle Point3D m_CenterOfRotation; /// used for calculation of the rotation angle Point2D m_ReferenceCursor; Vector3D m_RotationPlaneNormal; Vector3D m_RotationPlaneXVector; Vector3D m_RotationPlaneYVector; Vector3D m_PreviousRotationAxis; ScalarType m_PreviousRotationAngle; }; } #endif diff --git a/Modules/Core/include/mitkGenericIDRelationRule.h b/Modules/Core/include/mitkGenericIDRelationRule.h index 3818234e4f..ee8b935399 100644 --- a/Modules/Core/include/mitkGenericIDRelationRule.h +++ b/Modules/Core/include/mitkGenericIDRelationRule.h @@ -1,136 +1,136 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGenericIDRelationRule_h #define mitkGenericIDRelationRule_h #include "mitkPropertyRelationRuleBase.h" namespace mitk { /**This rule class can be used for relations that are only defined on the ID-layer and where no connection on the Data-layer can be defined or deduced. So it can be used for all ID based relations between PropertyProviders that also implement the interface identifiable. In order to be able to use this class for different relation types based on ID, the ruleIDTag is used. It must be specified when creating a rule instance. The ruleIDTag will be used as suffix for the rule ID of the instance and therefore allows to create specific and distinguishable rules instances based on this class. One may also specify the display name and the role names of the instance. If not speficied the default values are used (display name: " relation", source role name: "source of relation", destination role name: "destination of relation") */ class MITKCORE_EXPORT GenericIDRelationRule : public mitk::PropertyRelationRuleBase { public: mitkClassMacro(GenericIDRelationRule, PropertyRelationRuleBase); itkCloneMacro(Self); mitkNewMacro1Param(Self, const RuleIDType &); mitkNewMacro2Param(Self, const RuleIDType &, const std::string &); mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &); using RuleIDType = PropertyRelationRuleBase::RuleIDType; using RelationUIDType = PropertyRelationRuleBase::RelationUIDType; using RelationUIDVectorType = PropertyRelationRuleBase::RelationUIDVectorType; /** Returns an ID string that identifies the rule class */ RuleIDType GetRuleID() const override; bool IsAbstract() const override; /** Returns a human readable string that can be used to describe the rule. Does not need to be unique.*/ std::string GetDisplayName() const override; /** Returns a human readable string that can be used to describe the role of a source in context of the rule * instance.*/ std::string GetSourceRoleName() const override; /** Returns a human readable string that can be used to describe the role of a destination in context of the rule * instance.*/ std::string GetDestinationRoleName() const override; /** Pass through to base implementation of PropertyRelationRuleBase. See PropertyRelationRuleBase::connect documentation for more information. */ RelationUIDType Connect(IPropertyOwner *source, const IPropertyProvider *destination) const; protected: GenericIDRelationRule(const RuleIDType &ruleIDTag); GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName); GenericIDRelationRule(const RuleIDType &ruleIDTag, const std::string &displayName, const std::string &sourceRole, const std::string &destinationRole); ~GenericIDRelationRule() override = default; using InstanceIDType = PropertyRelationRuleBase::InstanceIDType; using InstanceIDVectorType = PropertyRelationRuleBase::InstanceIDVectorType; /** Is called if a instance ID cannot be deduced on the ID-layer. Implement this method to check which existing relation(s) as Connected_Data exists between both passed instances. If the passed instances have no explicit relation of type Connected_Data, an empty vector will be returned. @remark Per definition of property relation rules only 0 or 1 instance should be found for one provider pair and rule. But the data layer may be ambiguous and there for muliple relation instances of the rule instance could match. The implementation of this function should report all relation instances. The calling function will take care of this violation. @pre source must be a pointer to a valid IPropertyProvider instance. @pre destination must be a pointer to a valid IPropertyProvider instance.*/ InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source, const IPropertyProvider *destination) const override; /** Is called by HasRelation() if no relation of type Connected_ID (GetInstanceID_IDLayer()) or Connected_Data (GetInstanceID_datalayer()) is evident. Implement this method to deduce if the passed instances have a relation of type Implicit_Data. @pre source must be a pointer to a valid IPropertyProvider instance. @pre destination must be a pointer to a valid IPropertyProvider instance. */ bool HasImplicitDataRelation(const IPropertyProvider *source, const IPropertyProvider *destination) const override; /**Is called by Connect() to ensure that source has correctly set properties to resemble the relation on the data layer. This means that the method should set the properties that describe and encode the relation on the data layer (data-layer-specific relation properties). If the passed instance are already connected, the old settings should be overwritten. Connect() will ensure that source and destination are valid pointers. @param instanceID is the ID for the relation instance that should be connected. Existance of the relation instance is ensured. @pre source must be a valid instance. @pre destination must be a valid instance.*/ void Connect_datalayer(IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const override; /**This method is called by Disconnect() to remove all properties of the relation from the source that are set by Connect_datalayer(). @remark All RII-properties of this relation will removed by Disconnect() after this method call. If the relationUID is not part of the source. Nothing will be changed. Disconnect() ensures that source is a valid pointer if called. @remark Disconnect() ensures that sourece is valid and only invokes if instance exists.*/ void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const override; - virtual bool IsSupportedRuleID(const RuleIDType& ruleID) const override; + bool IsSupportedRuleID(const RuleIDType& ruleID) const override; itk::LightObject::Pointer InternalClone() const override; private: RuleIDType m_RuleIDTag; std::string m_DisplayName; std::string m_SourceRole; std::string m_DestinationRole; }; } // namespace mitk #endif diff --git a/Modules/Core/include/mitkInteractionSchemeSwitcher.h b/Modules/Core/include/mitkInteractionSchemeSwitcher.h index 4a4e485f7e..90466c56ed 100644 --- a/Modules/Core/include/mitkInteractionSchemeSwitcher.h +++ b/Modules/Core/include/mitkInteractionSchemeSwitcher.h @@ -1,125 +1,125 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKINTERACTIONSCHEMESWITCHER_H #define MITKINTERACTIONSCHEMESWITCHER_H #include "MitkCoreExports.h" #include "mitkInteractionEventHandler.h" #include namespace mitk { /*********************************************************************** * * \brief Class that offers a convenient way to switch between different * interaction schemes and their different modes. * * This class offers the possibility to switch between the two different * interaction schemes that are available: * * - MITK : The original interaction scheme * - left mouse button : setting the cross position in the MPR view * - middle mouse button : panning * - right mouse button : zooming * * There are 3 different MITK modes that are available in the MITK scheme. * * - PACS : An alternative interaction scheme that behaves more like a * PACS workstation * - left mouse button : behavior depends on current MouseMode * - middle mouse button : fast scrolling * - right mouse button : level-window * - ctrl + right button : zooming * - shift+ right button : panning * * There are 5 different PACS modes that are available in the PACS scheme. * Each mode defines the interaction that is performed on a left * mouse button click: * - Pointer : sets the cross position for the MPR * - Scroll * - Level-Window * - Zoom * - Pan * * When the interaction scheme is changed, this class sets the corresponding * interaction .xml-files for a given interaction event handler. * ***********************************************************************/ class MITKCORE_EXPORT InteractionSchemeSwitcher : public itk::Object { public: #pragma GCC visibility push(default) /** \brief Can be observed by GUI class to update button states when type is changed programmatically. */ itkEventMacro(InteractionSchemeChangedEvent, itk::AnyEvent); #pragma GCC visibility pop mitkClassMacroItkParent(InteractionSchemeSwitcher, itk::Object); itkFactorylessNewMacro(Self) itkCloneMacro(Self) // enum of the different interaction schemes that are available enum InteractionScheme { MITKStandard = 0, MITKRotationUncoupled, MITKRotationCoupled, MITKSwivel, PACSStandard, PACSLevelWindow, PACSPan, PACSScroll, PACSZoom }; /** * @brief Set the current interaction scheme of the given interaction event handler * * The interaction event handler is able to accept xml-configuration files that will define the interaction scheme. * Based on the given interaction scheme different configuration files are loaded into the interaction event handler. * The interaction scheme can be a variant of the MITK-mouse mode or the PACS-mouse mode (see 'enum InteractionScheme'). * The default is 'MITKStandard'. * If the interaction scheme has been changed, an 'InteractionSchemeChangedEvent' will be invoked. * * @pre The interaction event handler has to be valid (!nullptr). * @throw mitk::Exception, if the interaction event handler is invalid (==nullptr). * * @param interactionEventHandler The interaction event handler that defines the interaction scheme via configuration files * @param interactionScheme The interaction scheme that should be used for the currently active interaction event handler. */ void SetInteractionScheme(mitk::InteractionEventHandler* interactionEventHandler, InteractionScheme interactionScheme); /** * @brief Return the current interaction scheme * * @return The currently set InteractionScheme */ InteractionScheme GetInteractionScheme() const { return m_InteractionScheme; }; protected: InteractionSchemeSwitcher(); - virtual ~InteractionSchemeSwitcher() override; + ~InteractionSchemeSwitcher() override; private: InteractionScheme m_InteractionScheme; }; } // namespace mitk #endif // MITKINTERACTIONSCHEMESWITCHER_H diff --git a/Modules/Core/include/mitkSourceImageRelationRule.h b/Modules/Core/include/mitkSourceImageRelationRule.h index b631e5b3d8..283e381f22 100644 --- a/Modules/Core/include/mitkSourceImageRelationRule.h +++ b/Modules/Core/include/mitkSourceImageRelationRule.h @@ -1,164 +1,164 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkGenericIDRelationRule_h #define mitkGenericIDRelationRule_h #include "mitkPropertyRelationRuleBase.h" #include "mitkImage.h" namespace mitk { /**This rule class can be used for relations that reference an image as source for a destination entity. (e.g. an image that is used to generate the relation source). The ID-layer is supported like for GenericIDReleations. So it can be used for all ID based relations between PropertyProviders that also implement the interface identifiable. In addition the rule uses the data-layer to deduce/define relations. For this layer it uses properties compliant to DICOM. Thus (1) the information is stored in a DICOM Source Image Sequence item (0x0008,0x2112) and (2) the destination must have properties DICOM SOP Instance UIDs (0x0008, 0x0018) and DICOM SOP Class UID (0x0008, 0x0016). If the destination does not have this properties, no connection can be made on the data-layer. @remark Please note that PropertyRelationRules and DICOM use the term "source" differently. The DICOM source (image) equals the PropertyRelationRule destination. This is due to an inverted relation direction. So in the context of the SourceImageRelationRule interface a derived data is the source and points to the original image, it derives from. In the context of DICOM this referenced original image would be called source image (as the name of this class). In order to be able to use this class for different relation types (DICOM would call it purposes), the purposeTag is used. It must be specified when creating a rule instance. The purposeTag will be used as suffix for the rule ID of the instance and therefore allows to create specific and distinguishable rules instances based on this class. One may also specify the display name and the role names of the instance. If not specified the default values are used (display name: " relation", source role name: "derived data", destination role name: "source image") */ class MITKCORE_EXPORT SourceImageRelationRule : public mitk::PropertyRelationRuleBase { public: mitkClassMacro(SourceImageRelationRule, PropertyRelationRuleBase); itkNewMacro(Self); mitkNewMacro1Param(Self, const RuleIDType &); mitkNewMacro2Param(Self, const RuleIDType &, const std::string &); mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &); using RuleIDType = PropertyRelationRuleBase::RuleIDType; using RelationUIDType = PropertyRelationRuleBase::RelationUIDType; using RelationUIDVectorType = PropertyRelationRuleBase::RelationUIDVectorType; /** Returns an ID string that identifies the rule class */ RuleIDType GetRuleID() const override; bool IsAbstract() const override; /** Returns a human readable string that can be used to describe the rule. Does not need to be unique.*/ std::string GetDisplayName() const override; /** Returns a human readable string that can be used to describe the role of a source in context of the rule * instance.*/ std::string GetSourceRoleName() const override; /** Returns a human readable string that can be used to describe the role of a destination in context of the rule * instance.*/ std::string GetDestinationRoleName() const override; bool IsDestinationCandidate(const IPropertyProvider *owner) const override; /** Connects to passed images. @remark destination must specifiy DICOM SOP Instance UIDs (0x0008, 0x0018) and DICOM SOP Class UID (0x0008, 0x0016) in order to establish a connection on the data layer.*/ RelationUIDType Connect(Image *source, const Image *destination) const; protected: SourceImageRelationRule(); SourceImageRelationRule(const RuleIDType &purposeTag); SourceImageRelationRule(const RuleIDType &purposeTag, const std::string &displayName); SourceImageRelationRule(const RuleIDType &purposeTag, const std::string &displayName, const std::string &sourceRole, const std::string &destinationRole); ~SourceImageRelationRule() override = default; using InstanceIDType = PropertyRelationRuleBase::InstanceIDType; using InstanceIDVectorType = PropertyRelationRuleBase::InstanceIDVectorType; /** Helper function that returns a vector of all selections of the property DICOM.0008.2112 that refer to destination or all (if no destination is passed).*/ std::vector GetReferenceSequenceIndices(const IPropertyProvider * source, const IPropertyProvider * destination = nullptr) const; /** Is called if a instance ID cannot be deduced on the ID-layer. Implement this method to check which existing relation(s) as Connected_Data exists between both passed instances. If the passed instances have no explicit relation of type Connected_Data, an empty vector will be returned. @remark Per definition of property relation rules only 0 or 1 instance should be found for one provider pair and rule. But the data layer may be ambiguous and there for muliple relation instances of the rule instance could match. The implementation of this function should report all relation instances. The calling function will take care of this violation. @pre source must be a pointer to a valid IPropertyProvider instance. @pre destination must be a pointer to a valid IPropertyProvider instance.*/ InstanceIDVectorType GetInstanceID_datalayer(const IPropertyProvider *source, const IPropertyProvider *destination) const override; /** Is called by HasRelation() if no relation of type Connected_ID (GetInstanceID_IDLayer()) or Connected_Data (GetInstanceID_datalayer()) is evident. Implement this method to deduce if the passed instances have a relation of type Implicit_Data. @pre source must be a pointer to a valid IPropertyProvider instance. @pre destination must be a pointer to a valid IPropertyProvider instance. */ bool HasImplicitDataRelation(const IPropertyProvider *source, const IPropertyProvider *destination) const override; /**Is called by Connect() to ensure that source has correctly set properties to resemble the relation on the data layer. This means that the method should set the properties that describe and encode the relation on the data layer (data-layer-specific relation properties). If the passed instance are already connected, the old settings should be overwritten. Connect() will ensure that source and destination are valid pointers. @param instanceID is the ID for the relation instance that should be connected. Existance of the relation instance is ensured. @pre source must be a valid instance. @pre destination must be a valid instance.*/ void Connect_datalayer(IPropertyOwner *source, const IPropertyProvider *destination, const InstanceIDType &instanceID) const override; /**This method is called by Disconnect() to remove all properties of the relation from the source that are set by Connect_datalayer(). @remark All RII-properties of this relation will removed by Disconnect() after this method call. If the relationUID is not part of the source. Nothing will be changed. Disconnect() ensures that source is a valid pointer if called. @remark Disconnect() ensures that sourece is valid and only invokes if instance exists.*/ void Disconnect_datalayer(IPropertyOwner *source, const InstanceIDType &instanceID) const override; - virtual bool IsSupportedRuleID(const RuleIDType& ruleID) const override; + bool IsSupportedRuleID(const RuleIDType& ruleID) const override; itk::LightObject::Pointer InternalClone() const override; /**Prepares a new reference to an image on the data layer. Therefore an unused and valid sequence item index for the passed source will be genarated and a relationUID property with the relationUID will be set to block the instance ID. The instance ID will be returned. @remark The method is guarded by a class wide mutex to avoid racing conditions in a scenario where rules are used concurrently.*/ PropertyKeyPath::ItemSelectionIndex CreateNewSourceImageSequenceItem(IPropertyOwner *source) const; private: RuleIDType m_PurposeTag; std::string m_DisplayName; std::string m_SourceRole; std::string m_DestinationRole; }; } // namespace mitk #endif diff --git a/Modules/Core/include/mitkStdFunctionCommand.h b/Modules/Core/include/mitkStdFunctionCommand.h index e1ce8dfc2a..6e150fcc5c 100644 --- a/Modules/Core/include/mitkStdFunctionCommand.h +++ b/Modules/Core/include/mitkStdFunctionCommand.h @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSTDFUNCTIONCOMMAND_H #define MITKSTDFUNCTIONCOMMAND_H #include // itk #include // c++ #include namespace mitk { // define custom command to accept std::functions as "filter" and as "action" class MITKCORE_EXPORT StdFunctionCommand : public itk::Command { public: using Self = StdFunctionCommand; using Pointer = itk::SmartPointer; using FilterFunction = std::function; using ActionFunction = std::function; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(StdFunctionCommand, itk::Command); void SetCommandFilter(FilterFunction stdFunctionFilter) { m_StdFilterFunction = stdFunctionFilter; } void SetCommandAction(ActionFunction stdFunctionAction) { m_StdActionFunction = stdFunctionAction; } - virtual void Execute(Object*, const itk::EventObject& event) override + void Execute(Object*, const itk::EventObject& event) override { if (m_StdFilterFunction && m_StdActionFunction) { if (m_StdFilterFunction(event)) { m_StdActionFunction(event); } } } - virtual void Execute(const Object*, const itk::EventObject& event) override + void Execute(const Object*, const itk::EventObject& event) override { if (m_StdFilterFunction && m_StdActionFunction) { if (m_StdFilterFunction(event)) { m_StdActionFunction(event); } } } protected: FilterFunction m_StdFilterFunction; ActionFunction m_StdActionFunction; StdFunctionCommand() : m_StdFilterFunction(nullptr) , m_StdActionFunction(nullptr) {} - virtual ~StdFunctionCommand() {} + ~StdFunctionCommand() override {} private: ITK_DISALLOW_COPY_AND_ASSIGN(StdFunctionCommand); }; } // end namespace mitk #endif // MITKSTDFUNCTIONCOMMAND_H diff --git a/Modules/Core/test/mitkExceptionTest.cpp b/Modules/Core/test/mitkExceptionTest.cpp index c68bbf8bee..77c2f49731 100644 --- a/Modules/Core/test/mitkExceptionTest.cpp +++ b/Modules/Core/test/mitkExceptionTest.cpp @@ -1,369 +1,369 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include "mitkTestingMacros.h" // std includes #include // MITK includes #include "mitkException.h" #include "mitkExceptionMacro.h" #include "mitkTestingMacros.h" #include // ITK includes #include #include // VTK includes #include class SpecializedTestException : public mitk::Exception { public: mitkExceptionClassMacro(SpecializedTestException, mitk::Exception); }; class mitkExceptionTestSuite : public itk::Object, public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkExceptionTestSuite); MITK_TEST(TestExceptionConstructor_Success); MITK_TEST(TestSpecializedExceptionConstructor_Success); MITK_TEST(TestExceptionMessageStreamAddingString_Success); MITK_TEST(TestExceptionMessageStreamAddingSingleChars_Success); MITK_TEST(TestExceptionMessageStreamAddingObject_Success); MITK_TEST(TestSpecializedExceptionMessageStreamAddingString); MITK_TEST(TestExceptionMessageStreamThrowing_Success); MITK_TEST(TestMitkThrowMacroThrowing_Success); MITK_TEST(TestMitkThrowMacroMessage_Success); MITK_TEST(TestMitkThrowMacroException_Success); MITK_TEST(TestMitkThrowMacroSpezcializedException); MITK_TEST(TestGetNumberOfRethrows_Success); MITK_TEST(TestGetRethrowDataWithNegativNumber_Success); MITK_TEST(TestGetRethrowDataWithNumberZero_Success); MITK_TEST(TestGetRethrowDataWithNumberOne_Success); MITK_TEST(TestAddRethrowData_Success); MITK_TEST(TestFirstRethrowDataAreStoredProperly_Success); MITK_TEST(TestSecondRethrowDataAreStoredProperly_Success); MITK_TEST(TestRethrowMacro_Success); CPPUNIT_TEST_SUITE_END(); private: bool m_ExceptionThrown; std::string m_MessageText; std::string m_Message; std::string m_File; int m_Line; mitk::Exception m_E = mitk::Exception("test.cpp", 155, "", ""); mitk::Exception m_MyException = mitk::Exception("testfile.cpp", 111, "testmessage"); public: mitkClassMacroItkParent(mitkExceptionTestSuite, itk::Object); itkFactorylessNewMacro(Self) itkCloneMacro(Self) void throwExceptionManually() // this method is ONLY to test the constructor and no code example // normally exceptions should only be thrown by using the exception macro! { throw mitk::Exception("test.cpp", 155, "", ""); } void throwSpecializedExceptionManually() // this method is ONLY to test the constructor and no code example // normally exceptions should only be thrown by using the exception macro! { throw SpecializedTestException("test.cpp", 155, "", ""); } void throwExceptionManually(std::string message1, std::string message2) // this method is ONLY to test methods of mitk::Exception and no code example // normally exceptions should only be thrown by using the exception macro! { throw mitk::Exception("testfile.cpp", 155, message1.c_str(), "") << message2; } void throwExceptionWithThrowMacro() { mitkThrow() << "TEST EXCEPION THROWING WITH mitkThrow()"; } void throwExceptionWithThrowMacro(std::string message) { mitkThrow() << message.c_str(); } void throwSpecializedExceptionWithThrowMacro(std::string message) { mitkThrowException(mitk::Exception) << message; } void throwSpecializedExceptionWithThrowMacro2(std::string message) { mitkThrowException(SpecializedTestException) << message; } void reThrowExceptionWithReThrowMacro(std::string messageThrow, std::string messageReThrow) { try { throwExceptionWithThrowMacro(messageThrow); } catch (mitk::Exception &e) { mitkReThrow(e) << messageReThrow; } } - void setUp() + void setUp() override { m_ExceptionThrown = false; m_MessageText = ""; m_Message = "invalid"; m_File = "invalid"; m_Line = -1; } - void tearDown() + void tearDown() override { m_ExceptionThrown = false; m_MessageText = ""; m_Message = ""; m_File = ""; m_Line = 0; } void TestExceptionConstructor_Success() { try { this->throwExceptionManually(); } catch (const mitk::Exception &) { m_ExceptionThrown = true; } CPPUNIT_ASSERT_MESSAGE("Testing constructor of mitkException", m_ExceptionThrown); } void TestSpecializedExceptionConstructor_Success() { try { this->throwSpecializedExceptionManually(); } catch (const SpecializedTestException &) { m_ExceptionThrown = true; } CPPUNIT_ASSERT_MESSAGE("Testing constructor specialized exception (deriving from mitkException)", m_ExceptionThrown); } //##### this methods are ONLY to test the streaming operators of the exceptions and //##### NO code example. Please do not instantiate exceptions by yourself in normal code! //##### Normally exceptions should only be thrown by using the exception macro! void TestExceptionMessageStreamAddingString_Success() { m_MyException << " and additional stream"; CPPUNIT_ASSERT_MESSAGE("Testing mitkException message stream (adding std::string)", m_MyException.GetDescription() == std::string("testmessage and additional stream")); } void TestExceptionMessageStreamAddingSingleChars_Success() { m_MyException.SetDescription("testmessage2"); m_MyException << ' ' << 'a' << 'n' << 'd' << ' ' << 'c' << 'h' << 'a' << 'r' << 's'; CPPUNIT_ASSERT_MESSAGE("Testing mitkException message stream (adding single chars)", m_MyException.GetDescription() == std::string("testmessage2 and chars")); } void TestExceptionMessageStreamAddingObject_Success() { m_MyException.SetDescription("testmessage3"); m_MyException << m_MyException; // adding the object itself makes no sense but should work CPPUNIT_ASSERT_MESSAGE("Testing mitkException message stream (adding object)", m_MyException.GetDescription() != std::string("")); } void TestSpecializedExceptionMessageStreamAddingString() { SpecializedTestException mySpecializedException = SpecializedTestException("testfile.cpp", 111, "testmessage", "test"); mySpecializedException << " and additional stream"; CPPUNIT_ASSERT_MESSAGE("Testing specialized exception message stream (adding std::string)", mySpecializedException.GetDescription() == std::string("testmessage and additional stream")); } void TestExceptionMessageStreamThrowing_Success() { std::string thrownMessage = ""; try { this->throwExceptionManually("message1", " and message2"); } catch (const mitk::Exception &e) { thrownMessage = e.GetDescription(); m_ExceptionThrown = true; } CPPUNIT_ASSERT_MESSAGE("Testing throwing and streaming of mitk::Exception together.", m_ExceptionThrown && (thrownMessage == std::string("message1 and message2"))); } void TestMitkThrowMacroThrowing_Success() { // case 1: test throwing try { this->throwExceptionWithThrowMacro(); } catch (const mitk::Exception &) { m_ExceptionThrown = true; } CPPUNIT_ASSERT_MESSAGE("Testing mitkThrow()", m_ExceptionThrown); } void TestMitkThrowMacroMessage_Success() { // case 2: test message text try { this->throwExceptionWithThrowMacro("test123"); } catch (const mitk::Exception &e) { m_ExceptionThrown = true; m_MessageText = e.GetDescription(); } CPPUNIT_ASSERT_MESSAGE("Testing message test of mitkThrow()", (m_ExceptionThrown && (m_MessageText == "test123"))); } void TestMitkThrowMacroException_Success() { // case 3: specialized exception / command mitkThrow(mitk::Exception) try { this->throwSpecializedExceptionWithThrowMacro("test123"); } catch (const mitk::Exception &e) { m_ExceptionThrown = true; m_MessageText = e.GetDescription(); } CPPUNIT_ASSERT_MESSAGE("Testing special exception with mitkThrow(mitk::Exception)", m_ExceptionThrown && m_MessageText == "test123"); } void TestMitkThrowMacroSpezcializedException() { // case 4: specialized exception / command mitkThrow(mitk::SpecializedException) try { this->throwSpecializedExceptionWithThrowMacro2("test123"); } catch (const SpecializedTestException &e) { m_ExceptionThrown = true; m_MessageText = e.GetDescription(); } CPPUNIT_ASSERT_MESSAGE("Testing special exception with mitkThrow(mitk::SpecializedException)", m_ExceptionThrown && m_MessageText == "test123"); } //##### this methods are ONLY to test methods of mitk::Exception and no code example //##### normally exceptions should only be instantiated and thrown by using the exception macros! void TestGetNumberOfRethrows_Success() { // first: testing rethrow information methods, when no information is stored // case 1.1: method GetNumberOfRethrows() CPPUNIT_ASSERT_MESSAGE("Testing GetNumberOfRethrows() with empty rethrow information", m_E.GetNumberOfRethrows() == 0); } void TestGetRethrowDataWithNegativNumber_Success() { // case 1.2: GetRethrowData() with negative number m_E.GetRethrowData(-1, m_File, m_Line, m_Message); CPPUNIT_ASSERT_MESSAGE("Testing GetRethrowData() with invalid rethrow number (negative).", ((m_File == "") && (m_Line == 0) && (m_Message == ""))); } void TestGetRethrowDataWithNumberZero_Success() { // case 1.3: GetRethrowData() with number 0 m_E.GetRethrowData(0, m_File, m_Line, m_Message); CPPUNIT_ASSERT_MESSAGE("Testing GetRethrowData() with non-existing rethrow number (0).", ((m_File == "") && (m_Line == 0) && (m_Message == ""))); } void TestGetRethrowDataWithNumberOne_Success() { // case 1.4: GetRethrowData() with number 1 m_E.GetRethrowData(1, m_File, m_Line, m_Message); CPPUNIT_ASSERT_MESSAGE("Testing GetRethrowData() with non-existing rethrow number (1).", ((m_File == "") && (m_Line == 0) && (m_Message == ""))); } void TestAddRethrowData_Success() { // second: add rethrow data m_E.AddRethrowData("test2.cpp", 10, "Rethrow one"); CPPUNIT_ASSERT_MESSAGE("Testing adding of rethrow data.", m_E.GetNumberOfRethrows() == 1); m_E.AddRethrowData("test3.cpp", 15, "Rethrow two"); CPPUNIT_ASSERT_MESSAGE("Testing adding of more rethrow data.", m_E.GetNumberOfRethrows() == 2); } void TestFirstRethrowDataAreStoredProperly_Success() { // third: test if this rethrow data was stored properly m_E.AddRethrowData("test2.cpp", 10, "Rethrow one"); m_E.GetRethrowData(0, m_File, m_Line, m_Message); CPPUNIT_ASSERT_MESSAGE("Testing stored information of first rethrow.", ((m_File == "test2.cpp") && (m_Line == 10) && (m_Message == "Rethrow one"))); } void TestSecondRethrowDataAreStoredProperly_Success() { m_E.AddRethrowData("test2.cpp", 10, "Rethrow one"); m_E.AddRethrowData("test3.cpp", 15, "Rethrow two"); m_E.GetRethrowData(1, m_File, m_Line, m_Message); CPPUNIT_ASSERT_MESSAGE("Testing stored information of second rethrow.", ((m_File == "test3.cpp") && (m_Line == 15) && (m_Message == "Rethrow two"))); } void TestRethrowMacro_Success() { // case 1: test throwing try { this->reThrowExceptionWithReThrowMacro("Test original message.", "Test rethrow message."); } catch (const mitk::Exception &e) { m_Message = e.GetDescription(); m_ExceptionThrown = true; } CPPUNIT_ASSERT_MESSAGE("Testing mitkReThrow()", m_ExceptionThrown); CPPUNIT_ASSERT_MESSAGE("Testing message/descriprion after rethrow.", m_Message == "Test original message.Test rethrow message."); } }; MITK_TEST_SUITE_REGISTRATION(mitkException) diff --git a/Modules/Core/test/mitkPointSetLocaleTest.cpp b/Modules/Core/test/mitkPointSetLocaleTest.cpp index 990d3f014a..7a26e57d2a 100644 --- a/Modules/Core/test/mitkPointSetLocaleTest.cpp +++ b/Modules/Core/test/mitkPointSetLocaleTest.cpp @@ -1,198 +1,198 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include "mitkTestingMacros.h" // std includes #include #include // MITK includes #include "mitkIOUtil.h" #include "mitkPointSet.h" #include "mitkStandardFileLocations.h" // VTK includes #include // stream includes #include #include class mitkPointSetLocaleTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkPointSetLocaleTestSuite); MITK_TEST(TestIfGermanLocaleUsed_Success); CPPUNIT_TEST_SUITE_END(); private: typedef std::list StringList; StringList m_AllLocales; mitk::PointSet::Pointer m_RefPointSet; mitk::Point3D m_RefPoint; mitk::Point3D m_Point; mitk::PointSet::Pointer m_PointSet; bool ChangeLocale(const std::string &locale) { try { MITK_TEST_OUTPUT(<< "\n** Changing locale from " << setlocale(LC_ALL, nullptr) << " to '" << locale << "'"); setlocale(LC_ALL, locale.c_str()); std::locale l(locale.c_str()); std::cin.imbue(l); std::cout.imbue(l); return true; } catch (...) { MITK_TEST_OUTPUT(<< "Could not activate locale " << locale << "\n"); return false; } } void ReaderLocaleTest(mitk::Point3D &refPoint, std::string filename) { MITK_TEST_OUTPUT(<< "---- Reader Test ---- "); m_PointSet = mitk::IOUtil::Load(filename); if (m_PointSet->GetPointIfExists(0, &m_Point)) { CPPUNIT_ASSERT_MESSAGE("read x correct", fabs(refPoint[0] - m_Point[0]) < 0.00001); CPPUNIT_ASSERT_MESSAGE("read y correct", fabs(refPoint[1] - m_Point[1]) < 0.00001); CPPUNIT_ASSERT_MESSAGE("read z correct", fabs(refPoint[2] - m_Point[2]) < 0.00001); } else { MITK_TEST_FAILED_MSG(<< "File " << filename << " can not be read - test will not applied."); return; } } void WriterLocaleTest(mitk::Point3D &refPoint, std::string filename) { MITK_TEST_OUTPUT(<< "---- Writer Test---- "); // create pointset m_RefPointSet = mitk::PointSet::New(); m_RefPointSet->InsertPoint(0, refPoint); std::string tmpFilePath = mitk::IOUtil::CreateTemporaryFile("testPointSet_XXXXXX.mps"); // write point set mitk::IOUtil::Save(m_RefPointSet, tmpFilePath); std::ifstream stream(tmpFilePath.c_str()); // compare two .mps files std::ifstream refStream(filename.c_str()); CPPUNIT_ASSERT_MESSAGE("Read reference point set", refStream); CPPUNIT_ASSERT_MESSAGE("Read point set", stream); bool differ = false; if (stream.is_open() && refStream.is_open()) { std::string streamLine; std::string refStreamLine; while (!stream.eof() && !refStream.eof()) { getline(stream, streamLine); getline(refStream, refStreamLine); if (streamLine.compare(refStreamLine) != 0) { differ = true; break; } } stream.close(); refStream.close(); } CPPUNIT_ASSERT_MESSAGE("Write point set correct", !differ); } public: - void setUp() + void setUp() override { m_RefPointSet = mitk::PointSet::New(); // create locale list m_AllLocales.push_back("de_DE"); m_AllLocales.push_back("de_DE.utf8"); m_AllLocales.push_back("de_DE.UTF-8"); m_AllLocales.push_back("de_DE@euro"); m_AllLocales.push_back("German_Germany"); m_RefPoint[0] = 32.2946; m_RefPoint[1] = -17.7359; m_RefPoint[2] = 29.6502; } - void tearDown() + void tearDown() override { m_RefPoint[0] = 0; m_RefPoint[1] = 0; m_RefPoint[2] = 0; m_AllLocales.clear(); } void TestIfGermanLocaleUsed_Success() { // create reference point set m_RefPointSet->SetPoint(0, m_RefPoint); // QuickFix for MAC OS X // See for more the Bug #3894 comments #if defined(__APPLE__) || defined(MACOSX) m_AllLocales.push_back("C"); #endif // write a reference file using the "C" locale once ChangeLocale("C"); std::string referenceFilePath = mitk::IOUtil::CreateTemporaryFile("refPointSet_XXXXXX.mps"); MITK_INFO << "Reference PointSet in " << referenceFilePath; // write point set mitk::IOUtil::Save(m_RefPointSet, referenceFilePath); unsigned int numberOfTestedGermanLocales(0); for (auto iter = m_AllLocales.begin(); iter != m_AllLocales.end(); ++iter) { if (ChangeLocale(*iter)) { ++numberOfTestedGermanLocales; WriterLocaleTest(m_RefPoint, referenceFilePath); ReaderLocaleTest(m_RefPoint, referenceFilePath); } } if (numberOfTestedGermanLocales == 0) { MITK_TEST_OUTPUT(<< "Warning: No German locale was found on the system."); } } }; MITK_TEST_SUITE_REGISTRATION(mitkPointSetLocale) diff --git a/Modules/Core/test/mitkSurfaceTest.cpp b/Modules/Core/test/mitkSurfaceTest.cpp index 5551ab13aa..76a03aa782 100644 --- a/Modules/Core/test/mitkSurfaceTest.cpp +++ b/Modules/Core/test/mitkSurfaceTest.cpp @@ -1,279 +1,279 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include // std includes #include // MITK includes #include "mitkCommon.h" #include "mitkNumericTypes.h" #include "mitkSurface.h" // MITK includes #include // VTK includes #include "vtkPolyData.h" #include "vtkSphereSource.h" // stream includes #include class mitkSurfaceTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkSurfaceTestSuite); MITK_TEST(InitializationSurfacePointer_Success); MITK_TEST(InitializationCloneSurfacePointer_Success); MITK_TEST(StateOfVtkPolyDataEqualNullPointer_Success); MITK_TEST(SetVtkPolyDataNotNullPointer_Failure); MITK_TEST(SetClonedVtkPolyDataNotNullPointer_Failure); MITK_TEST(GetBoundingBox_Success); MITK_TEST(SurfaceExpandTimestepsAreFive_Success); MITK_TEST(Surface4DDataCreation_Success); MITK_TEST(TimeGeometrySurface_Success); MITK_TEST(ChangingDataOfSpecificTimestepSurface_Success); MITK_TEST(SurfaceCopyWithGraft_Failure); MITK_TEST(CopyingNumberOfTimesteps_Success); MITK_TEST(DestructionOfSurface_Success); CPPUNIT_TEST_SUITE_END(); private: mitk::Surface::Pointer m_Surface; mitk::Surface::Pointer m_CloneSurface; vtkSmartPointer m_SphereSource; const mitk::TimeGeometry *m_InputTimeGeometry; int m_Time; int m_Timestep; public: - void setUp() + void setUp() override { m_Surface = mitk::Surface::New(); m_CloneSurface = m_Surface->Clone(); m_SphereSource = vtkSmartPointer::New(); m_InputTimeGeometry = m_Surface->GetUpdatedTimeGeometry(); m_SphereSource->SetCenter(0, 0, 0); m_SphereSource->SetRadius(5.0); m_SphereSource->SetThetaResolution(10); m_SphereSource->SetPhiResolution(10); m_SphereSource->Update(); m_Time = 3; m_Timestep = 0; } - void tearDown() + void tearDown() override { m_Surface = nullptr; m_CloneSurface = nullptr; } void InitializationSurfacePointer_Success() { CPPUNIT_ASSERT_MESSAGE("Testing initialization", m_Surface.GetPointer()); } void InitializationCloneSurfacePointer_Success() { CPPUNIT_ASSERT_MESSAGE("Testing clone surface initialization", m_CloneSurface.GetPointer()); } void StateOfVtkPolyDataEqualNullPointer_Success() { CPPUNIT_ASSERT_MESSAGE("Testing initial state of vtkPolyData", m_Surface->GetVtkPolyData() == nullptr); } void SetVtkPolyDataNotNullPointer_Failure() { vtkSmartPointer polys = m_SphereSource->GetOutput(); m_Surface->SetVtkPolyData(polys); CPPUNIT_ASSERT_MESSAGE("Testing set vtkPolyData", m_Surface->GetVtkPolyData() != nullptr); } void SetClonedVtkPolyDataNotNullPointer_Failure() { vtkSmartPointer polys = m_SphereSource->GetOutput(); m_Surface->SetVtkPolyData(polys); m_CloneSurface = m_Surface->Clone(); CPPUNIT_ASSERT_MESSAGE("Testing set vtkPolyData of cloned surface!", m_CloneSurface->GetVtkPolyData() != nullptr); } void GetBoundingBox_Success() { vtkSmartPointer polys = m_SphereSource->GetOutput(); m_Surface->SetVtkPolyData(polys); double bounds[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; polys->ComputeBounds(); polys->GetBounds(bounds); m_Surface->UpdateOutputInformation(); m_Surface->SetRequestedRegionToLargestPossibleRegion(); auto *bb = const_cast(m_Surface->GetGeometry()->GetBoundingBox()); mitk::BoundingBox::BoundsArrayType surfBounds = bb->GetBounds(); bool passed = false; if (bounds[0] == surfBounds[0] && bounds[1] == surfBounds[1] && bounds[2] == surfBounds[2] && bounds[3] == surfBounds[3] && bounds[4] == surfBounds[4] && bounds[5] == surfBounds[5]) { passed = true; } CPPUNIT_ASSERT_MESSAGE("Testing GetBoundingBox()", passed); } void SurfaceExpandTimestepsAreFive_Success() { m_Surface->Expand(5); m_Surface->Update(); m_Surface->SetRequestedRegionToLargestPossibleRegion(); mitk::Surface::RegionType requestedRegion = m_Surface->GetRequestedRegion(); CPPUNIT_ASSERT_MESSAGE("Testing mitk::Surface::Expand( timesteps ): ", requestedRegion.GetSize(3) == 5); } void Surface4DDataCreation_Success() { double boundsMat[5][6]; for (int i = 0; i < 5; i++) { vtkNew sphereSource; sphereSource->SetCenter(0, 0, 0); sphereSource->SetRadius(1.0 * (i + 1.0)); sphereSource->SetThetaResolution(10); sphereSource->SetPhiResolution(10); sphereSource->Update(); sphereSource->GetOutput()->ComputeBounds(); sphereSource->GetOutput()->GetBounds(boundsMat[i]); m_Surface->SetVtkPolyData(sphereSource->GetOutput(), i); } m_Surface->UpdateOutputInformation(); m_Surface->SetRequestedRegionToLargestPossibleRegion(); bool passed = true; for (int i = 0; i < 5; i++) { mitk::BoundingBox::BoundsArrayType surfBounds = (const_cast(m_Surface->GetTimeGeometry()->GetGeometryForTimeStep(i)->GetBoundingBox())) ->GetBounds(); if (boundsMat[i][0] != surfBounds[0] || boundsMat[i][1] != surfBounds[1] || boundsMat[i][2] != surfBounds[2] || boundsMat[i][3] != surfBounds[3] || boundsMat[i][4] != surfBounds[4] || boundsMat[i][5] != surfBounds[5]) { passed = false; break; } } CPPUNIT_ASSERT_MESSAGE("Testing mitk::Surface::Testing 4D surface data creation", passed); } void TimeGeometrySurface_Success() { m_Timestep = m_InputTimeGeometry->TimePointToTimeStep(m_Time); CPPUNIT_ASSERT_MESSAGE("Testing correctness of geometry for surface->GetUpdatedTimeGeometry()", m_Time == m_Timestep); } void ChangingDataOfSpecificTimestepSurface_Success() { vtkNew sphereSource; sphereSource->SetCenter(0, 0, 0); sphereSource->SetRadius(100.0); sphereSource->SetThetaResolution(10); sphereSource->SetPhiResolution(10); sphereSource->Update(); m_Surface->SetVtkPolyData(sphereSource->GetOutput(), 3); m_Timestep = m_InputTimeGeometry->TimePointToTimeStep(m_Time); CPPUNIT_ASSERT_MESSAGE( "Explicitly changing the data of timestep 3 and checking for timebounds correctness of surface's geometry again", m_Time == m_Timestep); } void SurfaceCopyWithGraft_Failure() { double boundsMat[5][6]; for (int i = 0; i < 5; i++) { vtkNew sphereSource; sphereSource->SetCenter(0, 0, 0); sphereSource->SetRadius(1.0 * (i + 1.0)); sphereSource->SetThetaResolution(10); sphereSource->SetPhiResolution(10); sphereSource->Update(); sphereSource->GetOutput()->ComputeBounds(); sphereSource->GetOutput()->GetBounds(boundsMat[i]); m_Surface->SetVtkPolyData(sphereSource->GetOutput(), i); } m_Surface->UpdateOutputInformation(); m_Surface->SetRequestedRegionToLargestPossibleRegion(); mitk::Surface::Pointer dummy = mitk::Surface::New(); dummy->Graft(m_Surface); CPPUNIT_ASSERT_MESSAGE("Testing copying a Surface with Graft()", dummy->GetVtkPolyData() != nullptr); } void CopyingNumberOfTimesteps_Success() { double boundsMat[5][6]; for (int i = 0; i < 5; i++) { vtkNew sphereSource; sphereSource->SetCenter(0, 0, 0); sphereSource->SetRadius(1.0 * (i + 1.0)); sphereSource->SetThetaResolution(10); sphereSource->SetPhiResolution(10); sphereSource->Update(); sphereSource->GetOutput()->ComputeBounds(); sphereSource->GetOutput()->GetBounds(boundsMat[i]); m_Surface->SetVtkPolyData(sphereSource->GetOutput(), i); } m_Surface->UpdateOutputInformation(); m_Surface->SetRequestedRegionToLargestPossibleRegion(); unsigned int numberoftimesteps = m_Surface->GetTimeSteps(); mitk::Surface::Pointer dummy = mitk::Surface::New(); dummy->Graft(m_Surface); CPPUNIT_ASSERT_MESSAGE(" Old timesteps == copy of timesteps ", dummy->GetTimeSteps() == numberoftimesteps); } void DestructionOfSurface_Success() { m_Surface = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing destruction of surface", m_Surface.IsNull()); } }; MITK_TEST_SUITE_REGISTRATION(mitkSurface) diff --git a/Modules/Core/test/mitkTinyXMLTest.cpp b/Modules/Core/test/mitkTinyXMLTest.cpp index 69dd7575aa..21f551681c 100644 --- a/Modules/Core/test/mitkTinyXMLTest.cpp +++ b/Modules/Core/test/mitkTinyXMLTest.cpp @@ -1,164 +1,164 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include // std includes #include #include #include #include // MITK includes #include "mitkStringProperty.h" #include // itksys #include // VTK includes #include // vnl includes #include class mitkTinyXMLTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkTinyXMLTestSuite); MITK_TEST(TestingFunctionSetupWorks_Success); MITK_TEST(TestingReadValueFromSetupDocument_Success); MITK_TEST(TestingReadOutValueWorks_Success); MITK_TEST(TestDoubleValueWriteOut_Success); MITK_TEST(TestDoubleValueWriteOutManyDecimalPlaces_Success); CPPUNIT_TEST_SUITE_END(); private: const std::string m_Filename = itksys::SystemTools::GetCurrentWorkingDirectory() + "/TinyXMLTest.txt"; const std::string m_ElementToStoreAttributeName = "DoubleTest"; const std::string m_AttributeToStoreName = "CommaValue"; TiXmlDocument m_Document; TiXmlElement *m_DoubleTest; double calcPrecision(const unsigned int requiredDecimalPlaces) { return pow(10.0, -1.0 * ((double)requiredDecimalPlaces)); } bool Setup(double valueToWrite) { // 1. create simple document auto decl = new TiXmlDeclaration("1.0", "", ""); // TODO what to write here? encoding? etc.... m_Document.LinkEndChild(decl); auto version = new TiXmlElement("Version"); version->SetAttribute("Writer", __FILE__); version->SetAttribute("CVSRevision", "$Revision: 17055 $"); version->SetAttribute("FileVersion", 1); m_Document.LinkEndChild(version); // 2. store one element containing a double value with potentially many after comma digits. auto vElement = new TiXmlElement(m_ElementToStoreAttributeName); vElement->SetDoubleAttribute(m_AttributeToStoreName, valueToWrite); m_Document.LinkEndChild(vElement); // 3. store in file. return m_Document.SaveFile(m_Filename); } public: - void setUp() {} + void setUp() override {} - void tearDown() {} + void tearDown() override {} void TestingFunctionSetupWorks_Success() { CPPUNIT_ASSERT_MESSAGE("Test if Setup correctly writes data to file", Setup(1.0)); } int readValueFromSetupDocument(double &readOutValue) { if (!m_Document.LoadFile(m_Filename)) { CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", false); return TIXML_NO_ATTRIBUTE; } else { m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName); return m_DoubleTest->QueryDoubleAttribute(m_AttributeToStoreName, &readOutValue); } } void TestingReadValueFromSetupDocument_Success() { if (!m_Document.LoadFile(m_Filename)) { CPPUNIT_ASSERT_MESSAGE("Test Setup failed, could not open file", !m_Document.LoadFile(m_Filename)); } else { m_DoubleTest = m_Document.FirstChildElement(m_ElementToStoreAttributeName); CPPUNIT_ASSERT_MESSAGE("Test Setup could open file", m_DoubleTest != nullptr); } } /** * this first test ensures we can correctly readout values from the * TinyXMLDocument. */ void TestingReadOutValueWorks_Success() { double readValue; CPPUNIT_ASSERT_MESSAGE("checking if readout mechanism works.", TIXML_SUCCESS == readValueFromSetupDocument(readValue)); } void TestDoubleValueWriteOut_Success() { const double valueToWrite = -1.123456; const int validDigitsAfterComma = 6; // indicates the number of valid digits after comma of valueToWrite const double neededPrecision = calcPrecision(validDigitsAfterComma + 1); double readValue; Setup(valueToWrite); readValueFromSetupDocument(readValue); CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite equals readValue which was retrieved from TinyXML document", mitk::Equal(valueToWrite, readValue, neededPrecision)); } void TestDoubleValueWriteOutManyDecimalPlaces_Success() { const double valueToWrite = -1.12345678910111; const int validDigitsAfterComma = 14; // indicates the number of valid digits after comma of valueToWrite const double neededPrecision = calcPrecision(validDigitsAfterComma + 1); double readValue; Setup(valueToWrite); readValueFromSetupDocument(readValue); CPPUNIT_ASSERT_MESSAGE("Testing if value valueToWrite equals readValue which was retrieved from TinyXML document", mitk::Equal(valueToWrite, readValue, neededPrecision)); } }; MITK_TEST_SUITE_REGISTRATION(mitkTinyXML) diff --git a/Modules/Core/test/mitkVectorTest.cpp b/Modules/Core/test/mitkVectorTest.cpp index 720c7a1d15..6431e7ef24 100644 --- a/Modules/Core/test/mitkVectorTest.cpp +++ b/Modules/Core/test/mitkVectorTest.cpp @@ -1,441 +1,441 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include // std includes #include // MITK includes #include "mitkStringProperty.h" #include // itksys #include "itkImage.h" // VTK includes #include // vnl includes #include class mitkVectorTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkVectorTestSuite); MITK_TEST(ItkVecorEqualityUsingSameVector_Success); MITK_TEST(ItkVecorEqualityUsingDifferentVectors_Failure); MITK_TEST(ItkVecorEqualityForHigherEpsilonTolerance_Success); MITK_TEST(ItkVecorEqualityUsingDifferentVectorsWithElementWise_Success); MITK_TEST(ItkPointEqualitySamePoint_Success); MITK_TEST(ItkPointEqualityDifferentPoints_Failure); MITK_TEST(ItkPointEqualitForHigherEpsilons_Success); MITK_TEST(ItkPointEqualitDifferentPointsWithElementWise_Success); MITK_TEST(MitkVnlVectorEqualitySameMitkVnlVector_Success); MITK_TEST(MitkVnlVectorEqualityDifferentMitkVnlVectors_Failure); MITK_TEST(MitkVnlVectorEqualityHigherEpsilon_Success); MITK_TEST(MitkVnlVectorEqualityUsingDifferentMitkVnlVectorsWithElementWise_Success); MITK_TEST(VnlVectorEqualitySameVnlVector_Success); MITK_TEST(VnlVectorEqualityDifferentVnlVectors_Failure); MITK_TEST(VnlVectorEqualityDifferentVnlVectorsWithHighEps_Success); MITK_TEST(VnlVectorEqualityDifferentVnlVectorsWithLowEps_Success); MITK_TEST(VnlVectorEqualityDifferentVnlVectorsWithLowEps_Failure); MITK_TEST(ScalarEqualitySameScalar_Successs); MITK_TEST(ScalarEqualityDifferentScalarsDifferenceGreaterEps_Failure); MITK_TEST(ScalarEqualityDifferentScalarsDifferenceEqualEps_Successs); MITK_TEST(ScalarEqualityDifferentScalarsDifferenceLessEps_Successs); MITK_TEST(MatrixEqualitySameMatrixElementsWithEps_Success); MITK_TEST(MatrixEqualityElementWiseDifferentMatrixElementsWithEpsilonZero_Failure); MITK_TEST(MatrixEqualityDifferentMatrixElementsWithEpsilon_Success); MITK_TEST(MatrixEqualityRMSDifferentMatrixElementsWithEpsilon_Failure); MITK_TEST(MatrixEqualityRMSDifferentMatrixElementsWithEpsilonZero_Success); CPPUNIT_TEST_SUITE_END(); private: itk::Vector m_ItkVector_1; itk::Vector m_ItkVector_2; itk::Vector m_ItkVector_3; itk::Point m_ItkPoint_1; itk::Point m_ItkPoint_2; itk::Point m_ItkPoint_3; typedef mitk::ScalarType VnlValueType; vnl_vector_fixed m_VnlVector_1; vnl_vector_fixed m_VnlVector_2; vnl_vector_fixed m_VnlVector_3; mitk::ScalarType m_Scalar1; mitk::ScalarType m_Scalar2; mitk::ScalarType m_Scalar3; mitk::ScalarType m_Scalar4; vnl_matrix_fixed m_VnlMatrix3x3_1; vnl_matrix_fixed m_VnlMatrix3x3_2; mitk::ScalarType m_Epsilon; public: - void setUp() + void setUp() override { m_ItkVector_1[0] = 4.6; m_ItkVector_1[1] = 9.76543; m_ItkVector_1[2] = 746.09; m_VnlVector_1[0] = 4.6; m_VnlVector_1[1] = 9.76543; m_VnlVector_1[2] = 746.09; m_VnlVector_1[3] = 56.98; m_VnlVector_1[4] = 22.32; m_VnlVector_1[5] = 1.00; m_VnlVector_1[6] = 746.09; m_Scalar1 = 0.5689; m_Scalar2 = m_Scalar1 + mitk::eps * 1.01; m_Scalar3 = m_Scalar1; m_Scalar4 = m_Scalar1 + mitk::eps * 0.95; m_VnlMatrix3x3_1(0, 0) = 1.1; m_VnlMatrix3x3_1(0, 1) = 0.4; m_VnlMatrix3x3_1(0, 2) = 5.3; m_VnlMatrix3x3_1(1, 0) = 2.7; m_VnlMatrix3x3_1(1, 1) = 3578.56418; m_VnlMatrix3x3_1(1, 2) = 123.56; m_VnlMatrix3x3_1(2, 0) = 546.89; m_VnlMatrix3x3_1(2, 1) = 0.0001; m_VnlMatrix3x3_1(2, 2) = 1.0; m_VnlMatrix3x3_2(0, 0) = 1.1000009; m_VnlMatrix3x3_2(0, 1) = 0.4000009; m_VnlMatrix3x3_2(0, 2) = 5.3000009; m_VnlMatrix3x3_2(1, 0) = 2.7000009; m_VnlMatrix3x3_2(1, 1) = 3578.5641809; m_VnlMatrix3x3_2(1, 2) = 123.5600009; m_VnlMatrix3x3_2(2, 0) = 546.8900009; m_VnlMatrix3x3_2(2, 1) = 0.0001009; m_VnlMatrix3x3_2(2, 2) = 1.0000009; m_Epsilon = 0.000001; } - void tearDown() + void tearDown() override { m_ItkVector_1.Fill(0); m_ItkVector_2.Fill(0); m_ItkVector_3.Fill(0); m_ItkPoint_1.Fill(0); m_ItkPoint_2.Fill(0); m_ItkPoint_3.Fill(0); m_VnlVector_1.fill(0); m_VnlVector_2.fill(0); m_VnlVector_3.fill(0); m_Scalar1 = 0; m_Scalar2 = 0; m_Scalar3 = 0; m_Scalar4 = 0; m_VnlMatrix3x3_1.fill(0); m_VnlMatrix3x3_2.fill(0); } void ItkVecorEqualityUsingSameVector_Success() { CPPUNIT_ASSERT_MESSAGE("Test vector equality using the same vector with mitk::eps", mitk::Equal(m_ItkVector_1, m_ItkVector_1)); } void ItkVecorEqualityUsingDifferentVectors_Failure() { for (int i = 0; i < 3; i++) { m_ItkVector_2[i] = m_ItkVector_1[i] - mitk::eps * 1.1; } CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test vector equality using different vectors with an element-wise difference greater than mitk::eps", mitk::Equal(m_ItkVector_1, m_ItkVector_2)); } void ItkVecorEqualityForHigherEpsilonTolerance_Success() { for (int i = 0; i < 3; i++) { m_ItkVector_2[i] = m_ItkVector_1[i] - mitk::eps * 1.1; } CPPUNIT_ASSERT_MESSAGE("Vectors are equal for higher epsilon tolerance ( 1.2 * mitk::eps )", mitk::Equal(m_ItkVector_1, m_ItkVector_2, mitk::eps * 1.2)); } void ItkVecorEqualityUsingDifferentVectorsWithElementWise_Success() { for (int i = 0; i < 3; i++) { m_ItkVector_3[i] = m_ItkVector_1[i] - mitk::eps * 0.9; } CPPUNIT_ASSERT_MESSAGE( "Test vector equality using different vectors with an element-wise difference less than mitk::eps", mitk::Equal(m_ItkVector_1, m_ItkVector_3)); } void ItkPointEqualitySamePoint_Success() { // test itk point equality methods for (int i = 0; i < 3; i++) { m_ItkPoint_1[i] = m_ItkVector_1[i]; } CPPUNIT_ASSERT_MESSAGE("Test point equality using the same point with mitk::eps", mitk::Equal(m_ItkPoint_1, m_ItkPoint_1)); } void ItkPointEqualityDifferentPoints_Failure() { for (int i = 0; i < 3; i++) { m_ItkPoint_1[i] = m_ItkVector_1[i]; m_ItkPoint_2[i] = m_ItkVector_2[i]; } CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test point equality using different points with an element-wise difference greater than mitk::eps", mitk::Equal(m_ItkPoint_1, m_ItkPoint_2)); } void ItkPointEqualitForHigherEpsilons_Success() { for (int i = 0; i < 3; i++) { m_ItkVector_2[i] = m_ItkVector_1[i] - mitk::eps * 1.1; } for (int i = 0; i < 3; i++) { m_ItkPoint_1[i] = m_ItkVector_1[i]; m_ItkPoint_2[i] = m_ItkVector_2[i]; } CPPUNIT_ASSERT_MESSAGE("Points are equal for higher epsilon tolerance ( 1.2 * mitk::eps )", mitk::Equal(m_ItkPoint_1, m_ItkPoint_2, mitk::eps * 1.2)); } void ItkPointEqualitDifferentPointsWithElementWise_Success() { for (int i = 0; i < 3; i++) { m_ItkVector_3[i] = m_ItkVector_1[i] - mitk::eps * 0.9; } for (int i = 0; i < 3; i++) { m_ItkPoint_1[i] = m_ItkVector_1[i]; m_ItkPoint_3[i] = m_ItkVector_3[i]; } CPPUNIT_ASSERT_MESSAGE( "Test point equality using different points with an element-wise difference less than mitk::eps", mitk::Equal(m_ItkPoint_1, m_ItkPoint_3)); } void MitkVnlVectorEqualitySameMitkVnlVector_Success() { mitk::VnlVector mitkVnlVector_1(3); for (int i = 0; i < 3; i++) { mitkVnlVector_1.put(i, m_ItkVector_1[i]); } CPPUNIT_ASSERT_MESSAGE("Test mitk vnl vector equality using the same mitk vnl vector with mitk::eps", mitk::Equal(mitkVnlVector_1, mitkVnlVector_1)); } void MitkVnlVectorEqualityDifferentMitkVnlVectors_Failure() { mitk::VnlVector mitkVnlVector_1(3); mitk::VnlVector mitkVnlVector_2(3); for (int i = 0; i < 3; i++) { mitkVnlVector_1.put(i, m_ItkVector_1[i]); mitkVnlVector_2.put(i, m_ItkVector_2[i]); } CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test mitk vnl vector equality using different mitk vnl vectors with an element-wise difference " "greater than mitk::eps", mitk::Equal(mitkVnlVector_1, mitkVnlVector_2)); } void MitkVnlVectorEqualityHigherEpsilon_Success() { mitk::VnlVector mitkVnlVector_1(3); mitk::VnlVector mitkVnlVector_2(3); for (int i = 0; i < 3; i++) { m_ItkVector_2[i] = m_ItkVector_1[i] - mitk::eps * 1.1; } for (int i = 0; i < 3; i++) { mitkVnlVector_1.put(i, m_ItkVector_1[i]); mitkVnlVector_2.put(i, m_ItkVector_2[i]); } CPPUNIT_ASSERT_MESSAGE("Vnl vectors are equal for higher epsilon tolerance ( 1.2 * mitk::eps )", mitk::Equal(mitkVnlVector_1, mitkVnlVector_2, mitk::eps * 1.2)); } void MitkVnlVectorEqualityUsingDifferentMitkVnlVectorsWithElementWise_Success() { mitk::VnlVector mitkVnlVector_1(3); mitk::VnlVector mitkVnlVector_3(3); for (int i = 0; i < 3; i++) { m_ItkVector_3[i] = m_ItkVector_1[i] - mitk::eps * 0.9; } for (int i = 0; i < 3; i++) { mitkVnlVector_1.put(i, m_ItkVector_1[i]); mitkVnlVector_3.put(i, m_ItkVector_3[i]); } CPPUNIT_ASSERT_MESSAGE("Test mitk vnl vector equality using " "different mitk vnl vectors with an " "element-wise difference less than mitk::eps", mitk::Equal(mitkVnlVector_1, mitkVnlVector_3)); } void VnlVectorEqualitySameVnlVector_Success() { // test vnl_vector equality method CPPUNIT_ASSERT_MESSAGE("vnl_fixed : v_1 == v_1 ", (mitk::Equal(m_VnlVector_1, m_VnlVector_1))); } // the v_2 is constructed so that the equality test fails for mitk::eps, the norm of the difference between the // vectors is 7 * eps/6.9 void VnlVectorEqualityDifferentVnlVectors_Failure() { for (int i = 0; i < 7; i++) { m_VnlVector_2[i] = m_VnlVector_1[i] - mitk::eps * 1.1f; } CPPUNIT_ASSERT_NO_THROW_MESSAGE("vnl_fixed : v_1 != v_2 with mitk::eps ", (mitk::Equal(m_VnlVector_1, m_VnlVector_2))); } // increase the epsilon value used for testing equality - should now pass ( 1.2 * mitk::eps > 7 * mitk::eps/6.9 ) void VnlVectorEqualityDifferentVnlVectorsWithHighEps_Success() { for (int i = 0; i < 7; i++) { m_VnlVector_2[i] = m_VnlVector_1[i] - mitk::eps * 1.1f; } CPPUNIT_ASSERT_MESSAGE("vnl_fixed : v_1 == v_2 with eps = 1.2 * mitk::eps ", (mitk::Equal(m_VnlVector_1, m_VnlVector_2, mitk::eps * 1.2f))); } void VnlVectorEqualityDifferentVnlVectorsWithLowEps_Success() { for (int i = 0; i < 7; i++) { m_VnlVector_3[i] = m_VnlVector_1[i] - mitk::eps * 0.9f; } CPPUNIT_ASSERT_MESSAGE("vnl_fixed : v_1 == v_3 with eps = 0.8 * mitk::eps ", (mitk::Equal(m_VnlVector_1, m_VnlVector_3, mitk::eps))); } void VnlVectorEqualityDifferentVnlVectorsWithLowEps_Failure() { for (int i = 0; i < 7; i++) { m_VnlVector_3[i] = m_VnlVector_1[i] - mitk::eps * 0.9f; } CPPUNIT_ASSERT_NO_THROW_MESSAGE("vnl_fixed : v_1 != v_3 with eps = 0.8 * mitk::eps ", (mitk::Equal(m_VnlVector_1, m_VnlVector_3, mitk::eps * 0.8f))); } void ScalarEqualitySameScalar_Successs() { // test scalar equality method CPPUNIT_ASSERT_MESSAGE("Test scalar equality using the same scalar with mitk::eps", mitk::Equal(m_Scalar1, m_Scalar1)); } void ScalarEqualityDifferentScalarsDifferenceGreaterEps_Failure() { CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test scalar equality using the different scalars with a difference greater than mitk::eps", mitk::Equal(m_Scalar1, m_Scalar2)); } void ScalarEqualityDifferentScalarsDifferenceEqualEps_Successs() { CPPUNIT_ASSERT_MESSAGE("Test scalar equality using the different scalars with a difference equal to mitk::eps", mitk::Equal(m_Scalar1, m_Scalar3)); } void ScalarEqualityDifferentScalarsDifferenceLessEps_Successs() { CPPUNIT_ASSERT_MESSAGE("Test scalar equality using the different scalars with a difference less than mitk::eps", mitk::Equal(m_Scalar1, m_Scalar4)); } void MatrixEqualitySameMatrixElementsWithEps_Success() { // test matrix equality methods CPPUNIT_ASSERT_MESSAGE("Test for matrix equality with given epsilon=mitk::eps and exactly the same matrix elements", mitk::MatrixEqualElementWise(m_VnlMatrix3x3_1, m_VnlMatrix3x3_1, mitk::eps)); } void MatrixEqualityElementWiseDifferentMatrixElementsWithEpsilonZero_Failure() { CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test for matrix equality with given epsilon=0.0 and slightly different matrix elements", mitk::MatrixEqualElementWise(m_VnlMatrix3x3_1, m_VnlMatrix3x3_2, 0.0)); } void MatrixEqualityDifferentMatrixElementsWithEpsilon_Success() { CPPUNIT_ASSERT_MESSAGE("Test for matrix equality with given epsilon and slightly different matrix elements", mitk::MatrixEqualElementWise(m_VnlMatrix3x3_1, m_VnlMatrix3x3_2, m_Epsilon)); } void MatrixEqualityRMSDifferentMatrixElementsWithEpsilon_Failure() { CPPUNIT_ASSERT_NO_THROW_MESSAGE( "Test for matrix equality with given epsilon=0.0 and slightly different matrix elements", mitk::MatrixEqualRMS(m_VnlMatrix3x3_1, m_VnlMatrix3x3_2, 0.0)); } void MatrixEqualityRMSDifferentMatrixElementsWithEpsilonZero_Success() { CPPUNIT_ASSERT_MESSAGE("Test for matrix equality with given epsilon and slightly different matrix elements", mitk::MatrixEqualRMS(m_VnlMatrix3x3_1, m_VnlMatrix3x3_2, m_Epsilon)); } }; MITK_TEST_SUITE_REGISTRATION(mitkVector) diff --git a/Modules/Core/test/mitkWeakPointerTest.cpp b/Modules/Core/test/mitkWeakPointerTest.cpp index 5bc4633223..1543c4a4bf 100644 --- a/Modules/Core/test/mitkWeakPointerTest.cpp +++ b/Modules/Core/test/mitkWeakPointerTest.cpp @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Testing #include "mitkTestFixture.h" #include "mitkTestingMacros.h" // std includes #include // MITK includes #include // ITK includes #include class mitkWeakPointerTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkWeakPointerTestSuite); MITK_TEST(EqualPointers_Success); MITK_TEST(ExpiredWeakPointerWithSmartPointerAssignment_Success); MITK_TEST(ExpiredWeakPointerWithWeakPointerAssignment_Success); MITK_TEST(ExpiredWeakPointerWithSmartPointerConstructor_Success); MITK_TEST(ExpiredWeakPointerWithWeakPointerConstructor_Success); MITK_TEST(DeleteEventCall_Success); CPPUNIT_TEST_SUITE_END(); private: mitk::WeakPointer m_WeakPointer; mitk::WeakPointer m_WeakPointer2; itk::Object::Pointer m_SmartPointer; public: - void setUp() + void setUp() override { m_SmartPointer = itk::Object::New(); m_WeakPointer = m_SmartPointer; m_WeakPointer2 = m_WeakPointer; } - void tearDown() + void tearDown() override { m_SmartPointer = nullptr; m_WeakPointer = nullptr; m_WeakPointer2 = nullptr; } void EqualPointers_Success() { itk::Object::Pointer tmpSmartPointer(m_WeakPointer.Lock()); itk::Object::Pointer tmpSmartPointer2(m_WeakPointer2.Lock()); CPPUNIT_ASSERT_MESSAGE("Testing equal pointers", tmpSmartPointer.GetPointer() == tmpSmartPointer2.GetPointer()); } void ReferenceCountOfPointers_Success() { CPPUNIT_ASSERT_MESSAGE("Testing reference count", 1 == m_SmartPointer->GetReferenceCount()); } void ExpiredWeakPointerWithSmartPointerAssignment_Success() { m_SmartPointer = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing expired weak pointer (smart pointer assignment)", m_WeakPointer.IsExpired()); } void ExpiredWeakPointerWithWeakPointerAssignment_Success() { m_SmartPointer = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing expired weak pointer (weak pointer assignment)", m_WeakPointer2.IsExpired()); } void ExpiredWeakPointerWithSmartPointerConstructor_Success() { mitk::WeakPointer weakPointer3(m_SmartPointer); m_SmartPointer = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing expired weak pointer (smart pointer constructor)", weakPointer3.IsExpired()); } void ExpiredWeakPointerWithWeakPointerConstructor_Success() { mitk::WeakPointer weakPointer4(m_WeakPointer); m_WeakPointer = m_SmartPointer; m_SmartPointer = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing expired weak pointer (copy constructor)", weakPointer4.IsExpired()); } void DeleteEventCall_Success() { int deleteEventCallbackCalled = 0; m_WeakPointer.SetDeleteEventCallback([&deleteEventCallbackCalled]() { ++deleteEventCallbackCalled; }); m_WeakPointer = m_SmartPointer; m_SmartPointer = nullptr; CPPUNIT_ASSERT_MESSAGE("Testing call of delete event callback", 1 == deleteEventCallbackCalled); } }; MITK_TEST_SUITE_REGISTRATION(mitkWeakPointer) diff --git a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h index 2e1418945c..0b9a1865dd 100644 --- a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h +++ b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkDICOMPMIO_h #define __mitkDICOMPMIO_h #include #include #include #include #include namespace mitk { /** * Read and Writes a Parametric map to a dcm file * @ingroup Process */ class DICOMPMIO : public mitk::AbstractFileIO { public: DICOMPMIO(); // -------------- AbstractFileReader ------------- using AbstractFileReader::Read; /** * @brief Reads a DICOM parametric maps from the file system * @return a mitk::Image * @throws throws an mitk::Exception if an error ocurrs */ - virtual std::vector Read() override; - virtual ConfidenceLevel GetReaderConfidenceLevel() const override; + std::vector Read() override; + ConfidenceLevel GetReaderConfidenceLevel() const override; // -------------- AbstractFileWriter ------------- - virtual void Write() override; - virtual ConfidenceLevel GetWriterConfidenceLevel() const override; + void Write() override; + ConfidenceLevel GetWriterConfidenceLevel() const override; private: typedef mitk::Image PMInputType; typedef itk::Image PMitkInputImageType; typedef IODFloatingPointImagePixelModule::value_type PMFloatPixelType; // input type required for DCMQI typedef itk::Image PMitkInternalImageType; DICOMPMIO *IOClone() const override; // -------------- DICOMPMIO specific functions ------------- const std::string CreateMetaDataJsonFilePM() const; }; } // end of namespace mitk #endif // __mitkDICOMPMIO_h diff --git a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h index 07728d2a90..8e9cb9baa8 100644 --- a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h +++ b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKDICOMPMIOMIMETYPES_H #define MITKDICOMPMIOMIMETYPES_H #include "mitkCustomMimeType.h" #include #include namespace mitk { /// Provides the custom mime types for dicom qi objects loaded with DCMQI class MITKDICOMPMIO_EXPORT MitkDICOMPMIOMimeTypes { public: /** Mime type that parses dicom files to determine whether they are dicom pm objects. */ class MITKDICOMPMIO_EXPORT MitkDICOMPMMimeType : public CustomMimeType { public: MitkDICOMPMMimeType(); - virtual bool AppliesTo(const std::string &path) const override; - virtual MitkDICOMPMMimeType *Clone() const override; + bool AppliesTo(const std::string &path) const override; + MitkDICOMPMMimeType *Clone() const override; }; static MitkDICOMPMMimeType DICOMPM_MIMETYPE(); static std::string DICOMPM_MIMETYPE_NAME(); // Get all Mime Types static std::vector Get(); private: // purposely not implemented MitkDICOMPMIOMimeTypes(); MitkDICOMPMIOMimeTypes(const MitkDICOMPMIOMimeTypes &); }; } #endif // MITKDICOMPMIOMIMETYPES_H diff --git a/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h b/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h index 5e45f3a517..b5a7b99c8b 100644 --- a/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h +++ b/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h @@ -1,241 +1,241 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDICOMImageBlockDescriptor_h #define mitkDICOMImageBlockDescriptor_h #include "mitkDICOMEnums.h" #include "mitkDICOMImageFrameInfo.h" #include "mitkDICOMTag.h" #include "mitkDICOMTagCache.h" #include "mitkImage.h" #include "mitkProperties.h" #include "mitkWeakPointer.h" #include "mitkIPropertyProvider.h" #include "mitkGantryTiltInformation.h" #include namespace mitk { struct DICOMCachedValueInfo { unsigned int TimePoint; unsigned int SliceInTimePoint; std::string Value; }; class DICOMCachedValueLookupTable : public GenericLookupTable< DICOMCachedValueInfo > { public: typedef DICOMCachedValueLookupTable Self; typedef GenericLookupTable< DICOMCachedValueInfo > Superclass; const char *GetNameOfClass() const override { return "DICOMCachedValueLookupTable"; } DICOMCachedValueLookupTable() {} Superclass& operator=(const Superclass& other) override { return Superclass::operator=(other); } ~DICOMCachedValueLookupTable() override {} }; /** \ingroup DICOMReaderModule \brief Output descriptor for DICOMFileReader. As a result of analysis by a mitk::DICOMFileReader, this class describes the properties of a single mitk::Images that could be loaded by the file reader. The descriptor contains the following information: - the mitk::Image itself. This will be nullptr after analysis and only be present after actual loading. - a list of frames (mostly: filenames) that went into composition of the mitk::Image. - an assessment of the reader's ability to load this set of files (ReaderImplementationLevel) - this can be used for reader selection when one reader is able to load an image with correct colors and the other is able to produce only gray values, for example - description of aspects of the image. Mostly a key-value list implemented by means of mitk::PropertyList. - for specific keys and possible values, see documentation of specific readers. \note an mitk::Image may both consist of multiple files (the "old" DICOM way) or a mitk::Image may be described by a single DICOM file or even only parts of a DICOM file (the newer multi-frame DICOM classes). To reflect this DICOMImageFrameList describes a list of frames from different or a single file. Described aspects of an image are: - whether pixel spacing is meant to be in-patient or on-detector (mitk::PixelSpacingInterpretation) - details about a possible gantry tilt (intended for use by file readers, may be hidden later) */ class MITKDICOMREADER_EXPORT DICOMImageBlockDescriptor: public IPropertyProvider { public: DICOMImageBlockDescriptor(); - virtual ~DICOMImageBlockDescriptor(); + ~DICOMImageBlockDescriptor() override; DICOMImageBlockDescriptor(const DICOMImageBlockDescriptor& other); DICOMImageBlockDescriptor& operator=(const DICOMImageBlockDescriptor& other); static DICOMTagList GetTagsOfInterest(); /// List of frames that constitute the mitk::Image (DICOMImageFrame%s) void SetImageFrameList(const DICOMImageFrameList& framelist); /// List of frames that constitute the mitk::Image (DICOMImageFrame%s) const DICOMImageFrameList& GetImageFrameList() const; /// The 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList void SetMitkImage(Image::Pointer image); /// the 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList Image::Pointer GetMitkImage() const; /// Reader's capability to appropriately load this set of frames ReaderImplementationLevel GetReaderImplementationLevel() const; /// Reader's capability to appropriately load this set of frames void SetReaderImplementationLevel(const ReaderImplementationLevel& level); /// Key-value store describing aspects of the image to be loaded void SetProperty(const std::string& key, BaseProperty* value); /// Key-value store describing aspects of the image to be loaded BaseProperty* GetProperty(const std::string& key) const; /// Convenience function around GetProperty() std::string GetPropertyAsString(const std::string&) const; /// Convenience function around SetProperty() void SetFlag(const std::string& key, bool value); /// Convenience function around GetProperty() bool GetFlag(const std::string& key, bool defaultValue) const; /// Convenience function around SetProperty() void SetIntProperty(const std::string& key, int value); /// Convenience function around GetProperty() int GetIntProperty(const std::string& key, int defaultValue) const; - virtual BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, + BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override; - virtual std::vector GetPropertyKeys(const std::string &contextName = "", + std::vector GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override; - virtual std::vector GetPropertyContextNames() const override; + std::vector GetPropertyContextNames() const override; private: // For future implementation: load slice-by-slice, mark this using these methods void SetSliceIsLoaded(unsigned int index, bool isLoaded); // For future implementation: load slice-by-slice, mark this using these methods bool IsSliceLoaded(unsigned int index) const; // For future implementation: load slice-by-slice, mark this using these methods bool AllSlicesAreLoaded() const; public: /// Describe how the mitk::Image's pixel spacing should be interpreted PixelSpacingInterpretation GetPixelSpacingInterpretation() const; /// Describe the correct x/y pixel spacing of the mitk::Image (which some readers might need to adjust after loading) void GetDesiredMITKImagePixelSpacing(ScalarType& spacingXinMM, ScalarType& spacingYinMM) const; /// Describe the gantry tilt of the acquisition void SetTiltInformation(const GantryTiltInformation& info); /// Describe the gantry tilt of the acquisition const GantryTiltInformation GetTiltInformation() const; /// SOP Class UID of this set of frames void SetSOPClassUID(const std::string& uid); /// SOP Class UID of this set of frames std::string GetSOPClassUID() const; /// SOP Class as human readable name (e.g. "CT Image Storage") std::string GetSOPClassUIDAsName() const; /**Convinience method that returns the property timesteps*/ int GetNumberOfTimeSteps() const; /**return the number of frames that constitute one timestep.*/ int GetNumberOfFramesPerTimeStep() const; void SetTagCache(DICOMTagCache* privateCache); /** Type specifies additional tags of interest. Key is the tag path of interest. * The value is an optional user defined name for the property that should be used to store the tag value(s). * Empty value is default and will imply to use the found DICOMTagPath as property name.*/ typedef std::map AdditionalTagsMapType; /** * \brief Set a list of DICOMTagPaths that specifiy all DICOM-Tags that will be copied into the property of the mitk::Image. * * This method can be used to specify a list of DICOM-tags that shall be available after the loading. * The value in the tagMap is an optional user defined name for the property key that should be used * when storing the property). Empty value is default and will imply to use the found DICOMTagPath * as property key. * By default the content of the DICOM tags will be stored in a StringLookupTable on the mitk::Image. * This behaviour can be changed by setting a different TagLookupTableToPropertyFunctor via * SetTagLookupTableToPropertyFunctor(). */ void SetAdditionalTagsOfInterest(const AdditionalTagsMapType& tagMap); typedef std::function TagLookupTableToPropertyFunctor; /** * \brief Set a functor that defines how the slice-specific tag-values are stored in a Property. * * This method sets a functor that is given a StringLookupTable that contains the values of one DICOM tag * mapped to the slice index. * The functor is supposed to store these values in an mitk Property. * * By default, the StringLookupTable is stored in a StringLookupTableProperty except if all values are * identical. In this case, the unique value is stored only once in a StringProperty. */ void SetTagLookupTableToPropertyFunctor(TagLookupTableToPropertyFunctor); /// Print information about this image block to given stream void Print(std::ostream& os, bool filenameDetails) const; private: // read values from tag cache std::string GetPixelSpacing() const; std::string GetImagerPixelSpacing() const; Image::Pointer FixupSpacing(Image* mitkImage); Image::Pointer DescribeImageWithProperties(Image* mitkImage); void UpdateImageDescribingProperties() const; static mitk::BaseProperty::Pointer GetPropertyForDICOMValues(const DICOMCachedValueLookupTable& cacheLookupTable); double stringtodouble(const std::string& str) const; DICOMImageFrameList m_ImageFrameList; Image::Pointer m_MitkImage; BoolList m_SliceIsLoaded; ReaderImplementationLevel m_ReaderImplementationLevel; GantryTiltInformation m_TiltInformation; PropertyList::Pointer m_PropertyList; mitk::WeakPointer m_TagCache; mutable bool m_PropertiesOutOfDate; AdditionalTagsMapType m_AdditionalTagMap; std::set m_FoundAdditionalTags; TagLookupTableToPropertyFunctor m_PropertyFunctor; }; } #endif diff --git a/Modules/ImageStatistics/mitkImageStatisticsContainer.h b/Modules/ImageStatistics/mitkImageStatisticsContainer.h index c0011dd2dc..1a3c0eb202 100644 --- a/Modules/ImageStatistics/mitkImageStatisticsContainer.h +++ b/Modules/ImageStatistics/mitkImageStatisticsContainer.h @@ -1,166 +1,166 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIMAGESTATISTICSCONTAINER #define MITKIMAGESTATISTICSCONTAINER #include #include #include #include #include namespace mitk { /** @brief Container class for storing a StatisticsObject for each timestep. Stored statistics are: - for the defined statistics, see GetAllStatisticNames - Histogram of Pixel Values */ class MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer : public mitk::BaseData { public: mitkClassMacro(ImageStatisticsContainer, mitk::BaseData) itkFactorylessNewMacro(Self) itkCloneMacro(Self) using HistogramType = itk::Statistics::Histogram; using RealType = double; using LabelIndex = unsigned int; using IndexType = vnl_vector; using VoxelCountType = unsigned long; using StatisticsVariantType = boost::variant; using StatisticsMapType = std::map < std::string, StatisticsVariantType>; using StatisticsKeyType = std::string; - virtual void SetRequestedRegionToLargestPossibleRegion() override {} + void SetRequestedRegionToLargestPossibleRegion() override {} - virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; } + bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; } - virtual bool VerifyRequestedRegion() override { return true; } + bool VerifyRequestedRegion() override { return true; } - virtual void SetRequestedRegion(const itk::DataObject*) override {} + void SetRequestedRegion(const itk::DataObject*) override {} /** @brief Container class for storing the computed image statistics. @details The statistics are stored in a map with value as boost::variant. The type used to create the boost::variant is important as only this type can be recovered lateron. */ class MITKIMAGESTATISTICS_EXPORT ImageStatisticsObject { public: ImageStatisticsObject(); /** @brief Adds a statistic to the statistics object @details if already a statistic with that name is included, it is overwritten */ void AddStatistic(const std::string& key, StatisticsVariantType value); using StatisticNameVector = std::vector; /** @brief Returns the names of the default statistics @details The order is derived from the image statistics plugin. */ static const StatisticNameVector& GetDefaultStatisticNames(); /** @brief Returns the names of all custom statistics (defined at runtime and no default names). */ const StatisticNameVector& GetCustomStatisticNames() const; /** @brief Returns the names of all statistics (default and custom defined) Additional custom keys are added at the end in a sorted order. */ StatisticNameVector GetAllStatisticNames() const; StatisticNameVector GetExistingStatisticNames() const; bool HasStatistic(const std::string& name) const; /** @brief Converts the requested value to the defined type @param name defined string on creation (AddStatistic) @exception if no statistics with key name was found. */ template TType GetValueConverted(const std::string& name) const { auto value = GetValueNonConverted(name); return boost::get(value); } /** @brief Returns the requested value @exception if no statistics with key name was found. */ StatisticsVariantType GetValueNonConverted(const std::string& name) const; void Reset(); HistogramType::ConstPointer m_Histogram=nullptr; private: StatisticsMapType m_Statistics; StatisticNameVector m_CustomNames; static const StatisticNameVector m_DefaultNames; }; using TimeStepMapType = std::map; unsigned int GetNumberOfTimeSteps() const; /** @brief Deletes all stored values*/ void Reset(); /** @brief Returns the statisticObject for the given Timestep @pre timeStep must be valid */ const ImageStatisticsObject& GetStatisticsForTimeStep(TimeStepType timeStep) const; /** @brief Sets the statisticObject for the given Timestep @pre timeStep must be valid */ void SetStatisticsForTimeStep(TimeStepType timeStep, ImageStatisticsObject statistics); /** @brief Checks if the Time step exists @pre timeStep must be valid */ bool TimeStepExists(TimeStepType timeStep) const; protected: ImageStatisticsContainer(); - virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override; + void PrintSelf(std::ostream &os, itk::Indent indent) const override; private: itk::LightObject::Pointer InternalClone() const override; void SetTimeStepMap(TimeStepMapType map); TimeStepMapType m_TimeStepMap; }; MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(const ImageStatisticsContainer* container); MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(std::vector containers); } #endif // MITKIMAGESTATISTICSCONTAINER diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h index 15e21c1a65..c5e4e4dde8 100644 --- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h +++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h @@ -1,102 +1,102 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED #define QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED //QT headers #include //mitk headers #include "mitkImage.h" #include "mitkPlanarFigure.h" #include "mitkImageStatisticsContainer.h" #include // itk headers #ifndef __itkHistogram_h #include #endif /** /brief This class is executed as background thread for image statistics calculation. * Documentation: This class is derived from QThread and is intended to be used by QmitkImageStatisticsView to run the image statistics calculation in a background thread keeping the gui usable. */ class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsCalculationJob : public QThread { Q_OBJECT public: typedef itk::Statistics::Histogram HistogramType; /*! /brief standard constructor. */ QmitkImageStatisticsCalculationJob(); /*! /brief standard destructor. */ - ~QmitkImageStatisticsCalculationJob(); + ~QmitkImageStatisticsCalculationJob() override; /*! /brief Initializes the object with necessary data. */ void Initialize(const mitk::Image* image, const mitk::Image* binaryImage, const mitk::PlanarFigure* planarFig ); /*! /brief returns the calculated image statistics. */ mitk::ImageStatisticsContainer* GetStatisticsData() const; const mitk::Image* GetStatisticsImage() const; const mitk::Image* GetMaskImage() const; const mitk::PlanarFigure* GetPlanarFigure() const; /*! /brief Set flag to ignore zero valued voxels */ void SetIgnoreZeroValueVoxel( bool _arg ); /*! /brief Get status of zero value voxel ignoring. */ bool GetIgnoreZeroValueVoxel() const; /*! /brief Set bin size for histogram resolution.*/ void SetHistogramNBins( unsigned int nbins); /*! /brief Get bin size for histogram resolution.*/ unsigned int GetHistogramNBins() const; /*! /brief Returns the histogram of the currently selected time step. */ const HistogramType* GetTimeStepHistogram(unsigned int t = 0) const; /*! /brief Returns a flag the indicates if the statistics are updated successfully */ bool GetStatisticsUpdateSuccessFlag() const; /*! /brief Method called once the thread is executed. */ void run() override; std::string GetLastErrorMessage() const; private: mitk::Image::ConstPointer m_StatisticsImage; ///< member variable holds the input image for which the statistics need to be calculated. mitk::Image::ConstPointer m_BinaryMask; ///< member variable holds the binary mask image for segmentation image statistics calculation. mitk::PlanarFigure::ConstPointer m_PlanarFigureMask; ///< member variable holds the planar figure for segmentation image statistics calculation. mitk::ImageStatisticsContainer::Pointer m_StatisticsContainer; bool m_IgnoreZeros; ///< member variable holds flag to indicate if zero valued voxel should be suppressed unsigned int m_HistogramNBins; ///< member variable holds the bin size for histogram resolution. bool m_CalculationSuccessful; ///< flag set if statistics calculation was successful std::vector m_HistogramVector; ///< member holds the histograms of all time steps. std::string m_message; }; #endif // QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h index 42f309e9b4..e954a63372 100644 --- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h +++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h @@ -1,115 +1,115 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkImageStatisticsTreeModel_h #define QmitkImageStatisticsTreeModel_h #include "itkSimpleFastMutexLock.h" #include "QmitkAbstractDataStorageModel.h" //MITK #include #include "mitkImageStatisticsContainer.h" class QmitkImageStatisticsTreeItem; /*! \class QmitkImageStatisticsTreeModel Model that takes a mitk::ImageStatisticsContainer and represents it as model in context of the QT view-model-concept. */ class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsTreeModel : public QmitkAbstractDataStorageModel { Q_OBJECT public: QmitkImageStatisticsTreeModel(QObject *parent = nullptr); - virtual ~QmitkImageStatisticsTreeModel(); + ~QmitkImageStatisticsTreeModel() override; void SetImageNodes(const std::vector& nodes); void SetMaskNodes(const std::vector& nodes); void Clear(); - virtual Qt::ItemFlags flags(const QModelIndex &index) const override; - virtual QVariant data(const QModelIndex &index, int role) const override; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override; - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; + QVariant data(const QModelIndex &index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex &child) const override; signals: void dataAvailable(); /** Is emitted whenever the model changes are finished (usually a bit later than dataAvailable()).*/ void modelChanged(); protected: /* * @brief See 'QmitkAbstractDataStorageModel' */ void DataStorageChanged() override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodePredicateChanged() override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeAdded(const mitk::DataNode *node) override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeChanged(const mitk::DataNode *node) override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeRemoved(const mitk::DataNode *node) override; private: void UpdateByDataStorage(); using StatisticsContainerVector = std::vector; /* builds a hierarchical tree model for the image statistics 1. Level: Image --> 2. Level: Mask [if exist] --> 3. Level: Timestep [if >1 exist] */ void BuildHierarchicalModel(); StatisticsContainerVector m_Statistics; /** Relevant images set by the user.*/ std::vector m_ImageNodes; /** Helper that is constructed when m_ImageNodes is set. It has the same order like m_ImageNodes, but each image is represented n times, while n is the number of time steps the respective image has. This structure makes the business logic to select the correct image given a QIndex much simpler and therefore easy to understand/maintain. */ std::vector > m_TimeStepResolvedImageNodes; /** relevant masks set by the user.*/ std::vector m_MaskNodes; /** @sa m_TimeStepResolvedImageNodes */ std::vector> m_TimeStepResolvedMaskNodes; std::vector m_StatisticNames; itk::SimpleFastMutexLock m_Mutex; QmitkImageStatisticsTreeItem *m_RootItem; QVariant m_HeaderFirstColumn; }; #endif // mitkQmitkImageStatisticsTreeModel_h diff --git a/Modules/MatchPointRegistration/Helper/QmitkAlgorithmListModel.h b/Modules/MatchPointRegistration/Helper/QmitkAlgorithmListModel.h index c834bcaa64..4f1c048a51 100644 --- a/Modules/MatchPointRegistration/Helper/QmitkAlgorithmListModel.h +++ b/Modules/MatchPointRegistration/Helper/QmitkAlgorithmListModel.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAlgorithmListModel_h #define QmitkAlgorithmListModel_h #include #include //MITK #include "MitkMatchPointRegistrationExports.h" // MatchPoint #include /*! \class QmitkAlgorithmListModel Model that takes a list of MatchPoint algorithm dll handles and represents it as model in context of the QT view-model-concept. \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. */ class MITKMATCHPOINTREGISTRATION_EXPORT QmitkAlgorithmListModel : public QAbstractTableModel { Q_OBJECT public: QmitkAlgorithmListModel(QObject *parent = nullptr); - virtual ~QmitkAlgorithmListModel() {}; + ~QmitkAlgorithmListModel() override {}; void SetAlgorithms(::map::deployment::DLLDirectoryBrowser::DLLInfoListType algList); - virtual Qt::ItemFlags flags(const QModelIndex &index) const; - virtual QVariant data(const QModelIndex &index, int role) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; - virtual int rowCount(const QModelIndex &parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex &parent = QModelIndex()) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; + QVariant data(const QModelIndex &index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; private: ::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_AlgList; }; #endif // mitkQmitkAlgorithmListModel_h diff --git a/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp b/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp index 4ad24e9436..81dfce562f 100644 --- a/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp +++ b/Modules/ModelFit/autoload/IO/mitkModelFitIOActivator.cpp @@ -1,100 +1,100 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include #include namespace mitk { /* * This is the module activator for the IO aspects of the "ModelFit" module. */ class ModelFitIOActivator : public us::ModuleActivator { public: void registerProperty(const std::string& name, const std::string& key, const std::string& description) { mitk::CoreServices::GetPropertyDescriptions()->AddDescription(name, description); mitk::PropertyPersistenceInfo::Pointer ppi = mitk::PropertyPersistenceInfo::New(); ppi->SetNameAndKey(name, key); mitk::CoreServices::GetPropertyPersistence()->AddInfo(ppi, true); } void registerProperty(const std::string& name, const std::string& key, const std::string& description, const PropertyPersistenceInfo::DeserializationFunctionType &deFnc, const PropertyPersistenceInfo::SerializationFunctionType &serFnc) { mitk::CoreServices::GetPropertyDescriptions()->AddDescription(name, description); mitk::PropertyPersistenceInfo::Pointer ppi = mitk::PropertyPersistenceInfo::New(); ppi->SetNameAndKey(name, key); ppi->SetDeserializationFunction(deFnc); ppi->SetSerializationFunction(serFnc); mitk::CoreServices::GetPropertyPersistence()->AddInfo(ppi, true); } - void Load(us::ModuleContext* /*context*/) + void Load(us::ModuleContext* /*context*/) override { //register relevant properties registerProperty(mitk::ModelFitConstants::UID_PROPERTY_NAME(), "data_uid", "UID used to identify data in an MITK session."); registerProperty(mitk::ModelFitConstants::INPUT_VARIABLES_PROPERTY_NAME(), "modelfit_input_variables", "Array of input variables used in/for a model fit.", PropertyPersistenceDeserialization::deserializeXMLToScalarListLookupTableProperty, PropertyPersistenceSerialization::serializeScalarListLookupTablePropertyToXML); registerProperty(mitk::ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME(), "modelfit_parameter_name", "Name of the parameter, that is represented by the data and how it is used in the function string (modelfit.model.function)."); registerProperty(mitk::ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME(), "modelfit_parameter_unit", "Unit string of the Parameter. Is only used for display. Default value: \"\" (no unit)"); registerProperty(mitk::ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME(), "modelfit_parameter_scale", "Scaling of the parameter. Default value: 1."); registerProperty(mitk::ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME(), "modelfit_parameter_type", "Type of the parameters. Default value: parameter. Other options: derived, criterion, evaluation."); registerProperty(mitk::ModelFitConstants::MODEL_TYPE_PROPERTY_NAME(), "modelfit_model_type", "Value specifies the type of model (helpfull for classification; e.g. MR perfusion)"); registerProperty(mitk::ModelFitConstants::MODEL_NAME_PROPERTY_NAME(), "modelfit_model_name", "Name of the specific fit. Only used for display."); registerProperty(mitk::ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME(), "modelfit_model_function", "Functions string, that specifies the model and will be parsed, to plot the curves based on the parameter. Optional parameter that must not be set."); registerProperty(mitk::ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME(), "modelfit_model_functionClass", "ID of the model class implementation."); registerProperty(mitk::ModelFitConstants::MODEL_X_PROPERTY_NAME(), "modelfit_model_x", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::XAXIS_NAME_PROPERTY_NAME(), "modelfit_xaxis_name", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME(), "modelfit_xaxis_unit", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::YAXIS_NAME_PROPERTY_NAME(), "modelfit_yaxis_name", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME(), "modelfit_yaxis_unit", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME(), "modelfit_fit_uid", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_NAME_PROPERTY_NAME(), "modelfit_fit_name", "Human readable name for the fit."); registerProperty(mitk::ModelFitConstants::FIT_TYPE_PROPERTY_NAME(), "modelfit_fit_type", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_IMAGEUID_PROPERTY_NAME(), "modelfit_fit_input_imageUID", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME(), "modelfit_fit_input_roiUID", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME(), "modelfit_fit_input_data", "Value identifies the model type."); registerProperty(mitk::ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME(), "modelfit_fit_staticParameters", "Value identifies the model type.", PropertyPersistenceDeserialization::deserializeXMLToScalarListLookupTableProperty, PropertyPersistenceSerialization::serializeScalarListLookupTablePropertyToXML); } - void Unload(us::ModuleContext* ) + void Unload(us::ModuleContext* ) override { } private: }; } US_EXPORT_MODULE_ACTIVATOR(mitk::ModelFitIOActivator) diff --git a/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp index 6d7895d695..afd9e6f55e 100644 --- a/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp +++ b/Modules/ModelFit/autoload/Models/mitkModelFitModelsActivator.cpp @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include //general models #include "mitkGenericParamModelFactory.h" #include "mitkLinearModelFactory.h" #include "mitkT2DecayModelFactory.h" namespace mitk { /* * This is the module activator for the IO aspects of the "ModelFit" module. */ class ModelFitModelsActivator : public us::ModuleActivator { public: template void RegisterProvider(us::ModuleContext* context) { auto provider = new TProvider(); provider->RegisterService(context); m_RegisteredProviders.push_back(std::unique_ptr(provider)); } - virtual void Load(us::ModuleContext* context) override + void Load(us::ModuleContext* context) override { m_RegisteredProviders.clear(); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); } - virtual void Unload(us::ModuleContext* ) override + void Unload(us::ModuleContext* ) override { } private: std::vector > m_RegisteredProviders; }; } US_EXPORT_MODULE_ACTIVATOR(mitk::ModelFitModelsActivator) diff --git a/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h b/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h index 48ac3874bd..bf0b6d8b3b 100644 --- a/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h +++ b/Modules/ModelFit/include/itkMaskedNaryStatisticsImageFilter.h @@ -1,114 +1,114 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __itkMaskedNaryStatisticsImageFilter_h #define __itkMaskedNaryStatisticsImageFilter_h #include "itkImageToImageFilter.h" #include "itkImageIterator.h" #include "itkArray.h" namespace itk { /** \class MaskedNaryStatisticsImageFilter * \brief Computes a masked statistic on N images and produces vectors of those statistic results. * * All the input images must be of the same type. * * \ingroup IntensityImageFilters * \ingroup ITKImageIntensity */ template< class TInputImage, class TMaskImage = ::itk::Image > class ITK_EXPORT MaskedNaryStatisticsImageFilter: public ImageToImageFilter< TInputImage, TInputImage > { public: /** Standard class typedefs. */ typedef MaskedNaryStatisticsImageFilter Self; typedef ImageToImageFilter< TInputImage, TInputImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(MaskedNaryStatisticsImageFilter, ImageToImageFilter); /** Some typedefs. */ typedef TInputImage InputImageType; typedef typename InputImageType::Pointer InputImagePointer; typedef typename InputImageType::RegionType InputImageRegionType; typedef typename InputImageType::PixelType InputImagePixelType; typedef typename NumericTraits< InputImagePixelType >::RealType RealType; typedef std::vector PixelVectorType; typedef std::vector RealVectorType; typedef TMaskImage MaskImageType; typedef typename MaskImageType::Pointer MaskImagePointer; typedef typename MaskImageType::ConstPointer MaskImageConstPointer; typedef typename MaskImageType::RegionType MaskImageRegionType; itkSetConstObjectMacro(Mask, MaskImageType); itkGetConstObjectMacro(Mask, MaskImageType); itkGetConstReferenceMacro(Mean,RealVectorType); itkGetConstReferenceMacro(Sigma,RealVectorType); itkGetConstReferenceMacro(Variance,RealVectorType); itkGetConstReferenceMacro(Sum,RealVectorType); itkGetConstReferenceMacro(Minimum,PixelVectorType); itkGetConstReferenceMacro(Maximum,PixelVectorType); /** ImageDimension constants */ itkStaticConstMacro( InputImageDimension, unsigned int, TInputImage::ImageDimension); #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ itkConceptMacro( SameDimensionCheck, ( Concept::SameDimension< InputImageDimension, InputImageDimension > ) ); itkConceptMacro( OutputHasZeroCheck, ( Concept::HasZero< InputImagePixelType > ) ); /** End concept checking */ #endif protected: MaskedNaryStatisticsImageFilter(); - virtual ~MaskedNaryStatisticsImageFilter() {} + ~MaskedNaryStatisticsImageFilter() override {} - void GenerateData(); + void GenerateData() override; private: MaskedNaryStatisticsImageFilter(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented RealVectorType m_Mean; RealVectorType m_Sigma; RealVectorType m_Variance; RealVectorType m_Sum; PixelVectorType m_Minimum; PixelVectorType m_Maximum; MaskImageConstPointer m_Mask; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkMaskedNaryStatisticsImageFilter.hxx" #endif #endif diff --git a/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h b/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h index 734e584c58..36c057fcca 100644 --- a/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h +++ b/Modules/ModelFit/include/itkMaskedStatisticsImageFilter.h @@ -1,195 +1,195 @@ /*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #ifndef __itkMaskedStatisticsImageFilter_h #define __itkMaskedStatisticsImageFilter_h #include "itkImageToImageFilter.h" #include "itkNumericTraits.h" #include "itkArray.h" #include "itkSimpleDataObjectDecorator.h" namespace itk { /** \class MaskedStatisticsImageFilter * \brief Compute min. max, variance and mean of an (masked) Image. * * MaskedStatisticsImageFilter computes the minimum, maximum, sum, mean, variance * sigma of an image. The filter needs all of its input image. It * behaves as a filter with an input and output. Thus it can be inserted * in a pipeline with other filters and the statistics will only be * recomputed if a downstream filter changes. * * The filter passes its input through unmodified. The filter is * threaded. It computes statistics in each thread then combines them in * its AfterThreadedGenerate method. * \remark This filter differs from itk::StatisticsImageFilter by the fact that you can * specify an mask image. If set, only pixels within the mask (mask value > 0) are taken * into account for the statistics. * * \ingroup MathematicalStatisticsImageFilters * \ingroup ITKImageStatistics * */ template< typename TInputImage , typename TMaskImage = ::itk::Image > class MaskedStatisticsImageFilter: public ImageToImageFilter< TInputImage, TInputImage > { public: /** Standard Self typedef */ typedef MaskedStatisticsImageFilter Self; typedef ImageToImageFilter< TInputImage, TInputImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Runtime information support. */ itkTypeMacro(MaskedStatisticsImageFilter, ImageToImageFilter); /** Image related typedefs. */ typedef typename Superclass::InputImageType InputImageType; typedef typename Superclass::InputImagePointer InputImagePointer; typedef typename TInputImage::RegionType RegionType; typedef typename TInputImage::SizeType SizeType; typedef typename TInputImage::IndexType IndexType; typedef typename TInputImage::PixelType PixelType; /** Image related typedefs. */ itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension); /** Type to use for computations. */ typedef typename NumericTraits< PixelType >::RealType RealType; /** Smart Pointer type to a DataObject. */ typedef typename DataObject::Pointer DataObjectPointer; /** Type of DataObjects used for scalar outputs */ typedef SimpleDataObjectDecorator< RealType > RealObjectType; typedef SimpleDataObjectDecorator< PixelType > PixelObjectType; typedef TMaskImage MaskImageType; typedef typename MaskImageType::ConstPointer MaskImageConstPointer; typedef typename MaskImageType::RegionType MaskImageRegionType; /** Return the computed Minimum. */ PixelType GetMinimum() const { return this->GetMinimumOutput()->Get(); } PixelObjectType * GetMinimumOutput(); const PixelObjectType * GetMinimumOutput() const; /** Return the computed Maximum. */ PixelType GetMaximum() const { return this->GetMaximumOutput()->Get(); } PixelObjectType * GetMaximumOutput(); const PixelObjectType * GetMaximumOutput() const; /** Return the computed Mean. */ RealType GetMean() const { return this->GetMeanOutput()->Get(); } RealObjectType * GetMeanOutput(); const RealObjectType * GetMeanOutput() const; /** Return the computed Standard Deviation. */ RealType GetSigma() const { return this->GetSigmaOutput()->Get(); } RealObjectType * GetSigmaOutput(); const RealObjectType * GetSigmaOutput() const; /** Return the computed Variance. */ RealType GetVariance() const { return this->GetVarianceOutput()->Get(); } RealObjectType * GetVarianceOutput(); const RealObjectType * GetVarianceOutput() const; /** Return the compute Sum. */ RealType GetSum() const { return this->GetSumOutput()->Get(); } RealObjectType * GetSumOutput(); const RealObjectType * GetSumOutput() const; /** Make a DataObject of the correct type to be used as the specified * output. */ typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; using Superclass::MakeOutput; - virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx); + DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override; itkSetConstObjectMacro(Mask, MaskImageType); itkGetConstObjectMacro(Mask, MaskImageType); #ifdef ITK_USE_CONCEPT_CHECKING // Begin concept checking itkConceptMacro( InputHasNumericTraitsCheck, ( Concept::HasNumericTraits< PixelType > ) ); // End concept checking #endif protected: MaskedStatisticsImageFilter(); - ~MaskedStatisticsImageFilter(){} - void PrintSelf(std::ostream & os, Indent indent) const; + ~MaskedStatisticsImageFilter() override{} + void PrintSelf(std::ostream & os, Indent indent) const override; /** Pass the input through unmodified. Do this by Grafting in the * AllocateOutputs method. */ - void AllocateOutputs(); + void AllocateOutputs() override; /** Initialize some accumulators before the threads run. */ - void BeforeThreadedGenerateData(); + void BeforeThreadedGenerateData() override; /** Do final mean and variance computation from data accumulated in threads. */ - void AfterThreadedGenerateData(); + void AfterThreadedGenerateData() override; /** Multi-thread version GenerateData. */ void ThreadedGenerateData(const RegionType & outputRegionForThread, - ThreadIdType threadId); + ThreadIdType threadId) override; // Override since the filter needs all the data for the algorithm - void GenerateInputRequestedRegion(); + void GenerateInputRequestedRegion() override; // Override since the filter produces all of its output - void EnlargeOutputRequestedRegion(DataObject *data); + void EnlargeOutputRequestedRegion(DataObject *data) override; private: MaskedStatisticsImageFilter(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented Array< RealType > m_ThreadSum; Array< RealType > m_SumOfSquares; Array< SizeValueType > m_Count; Array< PixelType > m_ThreadMin; Array< PixelType > m_ThreadMax; MaskImageConstPointer m_Mask; }; // end of class } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkMaskedStatisticsImageFilter.hxx" #endif #endif diff --git a/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h b/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h index 512089d89b..ba1e9bb51c 100644 --- a/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h +++ b/Modules/ModelFit/include/itkMultiOutputNaryFunctorImageFilter.h @@ -1,150 +1,150 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __itkMultiOutputNaryFunctorImageFilter_h #define __itkMultiOutputNaryFunctorImageFilter_h #include "itkImageToImageFilter.h" #include "itkImageIterator.h" #include "itkArray.h" namespace itk { /** \class MultiOutputNaryFunctorImageFilter * \brief Perform a generic pixel-wise operation on N images and produces m output images. * * This is an extension of the itk::NaryFunctorImageFilter. It assumes that the functor * returns not only one result pixel value but a vector of m values an therefore generates * m output images. In addition (and difference to itk::NaryFunctorImageFilter) it also * passes the index of the current value vector to the functor (for space correlated * evaluations).\n * Class is templated over the types of the input images * and the type of the output images. It is also templated by the * operation to be applied. A Functor style is used to represent the * function.\n * * All the input images must be of the same type. * * \ingroup IntensityImageFilters MultiThreaded * \ingroup ITKImageIntensity */ template< class TInputImage, class TOutputImage, class TFunction, class TMaskImage = ::itk::Image > class ITK_EXPORT MultiOutputNaryFunctorImageFilter: public ImageToImageFilter< TInputImage, TOutputImage > { public: /** Standard class typedefs. */ typedef MultiOutputNaryFunctorImageFilter Self; typedef ImageToImageFilter< TInputImage, TOutputImage > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(MultiOutputNaryFunctorImageFilter, ImageToImageFilter); /** Some typedefs. */ typedef TFunction FunctorType; typedef TInputImage InputImageType; typedef typename InputImageType::Pointer InputImagePointer; typedef typename InputImageType::RegionType InputImageRegionType; typedef typename InputImageType::PixelType InputImagePixelType; typedef TOutputImage OutputImageType; typedef typename OutputImageType::Pointer OutputImagePointer; typedef typename OutputImageType::RegionType OutputImageRegionType; typedef typename OutputImageType::PixelType OutputImagePixelType; typedef typename FunctorType::InputPixelArrayType NaryInputArrayType; typedef typename FunctorType::OutputPixelArrayType NaryOutputArrayType; typedef TMaskImage MaskImageType; typedef typename MaskImageType::Pointer MaskImagePointer; typedef typename MaskImageType::RegionType MaskImageRegionType; /** Get the functor object. The functor is returned by reference. * (Functors do not have to derive from itk::LightObject, so they do * not necessarily have a reference count. So we cannot return a * SmartPointer). */ FunctorType & GetFunctor() { return m_Functor; } /** Set the functor object. This replaces the current Functor with a * copy of the specified Functor. This allows the user to specify a * functor that has ivars set differently than the default functor. * This method requires an operator!=() be defined on the functor * (or the compiler's default implementation of operator!=() being * appropriate). */ void SetFunctor(FunctorType & functor) { if ( m_Functor != functor ) { m_Functor = functor; this->ActualizeOutputs(); this->Modified(); } } itkSetObjectMacro(Mask, MaskImageType); itkGetConstObjectMacro(Mask, MaskImageType); /** ImageDimension constants */ itkStaticConstMacro( InputImageDimension, unsigned int, TInputImage::ImageDimension); itkStaticConstMacro( OutputImageDimension, unsigned int, TOutputImage::ImageDimension); #ifdef ITK_USE_CONCEPT_CHECKING /** Begin concept checking */ itkConceptMacro( SameDimensionCheck, ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) ); itkConceptMacro( OutputHasZeroCheck, ( Concept::HasZero< OutputImagePixelType > ) ); /** End concept checking */ #endif protected: MultiOutputNaryFunctorImageFilter(); - virtual ~MultiOutputNaryFunctorImageFilter() {} + ~MultiOutputNaryFunctorImageFilter() override {} /** MultiOutputNaryFunctorImageFilter can be implemented as a multi threaded filter. * Therefore, this implementation provides a ThreadedGenerateData() routine * which is called for each processing thread. The output image data is * allocated automatically by the superclass prior to calling * ThreadedGenerateData(). ThreadedGenerateData can only write to the * portion of the output image specified by the parameter * "outputRegionForThread" * * \sa ImageToImageFilter::ThreadedGenerateData(), * ImageToImageFilter::GenerateData() */ void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, - ThreadIdType threadId); + ThreadIdType threadId) override; /** Methods actualize the output settings of the filter according to the current functor*/ void ActualizeOutputs(); private: MultiOutputNaryFunctorImageFilter(const Self &); //purposely not implemented void operator=(const Self &); //purposely not implemented FunctorType m_Functor; MaskImagePointer m_Mask; }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkMultiOutputNaryFunctorImageFilter.tpp" #endif #endif diff --git a/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h index cb96da86bb..acffc1f1d7 100644 --- a/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h +++ b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h @@ -1,39 +1,39 @@ #ifndef CHI_SQUARE_FITCOSTFUNCTION_H #define CHI_SQUARE_FITCOSTFUNCTION_H #include #include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the Chi square. NOTE: This is only for Data from Radioactive Decays (e.g. PET, SPECT) */ class MITKMODELFIT_EXPORT ChiSquareFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef ChiSquareFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; ChiSquareFitCostFunction() { } - ~ChiSquareFitCostFunction(){} + ~ChiSquareFitCostFunction() override{} }; } #endif // CHISQUAREFITCOSTFUNCTION_H diff --git a/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h index 9cc6238bd2..98d8c24415 100644 --- a/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h +++ b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h @@ -1,176 +1,176 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __CONCRETE_MODEL_FACTORY_BASE_H #define __CONCRETE_MODEL_FACTORY_BASE_H #include "mitkModelFactoryBase.h" #include "MitkModelFitExports.h" namespace mitk { template class ConcreteModelFactoryBase : public ModelFactoryBase { public: /* typedef ConcreteModelFactoryBase Self; typedef ModelFactoryBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; */ mitkClassMacro(ConcreteModelFactoryBase, ModelFactoryBase); typedef ModelFactoryBase::ModelBaseType ModelBaseType; typedef ModelFactoryBase::ModelBasePointer ModelBasePointer; typedef TModel ModelType; typedef typename ModelType::Pointer ModelPointer; typedef ModelFactoryBase::ParameterNameType ParameterNameType; typedef ModelFactoryBase::ParameterNamesType ParameterNamesType; typedef ModelFactoryBase::ParametersSizeType ParametersSizeType; typedef ModelFactoryBase::ParamterScaleMapType ParamterScaleMapType; typedef ModelFactoryBase::ParamterUnitMapType ParamterUnitMapType; typedef ModelFactoryBase::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelFactoryBase::DerivedParametersSizeType DerivedParametersSizeType; typedef ModelFactoryBase::DerivedParamterScaleMapType DerivedParamterScaleMapType; typedef ModelFactoryBase::DerivedParamterUnitMapType DerivedParamterUnitMapType; typedef ModelFactoryBase::FunctionStringType FunctionStringType; typedef ModelFactoryBase::ModellClassIDType ModellClassIDType; static ModelPointer CreateConcreteModel() { return ModelType::New(); } - virtual ModelBasePointer CreateModel() const override + ModelBasePointer CreateModel() const override { return CreateConcreteModel().GetPointer(); }; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override { ConstraintCheckerBase::Pointer noConstraints; return noConstraints; }; - virtual ParameterNamesType GetParameterNames() const override + ParameterNamesType GetParameterNames() const override { return m_Reference->GetParameterNames(); }; - virtual ParametersSizeType GetNumberOfParameters() const override + ParametersSizeType GetNumberOfParameters() const override { return m_Reference->GetNumberOfParameters(); }; - virtual ParamterScaleMapType GetParameterScales() const override + ParamterScaleMapType GetParameterScales() const override { return m_Reference->GetParameterScales(); }; - virtual ParamterUnitMapType GetParameterUnits() const override + ParamterUnitMapType GetParameterUnits() const override { return m_Reference->GetParameterUnits(); }; - virtual ParameterNamesType GetDerivedParameterNames() const override + ParameterNamesType GetDerivedParameterNames() const override { return m_Reference->GetDerivedParameterNames(); }; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override + ParametersSizeType GetNumberOfDerivedParameters() const override { return m_Reference->GetNumberOfDerivedParameters(); }; - virtual DerivedParamterScaleMapType GetDerivedParameterScales() const override + DerivedParamterScaleMapType GetDerivedParameterScales() const override { return m_Reference->GetDerivedParameterScales(); }; - virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const override + DerivedParamterUnitMapType GetDerivedParameterUnits() const override { return m_Reference->GetDerivedParameterUnits(); }; - virtual std::string GetModelDisplayName() const override + std::string GetModelDisplayName() const override { return m_Reference->GetModelDisplayName(); }; - virtual std::string GetModelType() const override + std::string GetModelType() const override { return m_Reference->GetModelType(); }; - virtual FunctionStringType GetFunctionString() const override + FunctionStringType GetFunctionString() const override { return m_Reference->GetFunctionString(); }; - virtual ModellClassIDType GetClassID() const override + ModellClassIDType GetClassID() const override { return m_Reference->GetClassID(); }; - virtual std::string GetXName() const override + std::string GetXName() const override { return m_Reference->GetXName(); }; - virtual std::string GetXAxisName() const override + std::string GetXAxisName() const override { return m_Reference->GetXAxisName(); }; - virtual std::string GetXAxisUnit() const override + std::string GetXAxisUnit() const override { return m_Reference->GetXAxisUnit(); }; - virtual std::string GetYAxisName() const override + std::string GetYAxisName() const override { return m_Reference->GetYAxisName(); }; - virtual std::string GetYAxisUnit() const override + std::string GetYAxisUnit() const override { return m_Reference->GetYAxisUnit(); } protected: ConcreteModelFactoryBase() { m_Reference = ModelType::New(); }; - virtual ~ConcreteModelFactoryBase() + ~ConcreteModelFactoryBase() override { }; ModelPointer m_Reference; private: //No copy constructor allowed ConcreteModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __CONCRETE_MODEL_FACTORY_BASE_H diff --git a/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h b/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h index 4a52050f61..a079760102 100644 --- a/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h +++ b/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h @@ -1,209 +1,209 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __CONCRETE_MODEL_PARAMETERIZER_BASE_H #define __CONCRETE_MODEL_PARAMETERIZER_BASE_H #include "mitkModelParameterizerBase.h" namespace mitk { template class ConcreteModelParameterizerBase : public ModelParameterizerBase { public: typedef ConcreteModelParameterizerBase Self; typedef ModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelBaseType ModelBaseType; typedef typename Superclass::ModelBasePointer ModelBasePointer; typedef TModel ModelType; typedef typename ModelType::Pointer ModelPointer; typedef typename Superclass::StaticParameterValueType StaticParameterValueType; typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType; typedef typename Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /* Returns the global static parameters for the model. * @remark this default implementation assumes no global static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetGlobalStaticParameters() const + StaticParameterMapType GetGlobalStaticParameters() const override { StaticParameterMapType result; return result; }; /* Returns the local static parameters for the model at the given index. * @remark this default implementation assumes no local static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& /*currentPosition*/) const + StaticParameterMapType GetLocalStaticParameters(const IndexType& /*currentPosition*/) const override { StaticParameterMapType result; return result; }; /* Returns an newly generated instance of the concrete model. * It is parameterized by the static parameters (returns of GetGlobalParameter() and * GetLocalParameter()). */ - virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override + ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override { ModelPointer newModel = ModelType::New(); StaticParameterMapType params = this->GetGlobalStaticParameters(); StaticParameterMapType locals = this->GetLocalStaticParameters(currentPosition); params.insert(locals.begin(), locals.end()); newModel->SetTimeGrid(m_DefaultTimeGrid); newModel->SetStaticParameters(params); return newModel.GetPointer(); }; - virtual ModelBasePointer GenerateParameterizedModel() const override + ModelBasePointer GenerateParameterizedModel() const override { ModelPointer newModel = ModelType::New(); StaticParameterMapType params = this->GetGlobalStaticParameters(); newModel->SetTimeGrid(m_DefaultTimeGrid); newModel->SetStaticParameters(params, false); return newModel.GetPointer(); }; /* Returns a parameterization filled with zeros. * @remark this default implementation assumes no special initial parameterization is suggested. * Thus an zero filled vector is returned.*/ - virtual ParametersType GetDefaultInitialParameterization() const + ParametersType GetDefaultInitialParameterization() const override { ModelPointer newModel = ModelType::New(); ParametersType params; params.SetSize(newModel->GetNumberOfParameters()); params.Fill(0.0); return params; }; - virtual ParameterNamesType GetParameterNames() const override + ParameterNamesType GetParameterNames() const override { return GenerateParameterizedModel()->GetParameterNames(); }; - virtual ParametersSizeType GetNumberOfParameters() const override + ParametersSizeType GetNumberOfParameters() const override { return GenerateParameterizedModel()->GetNumberOfParameters(); }; - virtual ParamterScaleMapType GetParameterScales() const override + ParamterScaleMapType GetParameterScales() const override { return GenerateParameterizedModel()->GetParameterScales(); }; - virtual ParamterUnitMapType GetParameterUnits() const override + ParamterUnitMapType GetParameterUnits() const override { return GenerateParameterizedModel()->GetParameterUnits(); }; - virtual ParameterNamesType GetDerivedParameterNames() const override + ParameterNamesType GetDerivedParameterNames() const override { return GenerateParameterizedModel()->GetDerivedParameterNames(); }; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override + ParametersSizeType GetNumberOfDerivedParameters() const override { return GenerateParameterizedModel()->GetNumberOfDerivedParameters(); }; - virtual DerivedParamterScaleMapType GetDerivedParameterScales() const override + DerivedParamterScaleMapType GetDerivedParameterScales() const override { return GenerateParameterizedModel()->GetDerivedParameterScales(); }; - virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const override + DerivedParamterUnitMapType GetDerivedParameterUnits() const override { return GenerateParameterizedModel()->GetDerivedParameterUnits(); }; - virtual std::string GetModelDisplayName() const override + std::string GetModelDisplayName() const override { return GenerateParameterizedModel()->GetModelDisplayName(); }; - virtual std::string GetModelType() const override + std::string GetModelType() const override { return GenerateParameterizedModel()->GetModelType(); }; - virtual FunctionStringType GetFunctionString() const override + FunctionStringType GetFunctionString() const override { return GenerateParameterizedModel()->GetFunctionString(); }; - virtual ModellClassIDType GetClassID() const override + ModellClassIDType GetClassID() const override { return GenerateParameterizedModel()->GetClassID(); }; - virtual std::string GetXName() const override + std::string GetXName() const override { return GenerateParameterizedModel()->GetXName(); }; - virtual std::string GetXAxisName() const override + std::string GetXAxisName() const override { return GenerateParameterizedModel()->GetXAxisName(); }; - virtual std::string GetXAxisUnit() const override + std::string GetXAxisUnit() const override { return GenerateParameterizedModel()->GetXAxisUnit(); }; - virtual std::string GetYAxisName() const override + std::string GetYAxisName() const override { return GenerateParameterizedModel()->GetYAxisName(); }; - virtual std::string GetYAxisUnit() const override + std::string GetYAxisUnit() const override { return GenerateParameterizedModel()->GetYAxisUnit(); } protected: ConcreteModelParameterizerBase() { }; - virtual ~ConcreteModelParameterizerBase() + ~ConcreteModelParameterizerBase() override { }; private: //No copy constructor allowed ConcreteModelParameterizerBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __CONCRETE_MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/ModelFit/include/mitkConstraintCheckerBase.h b/Modules/ModelFit/include/mitkConstraintCheckerBase.h index 674be6d874..56c78b4d3f 100644 --- a/Modules/ModelFit/include/mitkConstraintCheckerBase.h +++ b/Modules/ModelFit/include/mitkConstraintCheckerBase.h @@ -1,66 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CONSTRAINT_CHECKER_BASE_H #define CONSTRAINT_CHECKER_BASE_H #include #include #include "mitkConstraintCheckerInterface.h" #include "MitkModelFitExports.h" namespace mitk { /** \class ConstraintCheckerBase * \brief This class is the base class for constraint checker. * @remark All functions of the ConstraintCheckerInterface must be implemented thread save because it will be used in a multi threaded * environment. */ class MITKMODELFIT_EXPORT ConstraintCheckerBase : public itk::Object, public ConstraintCheckerInterface { public: typedef ConstraintCheckerBase Self; typedef ConstraintCheckerInterface Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::PenaltyValueType PenaltyValueType; typedef Superclass::PenaltyArrayType PenaltyArrayType; typedef Superclass::SignalType SignalType; typedef Superclass::ParametersType ParametersType; - virtual PenaltyValueType GetPenaltySum(const ParametersType ¶meters) const; + PenaltyValueType GetPenaltySum(const ParametersType ¶meters) const override; protected: ConstraintCheckerBase() { } - ~ConstraintCheckerBase(){} + ~ConstraintCheckerBase() override{} private: ConstraintCheckerBase(const ConstraintCheckerBase& source); void operator=(const ConstraintCheckerBase&); //purposely not implemented }; } #endif // ConstraintCheckerBase_H diff --git a/Modules/ModelFit/include/mitkDummyModelFitFunctor.h b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h index ca9c086126..fec12a80a2 100644 --- a/Modules/ModelFit/include/mitkDummyModelFitFunctor.h +++ b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h @@ -1,80 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DUMMYMODELFITFUNCTOR_H #define __DUMMYMODELFITFUNCTOR_H #include #include "mitkModelBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkMVConstrainedCostFunctionDecorator.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT DummyModelFitFunctor : public ModelFitFunctorBase { public: typedef DummyModelFitFunctor Self; typedef ModelFitFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(DummyModelFitFunctor, ModelFitFunctorBase); typedef Superclass::InputPixelArrayType InputPixelArrayType; typedef Superclass::OutputPixelArrayType OutputPixelArrayType; itkSetMacro(DerivativeStepLength, double); itkGetMacro(DerivativeStepLength, double); - virtual ParameterNamesType GetCriterionNames() const; + ParameterNamesType GetCriterionNames() const override; protected: typedef Superclass::ParametersType ParametersType; typedef Superclass::SignalType SignalType; DummyModelFitFunctor(); - ~DummyModelFitFunctor(); + ~DummyModelFitFunctor() override; - virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, + ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, - DebugParameterMapType& debugParameters) const; + DebugParameterMapType& debugParameters) const override; - virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, - const SignalType& sample) const; + OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, + const SignalType& sample) const override; /** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/ virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value, const ModelBase* model) const; - virtual ParameterNamesType DefineDebugParameterNames() const; + ParameterNamesType DefineDebugParameterNames() const override; private: double m_DerivativeStepLength; }; } #endif // __DUMMYMODELFITFUNCTOR_H diff --git a/Modules/ModelFit/include/mitkGenericParamModel.h b/Modules/ModelFit/include/mitkGenericParamModel.h index 7d6fb8a78e..fb1c923569 100644 --- a/Modules/ModelFit/include/mitkGenericParamModel.h +++ b/Modules/ModelFit/include/mitkGenericParamModel.h @@ -1,112 +1,112 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_GENERIC_PARAM_MODEL_H_ #define __MITK_GENERIC_PARAM_MODEL_H_ #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Model that can parse a user specified function string and uses it as model function that is represented by the model instance. The parser used to interpret the string can handle simple mathematical formulas (e.g. "3.5 + a * x * sin(x) - 1 / 2"). The parser is able to recognize: - sums, differences, products and divisions (a + b, 4 - 3, 2 * x, 9 / 3) - algebraic signs ( +5, -5) - exponentiation ( 2 ^ 4 ) - parentheses (3 * (4 + 2)) - following unary functions: abs, exp, sin, cos, tan, sind (sine in degrees), cosd (cosine in degrees), tand (tangent in degrees) - variables (x, a, b, ... j) Remark: The variable "x" is reserved. It is the signal position / timepoint. Remark: The current version supports up to 10 model parameter. Don't use it for a model parameter that should be deduced by fitting (these are a..j).*/ class MITKMODELFIT_EXPORT GenericParamModel : public mitk::ModelBase { public: typedef GenericParamModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(GenericParamModel, ModelBase); static const std::string NAME_STATIC_PARAMETER_number; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual FunctionStringType GetFunctionString() const override; + FunctionStringType GetFunctionString() const override; itkSetStringMacro(FunctionString); /**@pre The Number of paremeters must be between 1 and 10.*/ itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10); - virtual std::string GetXName() const override; + std::string GetXName() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; + ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; protected: GenericParamModel(); - virtual ~GenericParamModel() {}; + ~GenericParamModel() override {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, - const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; + void SetStaticParameter(const ParameterNameType& name, + const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: /**Function string that should be parsed when computing the model function.*/ FunctionStringType m_FunctionString; /**Number of parameters the model should offer / the function string contains.*/ ParametersSizeType m_NumberOfParameters; //No copy constructor allowed GenericParamModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif \ No newline at end of file diff --git a/Modules/ModelFit/include/mitkGenericParamModelFactory.h b/Modules/ModelFit/include/mitkGenericParamModelFactory.h index c487b37532..1b917cdb76 100644 --- a/Modules/ModelFit/include/mitkGenericParamModelFactory.h +++ b/Modules/ModelFit/include/mitkGenericParamModelFactory.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_FACTORY_H #define __GENERIC_PARAM_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkGenericParamModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT GenericParamModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(GenericParamModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override; GenericParamModelFactory(); virtual ~GenericParamModelFactory(); private: //No copy constructor allowed GenericParamModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__GENERIC_PARAM_MODEL_FACTORY_H diff --git a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h index e52f90b7cb..b80786f2e5 100644 --- a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h +++ b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_PARAMETERIZER_H #define __GENERIC_PARAM_MODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkGenericParamModel.h" namespace mitk { /** Parameterizer for the GenricParamModel. */ class MITKMODELFIT_EXPORT GenericParamModelParameterizer : public ConcreteModelParameterizerBase { public: typedef GenericParamModelParameterizer Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(GenericParamModelParameterizer, ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelBaseType ModelBaseType; typedef typename Superclass::ModelBasePointer ModelBasePointer; typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelPointer ModelPointer; typedef typename Superclass::StaticParameterValueType StaticParameterValueType; typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType; typedef typename Superclass::StaticParameterMapType StaticParameterMapType; typedef typename Superclass::IndexType IndexType; itkSetMacro(FunctionString, mitk::ModelBase::FunctionStringType); /**@pre The Number of paremeters must be between 1 and 10.*/ itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10); - virtual mitk::ModelBase::FunctionStringType GetFunctionString() const override; + mitk::ModelBase::FunctionStringType GetFunctionString() const override; using Superclass::GenerateParameterizedModel; virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const; - virtual StaticParameterMapType GetGlobalStaticParameters() const override; + StaticParameterMapType GetGlobalStaticParameters() const override; virtual ParametersType GetDefaultInitialParameterization() const override; protected: GenericParamModelParameterizer(); virtual ~GenericParamModelParameterizer(); mitk::ModelBase::FunctionStringType m_FunctionString; /**Number of parameters the model should offer / the function string contains.*/ ParametersSizeType m_NumberOfParameters; private: //No copy constructor allowed GenericParamModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __GENERIC_PARAM_MODEL_PARAMETERIZER_H diff --git a/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h index 0066bc6156..10c2268980 100644 --- a/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h +++ b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h @@ -1,69 +1,69 @@ #ifndef MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H #define MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H #include "mitkValueBasedParameterizationDelegate.h" #include #include #include "mitkModelBase.h" #include "mitkImage.h" #include "mitkModelTraitsInterface.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT ImageBasedParameterizationDelegate : public ValueBasedParameterizationDelegate { public: typedef ImageBasedParameterizationDelegate Self; typedef ValueBasedParameterizationDelegate Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); itkTypeMacro(ImageBasedParameterizationDelegate, InitialParameterizationDelegateBase); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ParametersType ParametersType; typedef Superclass::IndexType IndexType; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ - virtual ParametersType GetInitialParameterization() const override; - virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const override; + ParametersType GetInitialParameterization() const override; + ParametersType GetInitialParameterization(const IndexType& currentPosition) const override; /** Adds an image as a source for the initial value of a parameter. * @param image Pointer to the image that is the value source. * @param paramIndex Indicates which parameter is defined by the source image. * It equals the position in the return vector of GetInitialParameterization(). * @remark setting an image for an index overwrites the value for this index set by * SetInitialParameterization. * @pre paramIndex must be in bound of the initial parametrization vector. * @pre image must be a valid instance*/ void AddInitialParameterImage(const mitk::Image* image, ParametersType::size_type paramIndex); protected: typedef std::map ImageMapType; ImageMapType m_ParameterImageMap; ImageBasedParameterizationDelegate(); - virtual ~ImageBasedParameterizationDelegate(); + ~ImageBasedParameterizationDelegate() override; private: //No copy constructor allowed ImageBasedParameterizationDelegate(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCXINITIALPARAMETERIZATIONDELEGATE_H diff --git a/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h index aabc270e7c..4ad7c27fec 100644 --- a/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h +++ b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef IndexedValueFunctorBase_H #define IndexedValueFunctorBase_H #include #include #include #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /**Functor base class for functors that use the index and/or input value to generate the output. This class is used in conjunction with IndexedValueFunctorPolicy and the itkMultiOutputNaryFunctorImageFilter. */ class MITKMODELFIT_EXPORT IndexedValueFunctorBase: public ::itk::Object { public: typedef IndexedValueFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(IndexedValueFunctorBase, itk::Object); typedef ScalarType InputImagePixelType; typedef std::vector InputPixelVectorType; typedef std::vector OutputPixelVectorType; typedef itk::Array GridArrayType; typedef itk::Index<3> IndexType; virtual OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const = 0; virtual unsigned int GetNumberOfOutputs() const = 0; protected: IndexedValueFunctorBase() {}; - ~IndexedValueFunctorBase() + ~IndexedValueFunctorBase() override {}; }; } #endif // IndexedValueFunctorBase_H diff --git a/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h index 787c845d14..38b49fae53 100644 --- a/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h +++ b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H #define __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H #include #include #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Base class for all initial parametrization delegates * These delegates are used to define custom strategies, which are used by model parameterizers * to determine the initial parametrization of a model (e.g. starting parameter for fitting). */ class MITKMODELFIT_EXPORT InitialParameterizationDelegateBase : public itk::Object { public: typedef InitialParameterizationDelegateBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(InitialParameterizationDelegateBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::ParametersType ParametersType; typedef ::itk::Index<3> IndexType; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ virtual ParametersType GetInitialParameterization() const = 0; virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const = 0; protected: InitialParameterizationDelegateBase(); - virtual ~InitialParameterizationDelegateBase(); + ~InitialParameterizationDelegateBase() override; private: //No copy constructor allowed InitialParameterizationDelegateBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h index 6b61c6bca5..399808e554 100644 --- a/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h +++ b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef LEVENBERGMARQUARDTMODELFITFUNCTOR_H #define LEVENBERGMARQUARDTMODELFITFUNCTOR_H #include #include #include "mitkModelBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkMVConstrainedCostFunctionDecorator.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT LevenbergMarquardtModelFitFunctor : public ModelFitFunctorBase { public: typedef LevenbergMarquardtModelFitFunctor Self; typedef ModelFitFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(LevenbergMarquardtModelFitFunctor, ModelFitFunctorBase); typedef Superclass::InputPixelArrayType InputPixelArrayType; typedef Superclass::OutputPixelArrayType OutputPixelArrayType; itkSetMacro(Epsilon, double); itkSetMacro(GradientTolerance, double); itkSetMacro(ValueTolerance, double); itkSetMacro(DerivativeStepLength, double); itkSetMacro(Iterations, unsigned int); itkSetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType); itkGetMacro(Epsilon, double); itkGetMacro(GradientTolerance, double); itkGetMacro(ValueTolerance, double); itkGetMacro(DerivativeStepLength, double); itkGetMacro(Iterations, unsigned int); itkGetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType); itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkSetMacro(ActivateFailureThreshold, bool); itkGetConstMacro(ActivateFailureThreshold, bool); - virtual ParameterNamesType GetCriterionNames() const; + ParameterNamesType GetCriterionNames() const override; protected: typedef Superclass::ParametersType ParametersType; typedef Superclass::SignalType SignalType; LevenbergMarquardtModelFitFunctor(); - ~LevenbergMarquardtModelFitFunctor(); + ~LevenbergMarquardtModelFitFunctor() override; - virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, + ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, - DebugParameterMapType& debugParameters) const; + DebugParameterMapType& debugParameters) const override; - virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, - const SignalType& sample) const; + OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, + const SignalType& sample) const override; /** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/ virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value, const ModelBase* model) const; - virtual ParameterNamesType DefineDebugParameterNames() const; + ParameterNamesType DefineDebugParameterNames() const override; private: double m_Epsilon; double m_GradientTolerance; double m_ValueTolerance; unsigned int m_Iterations; double m_DerivativeStepLength; ::itk::LevenbergMarquardtOptimizer::ScalesType m_Scales; /**Constraint checker. If set it will be used by the optimization strategies to add additional constraints to the given cost function. */ ConstraintCheckerBase::ConstPointer m_ConstraintChecker; /**If set to true and an constraint checker is set. The cost function will allways fail if the penalty of the checker reaches the threshold. In this case no function evaluation will be done-*/ bool m_ActivateFailureThreshold; }; } #endif // MODEL_FIT_FUNCTOR_BASE_H diff --git a/Modules/ModelFit/include/mitkLinearModel.h b/Modules/ModelFit/include/mitkLinearModel.h index 488f4fee79..34480b2258 100644 --- a/Modules/ModelFit/include/mitkLinearModel.h +++ b/Modules/ModelFit/include/mitkLinearModel.h @@ -1,93 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_LINEAR_MODEL_H_ #define __MITK_LINEAR_MODEL_H_ #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT LinearModel : public mitk::ModelBase { public: typedef LinearModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(LinearModel, ModelBase); - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual FunctionStringType GetFunctionString() const override; + FunctionStringType GetFunctionString() const override; - virtual std::string GetXName() const override; + std::string GetXName() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; + ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override; + ParametersSizeType GetNumberOfDerivedParameters() const override; protected: LinearModel() {}; - virtual ~LinearModel() {}; + ~LinearModel() override {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; - virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& - parameters) const; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& + parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, - const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; + void SetStaticParameter(const ParameterNameType& name, + const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: //No copy constructor allowed LinearModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h index db66410105..fd92166113 100644 --- a/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h +++ b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H #define MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H #include #include #include "MitkModelFitExports.h" namespace mitk { /** \class MVConstrainedCostFunctionDecorator * \brief This class is used to add constraints to any multi valued model fit cost function. * * MVConstrainedCostFunctionDecorator is used to extend a given cost function * with the functionality to regard given constraints for the measure. * To add this functionality to a cost function, instantiate the decorator, set * the wrapped cost function (that will be extended) and set a constraint checker * that defines the type of constraints.\n * The decorator has a failure threshold. An evaluation * can always be accounted as a failure if the sum of penalties given by the checker * is greater or equal to the threshold. If the evaluation is a failure the wrapped cost function * will not be evaluated. Otherwise the penalty will be added to every measure of the cost function. */ class MITKMODELFIT_EXPORT MVConstrainedCostFunctionDecorator : public mitk::MVModelFitCostFunction { public: typedef MVConstrainedCostFunctionDecorator Self; typedef mitk::MVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; typedef ConstraintCheckerBase::PenaltyValueType PenaltyValueType; itkSetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction); itkGetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction); itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase); itkSetMacro(FailureThreshold, PenaltyValueType); itkGetConstMacro(FailureThreshold, PenaltyValueType); itkSetMacro(ActivateFailureThreshold, bool); itkGetConstMacro(ActivateFailureThreshold, bool); /**Returns the number of evaluations done by the cost function instance since creation.*/ itkGetConstMacro(EvaluationCount, unsigned int); /**Returns the ration between evaluations that were penaltized and all evaluation since creation of the instance. 0.0 means no evaluation was penalized; 1.0 all evaluations were. (evaluations that hit the failure threshold count as penalized too.)*/ double GetPenaltyRatio() const; /**Returns the ration between evaluations that where beyond the failure thershold and all evaluation since creation of the instance. 0.0 means no evaluation was a failure (but some may be penalized); 1.0 all evaluations were failures.*/ double GetFailureRatio() const; /**Returns the index of the first (in terms of index position) failed parameter in the last failed evaluation.*/ ParametersType::size_type GetFailedParameter() const; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; MVConstrainedCostFunctionDecorator() : m_FailureThreshold(1e15), m_ActivateFailureThreshold(true), m_EvaluationCount(0), m_PenaltyCount(0), m_FailureCount(0), m_LastFailedParameter(-1) { } - ~MVConstrainedCostFunctionDecorator(){} + ~MVConstrainedCostFunctionDecorator() override{} ConstraintCheckerBase::ConstPointer m_ConstraintChecker; MVModelFitCostFunction::ConstPointer m_WrappedCostFunction; PenaltyValueType m_FailureThreshold; bool m_ActivateFailureThreshold; mutable unsigned int m_EvaluationCount; mutable unsigned int m_PenaltyCount; mutable unsigned int m_FailureCount; mutable ParametersType::size_type m_LastFailedParameter; }; } #endif diff --git a/Modules/ModelFit/include/mitkMVModelFitCostFunction.h b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h index dc3a02a8e4..7752b77fcc 100644 --- a/Modules/ModelFit/include/mitkMVModelFitCostFunction.h +++ b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h @@ -1,82 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MV_MODELFITCOSTFUNCTION_H #define MV_MODELFITCOSTFUNCTION_H #include #include #include "mitkModelFitCostFunctionInterface.h" #include "MitkModelFitExports.h" namespace mitk { /** Base class for all model fit cost function that return a multiple cost value * It offers also a default implementation for the numerical computation of the * derivatives. Normaly you just have to (re)implement CalcMeasure(). */ class MITKMODELFIT_EXPORT MVModelFitCostFunction : public itk::MultipleValuedCostFunction, public ModelFitCostFunctionInterface { public: typedef MVModelFitCostFunction Self; typedef itk::MultipleValuedCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef ModelFitCostFunctionInterface::SignalType SignalType; typedef Superclass::MeasureType MeasureType; typedef Superclass::DerivativeType DerivativeType; - void SetSample(const SignalType &sampleSet); + void SetSample(const SignalType &sampleSet) override; - MeasureType GetValue(const ParametersType& parameter) const; - void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const; + MeasureType GetValue(const ParametersType& parameter) const override; + void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const override; - unsigned int GetNumberOfValues (void) const; - unsigned int GetNumberOfParameters (void) const; + unsigned int GetNumberOfValues (void) const override; + unsigned int GetNumberOfParameters (void) const override; itkSetConstObjectMacro(Model, ModelBase); itkGetConstObjectMacro(Model, ModelBase); itkSetMacro(DerivativeStepLength, double); itkGetConstMacro(DerivativeStepLength, double); protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const = 0; MVModelFitCostFunction() : m_DerivativeStepLength(1e-5) { } - ~MVModelFitCostFunction(){} + ~MVModelFitCostFunction() override{} SignalType m_Sample; private: ModelBase::ConstPointer m_Model; /**value (delta of parameters) used to compute the derivatives numerically*/ double m_DerivativeStepLength; }; } #endif // MVModelFitCostFunction_H diff --git a/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h index 4e02e9648e..236f61daf1 100644 --- a/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h +++ b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H #define __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H #include #include "MitkModelFitExports.h" namespace mitk { /** Simple mitk based wrapper for the itk::MaskedNaryStatisticsImageFilter. * takes an input image and a mask image (both mitk::Images) and calculates the statistic * of the input image within the given mask (every pixel != 0).\n * The class assumes that the mask image is 3D (only one time step), if this is not the case * *only* the first time step will be used as mask.\n * If the input image has multiple time steps, the statistics will be calculated for each time * step. This the result arrays will always have as many values as the input image * has time steps.*/ class MITKMODELFIT_EXPORT MaskedDynamicImageStatisticsGenerator : public itk::Object { public: mitkClassMacroItkParent(MaskedDynamicImageStatisticsGenerator, itk::Object); itkNewMacro(Self); typedef itk::Array ResultType; itkSetConstObjectMacro(DynamicImage,Image); itkGetConstObjectMacro(DynamicImage,Image); itkSetConstObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); const ResultType& GetMaximum(); const ResultType& GetMinimum(); const ResultType& GetMean(); const ResultType& GetSigma(); const ResultType& GetVariance(); const ResultType& GetSum(); void Generate(); protected: MaskedDynamicImageStatisticsGenerator(); - ~MaskedDynamicImageStatisticsGenerator(); + ~MaskedDynamicImageStatisticsGenerator() override; template void DoCalculateStatistics(const itk::Image* image); virtual void CheckValidInputs() const; bool HasOutdatedResults() const; itk::TimeStamp m_GenerationTimeStamp; private: Image::ConstPointer m_DynamicImage; Image::ConstPointer m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::ConstPointer m_InternalMask; ResultType m_Maximum; ResultType m_Minimum; ResultType m_Mean; ResultType m_Sigma; ResultType m_Variance; ResultType m_Sum; }; } #endif // ATERIALINPUTFUNCTIONGENERATOR_H diff --git a/Modules/ModelFit/include/mitkModelBase.h b/Modules/ModelFit/include/mitkModelBase.h index 939801627b..491f50667d 100644 --- a/Modules/ModelFit/include/mitkModelBase.h +++ b/Modules/ModelFit/include/mitkModelBase.h @@ -1,217 +1,217 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODELBASE_H #define MODELBASE_H #include #include #include #include #include "MitkModelFitExports.h" #include "mitkModelTraitsInterface.h" namespace mitk { /**@class ModelBase * @brief Base class for (dynamic) models. * A model can be used to calculate its signal given the discrete time grid of the signal * and the parameters of the model.\n * A model has 3 types of parameters:\n * - parameters * - static parameters * - derived parameters * . * "Parameters" and "static parameters" are used to compute the signal of the model. * "Parameters" are the ones that will be changed for/by model fitting. * "Static parameters" are used to configure the model for fitting but are itself not * part of the fitting scope (compare itk::Transform parameters and static parameters). * "Derived parameters" are model specific parameters computed from "Parameters" e.g. (DerivedParam1 = Param1/Param2). * It may be implemented if e.g. for practical usage not the fitted parameters are needed but * derivation of them. * @remark: If you implement your own model calls regard const correctness and do not change * or undermine the constness of this base class. It is important because in case of fitting * models are used in a multi threaded environment and must be thread safe. Thus the getter and * computation functions are implemented as const and thread safe methods.*/ class MITKMODELFIT_EXPORT ModelBase : public itk::Object, public ModelTraitsInterface { public: typedef ModelBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelBase, itk::Object); typedef ModelTraitsInterface::ModelResultType ModelResultType; typedef ModelTraitsInterface::ParameterValueType ParameterValueType; typedef ModelTraitsInterface::ParametersType ParametersType; /** Type defining the time grid used be models. * @remark the model time grid has a resolution in sec and not like the time geometry which uses ms.*/ typedef itk::Array TimeGridType; typedef ModelTraitsInterface::ParameterNameType ParameterNameType; typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType; typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType; typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType; typedef double StaticParameterValueType; typedef std::vector StaticParameterValuesType; typedef std::map StaticParameterMapType; typedef double DerivedParameterValueType; typedef std::map DerivedParameterMapType; /**Default implementation returns a scale of 1.0 for every defined parameter.*/ - virtual ParamterScaleMapType GetParameterScales() const; + ParamterScaleMapType GetParameterScales() const override; /**Default implementation returns no unit string ("") for every defined parameter.*/ - virtual ParamterUnitMapType GetParameterUnits() const; + ParamterUnitMapType GetParameterUnits() const override; /**Default implementation returns a scale of 1.0 for every defined derived parameter.*/ - virtual DerivedParamterScaleMapType GetDerivedParameterScales() const; + DerivedParamterScaleMapType GetDerivedParameterScales() const override; /**Default implementation returns no unit string ("") for every defined derived parameter.*/ - virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const; + DerivedParamterUnitMapType GetDerivedParameterUnits() const override; /**Default implementation returns GetClassID as display name.*/ - virtual std::string GetModelDisplayName() const; + std::string GetModelDisplayName() const override; /**Default implementation returns "Unkown" as model type.*/ - virtual std::string GetModelType() const; + std::string GetModelType() const override; /**Default implementation returns an empty functions string.*/ - virtual FunctionStringType GetFunctionString() const; + FunctionStringType GetFunctionString() const override; /**Default implementation the class name of the concrete instance as ID.*/ - virtual ModellClassIDType GetClassID() const; + ModellClassIDType GetClassID() const override; /**Default implementation returns an empty string.*/ - virtual std::string GetXName() const; + std::string GetXName() const override; /**Default implementation returns an empty string.*/ - virtual std::string GetXAxisName() const; + std::string GetXAxisName() const override; /**Default implementation returns an empty string.*/ - virtual std::string GetXAxisUnit() const; + std::string GetXAxisUnit() const override; /**Default implementation returns an empty string.*/ - virtual std::string GetYAxisName() const; + std::string GetYAxisName() const override; /**Default implementation returns an empty string.*/ - virtual std::string GetYAxisUnit() const; + std::string GetYAxisUnit() const override; /** Returns the names of static parameters that will be used when using * the model to compute the signal (but are not defined via GetSignal()).*/ virtual ParameterNamesType GetStaticParameterNames() const = 0; /** Returns the number of static parameters that will be used when using * the model to compute the signal (but are not defined via GetSignal()).*/ virtual ParametersSizeType GetNumberOfStaticParameters() const = 0; /**Default implementation returns no unit string ("") for every defined parameter.*/ virtual ParamterUnitMapType GetStaticParameterUnits() const; /** Returns the names of derived parameters that can/will be computed by the model * given specific model parameters. * @remark Default implementation has no derived parameters*/ - virtual DerivedParameterNamesType GetDerivedParameterNames() const; + DerivedParameterNamesType GetDerivedParameterNames() const override; /** Returns the number of derived parameters that can/will be computed by the model * given specific model parameters. * @remark Default implementation has no derived parameters*/ - virtual DerivedParametersSizeType GetNumberOfDerivedParameters() const; + DerivedParametersSizeType GetNumberOfDerivedParameters() const override; /** Generic interface method that can be used to set the static parameters of the model * before it is used. * It checks the validity of the passed map and uses SetStaticParameter to set the values. * @param parameters The map with the static parameters and their values. * @param allParameters If true an exception will be thrown if the keys of passed parameters do * not equal the return of GetStaticParameterNames. Thus if true, one must set all static * parameters of the model. * @pre Parameters must only contain keys that exist in GetStaticParameterNames() * @pre If allParameters == true, parameters must define all keys of GetStaticParameterNames()*/ void SetStaticParameters(const StaticParameterMapType& parameters, bool allParameters = true); /** Generic interface method that can be used to retrieve the static parameters of the model; * e.g. in order to serialize the model settings. * It calls GetStaticParameter for every name defined in GetStaticParameterNames().*/ StaticParameterMapType GetStaticParameters() const; /** Generic interface method that computes all derived parameters implemented for the given models. * To changed the derived parameter computation. ComputeDerivedParameters must be (re)implemented. * @pre parameters must have the right size. * @param parameters The parameters of the model for which the derived parameters should be computed. * It calls GetStaticParameter for every name defined in GetStaticParameterNames(). * @remark Default implementation has no derived parameters*/ DerivedParameterMapType GetDerivedParameters(const ParametersType& parameters) const; /** Sets the time grid of the model. It indicates the time points correlated with the signal the modell should produce. @remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/ virtual void SetTimeGrid(const TimeGridType& grid); /** Gets the time grid of the model. It indicates the time points correlated with the signal the modell should produce. @remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/ itkGetConstReferenceMacro(TimeGrid, TimeGridType); ModelResultType GetSignal(const ParametersType& parameters) const; protected: virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const = 0; /** Member is called by GetSignal() before ComputeModelfunction(). It indicates if model is in a valid state and * ready to compute the signal. The default implementation checks nothing and always returns true. * Reimplement to realize special behavior for derived classes. * @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the * exception comment. * @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/ virtual bool ValidateModel(std::string& error) const; /** Helper function called by GetDerivedParameters(). Implement in derived classes to realize * the concrete computation of derived parameters. * @remark Default implementation has no derived parameters*/ virtual DerivedParameterMapType ComputeDerivedParameters(const ParametersType& parameters) const; /** Helper function called by SetStaticParameters(). Implement in derived classes to realize * the concrete setting of static parameters.*/ virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) = 0; /** Helper function called by GetStaticParameters(). Implement in derived classes to realize * the concrete retrieval of static parameters.*/ virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const = 0; ModelBase(); - virtual ~ModelBase(); + ~ModelBase() override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; //timeGrid in seconds TimeGridType m_TimeGrid; private: //No copy constructor allowed ModelBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MODELBASE_H diff --git a/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h index 93be534fe5..7df800933f 100644 --- a/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h +++ b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ModelBasedValueFunctorBase_H #define ModelBasedValueFunctorBase_H #include "mitkIndexedValueFunctorBase.h" #include "MitkModelFitExports.h" namespace mitk { /**Functor base class for functors that are some how based on an model. This abstract class adds the possibility to query the signal grid of the model.*/ class MITKMODELFIT_EXPORT ModelBasedValueFunctorBase: public IndexedValueFunctorBase { public: typedef ModelBasedValueFunctorBase Self; typedef IndexedValueFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelBasedValueFunctorBase, IndexedValueFunctorBase); typedef Superclass::InputImagePixelType InputImagePixelType; typedef Superclass::InputPixelVectorType InputPixelVectorType; typedef Superclass::OutputPixelVectorType OutputPixelVectorType; typedef Superclass::IndexType IndexType; typedef itk::Array GridArrayType; virtual GridArrayType GetGrid() const = 0; protected: ModelBasedValueFunctorBase() {}; - ~ModelBasedValueFunctorBase() + ~ModelBasedValueFunctorBase() override {}; }; } #endif // ModelBasedValueFunctorBase_H diff --git a/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h index 53706e577b..0960c5d491 100644 --- a/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h +++ b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKMODELDATAGENERATIONFUNCTOR_H #define MITKMODELDATAGENERATIONFUNCTOR_H #include "mitkSimpleFunctorBase.h" #include "mitkModelBase.h" #include "mitkModelParameterizerBase.h" #include namespace mitk { /** Functor class that can be used to generate a model signal for each index. This class assumes that value parameter passed in the Compute() call, is the parameter vector that should be used to generate the model signal. The time grid and the parameterized model are provided by the model parameterizer. This this functor will generate a signal for each index position and return the signal as output.*/ class MITKMODELFIT_EXPORT ModelDataGenerationFunctor : public SimpleFunctorBase { public: typedef ModelDataGenerationFunctor Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkTypeMacro(ModelDataGenerationFunctor, SimpleFunctorBase); typedef std::vector ParameterNamesType; typedef ModelBase::ModelResultType SignalType; typedef itk::Array ModelParametersType; itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); - virtual SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override; + SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override; - virtual unsigned int GetNumberOfOutputs() const override; + unsigned int GetNumberOfOutputs() const override; - virtual GridArrayType GetGrid() const override; + GridArrayType GetGrid() const override; protected: ModelDataGenerationFunctor(); - virtual ~ModelDataGenerationFunctor(); + ~ModelDataGenerationFunctor() override; private: ModelParameterizerBase::ConstPointer m_ModelParameterizer; }; } #endif // MITKMODELDATAGENERATIONFUNCTOR_H diff --git a/Modules/ModelFit/include/mitkModelFactoryBase.h b/Modules/ModelFit/include/mitkModelFactoryBase.h index 8151746dfc..06a34821a8 100644 --- a/Modules/ModelFit/include/mitkModelFactoryBase.h +++ b/Modules/ModelFit/include/mitkModelFactoryBase.h @@ -1,94 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_FACTORY_BASE_H #define __MODEL_FACTORY_BASE_H #include #include "mitkModelBase.h" #include "mitkModelTraitsInterface.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkConstraintCheckerBase.h" #include "MitkModelFitExports.h" namespace mitk { /**Base class for model factories. * Default implementation just passes the model properties through from an instance created with add model. * To use the the base class, derive and at least implement the abstract member functions. */ class MITKMODELFIT_EXPORT ModelFactoryBase : public itk::Object, public ModelTraitsInterface { public: /*typedef ModelFactoryBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; */ mitkClassMacroItkParent(ModelFactoryBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::Pointer ModelBasePointer; typedef ModelTraitsInterface::ParameterNameType ParameterNameType; typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType; typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType; typedef ModelTraitsInterface::ParamterScaleMapType ParamterScaleMapType; typedef ModelTraitsInterface::ParamterUnitMapType ParamterUnitMapType; typedef ModelTraitsInterface::FunctionStringType FunctionStringType; typedef ModelTraitsInterface::ModellClassIDType ModellClassIDType; typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType; typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType; typedef ModelTraitsInterface::DerivedParamterScaleMapType DerivedParamterScaleMapType; typedef ModelTraitsInterface::DerivedParamterUnitMapType DerivedParamterUnitMapType; virtual ModelBasePointer CreateModel() const = 0; /** Created a model parameterizer set up according to the passed model fit info. @pre fit must point to a valid instance.*/ ModelParameterizerBase::Pointer CreateParameterizer(const modelFit::ModelFitInfo* fit) const; /** Create the default constraints that should/can be used for fitting if nothing else * is specified by the user. * @return Pointer to the constraint checker for default constraints. May return a NULL pointer * to indicated that the Model has no constraints by default. */ virtual ConstraintCheckerBase::Pointer CreateDefaultConstraints() const = 0; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const = 0; protected: virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const = 0; ModelFactoryBase(); - virtual ~ModelFactoryBase(); + ~ModelFactoryBase() override; private: //No copy constructor allowed ModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_FACTORY_BASE_H diff --git a/Modules/ModelFit/include/mitkModelFitFunctorBase.h b/Modules/ModelFit/include/mitkModelFitFunctorBase.h index 6269111e28..e8f349474b 100644 --- a/Modules/ModelFit/include/mitkModelFitFunctorBase.h +++ b/Modules/ModelFit/include/mitkModelFitFunctorBase.h @@ -1,141 +1,141 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MODEL_FIT_FUNCTOR_BASE_H #define MODEL_FIT_FUNCTOR_BASE_H #include #include #include "mitkModelBase.h" #include "mitkSVModelFitCostFunction.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT ModelFitFunctorBase: public ::itk::Object { public: typedef ModelFitFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelFitFunctorBase, itk::Object); typedef ScalarType ParameterImagePixelType; typedef std::vector InputPixelArrayType; typedef std::vector OutputPixelArrayType; /** Returns the values determined by fitting the passed model. The values in the returned vector are ordered in the * following sequence: * - model parameters (see also GetParameterNames()) * - derived model parameters (see also GetDerivedParameterNames()) * - criterion(s) (see also GetCriterionNames()) * - evaluation parameters (see also GetEvaluationParameterNames()) * @param value Signal the model should be fitted onto * @param model Pointer to the preconfigured/ready to use model instance for the fitting against the signal curve * @param initialParameters parameters of the model that should be used as starting point of the fitting process. * @pre model must point to a valid instance. * @pre Size of initialParameters must be equal to model->GetNumberOfParameters(). */ OutputPixelArrayType Compute(const InputPixelArrayType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters) const; /** Returns the number of outputs the fit functor will return if compute is called. * The number depends in parts on the passed model. * @exception Exception will be thrown if no valid model is passed.*/ unsigned int GetNumberOfOutputs(const ModelBase* model) const; typedef ModelBase::ParameterNamesType ParameterNamesType; /** Returns names of all evaluation parameters defined by the user*/ ParameterNamesType GetEvaluationParameterNames() const; void ResetEvaluationParameters(); void RegisterEvaluationParameter(const std::string& parameterName, SVModelFitCostFunction* evaluationCostFunction); const SVModelFitCostFunction* GetEvaluationParameterCostFunction(const std::string& parameterName) const; /** Returns names of the criterion used to fit the model. */ virtual ParameterNamesType GetCriterionNames() const = 0 ; /** Returns names of the depug parameters generated by the functor. Is empty, if debug is deactivated. */ ParameterNamesType GetDebugParameterNames() const; itkBooleanMacro(DebugParameterMaps); itkSetMacro(DebugParameterMaps, bool); itkGetConstMacro(DebugParameterMaps, bool); protected: typedef ModelBase::ParametersType ParametersType; typedef ModelFitCostFunctionInterface::SignalType SignalType; ModelFitFunctorBase(); - ~ModelFitFunctorBase(); + ~ModelFitFunctorBase() override; /**Internal Method called by Compute to get the final criterion values thar dove the fit. must be implemented be concrete functor classes.*/ virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const = 0; /** Internal Method called by Compute(). Gets all derived parameters of the models with the final found parameters of the fit.*/ OutputPixelArrayType GetDerivedParameters(const ModelBase* model, const ParametersType& parameters) const; /** Internal Method called by Compute(). Gets the evaluation parameters for all cost functions enlisted by the user, based on the model with the final found parameters of the fit and the input signal.*/ OutputPixelArrayType GetEvaluationParameters(const ModelBase* model, const ParametersType& parameters, const SignalType& sample) const; typedef std::map DebugParameterMapType; /** Internal Method called by Compute(). It does the real fit and returns the found parameters. Additionally it must return its debug parameter via debugParameters. @post If m_DebugParameterMaps is true, it must return all debug parameters defined by GetDebugParameterNames() via debugParameters. @param value Signal the Model should be fitted against @param model Pointer to the model that should be fitted @param initialParameters Initial modal parameters for the fit @param [out] debugParameters Map containing all debug parameters for the done fit (must only valid if m_DebugParameterMap is true)*/ virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model, const ModelBase::ParametersType& initialParameters, DebugParameterMapType& debugParameters) const = 0; /** Returns names of the depug parameters generated by the functor. Will be called by GetDebugParameterNames, if debug is activated. */ virtual ParameterNamesType DefineDebugParameterNames()const = 0; private: typedef std::map CostFunctionMapType; CostFunctionMapType m_CostFunctionMap; bool m_DebugParameterMaps; ::itk::SimpleFastMutexLock m_Mutex; }; } #endif // MODEL_FIT_FUNCTOR_BASE_H diff --git a/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h index 6cb6aec733..fbe64ec591 100644 --- a/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h +++ b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKModelFitInfoSignalGenerationFunctor_H #define MITKModelFitInfoSignalGenerationFunctor_H #include "mitkModelBasedValueFunctorBase.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkModelFitParameterValueExtraction.h" #include namespace mitk { /** Functor class that can be used to generate a model signal for each index. This class is similar to ModelDataGenerationFunctor. But instead of using the passed input value as model parameters in the compute function, the model fit info is used to deduce the parameters based on the index. The time grid and the parameterized model are provided by the model parameterizer. This this functor will generate a signal for each index position and return the signal as output.*/ class MITKMODELFIT_EXPORT ModelFitInfoSignalGenerationFunctor : public ModelBasedValueFunctorBase { public: typedef ModelFitInfoSignalGenerationFunctor Self; typedef ModelBasedValueFunctorBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkTypeMacro(ModelFitInfoSignalGenerationFunctor, ModelBasedValueFunctorBase); typedef std::vector ParameterNamesType; typedef ModelBase::ModelResultType SignalType; typedef itk::Array ModelParametersType; itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase); itkSetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo); itkGetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo); - virtual IndexedValueFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const override; + IndexedValueFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const override; /** Convinient overload because this functor does not need the value */ virtual IndexedValueFunctorBase::OutputPixelVectorType Compute(const IndexType& currentIndex) const; - virtual unsigned int GetNumberOfOutputs() const override; + unsigned int GetNumberOfOutputs() const override; - virtual GridArrayType GetGrid() const override; + GridArrayType GetGrid() const override; protected: /**Method is called by Compute() to specify the parameters used to generate the model signal for the current index. The default implementation just extracts the parameters out of the model fit info and maps it into the result vector. Reimplement the method to change this behavior.*/ virtual ModelBase::ParametersType CompileModelParameters(const IndexType& currentIndex, const ModelBase * model) const; ModelFitInfoSignalGenerationFunctor(); - virtual ~ModelFitInfoSignalGenerationFunctor(); + ~ModelFitInfoSignalGenerationFunctor() override; private: ModelParameterizerBase::ConstPointer m_ModelParameterizer; modelFit::ModelFitInfo::ConstPointer m_FitInfo; }; } #endif // MITKModelFitInfoSignalGenerationFunctor_H diff --git a/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h b/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h index c9d1c61e1f..6d8f126ada 100644 --- a/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h +++ b/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h @@ -1,171 +1,171 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_MODEL_FIT_PLOT_DATA_HELPER_H_ #define __MITK_MODEL_FIT_PLOT_DATA_HELPER_H_ #include #include "mitkPoint.h" #include "mitkPointSet.h" #include "mitkModelBase.h" #include "mitkWeakPointer.h" #include "mitkCommon.h" #include "mitkModelFitInfo.h" #include "itkMapContainer.h" #include "MitkModelFitExports.h" namespace mitk { class ModelParameterizerBase; class Image; using PlotDataValues = std::vector>; /** Simple helper structure that represents a curve for plots and its generation time*/ class MITKMODELFIT_EXPORT PlotDataCurve : public ::itk::Object { public: mitkClassMacroItkParent(PlotDataCurve, itk::Object); itkFactorylessNewMacro(Self); using ValuesType = PlotDataValues; virtual void SetValues(const ValuesType& _arg); virtual void SetValues(ValuesType&& _arg); itkGetConstReferenceMacro(Values, ValuesType); itkGetMacro(Values, ValuesType); PlotDataCurve& operator=(const PlotDataCurve& rhs); PlotDataCurve& operator=(PlotDataCurve&& rhs) noexcept; void Reset(); protected: PlotDataCurve(); - virtual ~PlotDataCurve() = default; + ~PlotDataCurve() override = default; private: /** values of the curve */ ValuesType m_Values; PlotDataCurve(const PlotDataCurve& other) = delete; }; /** Collection of plot curves, e.g. every plot curve for a certain world coordinate position*/ using PlotDataCurveCollection = itk::MapContainer; /** Structure containing all information for one model fit */ struct MITKMODELFIT_EXPORT ModelFitPlotData { /** Plots that are related to the world coordinate labeled as current position.*/ PlotDataCurveCollection::Pointer currentPositionPlots; using PositionalCurveCollection = std::pair; using PositionalCollectionMap = std::map; /** Plot collections that are related to specific world coordinates (inspection position bookmarks).*/ PositionalCollectionMap positionalPlots; /** Plot collection for static plots of the fit that do not depend on some coordinates. */ PlotDataCurveCollection::Pointer staticPlots; /** Pointer to the model fit that correspondens with this plot data.*/ mitk::modelFit::ModelFitInfo::Pointer fitInfo; /** Helper function to get the collection of the current position. Returns nullptr if no current position exists.*/ static const PlotDataCurve* GetSamplePlot(const PlotDataCurveCollection* coll); static const PlotDataCurve* GetSignalPlot(const PlotDataCurveCollection* coll); static const PlotDataCurve* GetInterpolatedSignalPlot(const PlotDataCurveCollection* coll); /** Helper function that generates a humand readable name for the passed value of a positional collection map.*/ static std::string GetPositionalCollectionName(const PositionalCollectionMap::value_type& mapValue); const PlotDataCurveCollection* GetPositionalPlot(const mitk::Point3D& point) const; const PlotDataCurveCollection* GetPositionalPlot(mitk::PointSet::PointIdentifier id) const; /**returns the minimum (first element) and maximum (second element) of x of all plot data*/ PlotDataValues::value_type GetXMinMax() const; /**returns the minimum (first element) and maximum (second element) of y of all plot data*/ PlotDataValues::value_type GetYMinMax() const; ModelFitPlotData(); }; /** Helper function that actualizes min and max by the y values given in data.*/ void CheckYMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max); /** Helper function that actualizes min and max by the x values given in data.*/ void CheckXMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max); /** Function generates curve data for the signal defined by the passed informations. @param position The position in world coordinates the curve should be generated for. @param fitInfo Pointer to the fit info that defines the model/fit that produces the signal. @param timeGrid Defines the time grid of the generated signal. @param parameterizer Pointer to a parameterizer instance that is used to configure the model to generate the signal. If pointer is not set. The default parameterizer based on the fitInfo instance will be used. @pre position must be within the model fit input image @pre fitInfo must be a valid pointer. */ MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateModelSignalPlotData(const mitk::Point3D& position, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer = nullptr); /** Function generates curve data for all additinal inputs (e.g. ROI signal, AIF) stored in the fit information. The keys in the map are the same keys like in the fitInfo. @param position The position in world coordinates the curve should be generated for. @param fitInfo Pointer to the fit info that defines the model/fit that produces the signal. @param timeGrid Defines the time grid of the generated signal. @pre position must be within the model fit input image @pre fitInfo must be a valid pointer. */ MITKMODELFIT_EXPORT PlotDataCurveCollection::Pointer GenerateAdditionalModelFitPlotData(const mitk::Point3D& position, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid); /** Function generates curve data for a given image instance. @param position The position in world coordinates the curve should be generated for. @param image Pointer to the image the signal should be extracted from. @param timeGrid Defines the time grid of the generated signal. @pre position must be within the model fit input image @pre image must be a valid pointer. @pre image time steps must equal the timeGrid size. */ MITKMODELFIT_EXPORT PlotDataCurve::Pointer GenerateImageSamplePlotData(const mitk::Point3D& position, const mitk::Image* image, const mitk::ModelBase::TimeGridType& timeGrid); /** * Keyword used in curve collections as key for the sample (extracted from an image) plot. */ MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SAMPLE_NAME(); /** * Keyword used in curve collections as key for the signal (generated by a model) plot. */ MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SIGNAL_NAME(); /** * Keyword used in curve collections as key for the interpolated (hires) signal (generated by a model) plot. */ MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME(); } #endif diff --git a/Modules/ModelFit/include/mitkModelFitProviderBase.h b/Modules/ModelFit/include/mitkModelFitProviderBase.h index bfd963eebf..54c3098fd0 100644 --- a/Modules/ModelFit/include/mitkModelFitProviderBase.h +++ b/Modules/ModelFit/include/mitkModelFitProviderBase.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_FIT_PROVIDER_BASE_H #define __MODEL_FIT_PROVIDER_BASE_H #include // MITK #include // Microservices #include #include #include namespace mitk { /** * @brief Base class for model fit provider. */ template class ModelFitProviderBase : public mitk::IModelFitProvider { public: /** Returns an instance of the model factory that is represented by the provider.*/ - virtual itk::SmartPointer GenerateFactory() const override; + itk::SmartPointer GenerateFactory() const override; /** Returns the grid of the model variable extracted from the fit info. The default implementation returns a time grid extracted from the time geometry of the fitInfo->inputImage. Reimplement for other models/fits to generate other variable grids. @pre fitInfo is a valid instance for the model fit. */ - virtual ModelBase::TimeGridType GetVariableGrid(const modelFit::ModelFitInfo* fitInfo) const override; + ModelBase::TimeGridType GetVariableGrid(const modelFit::ModelFitInfo* fitInfo) const override; us::ServiceRegistration RegisterService(us::ModuleContext *context = us::GetModuleContext()); void UnregisterService(); ModelFitProviderBase(); - virtual ~ModelFitProviderBase(); + ~ModelFitProviderBase() override; protected: ModelFitProviderBase(const ModelFitProviderBase &other); virtual us::ServiceProperties GetServiceProperties() const; /** * \brief Set the service ranking for this file reader. * * Default is zero and should only be chosen differently for a reason. * The ranking is used to determine which reader to use if several * equivalent readers have been found. * It may be used to replace a default reader from MITK in your own project. * E.g. if you want to use your own reader for nrrd files instead of the default, * implement it and give it a higher ranking than zero. */ void SetRanking(int ranking); int GetRanking() const; private: ModelFitProviderBase &operator=(const ModelFitProviderBase &other); class Impl; std::unique_ptr< Impl > d; }; } // namespace mitk #ifndef ITK_MANUAL_INSTANTIATION #include "mitkModelFitProviderBase.tpp" #endif #endif /* __MODEL_FIT_PROVIDER_BASE_H */ diff --git a/Modules/ModelFit/include/mitkModelParameterizerBase.h b/Modules/ModelFit/include/mitkModelParameterizerBase.h index ddbeeca636..be9205dcdc 100644 --- a/Modules/ModelFit/include/mitkModelParameterizerBase.h +++ b/Modules/ModelFit/include/mitkModelParameterizerBase.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MODEL_PARAMETERIZER_BASE_H #define __MODEL_PARAMETERIZER_BASE_H #include #include #include "mitkModelBase.h" #include "mitkInitialParameterizationDelegateBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Base class for all model parameterizers * Model parameterizers are used to offer a generic api to generate/bind * models with specific global static and local static parameters in order to * utilize the model correctly.\n * - Global static parameter: parameters that are the same for a model independent * of the spatial position (in image space) that should be modeled (e.g. parameter "Tau" * for the DescriptivePharmacokineticBrixModel) * - Local static parameter: parameters that are specific for the spatial position (in image space) * that should be modeled (e.g. parameter "S0" for the DescriptivePharmacokineticBrixModel) */ class MITKMODELFIT_EXPORT ModelParameterizerBase : public itk::Object, public ModelTraitsInterface { public: typedef ModelParameterizerBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ModelParameterizerBase, itk::Object); typedef ModelBase ModelBaseType; typedef ModelBaseType::Pointer ModelBasePointer; typedef ModelBaseType::ParametersType ParametersType; typedef ModelBaseType::StaticParameterValueType StaticParameterValueType; typedef ModelBaseType::StaticParameterValuesType StaticParameterValuesType; typedef ModelBaseType::StaticParameterMapType StaticParameterMapType; typedef ModelBaseType::TimeGridType TimeGridType; typedef ::itk::Index<3> IndexType; virtual StaticParameterMapType GetGlobalStaticParameters() const = 0; virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const = 0; /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ ParametersType GetInitialParameterization() const; ParametersType GetInitialParameterization(const IndexType& currentPosition) const; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ virtual ParametersType GetDefaultInitialParameterization() const = 0; /** Possibility to set a custom strategy for defining the initial parameterization via a delegate.*/ void SetInitialParameterizationDelegate(const InitialParameterizationDelegateBase* delegate); virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const = 0; /** Generate model instance, only with global static parametrization. * Any local static parameter stay default.*/ virtual ModelBasePointer GenerateParameterizedModel() const = 0; itkSetMacro(DefaultTimeGrid, TimeGridType); itkGetConstReferenceMacro(DefaultTimeGrid, TimeGridType); protected: ModelParameterizerBase(); - virtual ~ModelParameterizerBase(); + ~ModelParameterizerBase() override; InitialParameterizationDelegateBase::ConstPointer m_InitialDelegate; /** The default time grid that should be set to generated models.*/ TimeGridType m_DefaultTimeGrid; private: //No copy constructor allowed ModelParameterizerBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/ModelFit/include/mitkModelSignalImageGenerator.h b/Modules/ModelFit/include/mitkModelSignalImageGenerator.h index 82b591f17b..9c43c19a37 100644 --- a/Modules/ModelFit/include/mitkModelSignalImageGenerator.h +++ b/Modules/ModelFit/include/mitkModelSignalImageGenerator.h @@ -1,72 +1,72 @@ #ifndef MODELSIGNALIMAGEGENERATOR_H #define MODELSIGNALIMAGEGENERATOR_H #include "mitkModelParameterizerBase.h" #include "mitkImage.h" #include "MitkModelFitExports.h" namespace mitk { /** Generator class that takes a model parameterizer instance, given parameter images and generates the corresponding signal image. Thus the generator simulates the signals of the model specified by parameterizer given the passed parameter images. The time grid of the signal is also defined by the parameterizer.*/ class MITKMODELFIT_EXPORT ModelSignalImageGenerator: public ::itk::Object { public: mitkClassMacroItkParent(ModelSignalImageGenerator, itk::Object); itkFactorylessNewMacro(Self); typedef mitk::Image::Pointer ParameterImageType; typedef std::vector ParameterNamesType; typedef unsigned int ParametersIndexType; typedef std::vector ParameterVectorType; typedef std::map ParameterMapType; typedef mitk::Image::Pointer ResultImageType; typedef mitk::Image::Pointer MaskType; typedef mitk::ModelBase::TimeGridType GridType; itkSetObjectMacro(Parameterizer, ModelParameterizerBase); itkGetObjectMacro(Parameterizer, ModelParameterizerBase); void SetParameterInputImage(const ParametersIndexType index, ParameterImageType inputParameterImage); ResultImageType GetGeneratedImage(); void Generate(); protected: ModelSignalImageGenerator() {}; - ~ModelSignalImageGenerator() + ~ModelSignalImageGenerator() override {}; template void DoGenerateData(itk::Image* image); template void DoPrepareMask(itk::Image* image); private: ParameterMapType m_ParameterInputMap; ParameterVectorType m_InputParameterImages; void SortParameterImages(); MaskType m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::Pointer m_InternalMask; ResultImageType m_ResultImage; ModelParameterizerBase::Pointer m_Parameterizer; }; } #endif // MODELSIGNALIMAGEGENERATOR_H diff --git a/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h index ab65dc8720..f415ca6a64 100644 --- a/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H #define MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H #include #include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ class MITKMODELFIT_EXPORT NormalizedSumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef NormalizedSumOfSquaredDifferencesFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; NormalizedSumOfSquaredDifferencesFitCostFunction() { } - ~NormalizedSumOfSquaredDifferencesFitCostFunction(){} + ~NormalizedSumOfSquaredDifferencesFitCostFunction() override{} }; } #endif // MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H diff --git a/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h index 4046ed1822..1afade58dd 100644 --- a/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h +++ b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_ #define __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_ #include #include #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Base class for generators for parameter fits of a given model. * The generators creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ class MITKMODELFIT_EXPORT ParameterFitImageGeneratorBase: public ::itk::Object { public: mitkClassMacroItkParent(ParameterFitImageGeneratorBase, ::itk::Object); using ParameterImagePixelType = ScalarType; using ModelBaseType = ModelBase; using ParameterNameType = ModelBaseType::ParameterNameType; using ParameterNamesType = ModelBaseType::ParameterNamesType; using ParameterImageMapType = std::map; /** Returns the progress of the current fit. e.g. 0 : none; 0.5 = 50%; 1: complete*/ virtual double GetProgress() const = 0; /** Commences the model fit over the dynamic image data. Stores the fitted parameter in * parameter images. After this method call is finished the parameter images can be retrieved via * GetParameterImages. * @pre Model must be set * @pre DynamicImage must be set * @post Parameter image map contains an image for every parameter of the model referenced by the parameter name.*/ void Generate(); /** Returns the fitted/generated parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetParameterImages(); /** Returns the generated derived parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetDerivedParameterImages(); /** Returns the generated criterion images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetCriterionImages(); /** Returns the generated evaluation parameter images. Triggers Generate() if result is outdated.*/ ParameterImageMapType GetEvaluationParameterImages(); /** Returns the names of the fitted/generated parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetParameterNames() const = 0; /** Returns the names of the derived parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetDerivedParameterNames() const = 0; /** Returns the names of the criteria, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetCriterionNames() const = 0; /** Returns the names of the evaluation parameters, that will be generated. These are also the keys of the related image map.*/ virtual ParameterNamesType GetEvaluationParameterNames() const = 0; protected: ParameterFitImageGeneratorBase() {}; - virtual ~ParameterFitImageGeneratorBase() {}; + ~ParameterFitImageGeneratorBase() override {}; virtual bool HasOutdatedResult() const; /** Check if the fit can be generated and all needed inputs are valid. * Throw an exception for a non valid or missing input.*/ virtual void CheckValidInputs() const; virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) = 0; itk::TimeStamp m_GenerationTimeStamp; private: ParameterImageMapType m_ParameterImageMap; ParameterImageMapType m_DerivedParameterImageMap; ParameterImageMapType m_CriterionImageMap; ParameterImageMapType m_EvaluationParameterImageMap; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h index 9f9e58aa65..2c49345022 100644 --- a/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h +++ b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h @@ -1,134 +1,134 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #define __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #include #include #include "mitkModelParameterizerBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkParameterFitImageGeneratorBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Class for generators for pixel based parameter fits of a given model based on a given 4D mitk image. * The class uses a model fit functor (based on ModelFitFunctorBase) given by the use. * @remark This generator fits every pixel on its own. If you want to fit the mean value of the given mask use * ROIBasedParameterFitImageGenerator. * The generator creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ class MITKMODELFIT_EXPORT PixelBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase { public: mitkClassMacro(PixelBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase); itkNewMacro(Self); typedef ScalarType ParameterImagePixelType; typedef std::vector FunctorValueArrayType; typedef ModelFitFunctorBase FitFunctorType; typedef ModelParameterizerBase ParameterizerType; typedef ParameterFitImageGeneratorBase::ModelBaseType ModelBaseType; typedef ParameterFitImageGeneratorBase::ParameterNameType ParameterNameType; typedef ParameterFitImageGeneratorBase::ParameterImageMapType ParameterImageMapType; itkSetObjectMacro(DynamicImage, Image); itkGetConstObjectMacro(DynamicImage, Image); itkSetObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); itkSetObjectMacro(FitFunctor, FitFunctorType); itkGetObjectMacro(FitFunctor, FitFunctorType); itkSetObjectMacro(ModelParameterizer, ParameterizerType); itkGetObjectMacro(ModelParameterizer, ParameterizerType); itkSetMacro(TimeGridByParameterizer, bool); itkGetMacro(TimeGridByParameterizer, bool); itkBooleanMacro(TimeGridByParameterizer); - virtual double GetProgress() const override; + double GetProgress() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParameterNamesType GetCriterionNames() const override; + ParameterNamesType GetCriterionNames() const override; - virtual ParameterNamesType GetEvaluationParameterNames() const override; + ParameterNamesType GetEvaluationParameterNames() const override; protected: PixelBasedParameterFitImageGenerator() : m_Progress(0), m_TimeGridByParameterizer(false) { m_InternalMask = nullptr; m_Mask = nullptr; m_DynamicImage = nullptr; }; - ~PixelBasedParameterFitImageGenerator() = default; + ~PixelBasedParameterFitImageGenerator() override = default; template void DoParameterFit(itk::Image* image); template void DoPrepareMask(itk::Image* image); void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject); - virtual bool HasOutdatedResult() const; - virtual void CheckValidInputs() const; - virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages); + bool HasOutdatedResult() const override; + void CheckValidInputs() const override; + void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override; private: Image::Pointer m_DynamicImage; Image::Pointer m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::Pointer m_InternalMask; FitFunctorType::Pointer m_FitFunctor; ParameterizerType::Pointer m_ModelParameterizer; ParameterImageMapType m_TempResultMap; ParameterImageMapType m_TempDerivedResultMap; ParameterImageMapType m_TempEvaluationResultMap; ParameterImageMapType m_TempCriterionResultMap; double m_Progress; /**Indicates if the time grid defined in the parameterizer should be used (True) or if the filter should extract the time grid from the input image (False).*/ bool m_TimeGridByParameterizer; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h index 783b8573c1..0d0042f989 100644 --- a/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h +++ b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #define __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_ #include #include #include "mitkModelParameterizerBase.h" #include "mitkModelFitFunctorBase.h" #include "mitkParameterFitImageGeneratorBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Class for generators for parameter fits of a given model based on one given signal and its time grid. * The class uses a model fit functor (based on ModelFitFunctorBase) given by the user. It will fit the model to the passed signal. * To produce the output/parameter images, the passed mask will be used as template. The geometry of the mask specifies the geometry * of the result images. Every pixel inside the mask (mask value > 0) will be filled with the fitting results. Every pixel outside the mask * (mask value == 0) will be set to 0.\n * The generators creates 4 types of images: * - parameter images: The images that encode the results of each fitted parameter * - derived parameter images: Images that encode the results of derived parameters defined by the model * - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters * - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy) * . */ class MITKMODELFIT_EXPORT ROIBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase { public: mitkClassMacro(ROIBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase); itkNewMacro(Self); using ParameterImagePixelType = ScalarType; using FunctorValueArrayType = std::vector; using FitFunctorType = ModelFitFunctorBase; using ParameterizerType = ModelParameterizerBase; using ModelBaseType = ParameterFitImageGeneratorBase::ModelBaseType; using ParameterNameType = ParameterFitImageGeneratorBase::ParameterNameType; using ParameterImageMapType = ParameterFitImageGeneratorBase::ParameterImageMapType; using TimeGridType = ModelBaseType::TimeGridType; using SignalType = ModelBaseType::ModelResultType; itkSetObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); itkGetConstReferenceMacro(Signal, SignalType); itkSetMacro(Signal, SignalType); itkGetConstReferenceMacro(TimeGrid, TimeGridType); itkSetMacro(TimeGrid, TimeGridType); itkSetObjectMacro(FitFunctor, FitFunctorType); itkGetObjectMacro(FitFunctor, FitFunctorType); itkSetObjectMacro(ModelParameterizer, ParameterizerType); itkGetObjectMacro(ModelParameterizer, ParameterizerType); - virtual double GetProgress() const override; + double GetProgress() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParameterNamesType GetCriterionNames() const override; + ParameterNamesType GetCriterionNames() const override; - virtual ParameterNamesType GetEvaluationParameterNames() const override; + ParameterNamesType GetEvaluationParameterNames() const override; protected: ROIBasedParameterFitImageGenerator() : m_Progress(0) { m_Mask = nullptr; }; - virtual ~ROIBasedParameterFitImageGenerator() override = default; + ~ROIBasedParameterFitImageGenerator() override = default; template void DoImageGeneration(itk::Image* image, double value); void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject); - virtual bool HasOutdatedResult() const override; - virtual void CheckValidInputs() const override; - virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override; + bool HasOutdatedResult() const override; + void CheckValidInputs() const override; + void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override; private: Image::Pointer m_Mask; SignalType m_Signal; TimeGridType m_TimeGrid; FitFunctorType::Pointer m_FitFunctor; Image::Pointer m_TempResultImage; ParameterizerType::Pointer m_ModelParameterizer; double m_Progress; }; } #endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_ diff --git a/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h index 5195c71eb8..ccb34f7ddc 100644 --- a/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h +++ b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h @@ -1,36 +1,36 @@ #ifndef REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H #define REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H #include #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT ReducedChiSquareFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef ReducedChiSquareFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; ReducedChiSquareFitCostFunction() { } - ~ReducedChiSquareFitCostFunction(){} + ~ReducedChiSquareFitCostFunction() override{} }; } #endif // REDUCEDCHISQUAREFITCOSTFUNCTION_H diff --git a/Modules/ModelFit/include/mitkSVModelFitCostFunction.h b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h index 33e5363a70..1e50197009 100644 --- a/Modules/ModelFit/include/mitkSVModelFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SV_MODELFITCOSTFUNCTION_H #define SV_MODELFITCOSTFUNCTION_H #include #include #include "mitkModelFitCostFunctionInterface.h" #include "MitkModelFitExports.h" namespace mitk { /** Base class for all model fit cost function that return a singel cost value*/ class MITKMODELFIT_EXPORT SVModelFitCostFunction : public itk::SingleValuedCostFunction, public ModelFitCostFunctionInterface { public: typedef SVModelFitCostFunction Self; typedef itk::SingleValuedCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef ModelFitCostFunctionInterface::SignalType SignalType; typedef Superclass::MeasureType MeasureType; typedef Superclass::DerivativeType DerivativeType; - void SetSample(const SignalType &sampleSet); + void SetSample(const SignalType &sampleSet) override; - MeasureType GetValue(const ParametersType& parameter) const; - void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const; + MeasureType GetValue(const ParametersType& parameter) const override; + void GetDerivative (const ParametersType ¶meters, DerivativeType &derivative) const override; - unsigned int GetNumberOfParameters (void) const; + unsigned int GetNumberOfParameters (void) const override; itkSetConstObjectMacro(Model, ModelBase); itkGetConstObjectMacro(Model, ModelBase); itkSetMacro(DerivativeStepLength, double); itkGetConstMacro(DerivativeStepLength, double); protected: virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const = 0; SVModelFitCostFunction(): m_DerivativeStepLength(1e-5) { } - ~SVModelFitCostFunction(){} + ~SVModelFitCostFunction() override{} SignalType m_Sample; private: ModelBase::ConstPointer m_Model; /**value (delta of parameters) used to compute the derivatives numerically*/ double m_DerivativeStepLength; }; } #endif // SV_MODELFITCOSTFUNCTION_H diff --git a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h index 8fce7fef5a..d2c4224ce0 100644 --- a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h +++ b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkScalarListLookupTablePropertySerializer_h #define mitkScalarListLookupTablePropertySerializer_h #include "mitkBasePropertySerializer.h" #include "mitkBaseProperty.h" #include "MitkModelFitExports.h" namespace mitk { /** * @brief Serializer for the ScalarListLookupTableProperty so it can be written and read from * file. */ class ScalarListLookupTablePropertySerializer : public BasePropertySerializer { public: mitkClassMacro(ScalarListLookupTablePropertySerializer, BasePropertySerializer); itkNewMacro(Self); - virtual TiXmlElement* Serialize(); - virtual BaseProperty::Pointer Deserialize(TiXmlElement* element); + TiXmlElement* Serialize() override; + BaseProperty::Pointer Deserialize(TiXmlElement* element) override; protected: ScalarListLookupTablePropertySerializer() {} - virtual ~ScalarListLookupTablePropertySerializer() {} + ~ScalarListLookupTablePropertySerializer() override {} }; namespace PropertyPersistenceSerialization { /** Serialization of a ScalarListLookupTableProperty into a XML string.*/ MITKMODELFIT_EXPORT ::std::string serializeScalarListLookupTablePropertyToXML(const mitk::BaseProperty *prop); } namespace PropertyPersistenceDeserialization { /**Deserialize a passed XML string into a ScalarListLookupTableProperty.*/ MITKMODELFIT_EXPORT mitk::BaseProperty::Pointer deserializeXMLToScalarListLookupTableProperty(const std::string &value); } } #endif // mitkScalarListLookupTablePropertySerializer_h diff --git a/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h index 93d18f07e8..1c50ccfe5e 100644 --- a/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h +++ b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h @@ -1,130 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SIMPLE_BARRIER_CONSTRAINT_CHECKER_H #define SIMPLE_BARRIER_CONSTRAINT_CHECKER_H #include "mitkConstraintCheckerBase.h" #include "MitkModelFitExports.h" namespace mitk { /** \class SimpleBarrierConstraintChecker * \brief This class implements constraints as simple barrier functions. * * SimpleBarrierConstraintChecker is used to check parameters against inequality * constraints realized as simple barrier functions.\n * Inequality constraints will be transformed to an inequality greater * or equal zero (c(x)>= 0). The BarrierSize indicates the size of the * region in front of the border of the legal value range. The barrier * function is modelled by log(c(x)/BarrierSize).\n * Example:\n * The given constraint is 500<= param_1. Its barriersize is 50, so * the barrier region is between 500 and 550.\n * The constraint will be transformed in 0 <= param_1 - 500. * The barrier function will 0 for any param_1 > 550 and * min(-log((param_1 - 500)/50), MaxConstraintPenalty) * for any other value of param_1.\n * If you have set a sum barrier, it will be checked against the value sum of the * specified parameters. */ class MITKMODELFIT_EXPORT SimpleBarrierConstraintChecker : public ConstraintCheckerBase { public: typedef SimpleBarrierConstraintChecker Self; typedef ConstraintCheckerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); typedef Superclass::PenaltyValueType PenaltyValueType; typedef Superclass::PenaltyArrayType PenaltyArrayType; typedef Superclass::SignalType SignalType; typedef Superclass::ParametersType ParametersType; typedef double BarrierValueType; typedef double BarrierWidthType; typedef ParametersType::SizeValueType ParameterIndexType; typedef std::vector ParameterIndexVectorType; struct Constraint { ParameterIndexVectorType parameters; BarrierValueType barrier; BarrierWidthType width; bool upperBarrier; Constraint(): barrier(0), width(0), upperBarrier(true) {}; }; - virtual PenaltyArrayType GetPenalties(const ParametersType& parameters) const override; + PenaltyArrayType GetPenalties(const ParametersType& parameters) const override; - virtual unsigned int GetNumberOfConstraints() const override; + unsigned int GetNumberOfConstraints() const override; - virtual PenaltyValueType GetFailedConstraintValue() const override; + PenaltyValueType GetFailedConstraintValue() const override; /** Sets a lower barrier for one parameter*/ void SetLowerBarrier(ParameterIndexType parameterID, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets an upper barrier for one parameter*/ void SetUpperBarrier(ParameterIndexType parameterID, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets a lower sum barrier for a set of parameter*/ void SetLowerSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier, BarrierWidthType width = 0.0); /** Sets an upper sum barrier for a set of parameter*/ void SetUpperSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier, BarrierWidthType width = 0.0); /*returns the constraint with the given index. @pre The index must exist.*/ Constraint& GetConstraint(unsigned int index); /*returns the constraint with the given index. @pre The index must exist.*/ const Constraint& GetConstraint(unsigned int index) const; /*removes a constraint. Indicated by the index. If the index does not exist, nothing will be removed and the state of the checker stays untouched.*/ void DeleteConstraint(unsigned int index); void ResetConstraints(); itkSetMacro(MaxConstraintPenalty, PenaltyValueType); itkGetConstMacro(MaxConstraintPenalty, PenaltyValueType); protected: typedef std::vector ConstraintVectorType; ConstraintVectorType m_Constraints; PenaltyValueType CalcPenalty(const ParametersType& parameters, const Constraint& constraint) const; SimpleBarrierConstraintChecker() : m_MaxConstraintPenalty(1e15) { } - ~SimpleBarrierConstraintChecker() {} + ~SimpleBarrierConstraintChecker() override {} private: PenaltyValueType m_MaxConstraintPenalty; }; } #endif // SimpleBarrierConstraintChecker_H diff --git a/Modules/ModelFit/include/mitkSimpleFunctorBase.h b/Modules/ModelFit/include/mitkSimpleFunctorBase.h index 5d12fec810..da29c2c3f3 100644 --- a/Modules/ModelFit/include/mitkSimpleFunctorBase.h +++ b/Modules/ModelFit/include/mitkSimpleFunctorBase.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SIMPLEFUNCTORBASE_H #define SIMPLEFUNCTORBASE_H #include #include #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /**Simple functor base class for the itkMultiOutputNaryFunctorImageFilter. */ class MITKMODELFIT_EXPORT SimpleFunctorBase: public ::itk::Object { public: typedef SimpleFunctorBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(SimpleFunctorBase, itk::Object); typedef ScalarType InputImagePixelType; typedef std::vector InputPixelVectorType; typedef std::vector OutputPixelVectorType; typedef itk::Array GridArrayType; virtual GridArrayType GetGrid() const = 0; virtual OutputPixelVectorType Compute(const InputPixelVectorType & value) const = 0; /** @todo #3 Function needs to be implemented in every derived Functor * The function is already declared here to ensure that derived models give feedback on how many output parameters they produce * This is requested by several generators */ virtual unsigned int GetNumberOfOutputs() const = 0; protected: SimpleFunctorBase(); - virtual ~SimpleFunctorBase(); + ~SimpleFunctorBase() override; }; } #endif // SIMPLEFUNCTORBASE_H diff --git a/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h index df9a201591..de6c65e3d6 100644 --- a/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #define SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #include #include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ class MITKMODELFIT_EXPORT SquaredDifferencesFitCostFunction : public mitk::MVModelFitCostFunction { public: typedef SquaredDifferencesFitCostFunction Self; typedef mitk::MVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; SquaredDifferencesFitCostFunction() { } - ~SquaredDifferencesFitCostFunction(){} + ~SquaredDifferencesFitCostFunction() override{} }; } #endif // SquaredDifferencesFitCostFunction_H diff --git a/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h index e40cb0450e..df5290a16a 100644 --- a/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h +++ b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #define SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H #include #include "MitkModelFitExports.h" namespace mitk { /** Multi valued model fit cost function that computes the squared differences between the model output and the * signal. */ class MITKMODELFIT_EXPORT SumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction { public: typedef SumOfSquaredDifferencesFitCostFunction Self; typedef mitk::SVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const; + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override; SumOfSquaredDifferencesFitCostFunction() { } - ~SumOfSquaredDifferencesFitCostFunction(){} + ~SumOfSquaredDifferencesFitCostFunction() override{} }; } #endif // SumOfSquaredDifferencesFitCostFunction_H diff --git a/Modules/ModelFit/include/mitkT2DecayModel.h b/Modules/ModelFit/include/mitkT2DecayModel.h index 47faefaf46..260d627972 100644 --- a/Modules/ModelFit/include/mitkT2DecayModel.h +++ b/Modules/ModelFit/include/mitkT2DecayModel.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_T2_DECAY_MODEL_H_ #define __MITK_T2_DECAY_MODEL_H_ #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Simple model of the MR T2 signal decay. */ class MITKMODELFIT_EXPORT T2DecayModel : public mitk::ModelBase { public: typedef T2DecayModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(T2DecayModel, ModelBase); - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual FunctionStringType GetFunctionString() const override; + FunctionStringType GetFunctionString() const override; - virtual std::string GetXName() const override; + std::string GetXName() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; + ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; protected: T2DecayModel() {}; - virtual ~T2DecayModel() {}; + ~T2DecayModel() override {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, - const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; + void SetStaticParameter(const ParameterNameType& name, + const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: //No copy constructor allowed T2DecayModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/ModelFit/include/mitkTestModel.h b/Modules/ModelFit/include/mitkTestModel.h index ac4abf2048..3cfbcd950f 100644 --- a/Modules/ModelFit/include/mitkTestModel.h +++ b/Modules/ModelFit/include/mitkTestModel.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_TEST_MODEL_H_ #define __MITK_TEST_MODEL_H_ #include "mitkModelBase.h" #include "MitkModelFitExports.h" namespace mitk { /**Simple (linear) test model that is used to check functionality of default implementations in factories and stuff.*/ class MITKMODELFIT_EXPORT TestModel : public mitk::ModelBase { public: typedef TestModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(TestModel, ModelBase); - virtual ParamterScaleMapType GetParameterScales() const override; + ParamterScaleMapType GetParameterScales() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual FunctionStringType GetFunctionString() const override; + FunctionStringType GetFunctionString() const override; - virtual std::string GetXName() const override; + std::string GetXName() const override; - virtual std::string GetXAxisName() const override; + std::string GetXAxisName() const override; - virtual std::string GetXAxisUnit() const override; + std::string GetXAxisUnit() const override; - virtual std::string GetYAxisName() const override; + std::string GetYAxisName() const override; - virtual std::string GetYAxisUnit() const override; + std::string GetYAxisUnit() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; + ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override; + ParametersSizeType GetNumberOfDerivedParameters() const override; protected: TestModel() {}; - virtual ~TestModel() {}; + ~TestModel() override {}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, - const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const + void SetStaticParameter(const ParameterNameType& name, + const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: //No copy constructor allowed TestModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/ModelFit/include/mitkTestModelFactory.h b/Modules/ModelFit/include/mitkTestModelFactory.h index 162c8d7512..7710b0ec43 100644 --- a/Modules/ModelFit/include/mitkTestModelFactory.h +++ b/Modules/ModelFit/include/mitkTestModelFactory.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __TEST_MODEL_FACTORY_H #define __TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkTestModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT TestModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacro(TestModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override; TestModelFactory(); - virtual ~TestModelFactory(); + ~TestModelFactory() override; private: //No copy constructor allowed TestModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h index bed752876c..6ce2a22e7d 100644 --- a/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h +++ b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h @@ -1,76 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __VALUE_BASED_PARAMETERIZATION_DELEGATE_H #define __VALUE_BASED_PARAMETERIZATION_DELEGATE_H #include #include #include "mitkInitialParameterizationDelegateBase.h" #include "MitkModelFitExports.h" namespace mitk { /** Parameterization delegate that always use parameters defined by the users. */ class MITKMODELFIT_EXPORT ValueBasedParameterizationDelegate : public InitialParameterizationDelegateBase { public: typedef ValueBasedParameterizationDelegate Self; typedef InitialParameterizationDelegateBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); itkTypeMacro(ValueBasedParameterizationDelegate, InitialParameterizationDelegateBase); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ParametersType ParametersType; typedef Superclass::IndexType IndexType; void SetInitialParameterization(ParametersType params); /** Returns the parameterization (e.g. initial parametrization for fitting) that should be used. If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return the result of GetInitialParameterization().*/ - virtual ParametersType GetInitialParameterization() const; - virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const; + ParametersType GetInitialParameterization() const override; + ParametersType GetInitialParameterization(const IndexType& currentPosition) const override; protected: ParametersType m_Parameterization; ValueBasedParameterizationDelegate(); - virtual ~ValueBasedParameterizationDelegate(); + ~ValueBasedParameterizationDelegate() override; private: //No copy constructor allowed ValueBasedParameterizationDelegate(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp b/Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp index f4c9251178..e5901acddc 100644 --- a/Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp +++ b/Modules/ModelFit/test/mitkMVConstrainedCostFunctionDecoratorTest.cpp @@ -1,157 +1,157 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include "mitkTestingMacros.h" #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkMVConstrainedCostFunctionDecorator.h" #include "mitkLinearModel.h" class TestCostFunction : public mitk::MVModelFitCostFunction { public: typedef TestCostFunction Self; typedef mitk::MVModelFitCostFunction Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkNewMacro(Self); typedef Superclass::SignalType SignalType; mutable unsigned int m_calls; protected: - virtual MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const + MeasureType CalcMeasure(const ParametersType ¶meters, const SignalType& signal) const override { MeasureType result = signal; result[0] = parameters[0]; result[1] = parameters[1]; ++m_calls; return result; }; TestCostFunction() { m_calls = 0; } - ~TestCostFunction(){} + ~TestCostFunction() override{} }; int mitkMVConstrainedCostFunctionDecoratorTest(int /*argc*/, char*[] /*argv[]*/) { MITK_TEST_BEGIN("mitkMVConstrainedCostFunctionDecoratorTest") mitk::SimpleBarrierConstraintChecker::Pointer checker = mitk::SimpleBarrierConstraintChecker::New(); mitk::MVConstrainedCostFunctionDecorator::Pointer decorator = mitk::MVConstrainedCostFunctionDecorator::New(); TestCostFunction::Pointer innerCF = TestCostFunction::New(); mitk::LinearModel::Pointer model = mitk::LinearModel::New(); decorator->SetModel(model); innerCF->SetModel(model); mitk::MVModelFitCostFunction::SignalType signal(5); signal.Fill(0.0); decorator->SetSample(signal); innerCF->SetSample(signal); mitk::LinearModel::TimeGridType grid(5); grid[0] = 0; grid[1] = 1; grid[2] = 2; grid[3] = 3; grid[4] = 4; model->SetTimeGrid(grid); mitk::SimpleBarrierConstraintChecker::ParametersType p1(2); p1[0] = 0; p1[1] = 50; mitk::SimpleBarrierConstraintChecker::ParametersType p2(2); p2[0] = 10; p2[1] = 50; mitk::SimpleBarrierConstraintChecker::ParametersType p3(2); p3[0] = 100; p3[1] = 50; mitk::SimpleBarrierConstraintChecker::ParametersType p4(2); p4[0] = 2; p4[1] = 50; checker->SetLowerBarrier(0,1,4); checker->SetUpperBarrier(0,100); double defaultMaxPenalty = 1e15; /////////////////////// //Tests //check freshly created checker; MITK_TEST_CONDITION_REQUIRED(decorator->GetWrappedCostFunction() == NULL, "Testing GetWrappedCostFunction for new decorator."); MITK_TEST_CONDITION_REQUIRED(decorator->GetConstraintChecker() == NULL, "Testing GetWrappedCostFunction for new decorator."); MITK_TEST_CONDITION_REQUIRED(decorator->GetFailureThreshold() == defaultMaxPenalty, "Testing GetWrappedCostFunction for new decorator."); MITK_TEST_FOR_EXCEPTION(mitk::Exception, decorator->GetValue(p1)); decorator->SetWrappedCostFunction(innerCF); MITK_TEST_FOR_EXCEPTION(mitk::Exception, decorator->GetValue(p1)); decorator->SetWrappedCostFunction(NULL); decorator->SetConstraintChecker(checker); MITK_TEST_FOR_EXCEPTION(mitk::Exception, decorator->GetValue(p1)); decorator->SetWrappedCostFunction(innerCF); mitk::MVModelFitCostFunction::MeasureType measure = decorator->GetValue(p1); MITK_TEST_CONDITION_REQUIRED(measure[0] == defaultMaxPenalty, "Testing measure 1 with parameters p1."); MITK_TEST_CONDITION_REQUIRED(measure[1] == defaultMaxPenalty, "Testing measure 2 with parameters p1."); MITK_TEST_CONDITION_REQUIRED(measure[2] == defaultMaxPenalty, "Testing measure 3 with parameters p1."); MITK_TEST_CONDITION_REQUIRED(measure[3] == defaultMaxPenalty, "Testing measure 3 with parameters p1."); MITK_TEST_CONDITION_REQUIRED(measure[4] == defaultMaxPenalty, "Testing measure 3 with parameters p1."); MITK_TEST_CONDITION_REQUIRED(innerCF->m_calls == 0, "Checking calls with parameters p1."); measure = decorator->GetValue(p2); MITK_TEST_CONDITION_REQUIRED(measure[0] == 10, "Testing measure 1 with parameters p2."); MITK_TEST_CONDITION_REQUIRED(measure[1] == 50, "Testing measure 2 with parameters p2."); MITK_TEST_CONDITION_REQUIRED(measure[2] == 70, "Testing measure 3 with parameters p2."); MITK_TEST_CONDITION_REQUIRED(innerCF->m_calls == 1, "Checking calls with parameters p2."); measure = decorator->GetValue(p3); MITK_TEST_CONDITION_REQUIRED(measure[0] == defaultMaxPenalty, "Testing measure 1 with parameters p3."); MITK_TEST_CONDITION_REQUIRED(measure[1] == defaultMaxPenalty, "Testing measure 2 with parameters p3."); MITK_TEST_CONDITION_REQUIRED(measure[2] == defaultMaxPenalty, "Testing measure 3 with parameters p3."); MITK_TEST_CONDITION_REQUIRED(innerCF->m_calls == 1, "Checking calls with parameters p3."); decorator->SetActivateFailureThreshold(false); measure = decorator->GetValue(p3); MITK_TEST_CONDITION_REQUIRED(measure[0] == 100+defaultMaxPenalty, "Testing measure 1 with parameters p3 (deactiveated threshold)."); MITK_TEST_CONDITION_REQUIRED(measure[1] == 50+defaultMaxPenalty, "Testing measure 2 with parameters p3 (deactiveated threshold)."); MITK_TEST_CONDITION_REQUIRED(measure[2] == 250+defaultMaxPenalty, "Testing measure 3 with parameters p3 (deactiveated threshold)."); MITK_TEST_CONDITION_REQUIRED(innerCF->m_calls ==2, "Checking calls with parameters p3 (deactiveated threshold)."); decorator->SetActivateFailureThreshold(true); measure = decorator->GetValue(p4); MITK_TEST_CONDITION_REQUIRED(measure[0] == 2+(-1*log(1/4.)), "Testing measure 1 with parameters p4."); MITK_TEST_CONDITION_REQUIRED(measure[1] == 50+(-1*log(1/4.)), "Testing measure 2 with parameters p4."); MITK_TEST_CONDITION_REQUIRED(measure[2] == 54+(-1*log(1/4.)), "Testing measure 3 with parameters p4."); MITK_TEST_CONDITION_REQUIRED(innerCF->m_calls == 3, "Checking calls with parameters p4."); MITK_TEST_END() } diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h b/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h index 9808c6e333..63416521ed 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkFitParameterModel_h #define QmitkFitParameterModel_h #include #include "mitkModelFitInfo.h" #include "mitkPointSet.h" #include "MitkModelFitUIExports.h" /*! \class QmitkFitParameterModel Model that can be used to display the parameter values of ModelFitInfo instances for different world coordinate positions. If more then one ModelFitInfo instance is given the model will use a tree hirarchy. The first level are the fits, the seconds level are the parameter of the fit. */ class MITKMODELFITUI_EXPORT QmitkFitParameterModel : public QAbstractTableModel { Q_OBJECT public: using FitVectorType = std::vector; QmitkFitParameterModel(QObject* parent = NULL); - virtual ~QmitkFitParameterModel() {}; + ~QmitkFitParameterModel() override {}; const FitVectorType& getFits() const; mitk::Point3D getCurrentPosition() const; const mitk::PointSet* getPositionBookmarks() const; - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex& index) const override; + QVariant data(const QModelIndex& index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; public Q_SLOTS: void setFits(const FitVectorType& fits); void setCurrentPosition(const mitk::Point3D& currentPos); void setPositionBookmarks(const mitk::PointSet* bookmarks); protected: std::size_t getBookmarksCount() const; private: bool hasSingleFit() const; FitVectorType m_Fits; mitk::PointSet::ConstPointer m_Bookmarks; mitk::Point3D m_CurrentPos; }; #endif // QmitkFitParameterModel_h diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h b/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h index 8584c08110..8eb1ae9cd0 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_FIT_PARAMETER_WIDGET_H #define QMITK_FIT_PARAMETER_WIDGET_H #include "mitkModelFitInfo.h" #include "mitkPointSet.h" #include "MitkModelFitUIExports.h" #include "ui_QmitkFitParameterWidget.h" #include class QmitkFitParameterModel; /** * \class QmitkFitParameterWidget * Widget that displays the parameters of all set ModelFitInfo instances for all given * world coordinate points. * In addition it allows to transfer this information as CSV into the clipboard or a file. */ class MITKMODELFITUI_EXPORT QmitkFitParameterWidget : public QWidget { Q_OBJECT public: using FitVectorType = std::vector; QmitkFitParameterWidget(QWidget* parent = 0); - ~QmitkFitParameterWidget(); + ~QmitkFitParameterWidget() override; const FitVectorType& getFits() const; mitk::Point3D getCurrentPosition() const; const mitk::PointSet* getPositionBookmarks() const; public Q_SLOTS: void setFits(const FitVectorType& fits); void setCurrentPosition(const mitk::Point3D& currentPos); void setPositionBookmarks(const mitk::PointSet* bookmarks); protected Q_SLOTS: void OnExportClicked() const; /** @brief Saves the results table to clipboard */ void OnClipboardResultsButtonClicked() const; protected: std::string streamModelToString() const; QmitkFitParameterModel * m_InternalModel; Ui::QmitkFitParameterWidget m_Controls; }; /** Helper function to sanatize strings before used in a csv export Moved to header in order to be reusabel for other ModelFitUI widgets.*/ std::string SanatizeString(std::string str); #endif // QmitkFitParameterWidget_H diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h index 80d22308c1..c6f5e87f8c 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkFitPlotDataModel_h #define QmitkFitPlotDataModel_h #include #include "mitkModelFitPlotDataHelper.h" #include "MitkModelFitUIExports.h" /*! \class QmitkFitPlotDataModel Model that can be used to display the values of an ModelFitPlotData instance. */ class MITKMODELFITUI_EXPORT QmitkFitPlotDataModel : public QAbstractTableModel { Q_OBJECT public: using FitVectorType = std::vector; QmitkFitPlotDataModel(QObject* parent = NULL); - virtual ~QmitkFitPlotDataModel() {}; + ~QmitkFitPlotDataModel() override {}; const mitk::ModelFitPlotData* GetPlotData() const; const std::string& GetXName() const; - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex& index) const override; + QVariant data(const QModelIndex& index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; public Q_SLOTS: void SetPlotData(const mitk::ModelFitPlotData* data); void SetXName(const std::string& xName); protected: std::pair GetCurveByColumn(int col) const; std::pair GetPositionalCurvePoint(const mitk::PlotDataCurve*) const; private: mitk::ModelFitPlotData m_PlotData; std::string m_XName; }; #endif // QmitkFitPlotDataModel_h diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h index 410b1764ca..94cf7c9ecc 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_FIT_PLOT_DATA_WIDGET_H #define QMITK_FIT_PLOT_DATA_WIDGET_H #include "mitkModelFitPlotDataHelper.h" #include "MitkModelFitUIExports.h" #include "ui_QmitkFitPlotDataWidget.h" #include #include class QmitkFitPlotDataModel; /** * \class QmitkFitPlotDataWidget * Widget that displays the content of a ModelFitPlotData instance. * In addition it allows to transfer this information as CSV into the clipboard or a file. */ class MITKMODELFITUI_EXPORT QmitkFitPlotDataWidget : public QWidget { Q_OBJECT public: using FitVectorType = std::vector; QmitkFitPlotDataWidget(QWidget* parent = 0); - ~QmitkFitPlotDataWidget(); + ~QmitkFitPlotDataWidget() override; const mitk::ModelFitPlotData* GetPlotData() const; const std::string& GetXName() const; public Q_SLOTS: void SetPlotData(const mitk::ModelFitPlotData* data); void SetXName(const std::string& xName); protected Q_SLOTS: void OnExportClicked() const; /** @brief Saves the results table to clipboard */ void OnClipboardResultsButtonClicked() const; protected: std::string StreamModelToString() const; QmitkFitPlotDataModel * m_InternalModel; Ui::QmitkFitPlotDataWidget m_Controls; }; #endif // QmitkFitPlotDataWidget_H diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h index 0016eacecc..0b9372389a 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesDelegate.h @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesDelegate_h #define QmitkInitialValuesDelegate_h /// Toolkit includes. #include #include #include #include "MitkModelFitUIExports.h" /** \class QmitkInitialValuesDelegate \brief An item delegate for rendering and editing the initial value (source) for a parameter. The delegate assumes the following: 1) the data requested with the edit role, will be an double if it is an simple scalar type. If the type is image, it will be a pointer to the currently selected data node. If nothing is selected now it will be a nullptr.*/ class MITKMODELFITUI_EXPORT QmitkInitialValuesDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkInitialValuesDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option - , const QModelIndex& index) const; + , const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; void setDataStorage(mitk::DataStorage* storage); void setNodePredicate(mitk::NodePredicateBase* predicate); protected: int valueType(const QModelIndex& index) const; /**Storage is used as source for potantial initial value images.*/ mitk::DataStorage::Pointer m_Storage; /**Predicates that is used to filter for potential/allowed images in the data storage*/ mitk::NodePredicateBase::Pointer m_Predicate; }; #endif diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h index fc2c2c813d..c094b30276 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_INITIAL_VALUES_MANAGER_WIDGET_H #define QMITK_INITIAL_VALUES_MANAGER_WIDGET_H #include "MitkModelFitUIExports.h" #include "ui_QmitkInitialValuesManagerWidget.h" #include #include "mitkModelTraitsInterface.h" #include "mitkInitialParameterizationDelegateBase.h" /*forward declarations*/ class QmitkInitialValuesModel; class QmitkInitialValuesTypeDelegate; class QmitkInitialValuesDelegate; namespace mitk { class DataStorage; class BaseGeometry; } /** * \class QmitkInitialValuesManagerWidget * \brief Widget that allows to edit the initial values of an model. */ class MITKMODELFITUI_EXPORT QmitkInitialValuesManagerWidget : public QWidget { Q_OBJECT public: QmitkInitialValuesManagerWidget(QWidget* parent = 0); - ~QmitkInitialValuesManagerWidget(); + ~QmitkInitialValuesManagerWidget() override; /** Returns the current set initial values of the model.*/ mitk::ModelTraitsInterface::ParametersType getInitialValues() const; mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const; bool hasValidInitialValues() const; signals: void initialValuesChanged(); public Q_SLOTS: /** Sets the names and the values of the initial parameter set for the model. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model and its parameter values. @values Default values to start with.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names, const mitk::ModelTraitsInterface::ParametersType values); void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names); void setDataStorage(mitk::DataStorage* storage); void setReferenceImageGeometry(mitk::BaseGeometry* refgeo); protected: QmitkInitialValuesModel* m_InternalModel; QmitkInitialValuesTypeDelegate* m_TypeDelegate; QmitkInitialValuesDelegate* m_ValuesDelegate; Ui::QmitkInitialValuesManagerWidget m_Controls; protected Q_SLOTS: void OnModelReset(); }; #endif // QmitkInitialValuesManagerWidget_H diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h index a7f2440c74..7e93702150 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesModel_h #define QmitkInitialValuesModel_h #include #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkModelTraitsInterface.h" #include "mitkDataNode.h" #include "mitkInitialParameterizationDelegateBase.h" #include "MitkModelFitUIExports.h" /*! \class QmitkInitialValuesModel Model that handles the definition of inital model values. */ class MITKMODELFITUI_EXPORT QmitkInitialValuesModel : public QAbstractTableModel { Q_OBJECT public: QmitkInitialValuesModel(QObject* parent = NULL); - virtual ~QmitkInitialValuesModel() {}; + ~QmitkInitialValuesModel() override {}; /** Sets the names and the values of the initial parameter set for the model. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model and its parameter values. @values Default values to start with.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names, const mitk::ModelTraitsInterface::ParametersType values); /**@overload Convinience method that sets the default initial values always to zero.*/ void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names); /** Adds an image as a source for the initial value of a parameter. * @param node Pointer to the image that is the value source. * @param paramIndex Indicates which parameter is defined by the source image. * It equals the position of the vector defined by setInitialValues(). * @remark setting an image for an index overwrites the value for this index set by * SetInitialParameterization. * @pre paramIndex must be in bound of the initial parametrization vector. * @pre node must be a valid image instance*/ void addInitialParameterImage(const mitk::DataNode* node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex); bool hasValidInitialValues() const; void resetInitialParameterImage(); /** Returns a pointer to a delegate instance that represents the parameterization of the model.*/ mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const; /** Returns the current set initial values of the model. * @Remark: this are only the simpel scalar initial values. If an source image was set, this is missed here. * Use getInitialParametrizationDelegate() to get everything at once.*/ mitk::ModelTraitsInterface::ParametersType getInitialValues() const; - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex& index) const override; + QVariant data(const QModelIndex& index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; /**Indicates if the content of the model was modified since the data was set via setInitialValues()*/ bool isModified(); private: int valueType(const QModelIndex& index) const; mitk::ModelTraitsInterface::ParametersType m_Values; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; typedef std::map ImageMapType; ImageMapType m_ParameterImageMap; /** Indicates if the data of the model was modified, since the model was set. */ bool m_modified; }; #endif // QmitkInitialValuesModel_h diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h index 29850b7bb8..934b876f58 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesTypeDelegate.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkInitialValuesTypeDelegate_h #define QmitkInitialValuesTypeDelegate_h #include #include "MitkModelFitUIExports.h" /** \class QmitkInitialValuesTypeDelegate \brief An item delegate for rendering and editing the type of a initial value. It assumes that the type is encoded as int. 0: simple scalar, 1: image.*/ class MITKMODELFITUI_EXPORT QmitkInitialValuesTypeDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkInitialValuesTypeDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option - , const QModelIndex& index) const; + , const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; }; #endif diff --git a/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h b/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h index e1ef9c6326..fbce8969af 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_INSPECTION_POSITION_WIDGET_H #define QMITK_INSPECTION_POSITION_WIDGET_H #include "mitkModelFitInfo.h" #include "mitkPointSet.h" #include "MitkModelFitUIExports.h" #include "ui_QmitkInspectionPositionWidget.h" #include class QmitkFitParameterModel; /** * \class QmitkInspectionPositionWidget * \brief Widget that allows manage the positions that should be used to inspect fits. */ class MITKMODELFITUI_EXPORT QmitkInspectionPositionWidget : public QWidget { Q_OBJECT public: using FitVectorType = std::vector; QmitkInspectionPositionWidget(QWidget* parent = 0); - ~QmitkInspectionPositionWidget(); + ~QmitkInspectionPositionWidget() override; mitk::Point3D GetCurrentPosition() const; const mitk::PointSet* GetPositionBookmarks() const; /** @brief assign a point set (contained in a node of DataStorage) for observation */ void SetPositionBookmarkNode(mitk::DataNode *newNode); mitk::DataNode *GetPositionBookmarkNode(); public Q_SLOTS: void SetCurrentPosition(const mitk::Point3D& currentPos); void OnPointListChanged(); void OnAddCurrentPositionClicked(); Q_SIGNALS: /** Is emitted as soon as the position bookmarks changed.*/ void PositionBookmarksChanged(); protected: mitk::Point3D m_CurrentPosition; Ui::QmitkInspectionPositionWidget m_Controls; }; #endif // QmitkInspectionPositionWidget_H diff --git a/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h index 17dda9b0fe..b4dc74fea8 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h +++ b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h @@ -1,84 +1,84 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Software Development for Integrated Diagnostic and Therapy. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H #define __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H //QT #include #include //MITK #include #include #include #include // ITK #include #include "MitkModelFitUIExports.h" class MITKMODELFITUI_EXPORT ParameterFitBackgroundJob : public QObject, public QRunnable { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: ParameterFitBackgroundJob(mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitInfo, mitk::DataNode* parentNode = NULL); /** */ ParameterFitBackgroundJob(mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitInfo, mitk::DataNode* parentNode, mitk::modelFit::ModelFitResultNodeVectorType additionalRelevantNodes); - ~ParameterFitBackgroundJob(); + ~ParameterFitBackgroundJob() override; - void run(); + void run() override; /**Returns the node (if defined), that is the parent object for the results of the job. May be null.*/ mitk::DataNode* GetParentNode() const; mitk::modelFit::ModelFitResultNodeVectorType GetAdditionalRelevantNodes() const; signals: void Finished(); void Error(QString err); void ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType resultMap, const ParameterFitBackgroundJob* pJob); void JobProgress(double progress); void JobStatusChanged(QString info); protected: //Inputs mitk::ParameterFitImageGeneratorBase::Pointer m_Generator; mitk::modelFit::ModelFitInfo::ConstPointer m_ModelFitInfo; mitk::DataNode::Pointer m_ParentNode; mitk::modelFit::ModelFitResultNodeVectorType m_AdditionalRelevantNodes; // Results mitk::modelFit::ModelFitResultNodeVectorType m_Results; ::itk::MemberCommand::Pointer m_spCommand; unsigned long m_ObserverID; void OnFitEvent(::itk::Object *, const itk::EventObject &event); }; #endif diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h index 4f079d7a28..8f61c64953 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H #define QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H #include "MitkModelFitUIExports.h" #include "ui_QmitkSimpleBarrierManagerWidget.h" #include #include "mitkSimpleBarrierConstraintChecker.h" /*forward declarations*/ class QmitkSimpleBarrierParametersDelegate; class QmitkSimpleBarrierTypeDelegate; class QmitkSimpleBarrierModel; /** * \class QmitkSimpleBarrierManagerWidget * \brief Widget that allows to edit the constraints of SimpleBarrierConstraintChecker. */ class MITKMODELFITUI_EXPORT QmitkSimpleBarrierManagerWidget : public QWidget { Q_OBJECT public: QmitkSimpleBarrierManagerWidget(QWidget* parent = 0); - ~QmitkSimpleBarrierManagerWidget(); + ~QmitkSimpleBarrierManagerWidget() override; signals: void ConstraintChanged(mitk::SimpleBarrierConstraintChecker::Constraint constraint); public Q_SLOTS: /** Sets the data handled by the model and resets the modified flag @param pChecker Pointer to the checker instance that should be managed. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model.*/ void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker, const mitk::ModelTraitsInterface::ParameterNamesType& names); protected Q_SLOTS: void OnShowContextMenuIsoSet(const QPoint& pos); void OnAddConstraint(bool checked); void OnDelConstraint(bool checked); protected: /** * \brief Updates the widget according to its current settings. */ void update(); mitk::SimpleBarrierConstraintChecker::Pointer m_Checker; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; QmitkSimpleBarrierModel* m_InternalModel; QmitkSimpleBarrierTypeDelegate* m_TypeDelegate; QmitkSimpleBarrierParametersDelegate* m_ParametersDelegate; bool m_InternalUpdate; Ui::QmitkSimpleBarrierManagerWidget m_Controls; }; #endif // QmitkSimpleBarrierManagerWidget_H diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h index 8ba77c9dff..198e075d07 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierModel_h #define QmitkSimpleBarrierModel_h #include #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkModelTraitsInterface.h" #include "MitkModelFitUIExports.h" /*! \class QmitkSimpleBarrierModel Model that handles a SimpleBarrierConstraintChecker and his defined constraints. It allows to couple a SimpleBarrierConstraintChecker with a Qt table view in Order to view and edit its contents. E.g. used in the QmitkSimpleBarrierManagerWidget. */ class MITKMODELFITUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel { Q_OBJECT public: QmitkSimpleBarrierModel(QObject* parent = NULL); - virtual ~QmitkSimpleBarrierModel() {}; + ~QmitkSimpleBarrierModel() override {}; /** Sets the data handled by the model and resets the modified flag @param pChecker Pointer to the checker instance that should be managed. @param names List of all possible parameter names. It is assumed that the index of the list equals the parameter index in the respective fitting model.*/ void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker, const mitk::ModelTraitsInterface::ParameterNamesType& names); - virtual Qt::ItemFlags flags(const QModelIndex& index) const; - virtual QVariant data(const QModelIndex& index, int role) const; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; - virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole); + Qt::ItemFlags flags(const QModelIndex& index) const override; + QVariant data(const QModelIndex& index, int role) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; + bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override; void addConstraint(); void deleteConstraint(const QModelIndex& index); /**Indicates if the content of the model was modified since the data was set via setChecker()*/ bool isModified(); private: mitk::SimpleBarrierConstraintChecker::Pointer m_Checker; mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames; /** Indicates if the data of the model was modified, since the model was set. */ bool m_modified; }; #endif // QmitkSimpleBarrierModel_h diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h index 8489fbd412..98b00d49a1 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierParametersDelegate.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierParametersDelegate_h #define QmitkSimpleBarrierParametersDelegate_h /// Toolkit includes. #include #include "MitkModelFitUIExports.h" /** \class QmitkSimpleBarrierParametersDelegate \brief An item delegate for rendering and editing the parameters relevant for a barrier constraint. The delegate assumes the following: 1) if the data is requested with the edit role, it gets a string list of all possible options. 2) if the data is requested with the display role it gets only a list of all currently selected options. If the data is transfered back to the model it contains all selected parameter names in a string list.*/ class MITKMODELFITUI_EXPORT QmitkSimpleBarrierParametersDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkSimpleBarrierParametersDelegate(QObject* parent = 0); void paint(QPainter* painter, const QStyleOptionViewItem& option - , const QModelIndex& index) const; + , const QModelIndex& index) const override; QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option - , const QModelIndex& index) const; + , const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; }; #endif diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h index 8bab74cee0..92e8e5d5d8 100644 --- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h +++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierTypeDelegate.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSimpleBarrierTypeDelegate_h #define QmitkSimpleBarrierTypeDelegate_h #include #include "MitkModelFitUIExports.h" /** \class QmitkSimpleBarrierTypeDelegate \brief An item delegate for rendering and editing the type of a simple barrier constraint. It assumes that the type is encoded as int. 0: lower border, 1: upper border.*/ class MITKMODELFITUI_EXPORT QmitkSimpleBarrierTypeDelegate : public QStyledItemDelegate { Q_OBJECT public: QmitkSimpleBarrierTypeDelegate(QObject* parent = 0); QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option - , const QModelIndex& index) const; + , const QModelIndex& index) const override; - void setEditorData(QWidget* editor, const QModelIndex& index) const; + void setEditorData(QWidget* editor, const QModelIndex& index) const override; - void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const; + void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override; }; #endif diff --git a/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp b/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp index e4db2e7682..0c503b5eaf 100644 --- a/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp +++ b/Modules/Pharmacokinetics/autoload/Models/mitkPharmacokineticModelsActivator.cpp @@ -1,84 +1,84 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include //MR perfusion models #include "mitkDescriptivePharmacokineticBrixModelFactory.h" #include "mitkExtendedToftsModelFactory.h" #include "mitkStandardToftsModelFactory.h" #include "mitkTwoCompartmentExchangeModelFactory.h" #include "mitkNumericTwoCompartmentExchangeModelFactory.h" //PET perfusion models #include "mitkOneTissueCompartmentModelFactory.h" #include "mitkExtendedOneTissueCompartmentModelFactory.h" #include "mitkTwoTissueCompartmentModelFactory.h" #include "mitkTwoTissueCompartmentFDGModelFactory.h" #include "mitkNumericTwoTissueCompartmentModelFactory.h" //general models #include "mitkThreeStepLinearModelFactory.h" namespace mitk { /* * This is the module activator for the IO aspects of the "pharmacokinetics" module. */ class PharmacokineticModelsActivator : public us::ModuleActivator { public: template void RegisterProvider(us::ModuleContext* context) { auto provider = new TProvider(); provider->RegisterService(context); m_RegisteredProviders.push_back(std::unique_ptr(provider)); } - virtual void Load(us::ModuleContext* context) override + void Load(us::ModuleContext* context) override { m_RegisteredProviders.clear(); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); RegisterProvider >(context); } - virtual void Unload(us::ModuleContext* ) override + void Unload(us::ModuleContext* ) override { } private: std::vector > m_RegisteredProviders; }; } US_EXPORT_MODULE_ACTIVATOR(mitk::PharmacokineticModelsActivator) diff --git a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h index 1f9119f189..0e01330a48 100644 --- a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h +++ b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h @@ -1,118 +1,118 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef AIFBASEDMODELBASE_H #define AIFBASEDMODELBASE_H #include "MitkPharmacokineticsExports.h" #include "mitkModelBase.h" #include "itkArray2D.h" namespace mitk { /** \class AIFBasedModelBase * \brief Base Class for all physiological perfusion models using an Aterial Input Function * All AIF based models come with an array of AIF values and the corresponding TimeGrid ( AIF(t)) * This class provides functions for setting the AIF Values and optionally a specific AIF TimeGrid. * It also provides a method for interpolation of the AIF source array to a specified Timegrid that differs from * AIFTimeGrid. The AIF must be set with an itk::Array. If no AIFTimeGrid is specified with the Setter, it is assumed * that the AIFTimeGrid is the same as the ModelTimegrid (e.g. AIF is derived from data set to be fitted). In this * case, AIFvalues must have the same length as ModelTimeGrid, otherwise an exception is generated*/ class MITKPHARMACOKINETICS_EXPORT AIFBasedModelBase : public mitk::ModelBase { public: typedef AIFBasedModelBase Self; typedef ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Run-time type information (and related methods). */ itkTypeMacro(PhysiologciModelBase, AIFBasedModelBase); static const std::string NAME_STATIC_PARAMETER_AIF; static const std::string NAME_STATIC_PARAMETER_AIFTimeGrid; static const std::string UNIT_STATIC_PARAMETER_AIF; static const std::string UNIT_STATIC_PARAMETER_AIFTimeGrid; /** Typedef for Aterial InputFunction AIF(t)*/ typedef itk::Array AterialInputFunctionType; itkGetConstReferenceMacro(AterialInputFunctionValues, AterialInputFunctionType); itkGetConstReferenceMacro(AterialInputFunctionTimeGrid, TimeGridType); itkSetMacro(AterialInputFunctionValues, AterialInputFunctionType); itkSetMacro(AterialInputFunctionTimeGrid, TimeGridType); - virtual std::string GetXAxisName() const override; + std::string GetXAxisName() const override; - virtual std::string GetXAxisUnit() const override; + std::string GetXAxisUnit() const override; - virtual std::string GetYAxisName() const override; + std::string GetYAxisName() const override; - virtual std::string GetYAxisUnit() const override; + std::string GetYAxisUnit() const override; /** Returns the TimeGrid used for the AIF. Either the externally set AIF time grid * or the time grid of the model if nothing is set.*/ const TimeGridType& GetCurrentAterialInputFunctionTimeGrid() const; /** Returns the Aterial Input function matching currentTimeGrid * The original values are interpolated to the passed TimeGrid * if currentTimeGrid.Size() = 0 , the Original AIF will be returned*/ const AterialInputFunctionType GetAterialInputFunction(TimeGridType currentTimeGrid) const; - virtual ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; - virtual ParamterUnitMapType GetStaticParameterUnits() const override; + ParameterNamesType GetStaticParameterNames() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; + ParamterUnitMapType GetStaticParameterUnits() const override; protected: AIFBasedModelBase(); - virtual ~AIFBasedModelBase(); + ~AIFBasedModelBase() override; /** Reimplementation that checks if AIF and timegrid settings are valid. * @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the * exception comment. * @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/ - virtual bool ValidateModel(std::string& error) const override; + bool ValidateModel(std::string& error) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; - virtual void SetStaticParameter(const ParameterNameType& name, + void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) override; - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; TimeGridType m_AterialInputFunctionTimeGrid; AterialInputFunctionType m_AterialInputFunctionValues; private: //No copy constructor allowed AIFBasedModelBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // AIFBASEDMODELBASE_H diff --git a/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h b/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h index c6599b9f7f..0f843b2ebc 100644 --- a/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h +++ b/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h @@ -1,96 +1,96 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __AIFBASED_MODEL_PARAMETERIZER_BASE_H #define __AIFBASED_MODEL_PARAMETERIZER_BASE_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkAIFParametrizerHelper.h" #include "mitkAIFBasedModelBase.h" namespace mitk { /** Base class for model parameterizers for Models using an Aterial Input Function */ template class MITKPHARMACOKINETICS_EXPORT AIFBasedModelParameterizerBase : public ConcreteModelParameterizerBase { public: typedef AIFBasedModelParameterizerBase Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(AIFBasedModelParameterizerBase, ConcreteModelParameterizerBase); typedef typename Superclass::ModelBaseType ModelBaseType; typedef typename Superclass::ModelBasePointer ModelBasePointer; typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelPointer ModelPointer; typedef typename Superclass::StaticParameterValueType StaticParameterValueType; typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType; typedef typename Superclass::StaticParameterMapType StaticParameterMapType; typedef typename Superclass::IndexType IndexType; itkSetMacro(AIF, mitk::AIFBasedModelBase::AterialInputFunctionType); itkGetConstReferenceMacro(AIF, mitk::AIFBasedModelBase::AterialInputFunctionType); itkSetMacro(AIFTimeGrid, mitk::ModelBase::TimeGridType); itkGetConstReferenceMacro(AIFTimeGrid, mitk::ModelBase::TimeGridType); /** Returns the global static parameters for the model. * @remark this default implementation assumes only AIF and its timegrid as static parameters. * Reimplement in derived classes to change this behavior.*/ - virtual StaticParameterMapType GetGlobalStaticParameters() const + StaticParameterMapType GetGlobalStaticParameters() const override { StaticParameterMapType result; StaticParameterValuesType valuesAIF = mitk::convertArrayToParameter(this->m_AIF); StaticParameterValuesType valuesAIFGrid = mitk::convertArrayToParameter(this->m_AIFTimeGrid); result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIF, valuesAIF)); result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid, valuesAIFGrid)); return result; }; protected: AIFBasedModelParameterizerBase() {}; - virtual ~AIFBasedModelParameterizerBase() + ~AIFBasedModelParameterizerBase() override {}; mitk::AIFBasedModelBase::AterialInputFunctionType m_AIF; mitk::ModelBase::TimeGridType m_AIFTimeGrid; private: //No copy constructor allowed AIFBasedModelParameterizerBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __AIFBASED_MODEL_PARAMETERIZER_BASE_H diff --git a/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h index e9de05ad23..5967386baa 100644 --- a/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h +++ b/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h @@ -1,33 +1,33 @@ #ifndef MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H #define MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H #include "mitkCurveDescriptionParameterBase.h" namespace mitk { /** Description parameter that computes the area under the curve */ class MITKPHARMACOKINETICS_EXPORT AreaUnderFirstMomentDescriptionParameter : public mitk::CurveDescriptionParameterBase { public: typedef mitk::AreaUnderFirstMomentDescriptionParameter Self; typedef CurveDescriptionParameterBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkCloneMacro(Self); - virtual DescriptionParameterNamesType GetDescriptionParameterName() const override; + DescriptionParameterNamesType GetDescriptionParameterName() const override; protected: static const std::string PARAMETER_NAME; AreaUnderFirstMomentDescriptionParameter(); - virtual ~AreaUnderFirstMomentDescriptionParameter(); + ~AreaUnderFirstMomentDescriptionParameter() override; - virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; + DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; }; } #endif // MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H diff --git a/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h index f4e58f4e70..14f0198624 100644 --- a/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h +++ b/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H #define MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H #include "mitkCurveDescriptionParameterBase.h" namespace mitk { /** Description parameter that computes the area under the curve */ class MITKPHARMACOKINETICS_EXPORT AreaUnderTheCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase { public: typedef mitk::AreaUnderTheCurveDescriptionParameter Self; typedef CurveDescriptionParameterBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkCloneMacro(Self); - virtual DescriptionParameterNamesType GetDescriptionParameterName() const override; + DescriptionParameterNamesType GetDescriptionParameterName() const override; protected: static const std::string PARAMETER_NAME; AreaUnderTheCurveDescriptionParameter(); - virtual ~AreaUnderTheCurveDescriptionParameter(); + ~AreaUnderTheCurveDescriptionParameter() override; - virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; + DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; }; } #endif // MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H diff --git a/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h b/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h index ee12ecfcc7..e300b970ff 100644 --- a/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h +++ b/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ATERIALINPUTFUNCTIONGENERATOR_H #define ATERIALINPUTFUNCTIONGENERATOR_H #include #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** \class AterialInputFunctionGenerator * \brief Compute the Aterial Input Function from a given dynamic image and a mask defining the tumour supplying artery * * The AterialInputFunctionGenerator takes a given 4D dynamic image and a corresponding mask and returns an array of the averaged values and * an array of the corresponding TimeGrid * within the mask over time. No conversion is performed, so conversion from signal to concentration has to be performed in advanced * and the resulting image is fed into the Generator. * The generator checks wether both image and mask are set and passes them to the itkMaskedNaryStatisticsImageFilter and the mitkExtractTimeGrid, to * calculate the mean of every time slice within the ROI and extract the corresponding time grid from the date set. */ class MITKPHARMACOKINETICS_EXPORT AterialInputFunctionGenerator : public itk::Object { public: mitkClassMacroItkParent(AterialInputFunctionGenerator, itk::Object); itkNewMacro(Self); /** @brief Setter and Getter for Input Image for calculation of AIF, already converted to concentrations * Getter calls CheckValidInputs() and CalculateAIFAndGetResult() if HasOutdatedResults() is true */ itkSetConstObjectMacro(DynamicImage, Image); itkGetConstObjectMacro(DynamicImage, Image); /** @brief Setter and Getter for mask defining the tumour feeding atery * Getter calls CheckValidInputs() and CalculateAIFAndGetResult() if HasOutdatedResults() is true */ itkSetConstObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); /** @brief Setter and Getter for the hematocritlevel, important for conversion to plasma curve*/ itkSetMacro(HCL, double); itkGetConstReferenceMacro(HCL, double); //Common Value for Hematocrit level is 0.45 static const double DEFAULT_HEMATOCRIT_LEVEL; void SetDefaultHematocritLevel() { this->m_HCL = DEFAULT_HEMATOCRIT_LEVEL; }; double GetDefaultHematocritLevel() { return DEFAULT_HEMATOCRIT_LEVEL; } AIFBasedModelBase::AterialInputFunctionType GetAterialInputFunction(); ModelBase::TimeGridType GetAterialInputFunctionTimeGrid(); protected: AterialInputFunctionGenerator() { m_Mask = NULL; m_DynamicImage = NULL; this->SetDefaultHematocritLevel(); }; - ~AterialInputFunctionGenerator() {}; + ~AterialInputFunctionGenerator() override {}; //template //void DoCalculateAIF(itk::Image* image); /** @brief Passes m_DynamicImage and m_Mask to the itkMaskedNaryStatisticsImageFilter and mitkExtractTimeGrid * and inserts the result into m_AIFValues and m_AIFTimeGrid and modiefies the Timestamp*/ virtual void CalculateAIFAndGetResult(); /** @brief Makes sure that m_DynamicImage and m_Mask are set */ virtual void CheckValidInputs() const; bool HasOutdatedResults(); itk::TimeStamp m_GenerationTimeStamp; private: Image::ConstPointer m_DynamicImage; Image::ConstPointer m_Mask; AIFBasedModelBase::AterialInputFunctionType m_AIFValues; ModelBase::TimeGridType m_AIFTimeGrid; double m_HCL; }; } #endif // ATERIALINPUTFUNCTIONGENERATOR_H diff --git a/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h b/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h index a10283ffe5..f387543b4b 100644 --- a/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h +++ b/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h @@ -1,146 +1,146 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CONCENTRATIONCURVEGENERATOR_H #define CONCENTRATIONCURVEGENERATOR_H #include #include #include "mitkConvertToConcentrationAbsoluteFunctor.h" #include "mitkConvertToConcentrationRelativeFunctor.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** \class ConcentrationCurveGenerator * \brief Converts a given 4D mitk::Image with MR signal values into a 4D mitk::Image with corresponding contrast agent concentration values * * From a given 4D image, the Generator takes the 3D image of the first time point as baseline image. It then loops over all time steps, casts * the current 3D image to itk and passes it to the ConvertToconcentrationFunctor. The returned 3D image has now values of concentration type and is stored at its timepoint * in the return image. */ class MITKPHARMACOKINETICS_EXPORT ConcentrationCurveGenerator : public itk::Object { public: mitkClassMacroItkParent(ConcentrationCurveGenerator, itk::Object); itkNewMacro(Self); //typedef itk::Image ImageType; typedef itk::Image ConvertedImageType; /** Getter and Setter for 4D mitk::Image*/ itkSetConstObjectMacro(DynamicImage,Image); itkGetConstObjectMacro(DynamicImage,Image); /** Parameters Relevant for conversion Calculation; Have to be Set externally (Sequence Dependend)*/ itkSetMacro(RelaxationTime, double); itkGetConstReferenceMacro(RelaxationTime, double); itkSetMacro(Relaxivity, double); itkGetConstReferenceMacro(Relaxivity, double); itkSetMacro(RecoveryTime, double); itkGetConstReferenceMacro(RecoveryTime, double); itkSetMacro(FlipAngle, double); itkGetConstReferenceMacro(FlipAngle, double); itkSetMacro(Factor, double); itkGetConstReferenceMacro(Factor, double); /** Getter and Setter for T10 Map image*/ itkSetConstObjectMacro(T10Image,Image); itkGetConstObjectMacro(T10Image,Image); itkSetMacro(T2Factor, double); itkGetConstReferenceMacro(T2Factor, double); itkSetMacro(T2EchoTime, double); itkGetConstReferenceMacro(T2EchoTime, double); /** @brief Calls Convert and returns the 4D mitk::image in Concentration units*/ itkSetMacro(isTurboFlashSequence,bool); itkGetConstReferenceMacro(isTurboFlashSequence,bool); itkSetMacro(AbsoluteSignalEnhancement,bool); itkGetConstReferenceMacro(AbsoluteSignalEnhancement,bool); itkSetMacro(RelativeSignalEnhancement,bool); itkGetConstReferenceMacro(RelativeSignalEnhancement,bool); itkSetMacro(UsingT1Map,bool); itkGetConstReferenceMacro(UsingT1Map,bool); itkSetMacro(isT2weightedImage,bool); itkGetConstReferenceMacro(isT2weightedImage,bool); Image::Pointer GetConvertedImage(); protected: ConcentrationCurveGenerator(); - ~ConcentrationCurveGenerator(); + ~ConcentrationCurveGenerator() override; template mitk::Image::Pointer convertToConcentration(const mitk::Image* inputImage, const mitk::Image* baselineImage); /** Calls ConvertToconcentrationFunctor for passed 3D itk::image*/ mitk::Image::Pointer ConvertSignalToConcentrationCurve(const mitk::Image* inputImage, const mitk::Image* baselineImage); /** @brief Takes the 3D image of the first timepoint to set as baseline image*/ void PrepareBaselineImage(); /** @brief loops over all timepoints, casts the current timepoint 3D mitk::image to itk and passes it to ConvertSignalToConcentrationCurve */ virtual void Convert(); private: Image::ConstPointer m_DynamicImage; Image::ConstPointer m_BaselineImage; Image::ConstPointer m_T10Image; Image::Pointer m_ConvertedImage; bool m_isT2weightedImage; bool m_isTurboFlashSequence; bool m_AbsoluteSignalEnhancement; bool m_RelativeSignalEnhancement; bool m_UsingT1Map; double m_Factor; //=Repetition Time TR double m_RecoveryTime; //= pre-CA T1 time double m_RelaxationTime; //= contrast agent relaxivity double m_Relaxivity; double m_FlipAngle; double m_T2Factor; double m_T2EchoTime; }; } #endif // CONCENTRATIONCURVEGENERATOR_H diff --git a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h index 086f89d029..de3ddcebb8 100644 --- a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h +++ b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h @@ -1,80 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CURVEDESCRIPTIONPARAMETERBASE_H #define CURVEDESCRIPTIONPARAMETERBASE_H #include #include #include #include #include #include "MitkPharmacokineticsExports.h" namespace mitk { /** Base class for functor that compute descriptive values for a curve (e.g. like Area under the Curve, Time to peek, maximum,...) @remark The derived classes must be implemented thread safe because GetCurveDescriptionParameter() and GetDescriptionParameterName() of one instance may be called in multi-threaded context (e.g. DescriptionParameterImageGeneratorBase and derived classes). */ class MITKPHARMACOKINETICS_EXPORT CurveDescriptionParameterBase : public itk::Object { public: typedef CurveDescriptionParameterBase Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(CurveDescriptionParameterBase, itk::Object) typedef itk::Array CurveType; typedef itk::Array CurveGridType; typedef double CurveDescriptionParameterResultType; typedef std::string CurveDescriptionParameterNameType; typedef std::vector DescriptionParameterResultsType; typedef std::vector DescriptionParameterNamesType; /** Returns the concrete description values for a curve. * @pre Curve value vector and curve grid must have the same size*/ DescriptionParameterResultsType GetCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const; /**Return the names of all descrition values that will be computed by the class. * @post The order of names equales the order of the results of GetCurveDescriptionParameter().*/ virtual DescriptionParameterNamesType GetDescriptionParameterName() const = 0 ; protected: /** Slot to implement the computation of the descriptor values.*/ virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const = 0; CurveDescriptionParameterBase(); - virtual ~CurveDescriptionParameterBase(); + ~CurveDescriptionParameterBase() override; private: //No copy constructor allowed CurveDescriptionParameterBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // CURVEDESCRIPTIONPARAMETERBASE_H diff --git a/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h b/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h index 0ae6ca5ffc..7393052ed6 100644 --- a/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h +++ b/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CURVE_PARAMETER_FUNCTOR_H #define CURVE_PARAMETER_FUNCTOR_H #include "mitkCurveDescriptionParameterBase.h" #include "mitkSimpleFunctorBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /**Functor for the curve description values by using the itkMulitOutputNaryImageFilter. * You may register any number of CurveDescriptionParamterBase instances to the functor. * The Functor will compute all values. * @warning the functor must be threadsafe and so must be the registered CurveDescriptionParamterBase instances.*/ class MITKPHARMACOKINETICS_EXPORT CurveParameterFunctor : public SimpleFunctorBase { public: typedef CurveParameterFunctor Self; typedef itk::Object Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkTypeMacro(CurveParameterFunctor, SimpleFunctorBase); typedef CurveDescriptionParameterBase::CurveDescriptionParameterNameType ParameterNameType; typedef CurveDescriptionParameterBase::DescriptionParameterNamesType ParameterNamesType; using GridArrayType = SimpleFunctorBase::GridArrayType; - virtual SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override; + SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override; - virtual unsigned int GetNumberOfOutputs() const override; + unsigned int GetNumberOfOutputs() const override; - virtual GridArrayType GetGrid() const override; + GridArrayType GetGrid() const override; itkSetMacro(Grid, GridArrayType); ParameterNamesType GetDescriptionParameterNames() const; /**@warning Teh function is currently not thread safe. @todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/ void ResetDescriptionParameters(); /**@warning Teh function is currently not thread safe. @todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/ void RegisterDescriptionParameter(const ParameterNameType& parameterName, CurveDescriptionParameterBase* parameterFunction); /**@warning Teh function is currently not thread safe. @todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/ const CurveDescriptionParameterBase* GetDescriptionParameterFunction(const ParameterNameType& parameterName) const; protected: CurveParameterFunctor(); - ~CurveParameterFunctor(); + ~CurveParameterFunctor() override; private: typedef std::map DescriptionParameterMapType; DescriptionParameterMapType m_DescriptorMap; GridArrayType m_Grid; }; } #endif // CURVE_PARAMETER_FUNCTOR_H diff --git a/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h b/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h index 1c74f80816..3898223f73 100644 --- a/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h +++ b/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_ #define __MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_ #include #include "mitkImage.h" #include "mitkCurveDescriptionParameterBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT DescriptionParameterImageGeneratorBase: public ::itk::Object { public: mitkClassMacroItkParent(DescriptionParameterImageGeneratorBase, ::itk::Object); typedef ScalarType ParameterImagePixelType; typedef CurveDescriptionParameterBase::CurveDescriptionParameterNameType ParameterNameType; typedef std::map ParameterImageMapType; virtual double GetProgress() const = 0; void Generate(); ParameterImageMapType GetParameterImages(); protected: DescriptionParameterImageGeneratorBase(); - virtual ~DescriptionParameterImageGeneratorBase(); + ~DescriptionParameterImageGeneratorBase() override; virtual bool HasOutdatedResult() const; virtual void CheckValidInputs() const; virtual void DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages) = 0; itk::TimeStamp m_GenerationTimeStamp; private: ParameterImageMapType m_ParameterImageMap; }; } #endif //__MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_ diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h index 2473c86144..24076cc3d1 100644 --- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h +++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h @@ -1,135 +1,135 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H #define DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H #include #include "mitkModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModel : public ModelBase { public: typedef DescriptivePharmacokineticBrixModel Self; typedef ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(DescriptivePharmacokineticBrixModel, ModelBase); static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_A; static const std::string NAME_PARAMETER_kep; static const std::string NAME_PARAMETER_kel; static const std::string NAME_PARAMETER_tlag; static const std::string NAME_STATIC_PARAMETER_Tau; static const std::string NAME_STATIC_PARAMETER_S0; static const std::string UNIT_PARAMETER_A; static const std::string UNIT_PARAMETER_kep; static const std::string UNIT_PARAMETER_kel; static const std::string UNIT_PARAMETER_tlag; static const std::string UNIT_STATIC_PARAMETER_Tau; static const std::string UNIT_STATIC_PARAMETER_S0; static const unsigned int POSITION_PARAMETER_A; static const unsigned int POSITION_PARAMETER_kep; static const unsigned int POSITION_PARAMETER_kel; //tlag in minutes static const unsigned int POSITION_PARAMETER_tlag; static const unsigned int NUMBER_OF_PARAMETERS; itkSetMacro(Tau, double); itkGetConstReferenceMacro(Tau, double); itkSetMacro(S0, double); itkGetConstReferenceMacro(S0, double); - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual std::string GetXAxisName() const override; + std::string GetXAxisName() const override; - virtual std::string GetXAxisUnit() const override; + std::string GetXAxisUnit() const override; - virtual std::string GetYAxisName() const override; + std::string GetYAxisName() const override; - virtual std::string GetYAxisUnit() const override; + std::string GetYAxisUnit() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; - virtual ParamterUnitMapType GetStaticParameterUnits() const override; + ParameterNamesType GetStaticParameterNames() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; + ParamterUnitMapType GetStaticParameterUnits() const override; protected: DescriptivePharmacokineticBrixModel(); - virtual ~DescriptivePharmacokineticBrixModel(); + ~DescriptivePharmacokineticBrixModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, + void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) override; - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: /**injection time Tau in minutes [min]*/ double m_Tau; /**Value of the first time step, thus base value to scale the signal. * Default is 1.*/ double m_S0; //No copy constructor allowed DescriptivePharmacokineticBrixModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h index abf2721d68..d3374cc6a3 100644 --- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H #define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkDescriptivePharmacokineticBrixModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacro(DescriptivePharmacokineticBrixModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override; DescriptivePharmacokineticBrixModelFactory(); - virtual ~DescriptivePharmacokineticBrixModelFactory(); + ~DescriptivePharmacokineticBrixModelFactory() override; private: //No copy constructor allowed DescriptivePharmacokineticBrixModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h index c2c216409c..dafd35ec94 100644 --- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h @@ -1,96 +1,96 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H #define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkDescriptivePharmacokineticBrixModel.h" namespace mitk { /** Parameterizer for the DescriptivePharmacokineticBrixModel that use an image for initializing the model. This parameterizer is amongst others used for pixel based fiting strategies. @sa DescriptivePharmacokineticBrixModelParameterizer*/ class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelParameterizer : public ConcreteModelParameterizerBase { public: typedef DescriptivePharmacokineticBrixModelParameterizer Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase); itkNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef Superclass::ModelPointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef itk::Image BaseImageType; typedef Superclass::IndexType IndexType; itkSetMacro(Tau, double); itkGetConstReferenceMacro(Tau, double); itkSetConstObjectMacro(BaseImage, BaseImageType); itkGetConstObjectMacro(BaseImage, BaseImageType); /* Returns the global static parameters for the model. * @remark this default implementation assumes no global static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetGlobalStaticParameters() const; + StaticParameterMapType GetGlobalStaticParameters() const override; /* Returns the local static parameters for the model at the given index. * @remark this default implementation assumes no local static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const; + StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const override; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: DescriptivePharmacokineticBrixModelParameterizer(); - virtual ~DescriptivePharmacokineticBrixModelParameterizer(); + ~DescriptivePharmacokineticBrixModelParameterizer() override; /**injection time Tau in minutes [min]*/ double m_Tau; /**Pointer to the image that containes the values of the first timestep (base value of the series that should be modelled)*/ BaseImageType::ConstPointer m_BaseImage; private: //No copy constructor allowed DescriptivePharmacokineticBrixModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h index 7c9f0b0b82..8b47cfe372 100644 --- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h @@ -1,94 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H #define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" namespace mitk { /** Parameterizer for the DescriptivePharmacokineticBrixModel that don't use an image for initializing the model but a single signal value. This parameterizer is amongst others used for ROI based fiting strategies where no complete image is needed/used. @sa DescriptivePharmacokineticBrixModelParameterizer*/ class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelValueBasedParameterizer : public ConcreteModelParameterizerBase { public: typedef DescriptivePharmacokineticBrixModelValueBasedParameterizer Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase); itkNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef Superclass::ModelPointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef itk::Image BaseImageType; typedef Superclass::IndexType IndexType; itkSetMacro(Tau, double); itkGetConstReferenceMacro(Tau, double); itkSetMacro(BaseValue, double); itkGetConstReferenceMacro(BaseValue, double); /* Returns the global static parameters for the model. * @remark this default implementation assumes no global static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetGlobalStaticParameters() const; + StaticParameterMapType GetGlobalStaticParameters() const override; /* Returns the local static parameters for the model at the given index. * @remark this default implementation assumes no local static parameters exist. * Thus an empty map is returned.*/ - virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const; + StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const override; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: DescriptivePharmacokineticBrixModelValueBasedParameterizer(); - virtual ~DescriptivePharmacokineticBrixModelValueBasedParameterizer(); + ~DescriptivePharmacokineticBrixModelValueBasedParameterizer() override; /**injection time Tau in minutes [min]*/ double m_Tau; /** Contains the base value that should be used by the model.*/ double m_BaseValue; private: //No copy constructor allowed DescriptivePharmacokineticBrixModelValueBasedParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h index cf032ad43c..0ea15bc50e 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h @@ -1,84 +1,84 @@ #ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H #define MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class OneTissueCompartmentModel * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ). * C(t) = vp * Cp(t) + conv(Cp(t),R(t)) * The parameters ktrans, ve and ve are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModel : public AIFBasedModelBase { public: typedef ExtendedOneTissueCompartmentModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ExtendedOneTissueCompartmentModel, ModelBase); static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_k1; static const std::string NAME_PARAMETER_k2; static const std::string NAME_PARAMETER_VB; static const std::string UNIT_PARAMETER_k1; static const std::string UNIT_PARAMETER_k2; static const std::string UNIT_PARAMETER_VB; static const unsigned int POSITION_PARAMETER_k1; static const unsigned int POSITION_PARAMETER_k2; static const unsigned int POSITION_PARAMETER_VB; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: ExtendedOneTissueCompartmentModel(); - virtual ~ExtendedOneTissueCompartmentModel(); + ~ExtendedOneTissueCompartmentModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed ExtendedOneTissueCompartmentModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h index d0d74e03ee..d943d1bfe7 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H #define MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkExtendedOneTissueCompartmentModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef ExtendedOneTissueCompartmentModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ExtendedOneTissueCompartmentModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: ExtendedOneTissueCompartmentModelParameterizer(); - virtual ~ExtendedOneTissueCompartmentModelParameterizer(); + ~ExtendedOneTissueCompartmentModelParameterizer() override; private: //No copy constructor allowed ExtendedOneTissueCompartmentModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h index cddc64c4e8..e95c6900fd 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h @@ -1,94 +1,94 @@ #ifndef MITKEXTENDEDTOFTSMODEL_H #define MITKEXTENDEDTOFTSMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class ExtendedToftsModel * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ). * C(t) = vp * Cp(t) + conv(Cp(t),R(t)) * The parameters ktrans, ve and ve are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModel : public AIFBasedModelBase { public: typedef ExtendedToftsModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ExtendedToftsModel, ModelBase); static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_Ktrans; static const std::string NAME_PARAMETER_ve; static const std::string NAME_PARAMETER_vp; static const std::string UNIT_PARAMETER_Ktrans; static const std::string UNIT_PARAMETER_ve; static const std::string UNIT_PARAMETER_vp; static const unsigned int POSITION_PARAMETER_Ktrans; static const unsigned int POSITION_PARAMETER_ve; static const unsigned int POSITION_PARAMETER_vp; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override; - virtual ParamterUnitMapType GetDerivedParameterUnits() const override; + ParametersSizeType GetNumberOfDerivedParameters() const override; + ParamterUnitMapType GetDerivedParameterUnits() const override; protected: ExtendedToftsModel(); - virtual ~ExtendedToftsModel(); + ~ExtendedToftsModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& - parameters) const; + DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& + parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed ExtendedToftsModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDTOFTSMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h index e4e5e49e0f..6338ee598c 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTENDEDTOFTSMODELFACTORY_H #define MITKEXTENDEDTOFTSMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkExtendedToftsModel.h" #include "mitkExtendedToftsModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(ExtendedToftsModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); using ModelType = Superclass::ModelType; using ModelParameterizerType = Superclass::ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; virtual ParametersType GetDefaultInitialParameterization() const override; protected: ExtendedToftsModelFactory(); - virtual ~ExtendedToftsModelFactory() override; + ~ExtendedToftsModelFactory() override; private: //No copy constructor allowed ExtendedToftsModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDTOFTSMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h index c43a773193..d42d1f75e5 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTENDEDTOFTSMODELPARAMETRIZER_H #define MITKEXTENDEDTOFTSMODELPARAMETRIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkExtendedToftsModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef ExtendedToftsModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ExtendedToftsModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: ExtendedToftsModelParameterizer(); - virtual ~ExtendedToftsModelParameterizer(); + ~ExtendedToftsModelParameterizer() override; private: //No copy constructor allowed ExtendedToftsModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h index 1eb4771a71..f7cafdc9a0 100644 --- a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h +++ b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_IMAGEGENERATIONHELPER_H #define __MITK_IMAGEGENERATIONHELPER_H #include "itkImage.h" #include "itkImageRegionIterator.h" #include "mitkImage.h" #include "mitkImagePixelReadAccessor.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @todo #3 this is a helper class for generating a 4D dynamic image of dimensions (x,y,z, t) from an itk::Array (t) * The Array will be set at every (x,y,z), so the result is a homogeneous image in 3D, with the 4th dimension as the Array. * Function GenerateDynamicImageMITK was copied from TestingHelper/TestArtifactGenerator. Maybe there is a better way to do this. */ class MITKPHARMACOKINETICS_EXPORT ImageGenerationHelper : public itk::Object { public: mitkClassMacroItkParent(ImageGenerationHelper, ::itk::Object); itkNewMacro(Self); typedef itk::Image TestImageType; typedef itk::Array TimeGridType; typedef itk::Array CurveType; itkSetMacro(DimX, unsigned int); itkSetMacro(DimY, unsigned int); itkSetMacro(DimZ, unsigned int); itkGetConstReferenceMacro(DimX, unsigned int); itkGetConstReferenceMacro(DimY, unsigned int); itkGetConstReferenceMacro(DimZ, unsigned int); itkSetMacro(Grid,TimeGridType); itkGetConstReferenceMacro(Grid,TimeGridType); itkSetMacro(Curve, CurveType); itkGetConstReferenceMacro(Curve,CurveType) Image::Pointer GenerateDynamicImageMITK(); private: ImageGenerationHelper(): m_DimX(0), m_DimY(0), m_DimZ(0) {}; - ~ImageGenerationHelper(){}; + ~ImageGenerationHelper() override{}; mitk::Image::Pointer GenerateTestFrame(unsigned int timePointIndex); unsigned int m_DimX, m_DimY, m_DimZ; TimeGridType m_Grid; CurveType m_Curve; }; } #endif //__MITK_IMAGEGENERATIONHELPER_H diff --git a/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h index 4e8a2690ab..2c591b9140 100644 --- a/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h +++ b/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKMAXIMUMCURVEDESCRIPTIONPARAMETER_H #define MITKMAXIMUMCURVEDESCRIPTIONPARAMETER_H #include "mitkCurveDescriptionParameterBase.h" namespace mitk { /** Descriptor computes the maximum of the curve.*/ class MITKPHARMACOKINETICS_EXPORT MaximumCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase { public: typedef mitk::MaximumCurveDescriptionParameter Self; typedef CurveDescriptionParameterBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkCloneMacro(Self); - virtual DescriptionParameterNamesType GetDescriptionParameterName() const override; + DescriptionParameterNamesType GetDescriptionParameterName() const override; protected: static const std::string PARAMETER_NAME; MaximumCurveDescriptionParameter(); - virtual ~MaximumCurveDescriptionParameter(); + ~MaximumCurveDescriptionParameter() override; - virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; + DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; }; } #endif // MITKMAXIMUMCONCENTRATIONCURVEDESCRIPTIONPARAMETER_H diff --git a/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h index e6da1ddad3..967a2af3c3 100644 --- a/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h +++ b/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h @@ -1,33 +1,33 @@ #ifndef MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H #define MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H #include "mitkCurveDescriptionParameterBase.h" namespace mitk { /** Description parameter that computes the area under the curve */ class MITKPHARMACOKINETICS_EXPORT MeanResidenceTimeDescriptionParameter : public mitk::CurveDescriptionParameterBase { public: typedef mitk::MeanResidenceTimeDescriptionParameter Self; typedef CurveDescriptionParameterBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkCloneMacro(Self); - virtual DescriptionParameterNamesType GetDescriptionParameterName() const override; + DescriptionParameterNamesType GetDescriptionParameterName() const override; protected: static const std::string PARAMETER_NAME; MeanResidenceTimeDescriptionParameter(); - virtual ~MeanResidenceTimeDescriptionParameter(); + ~MeanResidenceTimeDescriptionParameter() override; - virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; + DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; }; } #endif // MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h index 38d6dd181c..9b9a70bd05 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h @@ -1,116 +1,116 @@ #ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H #define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class NumericTwoCompartmentExchangeModel * @brief Implementation of the numeric model function of the 2 Compartment Exchange model, using an Aterial Input Function * The Model calculates the measured Concentration-Time-Curve from the mass balance equations of the 2-tissue compartent Model * * vp * dCp(t)/dt = F * (CA(t) - Cp(t)) - PS * (Cp(t) - Ci(t)) * ve * dCi(t)/dt = PS * (Cp(t) - Ci(t)) * * with concentration curve Cp(t) of the Blood Plasma p and Ce(t) of the Extracellular Extravascular Space(EES)(interstitial volume). CA(t) is the aterial concentration, i.e. the AIF * Cp(t) and Ce(t) are found numerical via Runge-Kutta methode, implemented in Boosts numeric library ODEINT. Here we use a runge_kutta_cash_karp54 stepper with * adaptive step size and error controll. * From the resulting curves Cp(t) and Ce(t) the measured concentration Ctotal(t) is found vial * * Ctotal(t) = vp * Cp(t) + ve * Ce(t) * * where vp=Vp/VT and ve=Ve/VT are the portion of Plasma/EES volume Vp/Ve of the total volume VT respectively. * The parameters PS, F, vp and ve are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModel : public AIFBasedModelBase { public: typedef NumericTwoCompartmentExchangeModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(NumericTwoCompartmentExchangeModel, ModelBase) typedef std::vector state_type; static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_F; static const std::string NAME_PARAMETER_PS; static const std::string NAME_PARAMETER_ve; static const std::string NAME_PARAMETER_vp; static const std::string NAME_STATIC_PARAMETER_ODEINTStepSize; static const std::string UNIT_PARAMETER_F; static const std::string UNIT_PARAMETER_PS; static const std::string UNIT_PARAMETER_ve; static const std::string UNIT_PARAMETER_vp; static const unsigned int POSITION_PARAMETER_F; static const unsigned int POSITION_PARAMETER_PS; static const unsigned int POSITION_PARAMETER_ve; static const unsigned int POSITION_PARAMETER_vp; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; itkGetConstReferenceMacro(ODEINTStepSize, double); itkSetMacro(ODEINTStepSize, double); - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual ParameterNamesType GetStaticParameterNames() const; - virtual ParametersSizeType GetNumberOfStaticParameters() const; + ParameterNamesType GetStaticParameterNames() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; protected: NumericTwoCompartmentExchangeModel(); - virtual ~NumericTwoCompartmentExchangeModel(); + ~NumericTwoCompartmentExchangeModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; + void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed NumericTwoCompartmentExchangeModel(const Self& source); void operator=(const Self&); //purposely not implemented double m_ODEINTStepSize; }; } #endif // MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h index cc7eb67497..bb8776a3fa 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h @@ -1,101 +1,101 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H #define MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModel : public AIFBasedModelBase { public: typedef NumericTwoTissueCompartmentModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(NumericTwoTissueCompartmentModel, ModelBase) typedef std::vector state_type; /** Model Specifications */ static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_K1; static const std::string NAME_PARAMETER_k2; static const std::string NAME_PARAMETER_k3; static const std::string NAME_PARAMETER_k4; static const std::string NAME_PARAMETER_VB; static const std::string UNIT_PARAMETER_K1; static const std::string UNIT_PARAMETER_k2; static const std::string UNIT_PARAMETER_k3; static const std::string UNIT_PARAMETER_k4; static const std::string UNIT_PARAMETER_VB; static const unsigned int POSITION_PARAMETER_K1; static const unsigned int POSITION_PARAMETER_k2; static const unsigned int POSITION_PARAMETER_k3; static const unsigned int POSITION_PARAMETER_k4; static const unsigned int POSITION_PARAMETER_VB; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: NumericTwoTissueCompartmentModel(); - virtual ~NumericTwoTissueCompartmentModel(); + ~NumericTwoTissueCompartmentModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed NumericTwoTissueCompartmentModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h index dfea16aec5..d49e13d20f 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H #define MITKNUMERICTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkNumericTwoTissueCompartmentModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef NumericTwoTissueCompartmentModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(NumericTwoTissueCompartmentModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: NumericTwoTissueCompartmentModelParameterizer(); - virtual ~NumericTwoTissueCompartmentModelParameterizer(); + ~NumericTwoTissueCompartmentModelParameterizer() override; private: //No copy constructor allowed NumericTwoTissueCompartmentModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h index b9d2ea989a..5f2de1e05b 100644 --- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h +++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h @@ -1,82 +1,82 @@ #ifndef MITKONETISSUECOMPARTMENTMODEL_H #define MITKONETISSUECOMPARTMENTMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class OneTissueCompartmentModel * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ). * C(t) = vp * Cp(t) + conv(Cp(t),R(t)) * The parameters ktrans, ve and ve are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModel : public AIFBasedModelBase { public: typedef OneTissueCompartmentModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(OneTissueCompartmentModel, ModelBase); static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_k1; static const std::string NAME_PARAMETER_k2; static const std::string UNIT_PARAMETER_k1; static const std::string UNIT_PARAMETER_k2; static const unsigned int POSITION_PARAMETER_k1; static const unsigned int POSITION_PARAMETER_k2; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: OneTissueCompartmentModel(); - virtual ~OneTissueCompartmentModel(); + ~OneTissueCompartmentModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed OneTissueCompartmentModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKONETISSUECOMPARTMENTMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h index 616d61f49e..05d74185a9 100644 --- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKONETISSUECOMPARTMENTMODELPARAMETRIZER_H #define MITKONETISSUECOMPARTMENTMODELPARAMETRIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkOneTissueCompartmentModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef OneTissueCompartmentModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(OneTissueCompartmentModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: OneTissueCompartmentModelParameterizer(); - virtual ~OneTissueCompartmentModelParameterizer(); + ~OneTissueCompartmentModelParameterizer() override; private: //No copy constructor allowed OneTissueCompartmentModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h b/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h index 7014be58dd..416fe3b98c 100644 --- a/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h +++ b/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h @@ -1,104 +1,104 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_ #define __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_ #include #include #include "mitkCurveParameterFunctor.h" #include "mitkDescriptionParameterImageGeneratorBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** Class for generating curve descriptor images based on a given 4D mitk image. * The class uses curve parameter functor to generate the curve description image(s). * Depending on the chosen functor several images may be generated as output. * @remark This generator fits every pixel on its own. If you want to fit the mean value of the given mask use * ROIBasedDescriptionParameterImageGenerator. */ class MITKPHARMACOKINETICS_EXPORT PixelBasedDescriptionParameterImageGenerator : public DescriptionParameterImageGeneratorBase { public: mitkClassMacro(PixelBasedDescriptionParameterImageGenerator, DescriptionParameterImageGeneratorBase); itkNewMacro(Self); typedef ScalarType ParameterImagePixelType; typedef std::vector FunctorValueArrayType; typedef CurveParameterFunctor FunctorType; typedef DescriptionParameterImageGeneratorBase::ParameterNameType ParameterNameType; typedef DescriptionParameterImageGeneratorBase::ParameterImageMapType ParameterImageMapType; itkSetObjectMacro(DynamicImage, Image); itkGetConstObjectMacro(DynamicImage, Image); itkSetObjectMacro(Mask, Image); itkGetConstObjectMacro(Mask, Image); itkSetObjectMacro(Functor, FunctorType); itkGetObjectMacro(Functor, FunctorType); - virtual double GetProgress() const override; + double GetProgress() const override; protected: PixelBasedDescriptionParameterImageGenerator() : m_Progress(0) { m_InternalMask = NULL; m_Mask = NULL; m_DynamicImage = NULL; }; - ~PixelBasedDescriptionParameterImageGenerator() {}; + ~PixelBasedDescriptionParameterImageGenerator() override {}; template void DoParameterCalculation(itk::Image* image); template void DoPrepareMask(itk::Image* image); void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject); - virtual bool HasOutdatedResult() const override; - virtual void CheckValidInputs() const override; - virtual void DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages) override; + bool HasOutdatedResult() const override; + void CheckValidInputs() const override; + void DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages) override; private: Image::Pointer m_DynamicImage; Image::Pointer m_Mask; typedef itk::Image InternalMaskType; InternalMaskType::Pointer m_InternalMask; FunctorType::Pointer m_Functor; ParameterImageMapType m_TempResultMap; double m_Progress; }; } #endif // __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_ diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h index 255d294093..07d0839d92 100644 --- a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h +++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h @@ -1,94 +1,94 @@ #ifndef MITKSTANDARDTOFTSMODEL_H #define MITKSTANDARDTOFTSMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class StandardToftsModel * @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function * The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific * residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ). * C(t) = vp * Cp(t) + conv(Cp(t),R(t)) * The parameters ktrans, ve and ve are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT StandardToftsModel : public AIFBasedModelBase { public: typedef StandardToftsModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(StandardToftsModel, ModelBase); static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_Ktrans; static const std::string NAME_PARAMETER_ve; static const std::string NAME_PARAMETER_vp; static const std::string UNIT_PARAMETER_Ktrans; static const std::string UNIT_PARAMETER_ve; static const std::string UNIT_PARAMETER_vp; static const unsigned int POSITION_PARAMETER_Ktrans; static const unsigned int POSITION_PARAMETER_ve; static const unsigned int POSITION_PARAMETER_vp; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override; + ParametersSizeType GetNumberOfDerivedParameters() const override; - virtual ParamterUnitMapType GetDerivedParameterUnits() const override; + ParamterUnitMapType GetDerivedParameterUnits() const override; protected: StandardToftsModel(); - virtual ~StandardToftsModel(); + ~StandardToftsModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& - parameters) const; + DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& + parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed StandardToftsModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKSTANDARDTOFTSMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h index e784b6ed07..c9d18b16b8 100644 --- a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSTANDARDTOFTSMODELFACTORY_H #define MITKSTANDARDTOFTSMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkStandardToftsModel.h" #include "mitkStandardToftsModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT StandardToftsModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(StandardToftsModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); using ModelType = Superclass::ModelType; using ModelParameterizerType = Superclass::ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; virtual ParametersType GetDefaultInitialParameterization() const override; protected: StandardToftsModelFactory(); - virtual ~StandardToftsModelFactory() override; + ~StandardToftsModelFactory() override; private: //No copy constructor allowed StandardToftsModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKSTANDARDTOFTSMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h index 4b8d710cd9..9c17209735 100644 --- a/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSTANDARDTOFTSMODELPARAMETRIZER_H #define MITKSTANDARDTOFTSMODELPARAMETRIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkStandardToftsModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT StandardToftsModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef StandardToftsModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(StandardToftsModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: StandardToftsModelParameterizer(); - virtual ~StandardToftsModelParameterizer(); + ~StandardToftsModelParameterizer() override; private: //No copy constructor allowed StandardToftsModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h index 162aa66043..bd314c23d7 100644 --- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h +++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h @@ -1,111 +1,111 @@ #ifndef MITKTHREESTEPLINEARMODEL_H #define MITKTHREESTEPLINEARMODEL_H #include "mitkModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModel : public mitk::ModelBase { public: typedef ThreeStepLinearModel Self; typedef mitk::ModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; typedef Superclass::ParameterNameType ParameterNameType; typedef Superclass::ParametersSizeType ParametersSizeType; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(ThreeStepLinearModel, ModelBase) static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_S0; static const std::string NAME_PARAMETER_t1; static const std::string NAME_PARAMETER_t2; static const std::string NAME_PARAMETER_a1; static const std::string NAME_PARAMETER_a2; static const std::string NAME_PARAMETER_b1; static const std::string NAME_PARAMETER_b2; static const std::string UNIT_PARAMETER_S0; static const std::string UNIT_PARAMETER_t1; static const std::string UNIT_PARAMETER_t2; static const std::string UNIT_PARAMETER_a1; static const std::string UNIT_PARAMETER_a2; static const std::string UNIT_PARAMETER_b1; static const std::string UNIT_PARAMETER_b2; static const unsigned int POSITION_PARAMETER_S0; static const unsigned int POSITION_PARAMETER_t1; static const unsigned int POSITION_PARAMETER_t2; static const unsigned int POSITION_PARAMETER_a1; static const unsigned int POSITION_PARAMETER_a2; static const unsigned int POSITION_PARAMETER_b1; static const unsigned int POSITION_PARAMETER_b2; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual FunctionStringType GetFunctionString() const override; + FunctionStringType GetFunctionString() const override; - virtual std::string GetXName() const override; + std::string GetXName() const override; - virtual ParameterNamesType GetParameterNames() const override; + ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; - virtual ParameterNamesType GetStaticParameterNames() const override; + ParameterNamesType GetStaticParameterNames() const override; - virtual ParametersSizeType GetNumberOfStaticParameters() const override; + ParametersSizeType GetNumberOfStaticParameters() const override; - virtual ParameterNamesType GetDerivedParameterNames() const override; + ParameterNamesType GetDerivedParameterNames() const override; - virtual ParametersSizeType GetNumberOfDerivedParameters() const override; + ParametersSizeType GetNumberOfDerivedParameters() const override; - virtual ParamterUnitMapType GetDerivedParameterUnits() const override; + ParamterUnitMapType GetDerivedParameterUnits() const override; protected: ThreeStepLinearModel() {}; - virtual ~ThreeStepLinearModel(){}; + ~ThreeStepLinearModel() override{}; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; - virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& - parameters) const; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType& + parameters) const override; - virtual void SetStaticParameter(const ParameterNameType& name, - const StaticParameterValuesType& values); - virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const; + void SetStaticParameter(const ParameterNameType& name, + const StaticParameterValuesType& values) override; + StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override; private: //No copy constructor allowed ThreeStepLinearModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTHREESTEPLINEARMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h index 3e056de79c..d9b488e6ea 100644 --- a/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h +++ b/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H #define MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H #include "mitkCurveDescriptionParameterBase.h" namespace mitk { /** Computes the position of the first maximum of the curve. As a secondary * aspect it also returns the value of the curve.*/ class MITKPHARMACOKINETICS_EXPORT TimeToPeakCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase { public: typedef mitk::TimeToPeakCurveDescriptionParameter Self; typedef CurveDescriptionParameterBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkFactorylessNewMacro(Self); itkCloneMacro(Self); - virtual DescriptionParameterNamesType GetDescriptionParameterName() const override; + DescriptionParameterNamesType GetDescriptionParameterName() const override; protected: static const std::string PARAMETER_PEAK_NAME; static const std::string PARAMETER_TIME_NAME; TimeToPeakCurveDescriptionParameter(); - virtual ~TimeToPeakCurveDescriptionParameter(); + ~TimeToPeakCurveDescriptionParameter() override; - virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; + DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override; }; } #endif // MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h index 3b8c8faf1a..89e40f11f2 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h +++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h @@ -1,118 +1,118 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOCOMPARTMENTEXCHANGEMODEL_H #define MITKTWOCOMPARTMENTEXCHANGEMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { /** @class TwoCompartmentExchangeModel * @brief Implementation of the analystical model function of the Physiological Pharmacokinetic Brix model, using an Aterial Input Function * The Model calculates the Concentration-Time-Curve as a convolution of the Aterial Input funciton CA(t) and a tissue specific * residue function R(t). The Residue funktion consists of two parts: The Residue funktion Qp(t) of the Blood Plasma p and the residue funktion Qi(t) of the * interstitial volume I. * Ctotal(t) = vp * Cp(t) + fi * Ci(t) = [vp * Qp(t) + fi * Qi(t)] conv CA(t) * = Qtotal(t) conv CA(t) * where vp=Vp/VT and fi=Vi/VT are the portion of Plasma/interstitial volume Vp/VI of the total volume VT respectively. * The Residuefunctions are described by * Qp(t) = F/Vp * PS/Vp * 1/(l2 - l1) *[ µ2 exp(l1*t) - µ1 exp(l2*t)]* sig(t) * Qi(t) = F/Vp * PS/Vi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t) * = F/Vp * PS/Vp * vp/fi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t) * with * l1/2 = -1/2 (PS/Vp * vp/fi + PS/Vp + F/Vp) +/- sqrt((PS/Vp * vp/fi + PS/Vp + F/Vp)² - 4* F/Vp * PS/Vp * vp/fi) * µ1/2 = F/Vp * Vp/PS + 1 + Vp/PS* l1/2 * * The parameters PS/Vp, F/Vp, vp and fi are subject to the fitting routine*/ class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModel : public AIFBasedModelBase { public: typedef TwoCompartmentExchangeModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(TwoCompartmentExchangeModel, ModelBase) /** Model Specifications */ static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_F; static const std::string NAME_PARAMETER_PS; static const std::string NAME_PARAMETER_ve; static const std::string NAME_PARAMETER_vp; static const unsigned int POSITION_PARAMETER_F; static const unsigned int POSITION_PARAMETER_PS; static const unsigned int POSITION_PARAMETER_ve; static const unsigned int POSITION_PARAMETER_vp; static const std::string UNIT_PARAMETER_F; static const std::string UNIT_PARAMETER_PS; static const std::string UNIT_PARAMETER_ve; static const std::string UNIT_PARAMETER_vp; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: TwoCompartmentExchangeModel(); - virtual ~TwoCompartmentExchangeModel(); + ~TwoCompartmentExchangeModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed TwoCompartmentExchangeModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h index c3cb903ea7..6088088639 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h @@ -1,97 +1,97 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTFDGMODEL_H #define MITKTWOTISSUECOMPARTMENTFDGMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModel : public AIFBasedModelBase { public: typedef TwoTissueCompartmentFDGModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(TwoTissueCompartmentFDGModel, ModelBase) /** Model Specifications */ static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_K1; static const std::string NAME_PARAMETER_k2; static const std::string NAME_PARAMETER_k3; static const std::string NAME_PARAMETER_VB; static const std::string UNIT_PARAMETER_K1; static const std::string UNIT_PARAMETER_k2; static const std::string UNIT_PARAMETER_k3; static const std::string UNIT_PARAMETER_VB; static const unsigned int POSITION_PARAMETER_K1; static const unsigned int POSITION_PARAMETER_k2; static const unsigned int POSITION_PARAMETER_k3; static const unsigned int POSITION_PARAMETER_VB; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: TwoTissueCompartmentFDGModel(); - virtual ~TwoTissueCompartmentFDGModel(); + ~TwoTissueCompartmentFDGModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed TwoTissueCompartmentFDGModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOTISSUECOMPARTMENTFDGMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h index df4cee1c8f..8bb692ab1d 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTFDGMODELPARAMETERIZER_H #define MITKTWOTISSUECOMPARTMENTFDGMODELPARAMETERIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkTwoTissueCompartmentFDGModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef TwoTissueCompartmentFDGModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(TwoTissueCompartmentFDGModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: TwoTissueCompartmentFDGModelParameterizer(); - virtual ~TwoTissueCompartmentFDGModelParameterizer(); + ~TwoTissueCompartmentFDGModelParameterizer() override; private: //No copy constructor allowed TwoTissueCompartmentFDGModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h index 24a20b7834..6d5e44e99a 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTMODEL_H #define MITKTWOTISSUECOMPARTMENTMODEL_H #include "mitkAIFBasedModelBase.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModel : public AIFBasedModelBase { public: typedef TwoTissueCompartmentModel Self; typedef AIFBasedModelBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** Run-time type information (and related methods). */ itkTypeMacro(TwoTissueCompartmentModel, ModelBase) /** Model Specifications */ static const std::string MODEL_DISPLAY_NAME; static const std::string NAME_PARAMETER_K1; static const std::string NAME_PARAMETER_k2; static const std::string NAME_PARAMETER_k3; static const std::string NAME_PARAMETER_k4; static const std::string NAME_PARAMETER_VB; static const std::string UNIT_PARAMETER_K1; static const std::string UNIT_PARAMETER_k2; static const std::string UNIT_PARAMETER_k3; static const std::string UNIT_PARAMETER_k4; static const std::string UNIT_PARAMETER_VB; static const unsigned int POSITION_PARAMETER_K1; static const unsigned int POSITION_PARAMETER_k2; static const unsigned int POSITION_PARAMETER_k3; static const unsigned int POSITION_PARAMETER_k4; static const unsigned int POSITION_PARAMETER_VB; static const unsigned int NUMBER_OF_PARAMETERS; - virtual std::string GetModelDisplayName() const override; + std::string GetModelDisplayName() const override; - virtual std::string GetModelType() const override; + std::string GetModelType() const override; - virtual ParameterNamesType GetParameterNames() const override; - virtual ParametersSizeType GetNumberOfParameters() const override; + ParameterNamesType GetParameterNames() const override; + ParametersSizeType GetNumberOfParameters() const override; - virtual ParamterUnitMapType GetParameterUnits() const override; + ParamterUnitMapType GetParameterUnits() const override; protected: TwoTissueCompartmentModel(); - virtual ~TwoTissueCompartmentModel(); + ~TwoTissueCompartmentModel() override; /** * Actual implementation of the clone method. This method should be reimplemeted * in subclasses to clone the extra required parameters. */ - virtual itk::LightObject::Pointer InternalClone() const; + itk::LightObject::Pointer InternalClone() const override; - virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; + ModelResultType ComputeModelfunction(const ParametersType& parameters) const override; - virtual void PrintSelf(std::ostream& os, ::itk::Indent indent) const; + void PrintSelf(std::ostream& os, ::itk::Indent indent) const override; private: //No copy constructor allowed TwoTissueCompartmentModel(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOTISSUECOMPARTMENTMODEL_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h index 3034cbf555..f7b2a79fce 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H #define MITKTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkTwoTissueCompartmentModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef TwoTissueCompartmentModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(TwoTissueCompartmentModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: TwoTissueCompartmentModelParameterizer(); - virtual ~TwoTissueCompartmentModelParameterizer(); + ~TwoTissueCompartmentModelParameterizer() override; private: //No copy constructor allowed TwoTissueCompartmentModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h b/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h index a543fbc242..263eba0ff0 100644 --- a/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h +++ b/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h @@ -1,79 +1,79 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Software Development for Integrated Diagnostic and Therapy. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __QMITK_DESCRIPTION_PARAMETER_BACKGROUND_JOB_H #define __QMITK_DESCRIPTION_PARAMETER_BACKGROUND_JOB_H //QT #include #include //MITK #include #include #include #include // ITK #include #include "MitkPharmacokineticsUIExports.h" class MITKPHARMACOKINETICSUI_EXPORT DescriptionParameterBackgroundJob : public QObject, public QRunnable { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: DescriptionParameterBackgroundJob(mitk::DescriptionParameterImageGeneratorBase* generator, mitk::DataNode* parentNode = NULL); - ~DescriptionParameterBackgroundJob(); + ~DescriptionParameterBackgroundJob() override; - void run(); + void run() override; /**Returns the node (if defined), that is the parent object for the results of the job. May be null.*/ mitk::DataNode* GetParentNode() const; signals: void Finished(); void Error(QString err); void ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType resultMap, const DescriptionParameterBackgroundJob* pJob); void JobProgress(double progress); void JobStatusChanged(QString info); protected: static mitk::modelFit::ModelFitResultNodeVectorType CreateResultNodes(const mitk::DescriptionParameterImageGeneratorBase::ParameterImageMapType& paramimages); //Inputs mitk::DescriptionParameterImageGeneratorBase::Pointer m_Generator; mitk::DataNode::Pointer m_ParentNode; // Results mitk::modelFit::ModelFitResultNodeVectorType m_Results; ::itk::MemberCommand::Pointer m_spCommand; unsigned long m_ObserverID; void OnComputeEvent(::itk::Object *, const itk::EventObject &event); }; #endif diff --git a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h index 3a6e8ad903..ae3183d91f 100644 --- a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h +++ b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h @@ -1,131 +1,131 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKABSTRACTDATASTORAGEINSPECTOR_H #define QMITKABSTRACTDATASTORAGEINSPECTOR_H #include #include // mitk core #include #include // qt #include class QAbstractItemVew; /** * @brief This abstract class is a convinient base class for easy implementation of widgets that * offer a specific view onto a given DataStorage instance to inspect its contents. * One may also get the selection in this inspector of the data storage. */ class MITKQTWIDGETS_EXPORT QmitkAbstractDataStorageInspector : public QWidget { Q_OBJECT public: - virtual ~QmitkAbstractDataStorageInspector(); + ~QmitkAbstractDataStorageInspector() override; /** * @brief Sets the data storage that will be used /monitored by the widget. * * @param dataStorage A pointer to the data storage to set. */ void SetDataStorage(mitk::DataStorage* dataStorage); /** * @brief Sets the node predicate and updates the widget, according to the node predicate. * * @param nodePredicate A pointer to node predicate. */ virtual void SetNodePredicate(mitk::NodePredicateBase* nodePredicate); mitk::NodePredicateBase* GetNodePredicate() const; using NodeList = QList; /** Returns the list of currently selected nodes.*/ NodeList GetSelectedNodes() const; /** Returns an pointer to the view that is used in the inspector to show the content.*/ virtual QAbstractItemView* GetView() = 0; virtual const QAbstractItemView* GetView() const = 0; /** Returns the setting of the internal connector. It can be changed by SetSelectOnlyVisibleNodes()*/ bool GetSelectOnlyVisibleNodes() const; using SelectionMode = QAbstractItemView::SelectionMode; /** Sets the selection mode of the inspector.*/ virtual void SetSelectionMode(SelectionMode mode) = 0; virtual SelectionMode GetSelectionMode() const = 0; Q_SIGNALS: /** * @brief A signal that will be emitted if the selected node has changed. * * @param nodes A list of data nodes that are newly selected. */ void CurrentSelectionChanged(NodeList nodes); public Q_SLOTS: /** * @brief Change the selection modus of the item view's selection model. * * If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view. * An outgoing selection can then at most contain the filtered nodes. * If false, the incoming non-visible selection will be stored and later added to the outgoing selection, * to include the original selection that could not be modified. * The part of the original selection, that is non-visible are the nodes that are not * * @param selectOnlyVisibleNodes The bool value to define the selection modus. */ void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes); /** * @brief Transform a list of data nodes into a model selection and set this as a new selection of the * selection model of the private member item view. * * The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If * necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case * the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable * in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection * but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes'). * * @param nodes A list of data nodes that should be newly selected. */ void SetCurrentSelection(NodeList selectedNodes); protected Q_SLOTS: void OnSelectionChanged(NodeList selectedNodes); protected: /** Helper function is called if data storage or predicate is changed to (re) initialize the widget correctly. Implement the function in derived classes.*/ virtual void Initialize() = 0; mitk::WeakPointer m_DataStorage; mitk::NodePredicateBase::Pointer m_NodePredicate; std::unique_ptr m_Connector; QmitkAbstractDataStorageInspector(QWidget* parent = nullptr); }; #endif // QMITKABSTRACTDATASTORAGEMODEL_H diff --git a/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h b/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h index 4ee22a0e26..fc42b2c4a6 100644 --- a/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h +++ b/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h @@ -1,92 +1,92 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKABSTRACTDATASTORAGEMODEL_H #define QMITKABSTRACTDATASTORAGEMODEL_H #include // mitk core #include #include #include // qt #include /* * @brief This abstract class extends the 'QAbstractItemModel' to accept an 'mitk::DataStorage' and a 'mitk::NodePredicateBase'. * It registers itself as a node event listener of the data storage. * The 'QmitkAbstractDataStorageModel' provides three empty functions, 'NodeAdded', 'NodeChanged' and 'NodeRemoved', that * may be implemented by subclasses. These functions allow to react to the 'AddNodeEvent', 'ChangedNodeEvent' and * 'RemoveNodeEvent' of the data storage. This might be useful to force an update on a custom view to correctly * represent the content of the data storage. * * A concrete implementation of this class is used to store the temporarily shown data nodes of the data storage. * These nodes may be a subset of all the nodes inside the data storage, if a specific node predicate is set. * * A model that implements this class has to return mitk::DataNode::Pointer objects for model indexes when the * role is QmitkDataNodeRole. */ class MITKQTWIDGETS_EXPORT QmitkAbstractDataStorageModel : public QAbstractItemModel { Q_OBJECT public: - virtual ~QmitkAbstractDataStorageModel(); + ~QmitkAbstractDataStorageModel() override; /* * @brief Sets the data storage and adds listener for node events. * * @param dataStorage A pointer to the data storage to set. */ void SetDataStorage(mitk::DataStorage* dataStorage); mitk::DataStorage* GetDataStorage() const; /* * @brief Sets the node predicate and updates the model data, according to the node predicate. * * @param nodePredicate A pointer to node predicate. */ void SetNodePredicate(mitk::NodePredicateBase* nodePredicate); mitk::NodePredicateBase* GetNodePredicate() const { return m_NodePredicate; } protected: virtual void DataStorageChanged() = 0; virtual void NodePredicateChanged() = 0; virtual void NodeAdded(const mitk::DataNode* node) = 0; virtual void NodeChanged(const mitk::DataNode* node) = 0; virtual void NodeRemoved(const mitk::DataNode* node) = 0; QmitkAbstractDataStorageModel(QObject* parent = nullptr); QmitkAbstractDataStorageModel(mitk::DataStorage* dataStorage, QObject* parent = nullptr); mitk::WeakPointer m_DataStorage; mitk::NodePredicateBase::Pointer m_NodePredicate; private: /** Helper triggered on the storage delete event */ void SetDataStorageDeleted(); unsigned long m_DataStorageDeletedTag; }; #endif // QMITKABSTRACTDATASTORAGEMODEL_H diff --git a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h index 4272175faf..3b53e140cf 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h +++ b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h @@ -1,79 +1,79 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H #define __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H #include // Microservices #include #include #include // MITK #include /** * @brief Base class for DataStorage inspector provider. */ template class QmitkDataStorageInspectorProviderBase : public mitk::IDataStorageInspectorProvider { public: - virtual QmitkAbstractDataStorageInspector* CreateInspector() const override; + QmitkAbstractDataStorageInspector* CreateInspector() const override; - virtual std::string GetInspectorID() const override; - virtual std::string GetInspectorDisplayName() const override; - virtual std::string GetInspectorDescription() const override; + std::string GetInspectorID() const override; + std::string GetInspectorDisplayName() const override; + std::string GetInspectorDescription() const override; us::ServiceRegistration RegisterService( us::ModuleContext *context = us::GetModuleContext()); void UnregisterService(); QmitkDataStorageInspectorProviderBase(const std::string& id); QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc= "" ); - virtual ~QmitkDataStorageInspectorProviderBase(); + ~QmitkDataStorageInspectorProviderBase() override; protected: QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other); QmitkDataStorageInspectorProviderBase &operator=(const QmitkDataStorageInspectorProviderBase &other) = delete; virtual us::ServiceProperties GetServiceProperties() const; /** * \brief Set the service ranking for this file reader. * * Default is zero and should only be chosen differently for a reason. * The ranking is used to determine which provider to use if several * equivalent providers have been found. * It may be used to replace a default provider from MITK in your own project. */ void SetRanking(int ranking); int GetRanking() const; private: class Impl; std::unique_ptr d; }; #ifndef ITK_MANUAL_INSTANTIATION #include "QmitkDataStorageInspectorProviderBase.tpp" #endif #endif /* __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H */ diff --git a/Modules/QtWidgets/include/QmitkDataStorageListInspector.h b/Modules/QtWidgets/include/QmitkDataStorageListInspector.h index 6bc899373d..ac98dc7441 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageListInspector.h +++ b/Modules/QtWidgets/include/QmitkDataStorageListInspector.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATASTORAGELISTINSPECTOR_H #define QMITKDATASTORAGELISTINSPECTOR_H #include #include #include #include "ui_QmitkDataStorageListInspector.h" /* * @brief This is an inspector that offers a simple list view on a data storage. */ class MITKQTWIDGETS_EXPORT QmitkDataStorageListInspector : public QmitkAbstractDataStorageInspector { Q_OBJECT public: QmitkDataStorageListInspector(QWidget* parent = nullptr); - virtual QAbstractItemView* GetView() override; - virtual const QAbstractItemView* GetView() const override; + QAbstractItemView* GetView() override; + const QAbstractItemView* GetView() const override; - virtual void SetSelectionMode(SelectionMode mode) override; - virtual SelectionMode GetSelectionMode() const override; + void SetSelectionMode(SelectionMode mode) override; + SelectionMode GetSelectionMode() const override; protected: - virtual void Initialize() override; + void Initialize() override; QmitkAbstractDataStorageModel* m_StorageModel; Ui_QmitkDataStorageListInspector m_Controls; }; #endif // QMITKDATASTORAGELISTINSPECTOR_H diff --git a/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h b/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h index e2dd6b31f9..d43df70f83 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h +++ b/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h @@ -1,105 +1,105 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATASTORAGESIMPLETREEMODEL_H #define QMITKDATASTORAGESIMPLETREEMODEL_H #include // qt widgets module #include class QmitkDataStorageTreeModelInternalItem; /** * @brief The 'QmitkDataStorageSimpleTreeModel' is a basic tree model, derived from the 'QmitkAbstractDataStorageModel'. * It provides functions to accept a data storage and a node predicate in order to customize the model data nodes. * Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.* * This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'. * This model is a "light" version of the classic QmitkDataStorgageTreeModel. The differences between both are the following: * - This class currently does not support DragNDrop. * - This class does not have the ability to change hirarchy or changes the layer property *of nodes. This was skipped on purpose, because that is not the job of the storage model. * - If a tree item A is removed this class does not attach children of A to the parent *of A. Instead the complete tree representation is updated. This was changed on purpose *because otherwise the internal representation of the model would not reflect the data storage graph anymore. */ class MITKQTWIDGETS_EXPORT QmitkDataStorageSimpleTreeModel : public QmitkAbstractDataStorageModel { Q_OBJECT public: QmitkDataStorageSimpleTreeModel(QObject *parent); - virtual ~QmitkDataStorageSimpleTreeModel(); + ~QmitkDataStorageSimpleTreeModel() override; // override from 'QmitkAbstractDataStorageModel' /* * @brief See 'QmitkAbstractDataStorageModel' */ void DataStorageChanged() override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodePredicateChanged() override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeAdded(const mitk::DataNode *node) override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeChanged(const mitk::DataNode *node) override; /* * @brief See 'QmitkAbstractDataStorageModel' */ void NodeRemoved(const mitk::DataNode *node) override; // override pure virtual from 'QAbstractItemModel' QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex &child) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; Qt::ItemFlags flags(const QModelIndex &index) const override; protected: using TreeItem = QmitkDataStorageTreeModelInternalItem; private: void UpdateModelData(); void AddNodeInternal(const mitk::DataNode *node); mitk::DataNode *GetParentNode(const mitk::DataNode *node) const; TreeItem *TreeItemFromIndex(const QModelIndex &index) const; QModelIndex IndexFromTreeItem(TreeItem *item) const; void ResetTree(); TreeItem *m_Root; /**helper structure to check, if a tree item is realy part of the model. Prefered over iterating over the tree by hand because we can use std::find.*/ std::list m_TreeItems; }; #endif // QmitkDataStorageSimpleTreeModel_H diff --git a/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h b/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h index 848c71645e..d5a0391775 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h +++ b/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATASTORAGETREEINSPECTOR_H #define QMITKDATASTORAGETREEINSPECTOR_H #include #include #include #include "ui_QmitkDataStorageTreeInspector.h" /* * @brief This is an inspector that offers a simple tree view on a data storage. * Something like the "data manager plugin", but in simple/light (with less functionality) * It uses the QmitkDataStorageSimpleTreeModel. */ class MITKQTWIDGETS_EXPORT QmitkDataStorageTreeInspector : public QmitkAbstractDataStorageInspector { Q_OBJECT public: QmitkDataStorageTreeInspector(QWidget* parent = nullptr); - virtual QAbstractItemView* GetView() override; - virtual const QAbstractItemView* GetView() const override; + QAbstractItemView* GetView() override; + const QAbstractItemView* GetView() const override; - virtual void SetSelectionMode(SelectionMode mode) override; - virtual SelectionMode GetSelectionMode() const override; + void SetSelectionMode(SelectionMode mode) override; + SelectionMode GetSelectionMode() const override; protected: - virtual void Initialize() override; + void Initialize() override; QmitkAbstractDataStorageModel* m_StorageModel; Ui_QmitkDataStorageTreeInspector m_Controls; }; #endif // QMITKDATASTORAGETREEINSPECTOR_H diff --git a/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h b/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h index e9df9eb9a8..e642007672 100644 --- a/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h +++ b/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKINTERACTIONSCHEMETOOLBAR_H #define QMITKINTERACTIONSCHEMETOOLBAR_H #include "MitkQtWidgetsExports.h" // mitk core #include "mitkInteractionSchemeSwitcher.h" #include #include /** * @brief * * */ class MITKQTWIDGETS_EXPORT QmitkInteractionSchemeToolBar : public QToolBar { Q_OBJECT public: using InteractionScheme = mitk::InteractionSchemeSwitcher::InteractionScheme; QmitkInteractionSchemeToolBar(QWidget* parent = nullptr); - virtual ~QmitkInteractionSchemeToolBar() override; + ~QmitkInteractionSchemeToolBar() override; void SetInteractionEventHandler(mitk::InteractionEventHandler::Pointer interactionEventHandler); protected slots: void OnInteractionSchemeChanged(); void AddButton(InteractionScheme id, const QString& toolName, const QIcon& icon, bool on = false); private: QActionGroup* m_ActionGroup; mitk::InteractionSchemeSwitcher::Pointer m_InteractionSchemeSwitcher; mitk::InteractionEventHandler::Pointer m_InteractionEventHandler; }; #endif // QMITKINTERACTIONSCHEMETOOLBAR_H diff --git a/Modules/QtWidgets/include/QmitkMxNMultiWidget.h b/Modules/QtWidgets/include/QmitkMxNMultiWidget.h index 06ec04b91e..4b0de0fed0 100644 --- a/Modules/QtWidgets/include/QmitkMxNMultiWidget.h +++ b/Modules/QtWidgets/include/QmitkMxNMultiWidget.h @@ -1,154 +1,154 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKMXNMULTIWIDGET_H #define QMITKMXNMULTIWIDGET_H // qt widgets module #include "MitkQtWidgetsExports.h" #include "QmitkRenderWindowWidget.h" // mitk core #include #include #include #include #include // qt #include class QHBoxLayout; class QVBoxLayout; class QGridLayout; class QSpacerItem; class QmitkRenderWindow; namespace mitk { class RenderingManager; } /** * @brief The 'QmitkMxNMultiWidget' is a QWidget that is used to display multiple render windows at once. * Render windows can dynamically be added and removed to change the layout of the multi widget. This * is done by using the 'ResetLayout'-function to define a layout. This will automatically add or remove * the appropriate number of render window widgets. * Several functions exist to retrieve specific render window(s) (widgets) by their position or name. * * The class uses the 'DisplayActionEventBroadcast' and 'DisplayActionEventHandler' classes to * load a state machine and set an event configuration. PACS mode is used per default. * Using the 'Synchronize' function the user can enable or disable the synchronization of display action events. * See 'DisplayActionEventFunctions'-class for the different synchronized and non-synchronized functions used. */ class MITKQTWIDGETS_EXPORT QmitkMxNMultiWidget : public QWidget { Q_OBJECT public: using RenderWindowWidgetPointer = std::shared_ptr; using RenderWindowWidgetMap = std::map>; using RenderWindowHash = QHash; QmitkMxNMultiWidget(QWidget* parent = 0, Qt::WindowFlags f = 0, mitk::RenderingManager* renderingManager = nullptr, mitk::BaseRenderer::RenderingMode::Type renderingMode = mitk::BaseRenderer::RenderingMode::Standard, const QString& multiWidgetName = "mxnmulti"); - virtual ~QmitkMxNMultiWidget() = default; + ~QmitkMxNMultiWidget() override = default; void SetDataStorage(mitk::DataStorage* dataStorage); void InitializeRenderWindowWidgets(); mitk::InteractionEventHandler::Pointer GetInteractionEventHandler() { return m_DisplayActionEventBroadcast.GetPointer(); }; void ResetLayout(int row, int column); void Synchronize(bool synchronized); void SetInteractionScheme(mitk::InteractionSchemeSwitcher::InteractionScheme scheme); RenderWindowWidgetMap GetRenderWindowWidgets() const; RenderWindowWidgetPointer GetRenderWindowWidget(int row, int column) const; RenderWindowWidgetPointer GetRenderWindowWidget(const QString& widgetName) const; RenderWindowHash GetRenderWindows() const; QmitkRenderWindow* GetRenderWindow(int row, int column) const; QmitkRenderWindow* GetRenderWindow(const QString& widgetName) const; void SetActiveRenderWindowWidget(RenderWindowWidgetPointer activeRenderWindowWidget); RenderWindowWidgetPointer GetActiveRenderWindowWidget() const; RenderWindowWidgetPointer GetFirstRenderWindowWidget() const; RenderWindowWidgetPointer GetLastRenderWindowWidget() const; unsigned int GetNumberOfRenderWindowWidgets() const; void RequestUpdate(const QString& widgetName); void RequestUpdateAll(); void ForceImmediateUpdate(const QString& widgetName); void ForceImmediateUpdateAll(); void ActivateAllCrosshairs(bool activate); const mitk::Point3D GetSelectedPosition(const QString& widgetName) const; public Q_SLOTS: void SetSelectedPosition(const QString& widgetName, const mitk::Point3D& newPosition); // mouse events void wheelEvent(QWheelEvent* e) override; void mousePressEvent(QMouseEvent* e) override; void moveEvent(QMoveEvent* e) override; Q_SIGNALS: void WheelMoved(QWheelEvent *); void Moved(); private: void InitializeGUI(); void InitializeDisplayActionEventHandling(); void CreateRenderWindowWidget(); void DestroyRenderWindowWidget(); void FillMultiWidgetLayout(); QString GetNameFromIndex(int row, int column) const; QString GetNameFromIndex(size_t index) const; QGridLayout* m_MxNMultiWidgetLayout; RenderWindowWidgetMap m_RenderWindowWidgets; RenderWindowWidgetPointer m_ActiveRenderWindowWidget; int m_MultiWidgetRows; int m_MultiWidgetColumns; int m_PlaneMode; mitk::RenderingManager* m_RenderingManager; mitk::BaseRenderer::RenderingMode::Type m_RenderingMode; QString m_MultiWidgetName; mitk::DisplayActionEventBroadcast::Pointer m_DisplayActionEventBroadcast; std::unique_ptr m_DisplayActionEventHandler; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITKMXNMULTIWIDGET_H diff --git a/Modules/QtWidgets/include/QmitkOverlayWidget.h b/Modules/QtWidgets/include/QmitkOverlayWidget.h index 34e746c9d3..b9d56364e5 100644 --- a/Modules/QtWidgets/include/QmitkOverlayWidget.h +++ b/Modules/QtWidgets/include/QmitkOverlayWidget.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_OVERLAY_WIDGET_H #define QMITK_OVERLAY_WIDGET_H #include #include /** Simple widget that can be used to achive overlays. The overlay will lie above its parent. * This implementation just renders a semi transparent black background. To add content to the * overlay derive from this class.*/ class MITKQTWIDGETS_EXPORT QmitkOverlayWidget : public QWidget { Q_OBJECT Q_PROPERTY(bool transparentForMouseEvents READ isTransparentForMouseEvents WRITE setTransparentForMouseEvents) public: explicit QmitkOverlayWidget(QWidget* parent = nullptr); - virtual ~QmitkOverlayWidget(); + ~QmitkOverlayWidget() override; bool isTransparentForMouseEvents() const; void setTransparentForMouseEvents(bool transparent = true); protected: bool event(QEvent* e) override; bool eventFilter(QObject* watched, QEvent* event) override; void paintEvent(QPaintEvent* event) override; private: void installEventFilterOnParent(); void removeEventFilterFromParent(); }; #endif diff --git a/Modules/QtWidgets/include/QmitkRenderWindowWidget.h b/Modules/QtWidgets/include/QmitkRenderWindowWidget.h index d74ff46a9c..d7a4815914 100644 --- a/Modules/QtWidgets/include/QmitkRenderWindowWidget.h +++ b/Modules/QtWidgets/include/QmitkRenderWindowWidget.h @@ -1,113 +1,113 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKRENDERWINDOWWIDGET_H #define QMITKRENDERWINDOWWIDGET_H // qt widgets module #include "MitkQtWidgetsExports.h" #include "QmitkRenderWindow.h" // mitk core #include #include #include #include #include // qt #include #include /** * @brief The 'QmitkRenderWindowWidget' is a QWidget that holds a render window * and some associates properties, like a crosshair (pointset) and decorations. * Decorations are corner annotation (text and color), frame color or background color * and can be set using this class. * The 'QmitkRenderWindowWidget' is used inside the 'QmitkMxNMultiWidget', where a map contains * several render window widgets to create the MxN display. */ class MITKQTWIDGETS_EXPORT QmitkRenderWindowWidget : public QWidget { Q_OBJECT public: QmitkRenderWindowWidget( QWidget* parent = nullptr, const QString& widgetName = "", mitk::DataStorage* dataStorage = nullptr, mitk::BaseRenderer::RenderingMode::Type renderingMode = mitk::BaseRenderer::RenderingMode::Standard ); - virtual ~QmitkRenderWindowWidget(); + ~QmitkRenderWindowWidget() override; void SetDataStorage(mitk::DataStorage* dataStorage); const QString& GetWidgetName() const { return m_WidgetName; }; QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; }; mitk::SliceNavigationController* GetSliceNavigationController() const; void RequestUpdate(); void ForceImmediateUpdate(); void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower); void ShowGradientBackground(bool enable); std::pair GetGradientBackgroundColors() const { return m_GradientBackgroundColors; }; bool IsGradientBackgroundOn() const; void SetDecorationColor(const mitk::Color& color); mitk::Color GetDecorationColor() const { return m_DecorationColor; }; void ShowColoredRectangle(bool show); bool IsColoredRectangleVisible() const; void ShowCornerAnnotation(bool show); bool IsCornerAnnotationVisible() const; void SetCornerAnnotationText(const std::string& cornerAnnotation); std::string GetCornerAnnotationText() const; bool IsRenderWindowMenuActivated() const; void ActivateCrosshair(bool activate); private: void InitializeGUI(); void InitializeDecorations(); void SetCrosshair(mitk::Point3D selectedPoint); QString m_WidgetName; QHBoxLayout* m_Layout; mitk::DataStorage* m_DataStorage; QmitkRenderWindow* m_RenderWindow; mitk::RenderingManager::Pointer m_RenderingManager; mitk::BaseRenderer::RenderingMode::Type m_RenderingMode; mitk::DataNode::Pointer m_PointSetNode; mitk::PointSet::Pointer m_PointSet; std::pair m_GradientBackgroundColors; mitk::Color m_DecorationColor; vtkSmartPointer m_RectangleProp; vtkSmartPointer m_CornerAnnotation; }; #endif // QMITKRENDERWINDOWWIDGET_H diff --git a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h index f4818e5798..f294820181 100644 --- a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h +++ b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKHOTKEYLINEEDIT_H #define QMITKHOTKEYLINEEDIT_H #include "MitkQtWidgetsExtExports.h" // qt #include #include class MITKQTWIDGETSEXT_EXPORT QmitkHotkeyLineEdit : public QLineEdit { Q_OBJECT public: static const std::string TOOLTIP; QmitkHotkeyLineEdit(QWidget* parent = nullptr); QmitkHotkeyLineEdit(const QKeySequence& qKeySequence, QWidget* parent = nullptr); QmitkHotkeyLineEdit(const QString& qQString, QWidget* parent = nullptr); virtual void SetKeySequence(const QKeySequence& qKeySequence); virtual void SetKeySequence(const QString& qKeySequenceAsString); virtual QKeySequence GetKeySequence(); virtual QString GetKeySequenceAsString(); bool Matches(QKeyEvent *event); protected Q_SLOTS: void LineEditTextChanged(const QString&); protected: - virtual void keyPressEvent(QKeyEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; void Init(); QKeySequence m_KeySequence; }; #endif // QMITKHOTKEYLINEEDIT_H diff --git a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h index 03e54c8a8e..9ad0d80376 100644 --- a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h +++ b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h @@ -1,96 +1,96 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H #define QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H // render window manager UI module #include "MitkRenderWindowManagerUIExports.h" #include "ui_QmitkRenderWindowDataStorageInspector.h" // render window manager module #include #include #include // qt widgets module #include /** * The 'QmitkRenderWindowDataStorageInspector' offers a GUI to manipulate the base renderer / render windows of the MITK workbench. * * In order to use this widget, a (e.g.) plugin has to set the controlled renderer, which will be forwarded to * a render window view direction controller. */ class MITKRENDERWINDOWMANAGERUI_EXPORT QmitkRenderWindowDataStorageInspector : public QmitkAbstractDataStorageInspector { Q_OBJECT public: QmitkRenderWindowDataStorageInspector(QWidget* parent = nullptr); // override from 'QmitkAbstractDataStorageInspector' /** * @brief See 'QmitkAbstractDataStorageInspector' */ - virtual QAbstractItemView* GetView() override; + QAbstractItemView* GetView() override; /** * @brief See 'QmitkAbstractDataStorageInspector' */ - virtual const QAbstractItemView* GetView() const override; + const QAbstractItemView* GetView() const override; /** * @brief See 'QmitkAbstractDataStorageInspector' */ - virtual void SetSelectionMode(SelectionMode mode) override; + void SetSelectionMode(SelectionMode mode) override; /** * @brief See 'QmitkAbstractDataStorageInspector' */ - virtual SelectionMode GetSelectionMode() const override; + SelectionMode GetSelectionMode() const override; /** * @brief Set the controlled base renderer. */ void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer); /** * @brief Set the currently selected render window. * * @param renderWindowId the text inside the combo box */ void SetActiveRenderWindow(const QString& renderWindowId); private Q_SLOTS: void ModelRowsInserted(const QModelIndex& parent, int start, int end); void SetAsBaseLayer(); void ResetRenderer(); void ChangeViewDirection(const QString& viewDirection); private: - virtual void Initialize() override; + void Initialize() override; void SetUpConnections(); Ui::QmitkRenderWindowDataStorageInspector m_Controls; std::unique_ptr m_StorageModel; std::unique_ptr m_RenderWindowLayerController; std::unique_ptr m_RenderWindowViewDirectionController; }; #endif // QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H diff --git a/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h b/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h index 0d4426c3d6..dead35f5d9 100644 --- a/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h +++ b/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h @@ -1,326 +1,326 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSEMANTICRELATIONSINTEGRATION_H #define MITKSEMANTICRELATIONSINTEGRATION_H #include // semantic relations module #include "mitkISemanticRelationsObservable.h" #include "mitkISemanticRelationsObserver.h" #include "mitkSemanticTypes.h" // mitk core #include namespace mitk { /** * @brief The API provides functions to manipulate image relations and instances * that are helpful during follow-up examination, like control-points (time period), * types of the images or lesions that may be visible on multiple images. * * The class is able to generate IDs from given data nodes using DICOM information. * These IDs are used to identify the corresponding instances of a specific case. * The case can also be directly identified by the given case ID. * * In order for most functions to work the case ID has to be used as a parameter. * If not, these functions do nothing. * * The class implements the ISemanticRelationsObservable interface to allow observers to * be informed about changes in the semantic relation storage. */ class MITKSEMANTICRELATIONS_EXPORT SemanticRelationsIntegration : public ISemanticRelationsObservable { public: /************************************************************************/ /* functions to implement the observer pattern */ /************************************************************************/ /** * @brief Adds the given concrete observer to the vector that holds all currently registered observer. * If the observer is already registered, it will not be added to the observer vector. * * @param observer The concrete observer to register. */ - virtual void AddObserver(ISemanticRelationsObserver* observer) override; + void AddObserver(ISemanticRelationsObserver* observer) override; /** * @brief Removes the given concrete observer from the vector that holds all currently registered observer. * * @param observer The concrete observer to unregister. */ - virtual void RemoveObserver(ISemanticRelationsObserver* observer) override; + void RemoveObserver(ISemanticRelationsObserver* observer) override; virtual ~SemanticRelationsIntegration() {} /************************************************************************/ /* functions to add / remove instances / attributes */ /************************************************************************/ /** * @brief Add the given image to the set of already existing images. * The date is extracted from the DICOM data of the image node and is compared to already existing control points in the semantic relations model. * The function tries to find a fitting control point or to extend an already existing control point, if the extracted control point is close to * any other, already existing control point. * Finally, the image is linked to the correct control point. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. */ void AddImage(const DataNode* imageNode); /** * @brief Remove the given image from the set of already existing images. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. */ void RemoveImage(const DataNode* imageNode); /** * @brief Add a newly created lesion to the set of already existing lesions - with no connection to a specific image / segmentation of the case data. * * @pre The UID of the lesion must not already exist for a lesion instance. * @throw SemanticRelationException, it the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists'). * * @param caseID The current case identifier is defined by the given string. * @param lesion The lesion instance to add. */ void AddLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion); /** * @brief Overwrite an already existing lesion instance (this may be useful to overwrite the lesion with a different lesion class). * * @pre The UID of the lesion has to exist for a lesion instance. * @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists'). * * @param caseID The current case identifier is defined by the given string. * @param lesion The lesion instance that overwrites an existing lesion. */ void OverwriteLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion); /** * @brief Add a newly created lesion to the set of already existing lesions. The lesion is added and a reference to * the lesion is added to the segmentation. If the segmentation is already linked to a lesion, the * old linkage is overwritten (this can be checked via 'IsRepresentingALesion'). * * @pre The given segmentation data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr). * @pre The UID of the lesion must not already exist for a lesion instance. * @throw SemanticRelationException, if the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists'). * * @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. * @param lesion The lesion instance to add and link. */ void AddLesionAndLinkSegmentation(const DataNode* segmentationNode, const SemanticTypes::Lesion& lesion); /** * @brief Remove the given lesion from the set of already existing lesions. * * @pre The UID of the lesion has to exist for a lesion instance. * @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists'). * @pre The function needs to assure that no segmentation is still representing (linked to) this lesion. * @throw SemanticRelationException, if the lesion instance to remove is still linked to by any segmentation (this can be checked via 'GetAllSegmentationsOfLesion'). * * @param caseID The current case identifier is defined by the given string. * @param lesion The lesion instance to remove. */ void RemoveLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion); /** * @brief Add a segmentation instance to the set of already existing segmentations - with no connection to a specific lesion. * * @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. * @param parentNode The node identifier of the parent node is extracted from the given parent data node. */ void AddSegmentation(const DataNode* segmentationNode, const DataNode* parentNode); /** * @brief Link the given segmentation instance to an an already existing lesion instance. If the segmentation is already linked to a lesion instance, the * old linkage is overwritten (this can be checked via 'IsRepresentingALesion'). * * @pre The given segmentation data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr). * @pre The UID of the lesion has to exist for a lesion instance. * @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists'). * * @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. * @param lesion The lesion instance to link. */ void LinkSegmentationToLesion(const DataNode* segmentationNode, const SemanticTypes::Lesion& lesion); /** * @brief Unlink the given segmentation instance from the linked lesion instance. * The lesion may stay unlinked to any segmentation. * * @pre The given segmentation data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr). * * @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. */ void UnlinkSegmentationFromLesion(const DataNode* segmentationNode); /** * @brief Remove the given segmentation from the set of already existing segmentations. * * @pre The given segmentation data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr). * * @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node. */ void RemoveSegmentation(const DataNode* segmentationNode); /** * @brief Set the control point for the given image. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. * @param controlPoint The control point instance which is used for the given image. */ void SetControlPointOfImage(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint); /** * @brief Add a newly created control point to the set of already existing control points. A reference to the control point is added to the given image. * This function combines adding a control point and linking it, since a control point with no associated data is not allowed. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * @pre The UID of the control point must not already exist for a control point instance. * @throw SemanticRelationException, if the UID of the control point already exists for a control point instance (this can be checked via 'InstanceExists'). * @pre The given control point must not already be contained in an existing control point interval. * @throw SemanticRelationException, if the given control point is already contained in an existing control point interval (this can be checked via 'CheckContainingControlPoint'). * @pre The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true'). * @throw SemanticRelationException, if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint'). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. * @param controlPoint The control point instance to add. For a newly added control point always has "startDate = endDate". * @param checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link. */ void AddControlPointAndLinkImage(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint, bool checkConsistence = true); /** * @brief Link the given image to an already existing control point. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * @pre The UID of the control point has to exist for a control point instance. * @throw SemanticRelationException, if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists'). * @pre The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true'). * @throw SemanticRelationException, if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint'). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. * @param controlPoint The control point instance to link. * @param checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link. */ void LinkImageToControlPoint(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint, bool checkConsistence = true); /** * @brief Unlink the given image from the linked control point. * If an image is unlinked from a control point, the function needs to check whether the control point is still linked to any other image: * - if not, the control point instance will be removed (has to be removed since a control point with no associated image is not allowed). * - if so, the function has to make sure that the control point instance is shortened to its minimum time period (e.g. moving the end point to an earlier date). * * @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node. */ void UnlinkImageFromControlPoint(const DataNode* imageNode); /** * @brief Add an examination period instance to the set of already existing examination periods - with no connection to a specific control point. * * @pre The UID of the examination period must not already exist for an examination period instance. * @throw SemanticRelationException, if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists'). * * @param caseID The current case identifier is defined by the given string. * @param examinationPeriod The examination period to add. */ void AddExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod); /** * @brief Rename an already existing examination period instance. * * @pre The UID of the examination period has to exist for an examination period instance. * @throw SemanticRelationException, if the UID of the examination period does not exist for an examination period instance (this can be checked via 'InstanceExists'). * * @param caseID The current case identifier is defined by the given string. * @param lesion The examination period instance that renames an existing examination period. */ void RenameExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod); /** * @brief Add a control point to the vector of control point UIDs of an existing examination period. * * @pre The UID of the control point has to exist for a control point instance. * @throw SemanticRelationException, if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists'). * @pre The UID of the examination period must not already exist for an examination period instance. * @throw SemanticRelationException, if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists'). * * @param caseID The current case identifier is defined by the given string. * @param controlPoint The control point instance to add to the examination period. * @param examinationPeriod The examination period to which the control point should be added. */ void AddControlPointToExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::ExaminationPeriod& examinationPeriod); /** * @brief Set (and possibly overwrite) the information type of the given image. * An already associated information type might be removed if is not referenced by any other image: * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * @post If the information type instance did not exist before, it is now added. * * @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case. * @param informationType An information type that identifies the corresponding information type instance. */ void SetInformationType(const DataNode* imageNode, const SemanticTypes::InformationType& informationType); /** * @brief Set the information type of the given image. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * @post If the information type instance did not exist before, it is now added. * * @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case. * @param informationType An information type that identifies the corresponding information type instance. */ void AddInformationTypeToImage(const DataNode* imageNode, const SemanticTypes::InformationType& informationType); /** * @brief Remove the information type of the given image. * If the information type is removed, the function needs to check whether the information type is referenced by any other image: * - if not, the information type instance can be removed (has to be removed since an information type with no associated image is not allowed). * - if so, the information type is just removed from the given image. * * @pre The given image data node has to be valid (!nullptr). * @throw SemanticRelationException, if the given image data node is invalid (==nullptr). * * @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case. */ void RemoveInformationTypeFromImage(const DataNode* imageNode); private: /** * @brief A vector that stores the currently registered observer of this observable subject. */ static std::vector m_ObserverVector; /** * @brief The class notifies (updates) the observer with a given case ID. * The view's caseID was set before in the GUI. The parts of the view that observe changes in the semantic relations are only updated, * if the given case ID is equal to the observer's current caseID and thus the observer currently shows the semantic information of the given case. * * @param caseID The caseID that identifies the currently active patient / case. */ - virtual void NotifyObserver(const mitk::SemanticTypes::CaseID& caseID) const override; + void NotifyObserver(const mitk::SemanticTypes::CaseID& caseID) const override; /** * @brief Remove all control points from the storage that are not referenced by any image anymore. * This might happen if an image has been removed (and unlinked from the corresponding control point) * or if the user sets a new control point for an image manually in the GUI. * * @param caseID The current case identifier is defined by the given string. */ void ClearControlPoints(const SemanticTypes::CaseID& caseID); }; } // namespace mitk #endif // MITKSEMANTICRELATIONSINTEGRATION_H diff --git a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h index 1bd7d46a0c..0fe52a106b 100644 --- a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h +++ b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H #define QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H // semantic relations UI module #include "MitkSemanticRelationsUIExports.h" // semantic relations module #include "mitkSemanticTypes.h" // qt widgets module #include "QmitkAbstractDataStorageInspector.h" /* * @brief The QmitkAbstractSemanticRelationsStorageInspector is a QmitkAbstractDataStorageInspector that can be used to * show the currently available data of an (abstract) semantic relations storage model. */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkAbstractSemanticRelationsStorageInspector : public QmitkAbstractDataStorageInspector { Q_OBJECT public: - virtual ~QmitkAbstractSemanticRelationsStorageInspector(); + ~QmitkAbstractSemanticRelationsStorageInspector() override; /** * @brief Extends the abstract base class to allow setting the current case ID which is needed to access the * semantic relations storage. The function sets the case ID in the storage model. * * @param caseID A case ID as string */ virtual void SetCaseID(const mitk::SemanticTypes::CaseID& caseID) = 0; /** * @brief Extends the abstract base class to allow setting the current lesion. * The function sets the lesion in the storage model. * *@param lesion The selected lesion */ virtual void SetLesion(const mitk::SemanticTypes::Lesion& lesion) = 0; protected: QmitkAbstractSemanticRelationsStorageInspector(QWidget* parent = nullptr); }; #endif // QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H diff --git a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h index 543ff5a007..ca12cb489a 100644 --- a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h +++ b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h @@ -1,115 +1,115 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H #define QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H // mitk semantic relations UI #include "MitkSemanticRelationsUIExports.h" // semantic relations module #include #include #include #include // qt widgets module #include "QmitkAbstractDataStorageModel.h" /* * @brief The QmitkAbstractSemanticRelationsStorageModel is a subclass of 'QmitkAbstractDataStorageModel' and provides additional * functionality to set and store a semantic relations instance, the current case ID and the current lesion. */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkAbstractSemanticRelationsStorageModel : public QmitkAbstractDataStorageModel, public mitk::ISemanticRelationsObserver { Q_OBJECT public: QmitkAbstractSemanticRelationsStorageModel(QObject* parent = nullptr); - virtual ~QmitkAbstractSemanticRelationsStorageModel(); + ~QmitkAbstractSemanticRelationsStorageModel() override; /* * @brief Update this model with the data from the semantic relations, * if the case ID is equal to the currently selected case ID of the table model. * * Overridden from 'ISemanticRelationsObserver'. * In order for the Update-function to be called, this model has to be added as an observer of SemanticRelation * (e.g. m_SemanticRelations->AddObserver(m_SemanticRelationsStorageModel);) * * @par caseID The current case ID to identify the currently active patient / case. */ - virtual void Update(const mitk::SemanticTypes::CaseID& caseID) override; + void Update(const mitk::SemanticTypes::CaseID& caseID) override; /** * @brief Set the current case ID which is needed to access the semantic relations storage. * * @param caseID A case ID as string */ void SetCaseID(const mitk::SemanticTypes::CaseID& caseID); const mitk::SemanticTypes::CaseID& GetCaseID() const { return m_CaseID; } /** * @brief Set the current lesion which can be used to show on which images the lesion is visible. * * @param lesion The selected lesion */ void SetLesion(const mitk::SemanticTypes::Lesion& lesion); const mitk::SemanticTypes::Lesion& GetLesion() const { return m_Lesion; } /** * @brief Set the current data node selection which can be used to show which lesions * are visible on the node selection. * * @param dataNodeSelection The selected data nodes */ void SetDataNodeSelection(const QList& dataNodeSelection); const QList& GetSelectedDataNodes() const { return m_SelectedDataNodes; }; /* * @brief Update the semantic relations storage model with the current data from the semantic relations model * and the current case ID. */ void UpdateModelData(); Q_SIGNALS: void ModelUpdated(); protected: /** * @brief Create a new 'SemanticRelationsDataStorageAccess' instance with the new data storage and * update the model data. * This functions is called inside the 'SetDataStorage'-function from the parent class. */ - virtual void DataStorageChanged() override; + void DataStorageChanged() override; /** * @brief This function is called if the model data is updated. It can be used by subclasses to define * the way the data of a specific model is generated. It typically consists of access to the * semantic relations storage to retrieve certain information. */ virtual void SetData() = 0; std::unique_ptr m_SemanticRelationsDataStorageAccess; std::unique_ptr m_SemanticRelationsIntegration; mitk::SemanticTypes::CaseID m_CaseID; QList m_SelectedDataNodes; mitk::SemanticTypes::Lesion m_Lesion; }; #endif // QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H diff --git a/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h b/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h index f7653ec75d..423aa5a896 100644 --- a/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h +++ b/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h @@ -1,110 +1,110 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKLESIONTREEMODEL_H #define QMITKLESIONTREEMODEL_H // mitk semantic relations UI #include "MitkSemanticRelationsUIExports.h" #include "QmitkAbstractSemanticRelationsStorageModel.h" #include "QmitkLesionTreeItem.h" /* * @brief The 'QmitkLesionTreeModel' is a subclass of 'QmitkAbstractSemanticRelationsStorageModel' and provides * functionality to serve as a tree model. * The tree model creates a new top-level tree item for each lesion that is stored inside the semantic relations storage. * Each lesion tree item contains lesion data that can be display inside a tree view. The lesion data * consists of a lesion with with its UID, name and lesion class. The name or UID is used for the top-level tree items. * Additionally the lesion data contains two vectors which define the lesion presence (bool) and the lesion volume (double) * for each control-point - information type pair. The lesion presence will be used inside this model for the tree items. * The volume is used inside another tree model. * * The model holds the last segmentation that is added to the data storage to support the process of defining a new lesion * (and linking it with the latest segmentation) (see 'NodeAdded'). * Furthermore the model is able to accept a 'QList' of currently selected data nodes and to use it to change the background * color of each lesion tree item that is connected to this data node(s). This helps to see which lesion is already found and * defined for a given (set of) data node(s). */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkLesionTreeModel : public QmitkAbstractSemanticRelationsStorageModel { Q_OBJECT public: /** * @brief Initialize the root item of the model. The root item does not have a parent item. */ QmitkLesionTreeModel(QObject* parent = nullptr); ////////////////////////////////////////////////////////////////////////// // overridden virtual functions from QAbstractItemModel ////////////////////////////////////////////////////////////////////////// - virtual QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override; - virtual QModelIndex parent(const QModelIndex& itemIndex) const override; + QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& itemIndex) const override; - virtual int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override; - virtual int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override; + int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override; + int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; ////////////////////////////////////////////////////////////////////////// // end override ////////////////////////////////////////////////////////////////////////// const mitk::DataNode* GetLastSegmentation() const; protected: // the following functions have to be overridden but are not implemented in this model - virtual void NodePredicateChanged() override { } - virtual void NodeAdded(const mitk::DataNode*) override; - virtual void NodeChanged(const mitk::DataNode*) override { } - virtual void NodeRemoved(const mitk::DataNode*) override { } + void NodePredicateChanged() override { } + void NodeAdded(const mitk::DataNode*) override; + void NodeChanged(const mitk::DataNode*) override { } + void NodeRemoved(const mitk::DataNode*) override { } /** * @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points * of the current case and stores them to define the header of the tree. * Furthermore all lesions are retrieved and the lesion data is stored and show in the tree view. */ - virtual void SetData() override; + void SetData() override; private: void SetLesionData(); void AddLesion(const mitk::SemanticTypes::Lesion& lesion); void SetSelectedDataNodesPresence(); /** * @brief The function uses the ID of the lesion to see if a data node presence was already set. * If not, the given bool value is used and stored inside a member variable. If the lesion presence * was already set, it will be overwritten. * The function is used by the 'SetSelectedDataNodesPresence' function. * * @param lesion The lesion whose data node presence should be set * @param dataNodePresence The bool value that defines the data node presence of the given lesion */ void SetDataNodePresenceOfLesion(const mitk::SemanticTypes::Lesion* lesion, bool dataNodePresence); QmitkLesionTreeItem* GetItemByIndex(const QModelIndex& index) const; std::map m_DataNodePresence; const mitk::DataNode* m_LastSegmentation; std::shared_ptr m_RootItem; mitk::SemanticTypes::ControlPointVector m_ControlPoints; mitk::SemanticTypes::LesionVector m_CurrentLesions; }; #endif // QMITKLESIONTREEMODEL_H diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h index 263baafa41..a0cdfc7e97 100644 --- a/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h +++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKPATIENTTABLEHEADERVIEW_H #define QMITKPATIENTTABLEHEADERVIEW_H // semantic relations ui module #include "MitkSemanticRelationsUIExports.h" // qt #include #include #include /* * @brief */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkPatientTableHeaderView : public QHeaderView { Q_OBJECT public: QmitkPatientTableHeaderView(QWidget* parent = nullptr); - ~QmitkPatientTableHeaderView(); + ~QmitkPatientTableHeaderView() override; enum HeaderDataModelRoles { HorizontalHeaderDataRole = Qt::UserRole }; /** * @brief Set the model of the table view of this header view. * This model returns a standard item model for the 'HorizontalHeaderDataRole'-role. * The header model has been previously filled with header data. * This function is overwritten from QHeaderView. */ - virtual void setModel(QAbstractItemModel* model) override; + void setModel(QAbstractItemModel* model) override; protected: /** * @brief Paint each header using 'PaintHeader'. * This function is overwritten from QHeaderView. */ - virtual void paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const override; + void paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const override; /** * @brief Get the section size by retrieving the text content. * The section size is dependent on the child and parent headers. * This function is overwritten from QHeaderView. */ QSize sectionSizeFromContents(int logicalIndex) const override; private: int PaintHeader(QPainter* painter, const QModelIndex& currentIndex, int logicalIndex, const QRect& sectionRect, int top) const; QSize HeaderSize(const QModelIndex& index) const; int CurrentHeaderLeft(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex, int left) const; int CurrentHeaderWidth(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex) const; QModelIndexList ParentIndexList(QModelIndex index) const; QModelIndex HeaderIndex(int sectionIndex) const; QModelIndex FindHeader(const QModelIndex& currentIndex, int sectionIndex, int& currentHeaderIndex) const; QModelIndexList ListHeader(const QModelIndex& currentIndex) const; QStandardItemModel* m_HeaderModel; }; #endif // QMITKPATIENTTABLEHEADERVIEW_H diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h index 57d5780ce7..798cade285 100644 --- a/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h +++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKPATIENTTABLEINSPECTOR_H #define QMITKPATIENTTABLEINSPECTOR_H // semantic relations UI module #include "MitkSemanticRelationsUIExports.h" #include "QmitkAbstractSemanticRelationsStorageInspector.h" #include "QmitkPatientTableModel.h" #include "QmitkTableItemThumbnailDelegate.h" #include "ui_QmitkPatientTableInspector.h" // qt widgets module #include // qt #include /* * @brief The QmitkPatientTableInspector is a QmitkAbstractSemanticRelationsStorageInspector that shows the currently * available data of the semantic relations storage model in a control-point - information type matrix. * * The QmitkPatientTableInspector uses the QmitkSemanticRelationsStorageModel, a QmitkAbstractDataStorageModel that * presents the semantic relations data as a table, showing a QPixmap as thumbnail for the data nodes. */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkPatientTableInspector : public QmitkAbstractSemanticRelationsStorageInspector { Q_OBJECT public: QmitkPatientTableInspector(QWidget* parent = nullptr); - virtual QAbstractItemView* GetView() override; - virtual const QAbstractItemView* GetView() const override; + QAbstractItemView* GetView() override; + const QAbstractItemView* GetView() const override; - virtual void SetSelectionMode(SelectionMode mode) override; - virtual SelectionMode GetSelectionMode() const override; + void SetSelectionMode(SelectionMode mode) override; + SelectionMode GetSelectionMode() const override; - virtual void SetCaseID(const mitk::SemanticTypes::CaseID& caseID) override; - virtual void SetLesion(const mitk::SemanticTypes::Lesion& lesion) override; + void SetCaseID(const mitk::SemanticTypes::CaseID& caseID) override; + void SetLesion(const mitk::SemanticTypes::Lesion& lesion) override; QItemSelectionModel* GetSelectionModel(); Q_SIGNALS: void DataNodeDoubleClicked(const mitk::DataNode*); void OnContextMenuRequested(const QPoint&); void OnNodeRemoved(const mitk::DataNode*); private Q_SLOTS: void OnModelUpdated(); void OnNodeButtonClicked(const QString&); void OnDataNodeSelectionChanged(const QList&); void OnItemDoubleClicked(const QModelIndex&); protected: - virtual void Initialize() override; + void Initialize() override; private: void SetUpConnections(); - virtual void keyPressEvent(QKeyEvent* e) override; + void keyPressEvent(QKeyEvent* e) override; Ui::QmitkPatientTableInspector m_Controls; QmitkPatientTableModel* m_StorageModel; QmitkTableItemThumbnailDelegate* m_ItemDelegate; }; #endif // QMITKPATIENTTABLEINSPECTOR_H diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h index 966f97a35e..0ecc0e3e71 100644 --- a/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h +++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h @@ -1,133 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKPATIENTTABLEMODEL_H #define QMITKPATIENTTABLEMODEL_H // semantic relations UI module #include "QmitkAbstractSemanticRelationsStorageModel.h" // semantic relations module #include #include // mitk core #include // qt #include #include /** * @brief The QmitkPatientTableModel is a subclass of the QmitkAbstractSemanticRelationsStorageModel and holds the semantic relations data of the currently selected case. * * The QmitkPatientTableModel uses the 'data' function to return either the data node of a table cell or the thumbnail of the underlying image. * The horizontal header of the table shows the control points of the current case and the vertical header of the table shows the information types of the current case. * Using the 'GetFilteredData'-function of the SemanticRelations-class the model is able to retrieve the correct data node for each table entry. * * Additionally the model creates and holds the QPixmaps of the known data nodes in order to return a thumbnail, if needed. */ class QmitkPatientTableModel : public QmitkAbstractSemanticRelationsStorageModel { Q_OBJECT public: QmitkPatientTableModel(QObject* parent = nullptr); - ~QmitkPatientTableModel(); + ~QmitkPatientTableModel() override; ////////////////////////////////////////////////////////////////////////// // overridden functions from QAbstractItemModel ////////////////////////////////////////////////////////////////////////// - virtual QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; - virtual QModelIndex parent(const QModelIndex& child) const override; + QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& child) const override; - virtual int rowCount(const QModelIndex& parent = QModelIndex()) const override; - virtual int columnCount(const QModelIndex& parent = QModelIndex()) const override; + int rowCount(const QModelIndex& parent = QModelIndex()) const override; + int columnCount(const QModelIndex& parent = QModelIndex()) const override; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; - virtual Qt::ItemFlags flags(const QModelIndex& index) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + Qt::ItemFlags flags(const QModelIndex& index) const override; ////////////////////////////////////////////////////////////////////////// /// end override ///////////////////////////////////////////////////////////////////////// void SetNodeType(const std::string& nodeType); protected: // the following functions have to be overridden... - virtual void NodePredicateChanged() override; + void NodePredicateChanged() override; // but are not implemented in this model - virtual void NodeAdded(const mitk::DataNode*) override { } - virtual void NodeChanged(const mitk::DataNode*) override { } - virtual void NodeRemoved(const mitk::DataNode*) override { } + void NodeAdded(const mitk::DataNode*) override { } + void NodeChanged(const mitk::DataNode*) override { } + void NodeRemoved(const mitk::DataNode*) override { } /** * @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points * and information types of the current case and stores them to define the header of the table. * Furthermore all images are retrieved and the pixmap of the images are generated and stored. */ - virtual void SetData() override; + void SetData() override; private: void SetHeaderModel(); void SetPixmaps(); void SetLesionPresences(); /** * @brief The function uses the ID of the node to see if a pixmap was already set. If not, the given pixmap * is used and stored inside a member variable. If the pixmap was already set, it will be overwritten. * Using 'nullptr' as a pixmap will erase the entry for the given data node. * * @param dataNode The data node whose pixmap should be set * @param pixmapFromImage The pixmap that shows an image of the content of the data node */ void SetPixmapOfNode(const mitk::DataNode* dataNode, QPixmap* pixmapFromImage); /** * @brief The function uses the ID of the node to see if a lesion presence was already set. If not, the given * bool value is used and stored inside a member variable. If the lesion presence was already set, it * will be overwritten. * The function is used by the 'SetLesionPresences' function. * * @param dataNode The data node whose lesion presence should be set * @param lesionPresence The bool value that defines the lesion presence of the given data node */ void SetLesionPresenceOfNode(const mitk::DataNode* dataNode, bool lesionPresence); /** * @brief Returns the data node that is associated with the given table entry (index). * * The function uses the SemanticRelations-class and the current control point data and information type data to * filter the nodes of the current case. * The index is used to access the correct row in the table (information type) and the correct column in the table (control point). * * @par index The QModelIndex of the table entry */ mitk::DataNode* GetCurrentDataNode(const QModelIndex &index) const; std::map m_PixmapMap; std::map m_LesionPresence; mitk::SemanticTypes::ExaminationPeriodVector m_ExaminationPeriods; mitk::SemanticTypes::InformationTypeVector m_InformationTypes; mitk::SemanticRelationsDataStorageAccess::DataNodeVector m_CurrentDataNodes; std::string m_SelectedNodeType; QStandardItemModel* m_HeaderModel; }; #endif // QMITKPATIENTTABLEMODEL_H diff --git a/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h b/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h index 9861660b0a..780fd9beef 100644 --- a/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h +++ b/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h @@ -1,80 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSTATISTICSCALCULATOR_H #define QMITKSTATISTICSCALCULATOR_H // mitk semantic relations UI #include "MitkSemanticRelationsUIExports.h" // mitk semantic relations module #include #include // mitk core #include #include // mitk image statistics ui module #include /* * @brief This class provides functions to compute the lesion volume of a given lesion. * A lesion can be defined by a specific segmentation at each control-point - information type pair. * This segmentation and its parent image will be used inside the private 'GetSegmentationMaskVolume' function. * This function in turn uses the image statistics module (the 'ImageStatisticsContainerManager') to retrieve * the specific statistics values from a statistics node. However, if the statistics are not found, * a new 'QmitkImageStatisticsCalculationJob' is started. If the job is finished and the statistics are calculated, * a new statistics node is added to the data storage (or an existing statistics data node is updated). */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkStatisticsCalculator : public QObject { Q_OBJECT public: QmitkStatisticsCalculator(); - ~QmitkStatisticsCalculator(); + ~QmitkStatisticsCalculator() override; void SetDataStorage(mitk::DataStorage* dataStorage) { m_DataStorage = dataStorage; } /** * @brief Compute and store lesion volume for all available control points and information types. * * @param lesionData The lesion data that holds the lesion and will hold the additional lesion data. * @param caseID The current case ID. */ void ComputeLesionVolume(mitk::LesionData& lesionData, const mitk::SemanticTypes::CaseID& caseID); private: /** * @brief * * */ double GetSegmentationMaskVolume(mitk::DataNode::Pointer imageNode, mitk::DataNode::Pointer segmentationNode); void OnStatisticsCalculationEnds(); QmitkImageStatisticsCalculationJob* m_CalculationJob; mitk::WeakPointer m_DataStorage; mitk::DataNode::Pointer m_ImageNode; mitk::DataNode::Pointer m_SegmentationNode; double m_MaskVolume; }; #endif // QMITKSTATISTICSCALCULATOR_H diff --git a/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h b/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h index 1c54bde693..a13f514294 100644 --- a/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h +++ b/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSTATISTICSTREEMODEL_H #define QMITKSTATISTICSTREEMODEL_H // mitk semantic relations UI #include "MitkSemanticRelationsUIExports.h" #include "QmitkAbstractSemanticRelationsStorageModel.h" #include "QmitkLesionTreeItem.h" #include "QmitkStatisticsCalculator.h" /* * @brief The 'QmitkStatisticsTreeModel' is a subclass of 'QmitkAbstractSemanticRelationsStorageModel' and provides * functionality to serve as a tree model. * The tree model creates a new top-level tree item for each lesion that is stored inside the semantic relations storage. * The top-level lesion tree items hold child items for each information type. * Each lesion tree item contains lesion data that can be display inside a tree view. The lesion data * consists of a lesion with with its UID, name and lesion class. The name or UID is used for the top-level tree items. * Additionally the lesion data contains two vectors which define the lesion presence (bool) and the lesion volume (double) * for each control-point - information type pair. The lesion volume will be used inside this model for the child items. * The presence is used inside another tree model. * * The model uses the 'QmitkStatisticsCalculator' to start the lesion volume calculation for each lesion. * This calculator is able to find an existing lesion volume or to trigger the computation of the required statistics. * If the required statistics are newly computed and added as a statistics container to the data storage, * this model will be notified about this event (see 'NodeAdded', 'NodeChanged' and 'NodeRemoved') and will update * its lesion tree items. */ class MITKSEMANTICRELATIONSUI_EXPORT QmitkStatisticsTreeModel : public QmitkAbstractSemanticRelationsStorageModel { Q_OBJECT public: /** * @brief Initialize the root item of the model. The root item does not have a parent item. */ QmitkStatisticsTreeModel(QObject* parent = nullptr); ////////////////////////////////////////////////////////////////////////// // overridden virtual functions from QAbstractItemModel ////////////////////////////////////////////////////////////////////////// - virtual QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override; - virtual QModelIndex parent(const QModelIndex& itemIndex) const override; + QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override; + QModelIndex parent(const QModelIndex& itemIndex) const override; - virtual int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override; - virtual int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override; + int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override; + int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override; - virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; - virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; ////////////////////////////////////////////////////////////////////////// // end override ////////////////////////////////////////////////////////////////////////// protected: - virtual void DataStorageChanged() override; - virtual void NodePredicateChanged() override { } - virtual void NodeAdded(const mitk::DataNode*) override; - virtual void NodeChanged(const mitk::DataNode*) override; - virtual void NodeRemoved(const mitk::DataNode*) override; + void DataStorageChanged() override; + void NodePredicateChanged() override { } + void NodeAdded(const mitk::DataNode*) override; + void NodeChanged(const mitk::DataNode*) override; + void NodeRemoved(const mitk::DataNode*) override; /** * @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points * of the current case and stores them to define the header of the tree. * Furthermore all lesions are retrieved and the lesion data is stored and show in the tree view. */ - virtual void SetData() override; + void SetData() override; private: void SetLesionData(); void AddLesion(const mitk::SemanticTypes::Lesion& lesion); QmitkLesionTreeItem* GetItemByIndex(const QModelIndex& index) const; std::unique_ptr m_StatisticsCalculator; std::shared_ptr m_RootItem; mitk::SemanticTypes::ControlPointVector m_ControlPoints; mitk::SemanticTypes::InformationTypeVector m_InformationTypes; mitk::SemanticTypes::LesionVector m_CurrentLesions; }; #endif // QMITKSTATISTICSTREEMODEL_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h index cb002c535c..7b59c33b8e 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODECOLORACTION_H #define QMITKDATANODECOLORACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include #include class MITK_QT_APP QmitkDataNodeColorAction : public QWidgetAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeColorAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeColorAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); - virtual void InitializeWithDataNode(const mitk::DataNode* dataNode) override; + void InitializeWithDataNode(const mitk::DataNode* dataNode) override; private Q_SLOTS: void OnColorChanged(); void OnActionChanged(); protected: - virtual void InitializeAction() override; + void InitializeAction() override; private: QPushButton* m_ColorButton; }; #endif // QMITKDATANODECOLORACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h index 6e061c5b7a..a673de8a74 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODECOLORMAPACTION_H #define QMITKDATANODECOLORMAPACTION_H #include #include "QmitkAbstractDataNodeAction.h" // mitk core #include // qt #include class MITK_QT_APP QmitkDataNodeColorMapAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeColorMapAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeColorMapAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnMenuAboutShow(); void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; void UseWholePixelRange(mitk::DataNode* node); }; #endif // QMITKDATANODECOLORMAPACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h index 461611044d..dbc5678bc2 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODECOMPONENTACTION_H #define QMITKDATANODECOMPONENTACTION_H #include // qt widgets ext module #include #include "QmitkAbstractDataNodeAction.h" // qt #include class MITK_QT_APP QmitkDataNodeComponentAction : public QWidgetAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeComponentAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeComponentAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); - virtual void InitializeWithDataNode(const mitk::DataNode* dataNode) override; + void InitializeWithDataNode(const mitk::DataNode* dataNode) override; private Q_SLOTS: void OnActionChanged(); protected: - virtual void InitializeAction() override; + void InitializeAction() override; private: QmitkNumberPropertySlider* m_ComponentSlider; }; #endif // QMITKDATANODECOMPONENTACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h index 723c8d7529..aeec00a4ea 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h @@ -1,140 +1,140 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODECONTEXTMENU_H #define QMITKDATANODECONTEXTMENU_H #include // qt widgets module #include "QmitkDataNodeGlobalReinitAction.h" #include "QmitkDataNodeReinitAction.h" #include "QmitkDataNodeRemoveAction.h" #include "QmitkDataNodeShowSelectedNodesAction.h" #include "QmitkDataNodeToggleVisibilityAction.h" #include "QmitkDataNodeShowDetailsAction.h" #include "QmitkDataNodeOpacityAction.h" #include "QmitkDataNodeColorAction.h" #include "QmitkDataNodeColorMapAction.h" #include "QmitkDataNodeComponentAction.h" #include "QmitkDataNodeTextureInterpolationAction.h" #include "QmitkDataNodeSurfaceRepresentationAction.h" #include "QmitkNodeDescriptor.h" // mitk core #include #include #include // blueberry ui qt plugin #include #include // qt #include class MITK_QT_APP QmitkDataNodeContextMenu : public QMenu { Q_OBJECT public: QmitkDataNodeContextMenu(berry::IWorkbenchPartSite::Pointer workbenchPartSite, QWidget* parent = nullptr); - virtual ~QmitkDataNodeContextMenu() override; + ~QmitkDataNodeContextMenu() override; void SetDataStorage(mitk::DataStorage* dataStorage); void SetBaseRenderer(mitk::BaseRenderer* baseRenderer); void SetSurfaceDecimation(bool surfaceDecimation); void SetSelectedNodes(const QList& selectedNodes); public Q_SLOTS: void OnContextMenuRequested(const QPoint& pos); void OnExtensionPointActionTriggered(bool); private: using DescriptorActionListType = std::vector>; using ConfigurationElementsType = std::map; void InitNodeDescriptors(); void InitDefaultActions(); void InitExtensionPointActions(); void InitServiceActions(); void AddColorAction(QWidgetAction* colorAction); void AddDescriptorActionList(DescriptorActionListType& descriptorActionList); QList GetActions(const mitk::DataNode* node); QList GetActions(const QList& nodes); QWidget* m_Parent; berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite; mitk::WeakPointer m_DataStorage; mitk::WeakPointer m_BaseRenderer; QList m_SelectedNodes; // store a list of all actions to remove them on menu destruction DescriptorActionListType m_DescriptorActionList; // stores the configuration elements for the context menu actions from extension points ConfigurationElementsType m_ConfigElements; QmitkNodeDescriptor* m_UnknownDataNodeDescriptor; QmitkNodeDescriptor* m_ImageDataNodeDescriptor; QmitkNodeDescriptor* m_MultiComponentImageDataNodeDescriptor; QmitkNodeDescriptor* m_DiffusionImageDataNodeDescriptor; QmitkNodeDescriptor* m_FiberBundleDataNodeDescriptor; QmitkNodeDescriptor* m_PeakImageDataNodeDescriptor; QmitkNodeDescriptor* m_SegmentDataNodeDescriptor; QmitkNodeDescriptor* m_SurfaceDataNodeDescriptor; QmitkNodeDescriptor* m_PointSetNodeDescriptor; QmitkNodeDescriptor* m_PlanarLineNodeDescriptor; QmitkNodeDescriptor* m_PlanarCircleNodeDescriptor; QmitkNodeDescriptor* m_PlanarEllipseNodeDescriptor; QmitkNodeDescriptor* m_PlanarAngleNodeDescriptor; QmitkNodeDescriptor* m_PlanarFourPointAngleNodeDescriptor; QmitkNodeDescriptor* m_PlanarRectangleNodeDescriptor; QmitkNodeDescriptor* m_PlanarPolygonNodeDescriptor; QmitkNodeDescriptor* m_PlanarPathNodeDescriptor; QmitkNodeDescriptor* m_PlanarDoubleEllipseNodeDescriptor; QmitkNodeDescriptor* m_PlanarBezierCurveNodeDescriptor; QmitkNodeDescriptor* m_PlanarSubdivisionPolygonNodeDescriptor; ////////////////////////////////////////////////////////////////////////// // default actions ////////////////////////////////////////////////////////////////////////// QmitkDataNodeGlobalReinitAction* m_GlobalReinitAction; QmitkDataNodeReinitAction* m_ReinitAction; QmitkDataNodeRemoveAction* m_RemoveAction; QmitkDataNodeShowSelectedNodesAction* m_ShowSelectedNodesAction; QmitkDataNodeToggleVisibilityAction* m_ToggleVisibilityAction; QmitkDataNodeShowDetailsAction* m_ShowDetailsAction; QmitkDataNodeOpacityAction* m_OpacityAction; QmitkDataNodeColorAction* m_ColorAction; QmitkDataNodeColorMapAction* m_ColormapAction; QmitkDataNodeComponentAction* m_ComponentAction; QmitkDataNodeTextureInterpolationAction* m_TextureInterpolationAction; QmitkDataNodeSurfaceRepresentationAction* m_SurfaceRepresentationAction; bool m_SurfaceDecimation; }; #endif // QMITKDATANODECONTEXTMENU_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h index 8c1a9f1a69..debc4440b2 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEGLOBALREINITACTION_H #define QMITKDATANODEGLOBALREINITACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace GlobalReinitAction { MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage); } class MITK_QT_APP QmitkDataNodeGlobalReinitAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: static const QString ACTION_ID; // = "org.mitk.gui.qt.application.globalreinitaction"; QmitkDataNodeGlobalReinitAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeGlobalReinitAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); private: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEGLOBALREINITACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h index 3f5435a221..82cbf772d2 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEHIDEALLACTION_H #define QMITKDATANODEHIDEALLACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace HideAllAction { MITK_QT_APP void Run(const QList& selectedNodes, mitk::BaseRenderer* baseRenderer = nullptr); } class MITK_QT_APP QmitkDataNodeHideAllAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeHideAllAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeHideAllAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEHIDEALLACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h index e1ed60d612..327e8ae918 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEOPACITYACTION_H #define QMITKDATANODEOPACITYACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include #include class MITK_QT_APP QmitkDataNodeOpacityAction : public QWidgetAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeOpacityAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeOpacityAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); - virtual void InitializeWithDataNode(const mitk::DataNode* dataNode) override; + void InitializeWithDataNode(const mitk::DataNode* dataNode) override; private Q_SLOTS: void OnOpacityChanged(int); void OnActionChanged(); protected: - virtual void InitializeAction() override; + void InitializeAction() override; QSlider* m_OpacitySlider; }; #endif // QMITKDATANODEOPACITYACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h index 88fa3f8f52..56011b7d64 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEOPENINACTION_H #define QMITKDATANODEOPENINACTION_H #include #include "QmitkAbstractDataNodeAction.h" // mitk core #include // qt #include class MITK_QT_APP QmitkDataNodeOpenInAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: typedef std::vector RendererVector; QmitkDataNodeOpenInAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeOpenInAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); void SetControlledRenderer(RendererVector controlledRenderer); private Q_SLOTS: void OnMenuAboutToShow(); void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; void SetControlledRenderer(); RendererVector m_ControlledRenderer; }; #endif // QMITKDATANODEOPENINACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h index f93b1b89ca..39ceb98a31 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEREINITACTION_H #define QMITKDATANODEREINITACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace ReinitAction { MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage, const QList& selectedNodes = QList(), mitk::BaseRenderer* baseRenderer = nullptr); } class MITK_QT_APP QmitkDataNodeReinitAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeReinitAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeReinitAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEREINITACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h index 957cb9464b..69b25dcb33 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEREMOVEACTION_H #define QMITKDATANODEREMOVEACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace RemoveAction { MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage, const QList& selectedNodes, QWidget* parent = nullptr); } class MITK_QT_APP QmitkDataNodeRemoveAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeRemoveAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeRemoveAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; private: QWidget* m_Parent; }; #endif // QMITKDATANODEREMOVEACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h index c1a64f1cfc..4e4fe4359a 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODESHOWDETAILSACTION_H #define QMITKDATANODESHOWDETAILSACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace ShowDetailsAction { MITK_QT_APP void Run(const QList& selectedNodes, QWidget* parent = nullptr); } class MITK_QT_APP QmitkDataNodeShowDetailsAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeShowDetailsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeShowDetailsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; private: QWidget* m_Parent; }; #endif // QMITKDATANODESHOWDETAILSACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h index 96f178407f..e77e97c317 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h @@ -1,46 +1,46 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODESHOWSELECTEDNODESACTION_H #define QMITKDATANODESHOWSELECTEDNODESACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include class MITK_QT_APP QmitkDataNodeShowSelectedNodesAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeShowSelectedNodesAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeShowSelectedNodesAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODESHOWSELECTEDNODESACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h index 77ef9f1fbe..9b62af9988 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODESURFACEREPRESENTATIONACTION_H #define QMITKDATANODESURFACEREPRESENTATIONACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include class MITK_QT_APP QmitkDataNodeSurfaceRepresentationAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeSurfaceRepresentationAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeSurfaceRepresentationAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnMenuAboutShow(); void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODESURFACEREPRESENTATIONACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h index 32ff4333a5..b4a8a1ac9c 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODETEXTUREINTERPOLATIONACTION_H #define QMITKDATANODETEXTUREINTERPOLATIONACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include class MITK_QT_APP QmitkDataNodeTextureInterpolationAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeTextureInterpolationAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeTextureInterpolationAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); - virtual void InitializeWithDataNode(const mitk::DataNode* dataNode) override; + void InitializeWithDataNode(const mitk::DataNode* dataNode) override; private Q_SLOTS: void OnActionChanged(); void OnActionToggled(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODETEXTUREINTERPOLATIONACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h index 65aca1c442..5fdbb3a841 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODETOGGLEVISIBILITYACTION_H #define QMITKDATANODETOGGLEVISIBILITYACTION_H #include #include "QmitkAbstractDataNodeAction.h" // qt #include namespace ToggleVisibilityAction { MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage, const QList& selectedNodes = QList(), mitk::BaseRenderer* baseRenderer = nullptr); } class MITK_QT_APP QmitkDataNodeToggleVisibilityAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeToggleVisibilityAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeToggleVisibilityAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODETOGGLEVISIBILITYACTION_H diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h index 5f032d9d6a..6351ce357a 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKFILEOPENACTION_H_ #define QMITKFILEOPENACTION_H_ #include #include // qt #include #include class QmitkFileOpenActionPrivate; class MITK_QT_APP QmitkFileOpenAction : public QAction { Q_OBJECT public: QmitkFileOpenAction(berry::IWorkbenchWindow::Pointer window); QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window); QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow* window); - virtual ~QmitkFileOpenAction() override; + ~QmitkFileOpenAction() override; protected slots: virtual void Run(); private: const QScopedPointer d; }; #endif /*QMITKFILEOPENACTION_H_*/ diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h index 069afbdc42..c444646843 100644 --- a/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h +++ b/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKFILESAVEACTION_H_ #define QMITKFILESAVEACTION_H_ #include #include // qt #include #include class QmitkFileSaveActionPrivate; class MITK_QT_APP QmitkFileSaveAction : public QAction { Q_OBJECT public: QmitkFileSaveAction(berry::IWorkbenchWindow::Pointer window); QmitkFileSaveAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window); QmitkFileSaveAction(const QIcon& icon, berry::IWorkbenchWindow* window); - virtual ~QmitkFileSaveAction() override; + ~QmitkFileSaveAction() override; protected slots: virtual void Run(); private: const QScopedPointer d; }; #endif /*QMITKFILESAVEACTION_H_*/ diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractNodeSelectionWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractNodeSelectionWidget.h index 42b1c72a67..e146771e28 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractNodeSelectionWidget.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractNodeSelectionWidget.h @@ -1,161 +1,161 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_ABSTRACT_NODE_SELECTION_WIDGET_H #define QMITK_ABSTRACT_NODE_SELECTION_WIDGET_H #include #include #include #include "org_mitk_gui_qt_common_Export.h" #include class QmitkAbstractDataStorageModel; class QAbstractItemVew; /** * \class QmitkAbstractNodeSelectionWidget * \brief Abstract base class for the selection of data from a data storage. */ class MITK_QT_COMMON QmitkAbstractNodeSelectionWidget : public QWidget { Q_OBJECT public: explicit QmitkAbstractNodeSelectionWidget(QWidget* parent = nullptr); - virtual ~QmitkAbstractNodeSelectionWidget(); + ~QmitkAbstractNodeSelectionWidget() override; /** * @brief Sets the data storage that will be used /monitored by widget. * * @par dataStorage A pointer to the data storage to set. */ void SetDataStorage(mitk::DataStorage* dataStorage); /** * Sets the node predicate and updates the widget, according to the node predicate. * Implement OnNodePredicateChange() for custom actualization of a derived widget class. * * @par nodePredicate A pointer to node predicate. */ void SetNodePredicate(mitk::NodePredicateBase* nodePredicate); mitk::NodePredicateBase* GetNodePredicate() const; QString GetInvalidInfo() const; QString GetEmptyInfo() const; QString GetPopUpTitel() const; QString GetPopUpHint() const; bool GetSelectionIsOptional() const; bool GetSelectOnlyVisibleNodes() const; using NodeList = QList; Q_SIGNALS: /* * @brief A signal that will be emitted if the selected node has changed. * * @par nodes A list of data nodes that are newly selected. */ void CurrentSelectionChanged(QList nodes); public Q_SLOTS: /* * @brief Change the selection modus of the item view's selection model. * * If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view. * An outgoing selection can then at most contain the filtered nodes. * If false, the incoming non-visible selection will be stored and later added to the outgoing selection, * to include the original selection that could not be modified. * The part of the original selection, that is non-visible are the nodes that are not * * @par selectOnlyVisibleNodes The bool value to define the selection modus. */ virtual void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes); /* * @brief Transform a list of data nodes into a model selection and set this as a new selection of the * selection model of the private member item view. * * The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If * necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case * the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable * in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection * but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes'). * * @par nodes A list of data nodes that should be newly selected. */ virtual void SetCurrentSelection(NodeList selectedNodes) = 0; /** Set the info text that should be displayed if no (valid) node is selected, * but a selection is mandatory. * The string can contain HTML code. if wanted*/ void SetInvalidInfo(QString info); /** Set the info text that should be displayed if no (valid) node is selected, * but a selection is optional. * The string can contain HTML code. if wanted*/ void SetEmptyInfo(QString info); /** Set the caption of the popup that is displayed to alter the selection. * The string can contain HTML code. if wanted*/ void SetPopUpTitel(QString info); /** Set the hint text of the popup that is displayed to alter the selection. * The string can contain HTML code. if wanted*/ void SetPopUpHint(QString info); /** Set the widget into an optional mode. Optional means that the selection of no valid node does not mean an invalid state. Thus no node is a valid "node" selection too.*/ void SetSelectionIsOptional(bool isOptional); protected: /**Member is called if the display of the selected nodes should be updated.*/ virtual void UpdateInfo() = 0; /**Member is called if the predicate has changed. Thus the selection might change to. The new (changed) predicate is passed with the function call. It is the same like this->GetNodePredicate() called in the function call.*/ virtual void OnNodePredicateChanged(mitk::NodePredicateBase* newPredicate) = 0; /**Member is called if the data storage has changed. Thus the selection might change to.*/ virtual void OnDataStorageChanged() = 0; virtual void NodeRemovedFromStorage(const mitk::DataNode* node) = 0; mitk::WeakPointer m_DataStorage; mitk::NodePredicateBase::Pointer m_NodePredicate; QString m_InvalidInfo; QString m_EmptyInfo; QString m_PopUpTitel; QString m_PopUpHint; bool m_IsOptional; bool m_SelectOnlyVisibleNodes; private: /** Helper triggered on the storage delete event */ void SetDataStorageDeleted(); unsigned long m_DataStorageDeletedTag; }; #endif // QmitkAbstractNodeSelectionWidget_H diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h index c3c3a23141..1c798cabe2 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_MULTI_NODE_SELECTION_WIDGET_H #define QMITK_MULTI_NODE_SELECTION_WIDGET_H #include #include #include #include "QmitkSimpleTextOverlayWidget.h" #include "org_mitk_gui_qt_common_Export.h" #include "ui_QmitkMultiNodeSelectionWidget.h" #include class QmitkAbstractDataStorageModel; class QAbstractItemVew; /** * \class QmitkMultiNodeSelectionWidget * \brief Widget that allows to perform and represents a multiple node selection. */ class MITK_QT_COMMON QmitkMultiNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget { Q_OBJECT public: explicit QmitkMultiNodeSelectionWidget(QWidget* parent = nullptr); using NodeList = QmitkAbstractNodeSelectionWidget::NodeList; NodeList GetSelectedNodes() const; /**Helper function that is used to check the given selection for consistency. Returning an empty string assumes that everything is alright and the selection is valid. If the string is not empty, the content of the string will be used as error message in the overlay to indicate the problem.*/ using SelectionCheckFunctionType = std::function; /**A selection check function can be set. If set the widget uses this function to check the made/set selection. If the selection is valid, everything is fine. If selection is indicated as invalid, it will not be communicated by the widget (no signal emission.*/ void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction); public Q_SLOTS: - virtual void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes) override; - virtual void SetCurrentSelection(NodeList selectedNodes) override; + void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes) override; + void SetCurrentSelection(NodeList selectedNodes) override; void OnEditSelection(); protected Q_SLOTS: void OnClearSelection(const mitk::DataNode* node); protected: NodeList CompileEmitSelection() const; void UpdateInfo() override; virtual void UpdateList(); void OnNodePredicateChanged(mitk::NodePredicateBase* newPredicate) override; void OnDataStorageChanged() override; void NodeRemovedFromStorage(const mitk::DataNode* node) override; NodeList m_CurrentSelection; QmitkSimpleTextOverlayWidget* m_Overlay; SelectionCheckFunctionType m_CheckFunction; std::string m_CheckResponse; Ui_QmitkMultiNodeSelectionWidget m_Controls; }; #endif // QmitkMultiNodeSelectionWidget_H diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h index 8d7b63ec38..8214b978e4 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_NODE_SELECTION_BUTTON_H #define QMITK_NODE_SELECTION_BUTTON_H #include #include #include "org_mitk_gui_qt_common_Export.h" #include "QPushButton" #include "QPixmap" /** Button class that can be used to display informations about a passed node. * If the passed node is a null ptr the node info text will be shown. * In difference to the normal push button text property. The node info can * be formated text (e.g. HTML code; like the tooltip text).*/ class MITK_QT_COMMON QmitkNodeSelectionButton : public QPushButton { Q_OBJECT public: explicit QmitkNodeSelectionButton(QWidget *parent = nullptr); - ~QmitkNodeSelectionButton(); + ~QmitkNodeSelectionButton() override; const mitk::DataNode* GetSelectedNode() const; public Q_SLOTS : virtual void SetSelectedNode(const mitk::DataNode* node); virtual void SetNodeInfo(QString info); protected: void paintEvent(QPaintEvent *p) override; mitk::DataNode::ConstPointer m_SelectedNode; QString m_Info; bool m_OutDatedThumpNail; QPixmap m_ThumpNail; }; #endif // QmitkSingleNodeSelectionWidget_H diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h index a0d014eac1..e784ff80d7 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h @@ -1,140 +1,140 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSELECTIONSERVICECONNECTOR_H #define QMITKSELECTIONSERVICECONNECTOR_H #include // qt widgets module #include // mitk gui qt common plugin #include "QmitkDataNodeSelectionProvider.h" #include "internal/QmitkDataNodeItemModel.h" // blueberry ui qt plugin #include /* * @brief The 'QmitkSelectionServiceConnector' is used to handle the selections of the global selection bus (selection service). * * The selection service connector can listen to a selection service. This should be done by using 'AddPostSelectionListener' * with the existing selection service of the surrounding 'QmitkAbstractView'. * The selection service connector can provide selections. This should be done by using 'SetAsSelectionProvider' * with the existing selection provider of the surrounding 'QmitkAbstractView'. * * The 'QmitkSelectionServiceConnector' offers a public slot and signal that can be used to propagate the selected * nodes from or to the global selection bus: * The 'ChangeServiceSelection'-slot transforms the given list of selected nodes into a QItemSelection of a temporary * data node selection model. This data node selection model is set as the item selection model of the member selection provider. * So by temporary adding a new data node selection model and changing its selection the selection provider sends a new selection * that can be received at any place in the workbench. * * The 'ServiceSelectionChanged'-signal sends a list of selected nodes to it's local environment (e.g. containing widget). * The 'ServiceSelectionChanged'-signal is emitted by the 'ServiceSelectionChanged'-function, which transforms the * berry selection of the selection into a data node list. The 'ServiceSelectionChanged'-function is called whenever * the selection service sends a selection changed event. * * In order to connect the 'QmitkSelectionServiceConnector' with a model-view pair, a 'QmitkModelViewSelectionConnector' needs to be used: * The 'QmitkModelViewSelectionConnector' offers a 'SetCurrentSelection'-slot that can be connected with the * 'ServiceSelectionChanged'-signal of this class. * The 'QmitkModelViewSelectionConnector' offers a 'CurrentSelectionChanged'-signal that can be connected with the * 'ChangeServiceSelection'-slot of this class. */ class MITK_QT_COMMON QmitkSelectionServiceConnector : public QObject { Q_OBJECT public: QmitkSelectionServiceConnector(); - ~QmitkSelectionServiceConnector(); + ~QmitkSelectionServiceConnector() override; /* * @brief Create a selection listener and add it to the list of selection listener of the given selection service. * * The selection listener is connected to the 'ServiceSelectionChanged' member function, which is * called if a berry selection is changed in the workbench. */ void AddPostSelectionListener(berry::ISelectionService* selectionService); /* * @brief Remove a selection listener from the list of selection listener of the selection service member. */ void RemovePostSelectionListener(); /* * @brief Store the given selection provider as a private member. * In order to use the public slot 'ChangeServiceSelection'-function, the selection provider member had to be * previously set. */ void SetAsSelectionProvider(QmitkDataNodeSelectionProvider* selectionProvider); /* * @brief Set the selection provider member to a nullptr. This will prevent the public slot * 'ChangeServiceSelection'-function from working. */ void RemoveAsSelectionProvider(); Q_SIGNALS: /* * @brief A signal that will be emitted by the private 'ServiceSelectionChanged'-function. This happens if a selection is changed * via the selection service. * * @par nodes A list of data nodes that are newly selected. */ void ServiceSelectionChanged(QList nodes); /* * @brief A signal that will be emitted by the private 'ServiceSelectionChanged'-function. If sourcePart has send an invalid selection * (selection pointer was Null). * @par sourcePart Part that sent the null selection. */ void ServiceNullSelection(const berry::IWorkbenchPart::Pointer& sourcePart); public Q_SLOTS: /* * @brief Send new selections to the selection service via the private selection provider member. * * This slot-function is called whenever a local selection is changed in the surrounding widget and a selection provider was set. * The newly selected data nodes are added temporary to a 'QmitkDataNodeItemModel', which is then used to define * the indices to select. * The 'QItemSelectionModel' is set as the item selection model of the selection provider member and its items are * selected by the indices previously defined by the 'QmitkDataNodeItemModel'. */ void ChangeServiceSelection(QList nodes); private: std::unique_ptr m_BerrySelectionListener; berry::ISelectionService* m_SelectionService; QmitkDataNodeSelectionProvider* m_SelectionProvider; std::shared_ptr m_DataNodeItemModel; std::shared_ptr m_DataNodeSelectionModel; /* * @brief Handle a selection received from the selection service. * * This function is called whenever a berry selection of the selection service is changed in the workbench. * The new selection is transformed into a data node selection and the contained data nodes are propagated * as the new current selection of the item view member. * * @par sourcePart The workbench part containing the selection. * @par selection The current selection. */ void OnServiceSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcePart, const berry::ISelection::ConstPointer& selection); }; #endif // QMITKSELECTIONSERVICECONNECTOR_H diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSimpleTextOverlayWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSimpleTextOverlayWidget.h index 93154622a3..5349163367 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkSimpleTextOverlayWidget.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSimpleTextOverlayWidget.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_SIMPLE_TEXT_OVERLAY_WIDGET_H #define QMITK_SIMPLE_TEXT_OVERLAY_WIDGET_H #include "QmitkOverlayWidget.h" #include "org_mitk_gui_qt_common_Export.h" /** Simple overlay that renders a passed string. You may pass an html string that will be rendered accordingly respecting the current application style sheet.*/ class MITK_QT_COMMON QmitkSimpleTextOverlayWidget : public QmitkOverlayWidget { Q_OBJECT Q_PROPERTY(QString overlayText READ GetOverlayText WRITE SetOverlayText) public: explicit QmitkSimpleTextOverlayWidget(QWidget* parent = nullptr); - virtual ~QmitkSimpleTextOverlayWidget(); + ~QmitkSimpleTextOverlayWidget() override; QString GetOverlayText() const; void SetOverlayText(const QString& text); protected: - virtual void paintEvent(QPaintEvent* event) override; + void paintEvent(QPaintEvent* event) override; private: QString m_Text; }; #endif diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSingleNodeSelectionWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSingleNodeSelectionWidget.h index 3cb7f8f079..36499a12a8 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkSingleNodeSelectionWidget.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSingleNodeSelectionWidget.h @@ -1,76 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_SINGLE_NODE_SELECTION_WIDGET_H #define QMITK_SINGLE_NODE_SELECTION_WIDGET_H #include #include #include #include "org_mitk_gui_qt_common_Export.h" #include "ui_QmitkSingleNodeSelectionWidget.h" #include #include class QmitkAbstractDataStorageModel; /** * \class QmitkSingleNodeSelectionWidget * \brief Widget that represents a node selection. It acts like a button. Clicking on it * allows to change the selection. */ class MITK_QT_COMMON QmitkSingleNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget { Q_OBJECT public: explicit QmitkSingleNodeSelectionWidget(QWidget* parent = nullptr); - ~QmitkSingleNodeSelectionWidget(); + ~QmitkSingleNodeSelectionWidget() override; mitk::DataNode::Pointer GetSelectedNode() const; using NodeList = QmitkAbstractNodeSelectionWidget::NodeList; public Q_SLOTS: - virtual void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes) override; - virtual void SetCurrentSelection(NodeList selectedNodes) override; + void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes) override; + void SetCurrentSelection(NodeList selectedNodes) override; protected Q_SLOTS: virtual void OnClearSelection(); protected: mitk::DataNode::Pointer ExtractCurrentValidSelection(const NodeList& nodes) const; NodeList CompileEmitSelection() const; bool eventFilter(QObject *obj, QEvent *ev) override; void EditSelection(); void UpdateInfo() override; void OnNodePredicateChanged(mitk::NodePredicateBase* newPredicate) override; void OnDataStorageChanged() override; void NodeRemovedFromStorage(const mitk::DataNode* node) override; NodeList m_ExternalSelection; mitk::DataNode::Pointer m_SelectedNode; Ui_QmitkSingleNodeSelectionWidget m_Controls; }; #endif // QmitkSingleNodeSelectionWidget_H diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionListItemWidget.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionListItemWidget.h index 46f2acdd10..94d40eea39 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionListItemWidget.h +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionListItemWidget.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H #define QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H #include #include #include "ui_QmitkNodeSelectionListItemWidget.h" #include "org_mitk_gui_qt_common_Export.h" class MITK_QT_COMMON QmitkNodeSelectionListItemWidget : public QWidget { Q_OBJECT public: explicit QmitkNodeSelectionListItemWidget(QWidget* parent = nullptr); - ~QmitkNodeSelectionListItemWidget(); + ~QmitkNodeSelectionListItemWidget() override; const mitk::DataNode* GetSelectedNode() const; public Q_SLOTS : virtual void SetSelectedNode(const mitk::DataNode* node); virtual void SetClearAllowed(bool allowed); signals: void ClearSelection(const mitk::DataNode* node); protected Q_SLOTS: void OnClearSelection(); protected: - virtual bool eventFilter(QObject *obj, QEvent *ev) override; + bool eventFilter(QObject *obj, QEvent *ev) override; Ui_QmitkNodeSelectionListItemWidget m_Controls; }; #endif // QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h index e07aa0a438..45269a4b8c 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __QMITK_NODE_SELECTION_PREFERENCE_PAGE_H #define __QMITK_NODE_SELECTION_PREFERENCE_PAGE_H #include "berryIQtPreferencePage.h" #include "berryIPreferences.h" #include "mitkDataStorageInspectorGenerator.h" #include "ui_QmitkNodeSelectionPreferencePage.h" class QWidget; /** * \class QmitkNodeSelectionPreferencePage * \brief Preference page for general node selection settings. */ class QmitkNodeSelectionPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkNodeSelectionPreferencePage(); - ~QmitkNodeSelectionPreferencePage(); + ~QmitkNodeSelectionPreferencePage() override; /** * \brief Called by framework to initialize this preference page, but currently does nothing. * \param workbench The workbench. */ - void Init(berry::IWorkbench::Pointer workbench); + void Init(berry::IWorkbench::Pointer workbench) override; /** * \brief Called by framework to create the GUI, and connect signals and slots. * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget. */ - void CreateQtControl(QWidget* widget); + void CreateQtControl(QWidget* widget) override; /** * \brief Required by framework to get hold of the GUI. * \return QWidget* the top most QWidget for the GUI. */ - QWidget* GetQtControl() const; + QWidget* GetQtControl() const override; /** * \see IPreferencePage::PerformOk */ - virtual bool PerformOk(); + bool PerformOk() override; /** * \see IPreferencePage::PerformCancel */ - virtual void PerformCancel(); + void PerformCancel() override; /** * \see IPreferencePage::Update */ - virtual void Update(); + void Update() override; protected slots: void UpdateWidgets(); void MoveDown(); void MoveUp(); protected: QWidget *m_MainControl; Ui::QmitkNodeSelectionPreferencePage* m_Controls; mitk::DataStorageInspectorGenerator::ProviderMapType m_Providers; }; #endif diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h index 82916d7f0c..42d5b1e1ff 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h +++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATAMANAGERHOTKEYSPREFPAGE_H #define QMITKDATAMANAGERHOTKEYSPREFPAGE_H #include // blueberry ui qt plugin #include // qt #include // c++ #include class QmitkHotkeyLineEdit; struct MITK_QT_DATAMANAGER QmitkDataManagerHotkeysPrefPage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkDataManagerHotkeysPrefPage(); - virtual void Init(berry::IWorkbench::Pointer workbench) override; + void Init(berry::IWorkbench::Pointer workbench) override; - virtual void CreateQtControl(QWidget* parent) override; + void CreateQtControl(QWidget* parent) override; - virtual QWidget* GetQtControl() const override; + QWidget* GetQtControl() const override; /** * @brief \see IPreferencePage::PerformOk() */ - virtual bool PerformOk() override; + bool PerformOk() override; /** * @brief \see IPreferencePage::PerformCancel() */ - virtual void PerformCancel() override; + void PerformCancel() override; /** * @brief \see IPreferencePage::Update() */ - virtual void Update() override; + void Update() override; protected: /** * @brief The node from which the properties are taken (will be catched from the preferences service in ctor) * * */ berry::IPreferences::WeakPtr m_DataManagerHotkeysPreferencesNode; /** * @brief Maps a label to hotkey lineedit, e.g. "Toggle Visibility of selected nodes" => QmitkHotkeyLineEdit * * */ std::map m_HotkeyEditors; QWidget* m_MainControl; }; #endif // QMITKDATAMANAGERHOTKEYSPREFPAGE_H diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h index 74702c874e..c42fdf2fc4 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h +++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKNODETABLEVIEWKEYFILTER_H #define QMITKNODETABLEVIEWKEYFILTER_H // mitk core #include #include #include namespace berry { struct IPreferencesService; } /** * @brief A small class which receives key-pressed events on the node table. */ class QmitkNodeTableViewKeyFilter : public QObject { Q_OBJECT public: QmitkNodeTableViewKeyFilter(QObject *dataManagerView, mitk::DataStorage *dataStorage); protected: - virtual bool eventFilter(QObject *obj, QEvent *event) override; + bool eventFilter(QObject *obj, QEvent *event) override; /** * @brief The Preferences Service to retrieve and store preferences. */ berry::IPreferencesService *m_PreferencesService; mitk::WeakPointer m_DataStorage; }; #endif // QMITKNODETABLEVIEWKEYFILTER_H diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h index 5620566c57..22e6ca0b98 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef DicomEventHandler_h #define DicomEventHandler_h #include #include /** * \brief DicomEventHandler is a class for handling dicom events between dicom plugin and datamanager. */ class DicomEventHandler : public QObject { Q_OBJECT public: /** * \brief DicomEventHandler constructor. */ DicomEventHandler(); /** * \brief DicomEventHandler destructor. */ - virtual ~DicomEventHandler(); + ~DicomEventHandler() override; /** * \brief Subscribes slots in this class. * * This function will subscribe OnSignalAddSeriesToDataManager and OnSignalRemoveSeriesFromStorage. * Doing this allows to react on ctkEvents with EVENT_TOPIC "org/mitk/gui/qt/dicom/ADD" and "org/mitk/gui/qt/dicom/DELETED". */ void SubscribeSlots(); public slots: /** * \brief Called when ctkEvent with EVENT_TOPIC "org/mitk/gui/qt/dicom/ADD" is thrown. * * If this slot catches an event it will add the dicom file provided by event properties. */ void OnSignalAddSeriesToDataManager(const ctkEvent& ctkEvent); /** * \brief Called when ctkEvent with EVENT_TOPIC "org/mitk/gui/qt/dicom/DELETED" is thrown. * * \note Not yet implemented. */ void OnSignalRemoveSeriesFromStorage(const ctkEvent& ctkEvent); }; #endif // QmitkDicomEventHandlerBuilder_h \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h index 6bbb1b6147..9246431591 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h @@ -1,149 +1,149 @@ /*========================================================================= The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDicomBrowser_h #define QmitkDicomBrowser_h // Blueberry #include #include #include #include // MITK #include "DicomEventHandler.h" #include "QmitkDicomDataEventPublisher.h" #include "QmitkDicomDirectoryListener.h" #include "QmitkStoreSCPLauncher.h" #include "QmitkStoreSCPLauncherBuilder.h" #include "ui_QmitkDicomBrowserControls.h" #include // Qt #include #include #include #include #include /** * \brief QmitkDicomBrowser is an editor providing functionality for dicom storage and import and query retrieve functionality. * * \sa berry::IPartListener * \ingroup ${plugin_target}_internal */ class DICOM_EXPORT QmitkDicomBrowser : public berry::QtEditorPart, virtual public berry::IPartListener { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: berryObjectMacro(QmitkDicomBrowser); static const std::string EDITOR_ID; static const QString TEMP_DICOM_FOLDER_SUFFIX; /** * \brief QmitkDicomBrowser constructor. */ QmitkDicomBrowser(); /** * \brief QmitkDicomBrowser destructor. */ - virtual ~QmitkDicomBrowser(); + ~QmitkDicomBrowser() override; /** * \brief Init initialize the editor. */ void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override; void SetFocus() override; void DoSave() override {} void DoSaveAs() override {} bool IsDirty() const override { return false; } bool IsSaveAsAllowed() const override { return false; } virtual void OnPreferencesChanged(const berry::IBerryPreferences* prefs); signals: /** * \brief SignalStartDicomImport is enitted when dicom directory for import was selected. */ void SignalStartDicomImport(const QString&); protected slots: /// \brief Called when import is finished. void OnDicomImportFinished(); /// \brief Called when Query Retrieve or Import Folder was clicked. void OnTabChanged(int); /// \brief Called when view button is clicked. Sends out an event for adding the current selected file to the mitkDataStorage. void OnViewButtonAddToDataManager(QHash eventProperties); /// \brief Called when status of dicom storage provider changes. void OnStoreSCPStatusChanged(const QString& status); /// \brief Called when dicom storage provider emits a network error. void OnDicomNetworkError(const QString& status); protected: /// \brief StartStoreSCP starts dicom storage provider. void StartStoreSCP(); /// \brief StopStoreSCP stops dicom storage provider. void StopStoreSCP(); /// \brief TestHandler initializes event handler. void TestHandler(); /// \brief CreateTemporaryDirectory creates temporary directory in which temorary dicom objects are stored. void CreateTemporaryDirectory(); /// \brief StartDicomDirectoryListener starts dicom directory listener. void StartDicomDirectoryListener(); /** * \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomBrowserControls.h. * * \param parent is a pointer to the parent widget */ void CreateQtPartControl(QWidget *parent) override; /// \brief SetPluginDirectory Sets plugin directory. void SetPluginDirectory(); Events::Types GetPartEventTypes() const override; ctkFileDialog* m_ImportDialog; Ui::QmitkDicomBrowserControls m_Controls; QmitkDicomDirectoryListener* m_DicomDirectoryListener; QmitkStoreSCPLauncherBuilder m_Builder; QmitkStoreSCPLauncher* m_StoreSCPLauncher; DicomEventHandler* m_Handler; QmitkDicomDataEventPublisher* m_Publisher; QString m_PluginDirectory; QString m_TempDirectory; QString m_DatabaseDirectory; }; #endif // QmitkDicomBrowser_h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h index 09461da862..6399c04c56 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDicomDataEventPublisher_H #define QmitkDicomDataEventPublisher_H #include #include /** * \brief QmitkDicomDataEventPublisher is a class for publishing ctkEvents. */ class QmitkDicomDataEventPublisher : public QObject { Q_OBJECT public: /** * \brief QmitkDicomDataEventPublisher constructor. */ QmitkDicomDataEventPublisher(); /** * \brief QmitkDicomDataEventPublisher destructor. */ - virtual ~QmitkDicomDataEventPublisher(); + ~QmitkDicomDataEventPublisher() override; /// @brief sets the event admin from given plugin context void PublishSignals(ctkPluginContext* context); void AddSeriesToDataManagerEvent(const ctkDictionary& properties); void RemoveSeriesFromStorageEvent(const ctkDictionary& properties); signals: void SignalAddSeriesToDataManager(const ctkDictionary&); void SignalRemoveSeriesFromStorage(const ctkDictionary&); }; #endif // QmitkDicomDataEventPublisher_H \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h index 3884a00d91..d47d220f59 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDicomDirectoryListener_h #define QmitkDicomDirectoryListener_h #include #include #include #include #include #include #include /** * \brief QmitkDicomDirectoryListener class listens on a given directory for incomng files. */ class QmitkDicomDirectoryListener : public QObject { Q_OBJECT public: /** * \brief QmitkDicomDirectoryListener default constructor. */ QmitkDicomDirectoryListener(); /** * \brief QmitkDicomDirectoryListener default destructor. */ - virtual ~QmitkDicomDirectoryListener(); + ~QmitkDicomDirectoryListener() override; /** * \brief sets listened directory. * \note that only one directory can be set. */ void SetDicomListenerDirectory(const QString&); /** * \brief get filepath to the listened directory. */ QString GetDicomListenerDirectory(); /** * \brief get the status whether the directorey listener is listening or not. */ bool IsListening(); /** * \brief set the directory listener listening. Id listening is set false the listener won't listen anymore. */ void SetListening(bool listening); /** * \brief set m_DicomFolderSuffix. */ void SetDicomFolderSuffix(QString suffix); signals: /** * \brief signal starts the dicom import with given file list. */ void SignalStartDicomImport(const QStringList&); public slots: /** * \brief called when listener directory changes */ void OnDirectoryChanged(const QString&); /** * \brief called when error occours during dicom store request */ void OnDicomNetworkError(const QString&); protected: /** * \brief creates directory if it's not already existing. */ void CreateListenerDirectory(const QDir& directory); /** * \brief Composes the filename and initializes m_LastRetrievedFile with it. */ void SetFilesToImport(); /** * \brief removes files from listener directory. */ void RemoveTemporaryFiles(); QString m_DicomFolderSuffix; QFileSystemWatcher* m_FileSystemWatcher; QStringList m_FilesToImport; QHash m_AlreadyImportedFiles; QDir m_DicomListenerDirectory; bool m_IsListening; }; #endif // QmitkDicomListener_h \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h index 1883caf460..61ca149a60 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h @@ -1,75 +1,75 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDicomPreferencePage_h #define QmitkDicomPreferencePage_h #include #include #include "berryIQtPreferencePage.h" #include #include class QWidget; class QCheckBox; class QLineEdit; class QPushButton; class DICOM_EXPORT QmitkDicomPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkDicomPreferencePage(); - virtual ~QmitkDicomPreferencePage(); + ~QmitkDicomPreferencePage() override; void Init(berry::IWorkbench::Pointer workbench) override; void CreateQtControl(QWidget* widget) override; QWidget* GetQtControl() const override; /// /// \see IPreferencePage::PerformOk() /// - virtual bool PerformOk() override; + bool PerformOk() override; /// /// \see IPreferencePage::PerformCancel() /// - virtual void PerformCancel() override; + void PerformCancel() override; /// /// \see IPreferencePage::Update() /// - virtual void Update() override; + void Update() override; protected: QWidget* m_MainControl; berry::IPreferences::Pointer m_DicomPreferencesNode; QLineEdit* m_PathEdit; QPushButton* m_PathSelect; QPushButton* m_PathDefault; protected slots: void DefaultButtonPushed(); void PathSelectButtonPushed(); }; #endif // QmitkQmitkDicomPreferencePage_h \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h index 781806fa37..385d9dc20f 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h @@ -1,117 +1,117 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkStoreSCPLauncher_h #define QmitkStoreSCPLauncher_h #include #include #include "QmitkStoreSCPLauncherBuilder.h" /** * \brief QmitkStoreSCPLauncher launches the dcmtk storage provider commandline tool in another process and provides basic interoperability with it. */ class QmitkStoreSCPLauncher : public QObject { Q_OBJECT public: /** * \brief QmitkStoreSCPLauncher constructor. */ QmitkStoreSCPLauncher(QmitkStoreSCPLauncherBuilder* builder); /** * \brief QmitkStoreSCPLauncher constructor. */ - virtual ~QmitkStoreSCPLauncher(); + ~QmitkStoreSCPLauncher() override; public slots: /** * \brief Starts a storage provider in a new process. */ void StartStoreSCP(); /** * \brief Called when storage provider process emits error. */ void OnProcessError(QProcess::ProcessError error); /** * \brief Called when storage provider process changes its state. */ void OnStateChanged(QProcess::ProcessState status); /** * \brief Called when storage provider process provides new information on its standard output. */ void OnReadyProcessOutput(); signals: /** * \brief signal is emitted if status of storage provider process has changend. * \param QString containing m_StatusText. */ void SignalStatusOfStoreSCP(const QString&); /** * \brief signal is emitted an error occours while storage provider process is running. * \param QString containing m_ErrorText. */ void SignalStoreSCPError(const QString& errorText = ""); /** * \brief signal is emitted when storage provider process starts storing dicom files. * \param QStringList& of processed dicom files. */ void SignalStartImport(const QStringList&); /** * \brief signal is emitted if import of storage provider process has finished. * \note currently not used. */ void SignalFinishedImport(); private: /** * \brief DicomEventHandler constructor. */ void FindPathToStoreSCP(); /** * \brief DicomEventHandler constructor. * \param QmitkStoreSCPLauncherBuilder* to builder object. */ void SetArgumentList(QmitkStoreSCPLauncherBuilder* builder); /** * \brief Converts the m_ArgumentList into a QString containing all arguments from list. */ QString ArgumentListToQString(); QString m_PathToStoreSCP; QString m_ErrorText; QString m_StatusText; QProcess* m_StoreSCP; QStringList m_ArgumentList; QStringList m_ImportFilesList; }; #endif //QmitkStoreSCPLauncher_h \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h index b144780243..4a53c38dbf 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h +++ b/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h @@ -1,92 +1,92 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkStoreSCPLauncherBuilder_h #define QmitkStoreSCPLauncherBuilder_h #include #include /** * \brief QmitkStoreSCPLauncherBuilder it builds the arguments for QmitkStoreSCPLauncher. */ class QmitkStoreSCPLauncherBuilder : public QObject { Q_OBJECT public: /** * \brief QmitkStoreSCPLauncherBuilder constructor. */ QmitkStoreSCPLauncherBuilder(); /** * \brief QmitkStoreSCPLauncherBuilder destructor. */ - virtual ~QmitkStoreSCPLauncherBuilder(); + ~QmitkStoreSCPLauncherBuilder() override; /** * \brief Adds port to this object. * \param port default is 105 */ QmitkStoreSCPLauncherBuilder* AddPort(const QString& port = QString("105")); /** * \brief Adds aetitle to this object. * \param aeTitle default is STORESCP */ QmitkStoreSCPLauncherBuilder* AddAETitle(const QString& aeTitle = QString("STORESCP")); /** * \brief Adds transfer syntax to this object. * \param transferSyntax default is +x= which means prefer uncompressed. */ QmitkStoreSCPLauncherBuilder* AddTransferSyntax(const QString& transferSyntax = QString("+x=")); /** * \brief Adds other network option to this object. * \param otherNetworkOptions default is -pm which means promiscuous mode, accept unknown SOP classes. */ QmitkStoreSCPLauncherBuilder* AddOtherNetworkOptions(const QString& otherNetworkOptions = QString("-pm")); /** * \brief Adds mode option to this object. * \param mode default is -v which means promiscuous verbose mode. */ QmitkStoreSCPLauncherBuilder* AddMode(const QString& mode = QString("-v")); /** * \brief Adds output directory to this object. * \param outputDirectory path to directory. */ QmitkStoreSCPLauncherBuilder* AddOutputDirectory(const QString& outputDirectory); QString* GetPort(); QString* GetAETitle(); QString* GetTransferSyntax(); QString* GetOtherNetworkOptions(); QString* GetMode(); QString* GetOutputDirectory(); private: QString* m_Port; QString* m_AETitle; QString* m_TransferSyntax; QString* m_OtherNetworkOptions; QString* m_Mode; QString* m_OutputDirectory; }; #endif diff --git a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h index 845ab34055..d406c64715 100644 --- a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h +++ b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h @@ -1,173 +1,173 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkImageCropper_h #define QmitkImageCropper_h #include #ifdef WIN32 #pragma warning( disable : 4250 ) #endif #include #include "QmitkRegisterClasses.h" #include #include "itkCommand.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "ui_ImageCropperControls.h" #include "usServiceRegistration.h" /*! @brief QmitkImageCropperView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkImageCropper : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) private: Q_OBJECT public: /*! @brief Constructor. Called by SampleApp (or other apps that use functionalities) */ QmitkImageCropper(QObject *parent = 0); - virtual ~QmitkImageCropper(); + ~QmitkImageCropper() override; static const std::string VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! @brief Creates the Qt connections needed */ QWidget* GetControls(); /// @brief Called when the user clicks the GUI button protected slots: /*! * @brief Creates a new bounding object */ virtual void DoCreateNewBoundingObject(); /*! * @brief Whenever Crop button is pressed, issue a cropping action */ void DoCropping(); /*! * @brief Whenever Mask button is pressed, issue a masking action */ void DoMasking(); /*! * @brief Dis- or enable the advanced setting section */ void OnAdvancedSettingsButtonToggled(); /*! * @brief Updates current selection of the bounding object */ void OnDataSelectionChanged(const mitk::DataNode* node); /*! * @brief Sets the scalar value for outside pixels in case of masking */ void OnSliderValueChanged(int slidervalue); protected: /*! @brief called by QmitkFunctionality when DataManager's selection has changed */ void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; /*! @brief Sets the selected bounding object as current bounding object and set up interactor */ void OnComboBoxSelectionChanged(const mitk::DataNode* node); /*! * @brief Initializes a new bounding shape using the selected image geometry. */ mitk::Geometry3D::Pointer InitializeWithImageGeometry(mitk::BaseGeometry::Pointer geometry); void CreateBoundingShapeInteractor(bool rotationEnabled); private: /*! * The parent QWidget */ QWidget* m_ParentWidget; /*! * @brief A pointer to the node of the image to be cropped. */ mitk::WeakPointer m_ImageNode; /*! * @brief The cuboid used for cropping. */ mitk::GeometryData::Pointer m_CroppingObject; /*! * @brief Tree node of the cuboid used for cropping. */ mitk::DataNode::Pointer m_CroppingObjectNode; /*! * @brief Interactor for moving and scaling the cuboid */ mitk::BoundingShapeInteractor::Pointer m_BoundingShapeInteractor; void ProcessImage(bool crop); /*! * @brief Resets GUI to default */ void setDefaultGUI(); QString AdaptBoundingObjectName(const QString& name) const; // cropping parameter mitk::ScalarType m_CropOutsideValue; bool m_Advanced; bool m_Active; bool m_ScrollEnabled; Ui::ImageCropperControls m_Controls; }; #endif // QmitkImageCropper_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h index 72cd06f5b3..336d47571c 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h @@ -1,130 +1,130 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_H #define __Q_MITK_MATCHPOINT_H #include #include #include #include #include //QT #include // MatchPoint #include #include #include #include "ui_QmitkMatchPointBrowserControls.h" #include "QmitkMAPAlgorithmModel.h" #include "QmitkAlgorithmListModel.h" #include "mitkAlgorithmInfoSelectionProvider.h" /*! \brief MatchPoint \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPointBrowser : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointBrowser) QmitkMatchPointBrowser(); - virtual ~QmitkMatchPointBrowser(); + ~QmitkMatchPointBrowser() override; /** * \brief Called by the framework to indicate that the preferences have changed. * \param prefs not used, as we call RetrievePreferenceValues(). */ - void OnPreferencesChanged(const berry::IBerryPreferences* prefs); + void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override; protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); /// \brief Called when the user clicks the GUI button void OnSearchFolderButtonPushed(); void OnAlgoListSelectionChanged(const QModelIndex&); void OnSearchChanged(const QString&); protected: - virtual void CreateQtPartControl(QWidget* parent); - virtual void SetFocus(); + void CreateQtPartControl(QWidget* parent) override; + void SetFocus() override; Ui::MatchPointBrowserControls m_Controls; //! [Qt Selection Provider] /** @brief this pointer holds the selection provider*/ mitk::AlgorithmInfoSelectionProvider::Pointer m_SelectionProvider; //! [Qt Selection Provider] private: - void SetSelectionProvider(); + void SetSelectionProvider() override; void Error(QString msg); /** * \brief Called on startup and by OnPreferencesChanged to load all * preferences except the temporary folder into member variables. */ void RetrieveAndStorePreferenceValues(); void OnInvalidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event); void OnValidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event); /** * \brief Called to get hold of the actual preferences node. */ berry::IBerryPreferences::Pointer RetrievePreferences(); QWidget* m_Parent; ::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_DLLInfoList; QStringList m_currentSearchPaths; QmitkAlgorithmListModel* m_algModel; QSortFilterProxyModel* m_filterProxy; ::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle; ::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h index 08e09ac433..310c96aaec 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_ALGORITHM_SELECTION_PROVIDER_H #define _MITK_ALGORITHM_SELECTION_PROVIDER_H #include #include #include #include "mitkMAPAlgorithmInfoSelection.h" namespace mitk { class AlgorithmInfoSelectionProvider: public QObject, public berry::ISelectionProvider { Q_OBJECT public: berryObjectMacro(AlgorithmInfoSelectionProvider) AlgorithmInfoSelectionProvider(); - void AddSelectionChangedListener(berry::ISelectionChangedListener* listener); + void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override; - void RemoveSelectionChangedListener( berry::ISelectionChangedListener* listener); + void RemoveSelectionChangedListener( berry::ISelectionChangedListener* listener) override; - berry::ISelection::ConstPointer GetSelection() const; - void SetSelection(const berry::ISelection::ConstPointer& selection); + berry::ISelection::ConstPointer GetSelection() const override; + void SetSelection(const berry::ISelection::ConstPointer& selection) override; MAPAlgorithmInfoSelection::ConstPointer GetInfoSelection() const; void SetInfoSelection(MAPAlgorithmInfoSelection::ConstPointer selection); protected: berry::ISelectionChangedListener::Events _selectionEvents; MAPAlgorithmInfoSelection::ConstPointer _selection; }; } #endif /* BERRYQTSELECTIONPROVIDER_H_ */ diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/org_mitk_gui_qt_matchpoint_algorithm_browser_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/org_mitk_gui_qt_matchpoint_algorithm_browser_Activator.h index 322c2dc610..43512275d3 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/org_mitk_gui_qt_matchpoint_algorithm_browser_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/org_mitk_gui_qt_matchpoint_algorithm_browser_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_algorithm_browser_Activator_h #define org_mitk_gui_qt_matchpoint_algorithm_browser_Activator_h #include class org_mitk_gui_qt_matchpoint_algorithm_browser_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_algorithm_browser") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_algorithmcontrol_Activator #endif // org_mitk_gui_qt_algorithmcontrol_Activator_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h index 52cc27c070..2d2cf374b0 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h @@ -1,214 +1,214 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_H #define __Q_MITK_MATCHPOINT_H #include #include #include "ui_QmitkMatchPointControls.h" #include // MatchPoint #include #include #include #include #include #include #include class QmitkRegistrationJob; class QmitkMappingJob; /*! \brief MatchPoint \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPoint : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPoint) QmitkMatchPoint(); - ~QmitkMatchPoint(); + ~QmitkMatchPoint() override; protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); /// \brief Called when the user clicks the GUI button void OnLoadAlgorithmButtonPushed(); void OnSelectedAlgorithmChanged(); void OnNodeSelectionChanged(QList nodes); void OnStartRegBtnPushed(); void OnStopRegBtnPushed(); void OnSaveLogBtnPushed(); void OnRegJobError(QString err); void OnRegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration, const QmitkRegistrationJob* pRegJob); void OnRegJobFinished(); void OnMapJobError(QString err); void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job); void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration); void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel); void OnAlgorithmStatusChanged(QString info); void OnAlgorithmInfo(QString info); protected: - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList& nodes) override; private: /** * @brief Adapt the visibility of GUI elements depending on the current data loaded */ void AdaptFolderGUIElements(); void Error(QString msg); void UpdateAlgorithmList(); /** * checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored m_MovingData and m_TargetData. It also sets the info lables accordingly. * @return True: All inputs are set and valid (images). False: At least one input is not set * or invalid */ bool CheckInputs(); /** * Updates the state of registration control buttons. Regarding to selected * inputs, loaded algorithm and its state.*/ void ConfigureRegistrationControls(); /** * Configures the progress bars according to the chosen algorithm. */ void ConfigureProgressInfos(); /** Configure the node selectors predicates and informations according to the selected algorithm. */ void ConfigureNodeSelectors(); /** Methods returns a list of all nodes in the data manager containing a registration wrapper. * The list may be empty.*/ mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const; /** Returns a proposal for a (unique) default reg job name */ std::string GetDefaultRegJobName() const; /** Returns the display name of the passed node. Normally it is just node->GetName(). * if the node contains a point set it is additionally checked if the point set node * has a source node and its name will be added in parentheses.*/ std::string GetInputNodeDisplayName(const mitk::DataNode* node) const; /** Returns the Pointer to the DLL info of the algorithm currently selected by the system. The info is received via m_AlgorithmSelectionListener. @return If there is no item selected the returning pointer will be null. */ const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const; //! [Qt Selection Listener method and pointer] /** * @brief Method of berry::ISelectionListener that implements the selection listener functionality. * @param sourcepart The workbench part responsible for the selection change. * @param selection This parameter holds the current selection. * * @see ISelectionListener */ void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart, const berry::ISelection::ConstPointer& selection); void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection); friend struct berry::SelectionChangedAdapter; QWidget* m_Parent; /** @brief this pointer holds the algorithm selection listener */ QScopedPointer m_AlgorithmSelectionListener; ::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle; ::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm; ::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo; typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm; typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm; typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm; mitk::DataNode::Pointer m_spSelectedTargetNode; mitk::DataNode::Pointer m_spSelectedMovingNode; /*Data of the selected target node that should be used for registration. Can be the direct return of node->GetData(), but can also be a sub set (like a special time frame).*/ mitk::BaseData::ConstPointer m_spSelectedTargetData; /*Data of the selected moving node that should be used for registration. Can be the direct return of node->GetData(), but can also be a sub set (like a special time frame).*/ mitk::BaseData::ConstPointer m_spSelectedMovingData; mitk::DataNode::Pointer m_spSelectedTargetMaskNode; mitk::DataNode::Pointer m_spSelectedMovingMaskNode; /*Data of the selected target mask node that should be used for registration. Can be the direct return of node->GetData(), but can also be a sub set (like a special time frame).*/ mitk::Image::ConstPointer m_spSelectedTargetMaskData; /*Data of the selected moving mask node that should be used for registration. Can be the direct return of node->GetData(), but can also be a sub set (like a special time frame).*/ mitk::Image::ConstPointer m_spSelectedMovingMaskData; // boolean variables to control visibility of GUI elements bool m_CanLoadAlgorithm; bool m_ValidInputs; bool m_Working; Ui::MatchPointAdvancedControls m_Controls; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator.h index 2401631b2d..7420b67892 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator.h @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator_h #define org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator_h #include class org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_algorithmcontrol") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator #endif // org_mitk_gui_qt_matchpoint_algorithmcontrol_Activator_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h index 9127e8bf1a..c77caffcf7 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h @@ -1,123 +1,123 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H #define __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H #include #include #include #include "ui_QmitkMatchPointRegistrationEvaluator.h" /*! \brief QmitkMatchPointRegistrationEvaluator \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPointRegistrationEvaluator : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointRegistrationEvaluator) QmitkMatchPointRegistrationEvaluator(); - ~QmitkMatchPointRegistrationEvaluator(); + ~QmitkMatchPointRegistrationEvaluator() override; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; protected slots: /// \brief Called when the user clicks the GUI button void OnEvalBtnPushed(); void OnStopBtnPushed(); void OnSettingsChanged(mitk::DataNode*); void OnSliceChanged(); protected: /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes) override; - virtual void NodeRemoved(const mitk::DataNode* node) override; + void NodeRemoved(const mitk::DataNode* node) override; - virtual void SetFocus(); + void SetFocus() override; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; Ui::MatchPointRegistrationEvaluatorControls m_Controls; private: QWidget *m_Parent; void Error(QString msg); /** Methods returns a list of all eval nodes in the data manager.*/ QList GetEvalNodes(); /** * Checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode. * They are also checked for vadility and stored in m_ValidInput,... . * It also sets the info lables accordingly.*/ void CheckInputs(); /** * Updates the state of controls regarding to selected eval object.*/ void ConfigureControls(); mitk::DataNode::Pointer m_selectedEvalNode; QmitkSliceNavigationListener m_SliceChangeListener; itk::TimeStamp m_selectedNodeTime; itk::TimeStamp m_currentPositionTime; bool m_activeEvaluation; bool m_autoMoving; bool m_autoTarget; /** @brief currently valid selected position in the inspector*/ mitk::Point3D m_currentSelectedPosition; /** @brief indicates if the currently selected position is valid for the currently selected fit. * This it is within the input image */ unsigned int m_currentSelectedTimeStep; mitk::DataNode::Pointer m_spSelectedRegNode; mitk::DataNode::Pointer m_spSelectedMovingNode; mitk::DataNode::Pointer m_spSelectedTargetNode; static const std::string HelperNodeName; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.h index 49c3f5ece7..7eec4425ac 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/org_mitk_gui_qt_matchpoint_evaluator_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_evaluator_Activator_h #define org_mitk_gui_qt_matchpoint_evaluator_Activator_h #include class org_mitk_gui_qt_matchpoint_evaluator_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_evaluator") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_evaluator_Activator #endif // org_mitk_gui_qt_matchpoint_evaluator_Activator_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h index 0cc6c1f155..28f48681a3 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h @@ -1,205 +1,205 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H #define __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H #include #include #include "ui_QmitkMatchPointFrameCorrectionControls.h" #include // MatchPoint #include #include #include #include #include #include #include #include /*! \brief View for motion artefact correction of images. The view utalizes MatchPoint registration algorithms and the mitk::TimeFramesRegistrationHelper and implemnts the GUI business logic to make frame correction aka motion artefact correction on 3D+t images. */ class QmitkMatchPointFrameCorrection : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointFrameCorrection) QmitkMatchPointFrameCorrection(); - ~QmitkMatchPointFrameCorrection(); + ~QmitkMatchPointFrameCorrection() override; protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); /// \brief Called when the user clicks the GUI button void OnMaskCheckBoxToggeled(bool checked); void OnLoadAlgorithmButtonPushed(); void OnSelectedAlgorithmChanged(); void OnStartRegBtnPushed(); void OnSaveLogBtnPushed(); void OnFramesSelectAllPushed(); void OnFramesDeSelectAllPushed(); void OnFramesInvertPushed(); void OnRegJobError(QString err); void OnRegJobFinished(); void OnMapJobError(QString err); void OnMapResultIsAvailable(mitk::Image::Pointer spMappedData, const QmitkFramesRegistrationJob* job); void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration); void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel); void OnAlgorithmStatusChanged(QString info); void OnAlgorithmInfo(QString info); void OnFrameProcessed(double progress); void OnFrameRegistered(double progress); void OnFrameMapped(double progress); protected: - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList& nodes) override; private: /** * @brief Adapt the visibility of GUI elements depending on the current data loaded */ void AdaptFolderGUIElements(); void Error(QString msg); void UpdateAlgorithmList(); /** * checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored m_MovingData and m_TargetData. It also sets the info lables accordingly. * @return True: All inputs are set and valid (images). False: At least one input is not set * or invalid */ bool CheckInputs(); /** * Updates the state of registration control buttons. Regarding to selected * inputs, loaded algorithm and its state.*/ void ConfigureRegistrationControls(); /** * Configures the progress bars according to the chosen algorithm. */ void ConfigureProgressInfos(); /**configure the frame list widget based on the selected target.*/ void ConfigureFrameList(); /**generates the ignore list based on the frame list widget selection.*/ mitk::TimeFramesRegistrationHelper::IgnoreListType GenerateIgnoreList() const; /** Methods returns a list of all nodes in the data manager containing a registration wrapper. * The list may be empty.*/ mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const; /** Returns a proposal for a (unique) default reg job name */ std::string GetDefaultJobName() const; /** Returns the display name of the passed node. Normally it is just node->GetName(). * if the node contains a point set it is additionally checked if the point set node * has a source node and its name will be added in parentheses.*/ std::string GetInputNodeDisplayName(const mitk::DataNode* node) const; /** Returns the Pointer to the DLL info of the algorithm currently selected by the system. The info is received via m_AlgorithmSelectionListener. @return If there is no item selected the returning pointer will be null. */ const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const; //! [Qt Selection Listener method and pointer] /** * @brief Method of berry::ISelectionListener that implements the selection listener functionality. * @param sourcepart The workbench part responsible for the selection change. * @param selection This parameter holds the current selection. * * @see ISelectionListener */ void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart, const berry::ISelection::ConstPointer& selection); void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection); friend struct berry::SelectionChangedAdapter; QWidget* m_Parent; /** @brief this pointer holds the algorithm selection listener */ QScopedPointer m_AlgorithmSelectionListener; ::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle; ::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm; ::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo; typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm; typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm; typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm; mitk::DataNode::Pointer m_spSelectedTargetNode; /*Data of the selected target node that should be used for registration. Can be the direct return of node->GetData(), but can also be a sub set (like a special time frame).*/ mitk::BaseData::ConstPointer m_spSelectedTargetData; mitk::DataNode::Pointer m_spSelectedTargetMaskNode; mitk::Image::ConstPointer m_spSelectedTargetMaskData; // boolean variables to control visibility of GUI elements bool m_CanLoadAlgorithm; bool m_ValidInputs; bool m_Working; Ui::MatchPointFrameCorrectionControls m_Controls; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/org_mitk_gui_qt_matchpoint_framereg_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/org_mitk_gui_qt_matchpoint_framereg_Activator.h index b98000b8d6..bdd6f91ff9 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/org_mitk_gui_qt_matchpoint_framereg_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/org_mitk_gui_qt_matchpoint_framereg_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_framereg_Activator_h #define org_mitk_gui_qt_matchpoint_framereg_Activator_h #include class org_mitk_gui_qt_matchpoint_framereg_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_framereg") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_framereg_Activator #endif // org_mitk_gui_qt_matchpoint_framereg_Activator diff --git a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h index d30857249d..c70437bb91 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h @@ -1,153 +1,153 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H #define __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H #include #include #include #include #include #include "ui_QmitkMatchPointRegistrationManipulator.h" class QmitkMappingJob; /*! \brief QmitkMatchPointRegistrationManipulator \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPointRegistrationManipulator : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointRegistrationManipulator) QmitkMatchPointRegistrationManipulator(); - ~QmitkMatchPointRegistrationManipulator(); + ~QmitkMatchPointRegistrationManipulator() override; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; protected slots: /// \brief Called when the user clicks the GUI button void OnStartBtnPushed(); void OnCancelBtnPushed(); void OnStoreBtnPushed(); void OnSettingsChanged(mitk::DataNode*); void OnSelectionChanged(); void OnRegistrationChanged(); void OnCenterTypeChanged(int); void OnSliceChanged(); void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job); void Error(QString msg); protected: /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes) override; - virtual void NodeRemoved(const mitk::DataNode* node) override; + void NodeRemoved(const mitk::DataNode* node) override; - virtual void SetFocus(); + void SetFocus() override; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; Ui::MatchPointRegistrationManipulatorControls m_Controls; private: QWidget *m_Parent; /** Methods returns a list of all eval nodes in the data manager.*/ QList GetEvalNodes(); /** * Checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode. * They are also checked for validity.*/ void CheckInputs(); /** * Updates the state of controls regarding to the state of the view and it objects.*/ void ConfigureControls(); /** Initialize the state of the view, so the manipulation can start.*/ void InitSession(); /** Stops session, removes all obsolete members (e.g. RegEvalObject). After that the view is in a valid but inactive state.*/ void StopSession(); void ConfigureTransformCenter(int centerType); mitk::DataNode::Pointer m_EvalNode; QmitkSliceNavigationListener m_SliceChangeListener; itk::TimeStamp m_selectedNodeTime; itk::TimeStamp m_currentPositionTime; bool m_activeManipulation; bool m_autoMoving; bool m_autoTarget; /** @brief currently valid selected position in the inspector*/ mitk::Point3D m_currentSelectedPosition; /** @brief indicates if the currently selected position is valid for the currently selected fit. * This it is within the input image */ unsigned int m_currentSelectedTimeStep; mitk::DataNode::Pointer m_SelectedPreRegNode; mitk::DataNode::Pointer m_SelectedMovingNode; mitk::DataNode::Pointer m_SelectedTargetNode; mitk::MAPRegistrationWrapper::Pointer m_CurrentRegistrationWrapper; map::core::RegistrationBase::Pointer m_CurrentRegistration; using MAPRegistrationType = map::core::Registration<3, 3>; MAPRegistrationType::Pointer m_SelectedPreReg; bool m_internalUpdate; static const std::string HelperNodeName; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/org_mitk_gui_qt_matchpoint_manipulator_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/org_mitk_gui_qt_matchpoint_manipulator_Activator.h index b25a4cf2ca..f2b6f55ca1 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/org_mitk_gui_qt_matchpoint_manipulator_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/org_mitk_gui_qt_matchpoint_manipulator_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_manipulator_Activator_h #define org_mitk_gui_qt_matchpoint_manipulator_Activator_h #include class org_mitk_gui_qt_matchpoint_manipulator_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_manipulator") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_manipulator_Activator #endif // org_mitk_gui_qt_matchpoint_manipulator_Activator_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h index 98feabcd1a..c33d3fda16 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h @@ -1,180 +1,180 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_MAPPER_H #define __Q_MITK_MATCHPOINT_MAPPER_H #include #include #include #include "ui_QmitkMatchPointMapper.h" #include "QmitkMappingJob.h" // MatchPoint /*! \brief QmitkMatchPointMapper \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPointMapper : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointMapper) QmitkMatchPointMapper(); - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); /// \brief Called when the user clicks the GUI button void OnLockRegButtonPushed(); void OnLockInputButtonPushed(); void OnLockReferenceButtonPushed(); void OnManualRefChecked(); void OnLinkSampleFactorChecked(); void OnXFactorChanged(double d); void OnMapBtnPushed(); void OnRefineBtnPushed(); void OnMapJobError(QString err); void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job); void OnMappingInfo(QString info); protected: - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList& nodes) override; Ui::MatchPointMapperControls m_Controls; private: QWidget *m_Parent; void MapNStoreImage(QmitkMappingJob* job); void Error(QString msg); /** Method checks if the currently selected reg node has a direct kernel that * can be decomposed in a rotation matrix and a offset. If this is true, true * is returned. In all other cases false is returned.*/ bool IsAbleToRefineGeometry() const; /** Method checks if the currently selected input is a binary image (property binary == true). * If this is true, true is returned. In all other cases false is returned.*/ bool IsBinaryInput() const; /** Method checks if the currently selected input is a point set. * If this is true, true is returned. In all other cases false is returned.*/ bool IsPointSetInput() const; /** Function returns the first data node containing a registration wrapper * in the current selection of the data manager. If nothing is selected or * no registration wrapper is selected it return nullptr.*/ mitk::DataNode::Pointer GetSelectedRegNode(); /** Methods returns a list of all nodes selected in the data manager that do * NOT contain registration wrappers. The list may be empty if nothing is * selected or no appropriate data node is selected.*/ QList GetSelectedDataNodes(); /** If a registration node is set, this function determines the auto reference node. * The auto reference node is the node of the target data used to determine the * registration object or, if the first cannot be determined, the currently selected input * node. * @return Pointer to the reference node (target data of the registration algorithm run). * Function may return nullptr if the referenced node cannot be found or is not defined * by the registration.*/ mitk::DataNode::Pointer GetAutoRefNodeByReg(); /** * Checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode. * They are also checked for vadility and stored in m_ValidInput,... . * It also sets the info lables accordingly.*/ void CheckInputs(); /** Methods checks the validity of the currently stored * m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode. * Results are returned via the parameters. Details of the evaluation are * printed to the log widget.*/ void CheckNodesValidity(bool& validReg, bool& validInput, bool& validRef); /** * Updates the state of mapping control button regarding to selected * input, registration and reference.*/ void ConfigureMappingControls(); /** * Configures the progress bars accoarding to the choosen algorithm. */ void ConfigureProgressInfos(); /** * Used to generate, configure and execute a mapping job regarding the * current settings. * @param doGeometryRefinement Set true if only a geometry refinement should be done. * Set to false if a mapping/resampling of the input should be done.*/ void SpawnMappingJob(bool doGeometryRefinement = false); mitk::DataNode::Pointer m_spSelectedRegNode; mitk::DataNode::Pointer m_spSelectedInputNode; mitk::DataNode::Pointer m_spSelectedRefNode; /** boolean variable to control visibility of GUI elements*/ bool m_ValidReg; /** boolean variable to control visibility of GUI elements*/ bool m_ValidInput; /** boolean variable to control visibility of GUI elements*/ bool m_ValidRef; /** used for the internal logic to indicate of the current settings are set for mapping binary images (used by ConfigureMappingControls()).*/ bool m_preparedForBinaryInput; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/org_mitk_gui_qt_matchpoint_mapper_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/org_mitk_gui_qt_matchpoint_mapper_Activator.h index b76bab2456..7f64ffc1ac 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/org_mitk_gui_qt_matchpoint_mapper_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/org_mitk_gui_qt_matchpoint_mapper_Activator.h @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_mapper_Activator_h #define org_mitk_gui_qt_matchpoint_mapper_Activator_h #include class org_mitk_gui_qt_matchpoint_mapper_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_mapper") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_mapper_Activator #endif // org_mitk_gui_qt_matchpoint_mapper_Activator_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h index fec2acf803..1f2f2c27a5 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h @@ -1,162 +1,162 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H #define __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H #include #include #include #include #include #include "mitkMAPRegistrationWrapper.h" #include "ui_QmitkMatchPointRegistrationVisualizer.h" /*! \brief QmitkMatchPointRegistrationVisualizer \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkMatchPointRegistrationVisualizer : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointRegistrationVisualizer) QmitkMatchPointRegistrationVisualizer(); - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /** Returns the registration currently handled by the plugin. * May return nullptr, if no registration is selected/handled by * the plugin*/ mitk::MAPRegistrationWrapper* GetCurrentRegistration(); protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); void OnLockRegButtonPushed(); void OnStyleButtonPushed(); void OnDirectionChanged(int index); void OnUseFOVRefBtnPushed(); void OnUpdateBtnPushed(); void OnColorInterpolationChecked(bool); protected: - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList& nodes) override; void ActualizeRegInfo(mitk::MAPRegistrationWrapper* currentReg); Ui::MatchPointRegVisControls* m_Controls; private: QWidget* m_Parent; void Error(QString msg); void CheckInputs(); /** Function returns the first data node containing a registration wrapper * in the current selection of the data manager. If nothing is selected or * no registration wrapper is selected it return nullptr.*/ mitk::DataNode::Pointer GetSelectedRegNode() const; /** If a registration node is set, this function determines the relevant referenced node. * The reference node is the node of the target or moving data (depending on the selected directions) * used to determine the* registration object. * @return Pointer to the reference node (moving or target data of the registration algorithm run). * Function may return nullptr if the referenced node cannot be found or is not defined * by the registration.*/ mitk::DataNode::Pointer GetRefNodeOfReg(bool target) const; /** Methods returns the first node selected in the data manager that does * NOT contain a registration wrapper and has a data pointer with a geometry. * Returned pointer may be nullptr if nothing is selected or no appropriate data * node is selected.*/ mitk::DataNode::Pointer GetSelectedDataNode(); /** Methods checks if the given gridRes is larger than maxGridRes and scales down the spacing if necessary. * @param gridRes the resolution of the "grid". * @param spacing the spacing that would be used on the grid. * @param maxGridRes the maximum resolution of the "grid".*/ mitk::ScalarType GetSaveSpacing(mitk::ScalarType gridRes, mitk::ScalarType spacing, unsigned int maxGridRes) const; /** * Checks for mandatory node properties and defines them with default values if they are missing.*/ void InitRegNode(); /** * Updates the gui controls regarding the current state of the instance.*/ void ConfigureVisualizationControls(); /** * Updates the properties of the selected node according to the states of the gui controls.*/ void StoreStateInNode(); /** * Updates the state of the gui controls according to the properties of the selected node.*/ void LoadStateFromNode(); /** * Checks accordung to the current direction if there is a default FOV ref and sets it, * if the current FOV ref is not locked.*/ void CheckAndSetDefaultFOVRef(); void UpdateOrientationMatrixWidget(); /**indicates if the gui updates is triggered internally or by user. Needed to * avoid update loops by ConfigureVisualizationControlls();*/ bool m_internalUpdateGuard; mitk::DataNode::Pointer m_spSelectedFOVRefNode; mitk::DataNode::Pointer m_spSelectedRegNode; /**Used to store informations about the FOV reference orientation. Default is identity matrix.*/ mitk::AffineTransform3D::MatrixType m_FOVRefOrientation; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/org_mitk_gui_qt_matchpoint_visualizer_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/org_mitk_gui_qt_matchpoint_visualizer_Activator.h index 5615a28bd4..1d77c3e1c6 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/org_mitk_gui_qt_matchpoint_visualizer_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/org_mitk_gui_qt_matchpoint_visualizer_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_visualizer_Activator_h #define org_mitk_gui_qt_matchpoint_visualizer_Activator_h #include class org_mitk_gui_qt_matchpoint_visualizer_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_visualizer") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_visualizer_Activator #endif // org_mitk_gui_qt_matchpoint_visualizer_Activator_h diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h index 4f2bfef54a..4dc27b591f 100644 --- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h +++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkImageStatisticsView_H__INCLUDED #define QmitkImageStatisticsView_H__INCLUDED #include "ui_QmitkImageStatisticsViewControls.h" // Qmitk includes #include #include #include #include #include #include /*! \brief QmitkImageStatisticsView is a bundle that allows statistics calculation from images. Three modes are supported: 1. Statistics of one image, 2. Statistics of an image and a segmentation, 3. Statistics of an image and a Planar Figure. The statistics calculation is realized in a separate thread to keep the gui accessible during calculation. \ingroup Plugins/org.mitk.gui.qt.measurementtoolbox */ class QmitkImageStatisticsView : public QmitkAbstractView, public mitk::ILifecycleAwarePart, public berry::IPartListener { Q_OBJECT public: /*! \brief default constructor */ QmitkImageStatisticsView(QObject *parent = nullptr, const char *name = nullptr); /*! \brief default destructor */ - virtual ~QmitkImageStatisticsView(); + ~QmitkImageStatisticsView() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /*! \brief Is called from the selection mechanism once the data manager selection has changed*/ void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &selectedNodes) override; static const std::string VIEW_ID; protected: using HistogramType = mitk::ImageStatisticsContainer::HistogramType; - virtual void Activated() override; - virtual void Deactivated() override; - virtual void Visible() override; - virtual void Hidden() override; - virtual void SetFocus() override; + void Activated() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; + void SetFocus() override; /** \brief Is called right before the view closes (before the destructor) */ - virtual void PartClosed(const berry::IWorkbenchPartReference::Pointer&) override; + void PartClosed(const berry::IWorkbenchPartReference::Pointer&) override; /** \brief Required for berry::IPartListener */ - virtual Events::Types GetPartEventTypes() const override { return Events::CLOSED; } + Events::Types GetPartEventTypes() const override { return Events::CLOSED; } void OnImageSelectorChanged(); void OnMaskSelectorChanged(); void CalculateOrGetStatistics(); void CalculateStatistics(const mitk::Image* image, const mitk::Image* mask = nullptr, const mitk::PlanarFigure* maskPlanarFigure = nullptr); void ComputeAndDisplayIntensityProfile(mitk::Image * image, mitk::PlanarFigure* maskPlanarFigure); void FillHistogramWidget(const std::vector &histogram, const std::vector &dataLabels); QmitkChartWidget::ColorTheme GetColorTheme() const; void ResetGUI(); void ResetGUIDefault(); void PrepareDataStorageComboBoxes(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); void OnStatisticsCalculationEnds(); void OnRequestHistogramUpdate(unsigned int nBins); void OnCheckBoxIgnoreZeroStateChanged(int state); void OnSliderWidgetHistogramChanged(double value); void OnSliderWidgetIntensityProfileChanged(); // member variable Ui::QmitkImageStatisticsViewControls m_Controls; private: std::string GenerateStatisticsNodeName(); void HandleExistingStatistics(mitk::Image::ConstPointer image, mitk::BaseData::ConstPointer mask, mitk::ImageStatisticsContainer::Pointer); void SetupRelationRules(mitk::ImageStatisticsContainer::Pointer, mitk::BaseData::ConstPointer mask); mitk::DataNode::Pointer GetNodeForStatisticsContainer(mitk::ImageStatisticsContainer::ConstPointer container); typedef itk::SimpleMemberCommand< QmitkImageStatisticsView > ITKCommandType; QmitkImageStatisticsCalculationJob * m_CalculationJob = nullptr; mitk::DataNode::ConstPointer m_selectedImageNode = nullptr, m_selectedMaskNode = nullptr; mitk::PlanarFigure::Pointer m_selectedPlanarFigure=nullptr; long m_PlanarFigureObserverTag; bool m_ForceRecompute = false; }; #endif // QmitkImageStatisticsView_H__INCLUDED diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h index d8a7da9c60..72d7b09997 100644 --- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h +++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_MEASUREMENT_H__INCLUDED #define QMITK_MEASUREMENT_H__INCLUDED #include #include #include "usServiceRegistration.h" /// forward declarations struct QmitkMeasurementViewData; namespace mitk { class PlanarFigure; } /// /// A view for doing measurements in digital images by means of /// mitk::Planarfigures which can represent drawing primitives (Lines, circles, ...). /// The view consists of only three main elements: /// 1. A toolbar for activating PlanarFigure drawing /// 2. A textbrowser which shows details for the selected PlanarFigures /// 3. A button for copying all details to the clipboard /// class QmitkMeasurementView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; QmitkMeasurementView(); - virtual ~QmitkMeasurementView(); + ~QmitkMeasurementView() override; void CreateQtPartControl(QWidget* parent) override; void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; void NodeAdded(const mitk::DataNode* node) override; void NodeChanged(const mitk::DataNode* node) override; void NodeRemoved(const mitk::DataNode* node) override; void PlanarFigureSelected( itk::Object* object, const itk::EventObject& ); protected slots: void OnDrawLineTriggered( bool checked = false ); void OnDrawPathTriggered( bool checked = false ); void OnDrawAngleTriggered( bool checked = false ); void OnDrawFourPointAngleTriggered( bool checked = false ); void OnDrawCircleTriggered( bool checked = false ); void OnDrawEllipseTriggered( bool checked = false ); void OnDrawDoubleEllipseTriggered( bool checked = false ); void OnDrawRectangleTriggered( bool checked = false ); void OnDrawPolygonTriggered( bool checked = false ); void OnDrawBezierCurveTriggered( bool checked = false ); void OnDrawSubdivisionPolygonTriggered( bool checked = false ); void OnCopyToClipboard( bool checked = false ); private: void CreateConnections(); mitk::DataNode::Pointer AddFigureToDataStorage(mitk::PlanarFigure* figure, const QString& name); void UpdateMeasurementText(); void AddAllInteractors(); mitk::DataNode::Pointer DetectTopMostVisibleImage(); void EnableCrosshairNavigation(); void DisableCrosshairNavigation(); void PlanarFigureInitialized(); void CheckForTopMostVisibleImage(mitk::DataNode* nodeToNeglect = nullptr); mitk::DataStorage::SetOfObjects::ConstPointer GetAllPlanarFigures() const; QmitkMeasurementViewData* d; // holds configuration objects that have been deactivated std::map m_DisplayInteractorConfigs; }; #endif // QMITK_MEASUREMENT_H__INCLUDED diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h index a4e26e4306..536bb74b07 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItem.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAnimationItem_h #define QmitkAnimationItem_h #include class QmitkAnimationItem : public QStandardItem { public: enum AnimationItemDataRole { WidgetKeyRole = Qt::UserRole + 2, DurationRole, DelayRole, StartWithPreviousRole, RenderWindowRole, FromRole, ToRole, ReverseRole, OrbitRole }; explicit QmitkAnimationItem(const QString& widgetKey, double duration = 2.0, double delay = 0.0, bool startWithPrevious = false); - virtual ~QmitkAnimationItem(); + ~QmitkAnimationItem() override; QString GetWidgetKey() const; void SetWidgetKey(const QString& widgetKey); double GetDuration() const; void SetDuration(double duration); double GetDelay() const; void SetDelay(double delay); bool GetStartWithPrevious() const; void SetStartWithPrevious(bool startWithPrevious); virtual void Animate(double s) = 0; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h index ba9d4363e5..1ac4f06905 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationItemDelegate.h @@ -1,33 +1,33 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAnimationItemDelegate_h #define QmitkAnimationItemDelegate_h #include class QmitkAnimationItemDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit QmitkAnimationItemDelegate(QObject* parent = nullptr); - ~QmitkAnimationItemDelegate(); + ~QmitkAnimationItemDelegate() override; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h index 6f3bcc2e6f..8ccbb45631 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkAnimationWidget.h @@ -1,35 +1,35 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAnimationWidget_h #define QmitkAnimationWidget_h #include class QmitkAnimationItem; class QmitkAnimationWidget : public QWidget { Q_OBJECT public: explicit QmitkAnimationWidget(QWidget* parent = nullptr); - virtual ~QmitkAnimationWidget(); + ~QmitkAnimationWidget() override; virtual void SetAnimationItem(QmitkAnimationItem* animationItem) = 0; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h index 16c1acbafd..7b8da6df35 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMakerView.h @@ -1,100 +1,100 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMovieMakerView_h #define QmitkMovieMakerView_h #include class QmitkAnimationItem; class QmitkAnimationWidget; class QmitkFFmpegWriter; class QMenu; class QStandardItemModel; class QTimer; namespace Ui { class QmitkMovieMakerView; } class QmitkMovieMakerView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; QmitkMovieMakerView(); - ~QmitkMovieMakerView(); + ~QmitkMovieMakerView() override; void CreateQtPartControl(QWidget* parent) override; void SetFocus() override; private slots: void OnMoveAnimationUpButtonClicked(); void OnMoveAnimationDownButtonClicked(); void OnAddAnimationButtonClicked(); void OnRemoveAnimationButtonClicked(); void OnAnimationTreeViewRowsInserted(const QModelIndex& parent, int start, int end); void OnAnimationTreeViewRowsRemoved(const QModelIndex& parent, int start, int end); void OnAnimationTreeViewSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); void OnStartComboBoxCurrentIndexChanged(int index); void OnDurationSpinBoxValueChanged(double value); void OnDelaySpinBoxValueChanged(double value); void OnPlayButtonToggled(bool checked); void OnStopButtonClicked(); void OnRecordButtonClicked(); void OnFPSSpinBoxValueChanged(int value); void OnTimerTimeout(); private: void InitializeAnimationWidgets(); void InitializeAnimationTreeViewWidgets(); void InitializeAnimationModel(); void InitializeAddAnimationMenu(); void InitializePlaybackAndRecordWidgets(); void InitializeRecordMenu(); void InitializeTimer(QWidget* parent); void ConnectAnimationTreeViewWidgets(); void ConnectAnimationWidgets(); void ConnectPlaybackAndRecordWidgets(); void ConnectTimer(); void RenderCurrentFrame(); void UpdateWidgets(); void UpdateAnimationWidgets(); void HideCurrentAnimationWidget(); void ShowAnimationWidget(QmitkAnimationItem* animationItem); void RedrawTimeline(); void CalculateTotalDuration(); QmitkAnimationItem* GetSelectedAnimationItem() const; QVector > GetActiveAnimations(double t) const; QString GetFFmpegPath() const; QmitkFFmpegWriter* m_FFmpegWriter; Ui::QmitkMovieMakerView* m_Ui; QStandardItemModel* m_AnimationModel; QMap m_AnimationWidgets; QMenu* m_AddAnimationMenu; QMenu* m_RecordMenu; QTimer* m_Timer; double m_TotalDuration; int m_NumFrames; int m_CurrentFrame; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h index d3d035ddd9..9901585d99 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationItem.h @@ -1,37 +1,37 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkOrbitAnimationItem_h #define QmitkOrbitAnimationItem_h #include "QmitkAnimationItem.h" class QmitkOrbitAnimationItem : public QmitkAnimationItem { public: explicit QmitkOrbitAnimationItem(int orbit = 360, bool reverse = false, double duration = 2.0, double delay = 0.0, bool startWithPrevious = false); - virtual ~QmitkOrbitAnimationItem(); + ~QmitkOrbitAnimationItem() override; int GetOrbit() const; void SetOrbit(int angle); bool GetReverse() const; void SetReverse(bool reverse); void Animate(double s) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h index 3662b6165d..cfdbfe5ce9 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkOrbitAnimationWidget.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkOrbitAnimationWidget_h #define QmitkOrbitAnimationWidget_h #include "QmitkAnimationWidget.h" class QmitkOrbitAnimationItem; namespace Ui { class QmitkOrbitAnimationWidget; } class QmitkOrbitAnimationWidget : public QmitkAnimationWidget { Q_OBJECT public: explicit QmitkOrbitAnimationWidget(QWidget* parent = nullptr); - ~QmitkOrbitAnimationWidget(); + ~QmitkOrbitAnimationWidget() override; void SetAnimationItem(QmitkAnimationItem* orbitAnimationItem) override; private slots: void OnOrbitChanged(int orbit); void OnReverseChanged(bool reverse); private: Ui::QmitkOrbitAnimationWidget* m_Ui; QmitkOrbitAnimationItem* m_AnimationItem; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h index 754d8b5e45..6330112769 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h @@ -1,132 +1,132 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QMITK_ScreenshotMaker_H__INCLUDED) #define QMITK_ScreenshotMaker_H__INCLUDED #include #include #include "mitkCameraRotationController.h" #include "mitkStepper.h" #include "mitkMultiStepper.h" #include "mitkMovieGenerator.h" #include "itkCommand.h" #include "vtkEventQtSlotConnect.h" #include "vtkRenderWindow.h" #include "mitkVtkPropRenderer.h" #include "ui_QmitkScreenshotMakerControls.h" //#include "../MovieMakerDll.h" //class QmitkMovieMakerControls; class QmitkStepperAdapter; class vtkCamera; class QTimer; class QTime; /** * \brief View for creating movies (AVIs) */ class QmitkScreenshotMaker: public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: /** \brief Constructor. */ QmitkScreenshotMaker(QObject *parent=0, const char *name=0); /** \brief Destructor. */ - virtual ~QmitkScreenshotMaker(); + ~QmitkScreenshotMaker() override; /** \brief Method for creating the widget containing the application * controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; // virtual QWidget * CreateControlWidget(QWidget *parent); /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; /** \brief Method for creating the connections of main and control widget. */ virtual void CreateConnections(); /** \brief Method for creating an QAction object, i.e. button & menu entry. * @param parent the parent QWidget */ // virtual QAction * CreateAction(QActionGroup *parent); /// /// Called when a RenderWindowPart becomes available. /// - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; /// /// Called when a RenderWindowPart becomes unavailable. /// - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; signals: protected slots: void GenerateScreenshot(); void GenerateMultiplanarScreenshots(); void Generate3DHighresScreenshot(); void GenerateMultiplanar3DHighresScreenshot(); void SelectBackgroundColor(); protected: QObject *parentWidget; QWidget* m_Parent; vtkEventQtSlotConnect * connections; vtkRenderWindow * renderWindow; mitk::VtkPropRenderer::Pointer m_PropRenderer; Ui::QmitkScreenshotMakerControls* m_Controls; private: - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; vtkCamera* GetCam(); void GenerateHR3DAtlasScreenshots(QString fileName, QString filter = ""); void GenerateMultiplanarScreenshots(QString fileName); mitk::DataNode::Pointer GetTopLayerNode(); void MultichannelScreenshot(mitk::VtkPropRenderer* renderer, QString fileName, QString filter); /*! \brief taking a screenshot "from" the specified renderer \param magnificationFactor specifying the quality of the screenshot (the magnification of the actual RenderWindow size) \param fileName file location and name where the screenshot should be saved */ void TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName, QString filter = ""); QColor m_BackgroundColor; mitk::DataNode* m_SelectedNode; QString m_LastPath; QString m_LastFile; QString m_PNGExtension = "PNG File (*.png)"; QString m_JPGExtension = "JPEG File (*.jpg)"; }; #endif // !defined(QMITK_ScreenshotMaker_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h index 90321e8ebc..77ffbe07e4 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationItem.h @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSliceAnimationItem_h #define QmitkSliceAnimationItem_h #include "QmitkAnimationItem.h" class QmitkSliceAnimationItem : public QmitkAnimationItem { public: explicit QmitkSliceAnimationItem(int renderWindow = 0, int from = 0, int to = 0, bool reverse = false, double duration = 2.0, double delay = 0.0, bool startWithPrevious = false); - virtual ~QmitkSliceAnimationItem(); + ~QmitkSliceAnimationItem() override; int GetRenderWindow() const; void SetRenderWindow(int renderWindow); int GetFrom() const; void SetFrom(int from); int GetTo() const; void SetTo(int to); bool GetReverse() const; void SetReverse(bool reverse); void Animate(double s) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h index 11f3a4f4fe..bad153b4a4 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkSliceAnimationWidget.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSliceAnimationWidget_h #define QmitkSliceAnimationWidget_h #include "QmitkAnimationWidget.h" class QmitkSliceAnimationItem; namespace Ui { class QmitkSliceAnimationWidget; } class QmitkSliceAnimationWidget : public QmitkAnimationWidget { Q_OBJECT public: explicit QmitkSliceAnimationWidget(QWidget* parent = nullptr); - ~QmitkSliceAnimationWidget(); + ~QmitkSliceAnimationWidget() override; void SetAnimationItem(QmitkAnimationItem* sliceAnimationItem) override; private slots: void OnRenderWindowChanged(int renderWindow); void OnFromChanged(double from); void OnToChanged(double to); void OnReverseChanged(bool reverse); private: Ui::QmitkSliceAnimationWidget* m_Ui; QmitkSliceAnimationItem* m_AnimationItem; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.h index 7727e76f9a..40dc7565a7 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationItem.h @@ -1,40 +1,40 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkTimeSliceAnimationItem_h #define QmitkTimeSliceAnimationItem_h #include "QmitkAnimationItem.h" class QmitkTimeSliceAnimationItem : public QmitkAnimationItem { public: explicit QmitkTimeSliceAnimationItem(int from = 0, int to = 0, bool reverse = false, double duration = 2.0, double delay = 0.0, bool startWithPrevious = false); - virtual ~QmitkTimeSliceAnimationItem(); + ~QmitkTimeSliceAnimationItem() override; int GetFrom() const; void SetFrom(int from); int GetTo() const; void SetTo(int to); bool GetReverse() const; void SetReverse(bool reverse); void Animate(double s) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationWidget.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationWidget.h index b1bdfd9737..3051733210 100644 --- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationWidget.h +++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkTimeSliceAnimationWidget.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkTimeSliceAnimationWidget_h #define QmitkTimeSliceAnimationWidget_h #include "QmitkAnimationWidget.h" class QmitkTimeSliceAnimationItem; namespace Ui { class QmitkTimeSliceAnimationWidget; } class QmitkTimeSliceAnimationWidget : public QmitkAnimationWidget { Q_OBJECT public: explicit QmitkTimeSliceAnimationWidget(QWidget* parent = nullptr); - ~QmitkTimeSliceAnimationWidget(); + ~QmitkTimeSliceAnimationWidget() override; void SetAnimationItem(QmitkAnimationItem* sliceAnimationItem) override; private slots: void OnFromChanged(double from); void OnToChanged(double to); void OnReverseChanged(bool reverse); private: Ui::QmitkTimeSliceAnimationWidget* m_Ui; QmitkTimeSliceAnimationItem* m_AnimationItem; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/QmitkMultiLabelSegmentationPreferencePage.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/QmitkMultiLabelSegmentationPreferencePage.h index 95cb8c74c4..68b30642a6 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/QmitkMultiLabelSegmentationPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/QmitkMultiLabelSegmentationPreferencePage.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMultiLabelSegmentationPreferencePage_h_included #define QmitkMultiLabelSegmentationPreferencePage_h_included #include "berryIQtPreferencePage.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include class QWidget; class QCheckBox; class QRadioButton; class QDoubleSpinBox; class MITK_QT_SEGMENTATION QmitkMultiLabelSegmentationPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkMultiLabelSegmentationPreferencePage(); - ~QmitkMultiLabelSegmentationPreferencePage(); + ~QmitkMultiLabelSegmentationPreferencePage() override; - void Init(berry::IWorkbench::Pointer workbench); + void Init(berry::IWorkbench::Pointer workbench) override; - void CreateQtControl(QWidget* widget); + void CreateQtControl(QWidget* widget) override; - QWidget* GetQtControl() const; + QWidget* GetQtControl() const override; /// /// \see IPreferencePage::PerformOk() /// - virtual bool PerformOk(); + bool PerformOk() override; /// /// \see IPreferencePage::PerformCancel() /// - virtual void PerformCancel(); + void PerformCancel() override; /// /// \see IPreferencePage::Update() /// - virtual void Update(); + void Update() override; protected slots: void OnVolumeRenderingCheckboxChecked(int); void OnSmoothingCheckboxChecked(int); protected: QWidget* m_MainControl; QRadioButton* m_RadioOutline; QRadioButton* m_RadioOverlay; QCheckBox* m_VolumeRenderingCheckBox; QDoubleSpinBox* m_SmoothingSpinBox; QDoubleSpinBox* m_DecimationSpinBox; QCheckBox* m_SelectionModeCheckBox; bool m_Initializing; berry::IPreferences::Pointer m_SegmentationPreferencesNode; }; #endif /* QMITKDATAMANAGERPREFERENCEPAGE_H_ */ diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/Common/QmitkDataSelectionWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/Common/QmitkDataSelectionWidget.h index 94d7b8d5f0..07e5abe875 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/Common/QmitkDataSelectionWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/Common/QmitkDataSelectionWidget.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDataSelectionWidget_h #define QmitkDataSelectionWidget_h #include #include #include #include namespace mitk { class NodePredicateBase; } class QmitkDataStorageComboBox; class QmitkDataSelectionWidget : public QWidget { Q_OBJECT public: enum PredicateType { ImagePredicate, MaskPredicate, SegmentationPredicate, SurfacePredicate }; explicit QmitkDataSelectionWidget(QWidget* parent = nullptr); - ~QmitkDataSelectionWidget(); + ~QmitkDataSelectionWidget() override; unsigned int AddDataStorageComboBox(PredicateType predicate); unsigned int AddDataStorageComboBox(mitk::NodePredicateBase* predicate = nullptr); unsigned int AddDataStorageComboBox(const QString &labelText, PredicateType predicate); unsigned int AddDataStorageComboBox(const QString &labelText, mitk::NodePredicateBase* predicate = nullptr); mitk::DataStorage::Pointer GetDataStorage() const; mitk::DataNode::Pointer GetSelection(unsigned int index); void SetPredicate(unsigned int index, PredicateType predicate); void SetPredicate(unsigned int index, mitk::NodePredicateBase* predicate); void SetHelpText(const QString& text); signals: void SelectionChanged(unsigned int index, const mitk::DataNode* selection); private slots: void OnSelectionChanged(const mitk::DataNode* selection); private: Ui::QmitkDataSelectionWidgetControls m_Controls; std::vector m_DataStorageComboBoxes; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkAutocropAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkAutocropAction.h index c5784f8e2d..cfb1c17e96 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkAutocropAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkAutocropAction.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_AUTOCROPACTION_H #define QMITK_AUTOCROPACTION_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" #include "mitkImage.h" class MITK_QT_SEGMENTATION QmitkAutocropAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkAutocropAction(); - virtual ~QmitkAutocropAction(); + ~QmitkAutocropAction() override; //interface methods - void Run( const QList& selectedNodes ); - void SetDataStorage(mitk::DataStorage* dataStorage); - void SetSmoothed(bool smoothed); - void SetDecimated(bool decimated); - void SetFunctionality(berry::QtViewPart* functionality); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; + void SetFunctionality(berry::QtViewPart* functionality) override; protected: mitk::Image::Pointer IncreaseCroppedImageSize( mitk::Image::Pointer image ); private: typedef QList NodeList; }; #endif // QMITK_AUTOCROPACTION_H diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertMaskToLabelAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertMaskToLabelAction.h index 2986fac803..8d1c236442 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertMaskToLabelAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertMaskToLabelAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __QmitkConvertMaskToLabelAction_H_ #define __QmitkConvertMaskToLabelAction_H_ #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" #include "mitkImage.h" class MITK_QT_SEGMENTATION QmitkConvertMaskToLabelAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkConvertMaskToLabelAction(); - virtual ~QmitkConvertMaskToLabelAction(); + ~QmitkConvertMaskToLabelAction() override; //interface methods - void Run( const QList& selectedNodes ); - void SetDataStorage(mitk::DataStorage* dataStorage); - void SetSmoothed(bool smoothed); - void SetDecimated(bool decimated); - void SetFunctionality(berry::QtViewPart* functionality); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; + void SetFunctionality(berry::QtViewPart* functionality) override; protected: private: typedef QList NodeList; }; #endif // __QmitkConvertMaskToLabelAction_H_ diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertSurfaceToLabelAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertSurfaceToLabelAction.h index dc240cd2de..e31911f6c8 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertSurfaceToLabelAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertSurfaceToLabelAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __QmitkConvertSurfaceToLabelAction_H_ #define __QmitkConvertSurfaceToLabelAction_H_ #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" #include "mitkImage.h" class MITK_QT_SEGMENTATION QmitkConvertSurfaceToLabelAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkConvertSurfaceToLabelAction(); - virtual ~QmitkConvertSurfaceToLabelAction(); + ~QmitkConvertSurfaceToLabelAction() override; //interface methods - void Run( const QList& selectedNodes ); - void SetDataStorage(mitk::DataStorage* dataStorage); - void SetSmoothed(bool smoothed); - void SetDecimated(bool decimated); - void SetFunctionality(berry::QtViewPart* functionality); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; + void SetFunctionality(berry::QtViewPart* functionality) override; protected: private: typedef QList NodeList; }; #endif // __QmitkConvertSurfaceToLabelAction_H_ diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h index 72fc44ca80..84c95e7eba 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_ConvertToMultiLabelSegmentation_H #define QMITK_ConvertToMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" //#include "mitkImage.h" class MITK_QT_SEGMENTATION QmitkConvertToMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkConvertToMultiLabelSegmentationAction(); - virtual ~QmitkConvertToMultiLabelSegmentationAction(); + ~QmitkConvertToMultiLabelSegmentationAction() override; //interface methods - virtual void Run( const QList& selectedNodes ); - virtual void SetDataStorage(mitk::DataStorage* dataStorage); - virtual void SetFunctionality(berry::QtViewPart* functionality); - virtual void SetSmoothed(bool smoothed); - virtual void SetDecimated(bool decimated); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetFunctionality(berry::QtViewPart* functionality) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; private: typedef QList NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_ConvertToMultiLabelSegmentation_H diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelPresetAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelPresetAction.h index a9d9849c51..924cdb6a2a 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelPresetAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelPresetAction.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_QmitkCreateMultiLabelPresetAction_H #define QMITK_QmitkCreateMultiLabelPresetAction_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelPresetAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelPresetAction(); - virtual ~QmitkCreateMultiLabelPresetAction(); + ~QmitkCreateMultiLabelPresetAction() override; //interface methods - virtual void Run( const QList& selectedNodes ); - virtual void SetDataStorage(mitk::DataStorage* dataStorage); - virtual void SetFunctionality(berry::QtViewPart* functionality); - virtual void SetSmoothed(bool smoothed); - virtual void SetDecimated(bool decimated); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetFunctionality(berry::QtViewPart* functionality) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; private: typedef QList NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h index 1c2cfc57d5..380044c594 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_CreateMultiLabelSegmentation_H #define QMITK_CreateMultiLabelSegmentation_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreateMultiLabelSegmentationAction(); - virtual ~QmitkCreateMultiLabelSegmentationAction(); + ~QmitkCreateMultiLabelSegmentationAction() override; //interface methods - virtual void Run( const QList& selectedNodes ) override; - virtual void SetDataStorage(mitk::DataStorage* dataStorage) override; - virtual void SetFunctionality(berry::QtViewPart* functionality) override; - virtual void SetSmoothed(bool smoothed) override; - virtual void SetDecimated(bool decimated) override; + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetFunctionality(berry::QtViewPart* functionality) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; private: typedef QList NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkLoadMultiLabelPresetAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkLoadMultiLabelPresetAction.h index eb888d6a6d..83869d9d49 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkLoadMultiLabelPresetAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkLoadMultiLabelPresetAction.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_QmitkLoadMultiLabelPresetAction_H #define QMITK_QmitkLoadMultiLabelPresetAction_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_multilabelsegmentation_Export.h" #include "vector" #include "mitkDataNode.h" class MITK_QT_SEGMENTATION QmitkLoadMultiLabelPresetAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkLoadMultiLabelPresetAction(); - virtual ~QmitkLoadMultiLabelPresetAction(); + ~QmitkLoadMultiLabelPresetAction() override; //interface methods - virtual void Run( const QList& selectedNodes ); - virtual void SetDataStorage(mitk::DataStorage* dataStorage); - virtual void SetFunctionality(berry::QtViewPart* functionality); - virtual void SetSmoothed(bool smoothed); - virtual void SetDecimated(bool decimated); + void Run( const QList& selectedNodes ) override; + void SetDataStorage(mitk::DataStorage* dataStorage) override; + void SetFunctionality(berry::QtViewPart* functionality) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; private: typedef QList NodeList; mitk::DataStorage::Pointer m_DataStorage; }; #endif // QMITK_CreateMultiLabelSegmentation_H diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.h index 95d975b91c..d57886f26f 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkMultiLabelSegmentationView.h @@ -1,186 +1,186 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMultiLabelSegmentationView_h #define QmitkMultiLabelSegmentationView_h #include #include "mitkSegmentationInteractor.h" #include #include "ui_QmitkMultiLabelSegmentationControls.h" // berry #include class QmitkRenderWindow; /** * \ingroup ToolManagerEtAl * \ingroup org_mitk_gui_qt_multilabelsegmentation_internal */ class QmitkMultiLabelSegmentationView : public QmitkAbstractView, public mitk::ILifecycleAwarePart { Q_OBJECT public: static const std::string VIEW_ID; QmitkMultiLabelSegmentationView(); - virtual ~QmitkMultiLabelSegmentationView(); + ~QmitkMultiLabelSegmentationView() override; typedef std::map NodeTagMapType; // GUI setup - void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; // ILifecycleAwarePart interface public: - void Activated(); - void Deactivated(); - void Visible(); - void Hidden(); + void Activated() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; virtual int GetSizeFlags(bool width); virtual int ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult); protected slots: // reaction to the shortcut for toggling the visibility of the working node void OnVisibilityShortcutActivated(); // reaction to the shortcut for iterating over all labels void OnLabelToggleShortcutActivated(); // reaction to the selection of any 2D segmentation tool void OnManualTool2DSelected(int id); // reaction to button "New Label" void OnNewLabel(); // reaction to button "Show Label Table" void OnShowLabelTable(bool value); // reaction to button "New Segmentation Session" void OnNewSegmentationSession(); // reaction to signal "goToLabel" from labelset widget void OnGoToLabel(const mitk::Point3D &pos); void OnResetView(); // reaction to the button "Add Layer" void OnAddLayer(); // reaction to the button "Delete Layer" void OnDeleteLayer(); // reaction to the button "Previous Layer" void OnPreviousLayer(); // reaction to the button "Next Layer" void OnNextLayer(); // reaction to the combobox change "Change Layer" void OnChangeLayer(int); // reaction to the button "Deactive Active Tool" void OnDeactivateActiveTool(); // reaction to the button "Lock exterior" void OnLockExteriorToggled(bool); // reaction to the selection of a new patient (reference) image in the DataStorage combobox void OnReferenceSelectionChanged(const mitk::DataNode* node); // reaction to the selection of a new Segmentation (working) image in the DataStorage combobox void OnSegmentationSelectionChanged(const mitk::DataNode* node); // reaction to ... void OnInterpolationSelectionChanged(int); protected: // reimplemented from QmitkAbstractView void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &nodes) override; // reimplemented from QmitkAbstractView void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override; // reimplemented from QmitkAbstractView void NodeAdded(const mitk::DataNode* node) override; // reimplemented from QmitkAbstractView void NodeRemoved(const mitk::DataNode* node) override; void OnEstablishLabelSetConnection(); void OnLooseLabelSetConnection(); - void SetFocus(); + void SetFocus() override; void UpdateControls(); void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart); void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart); void ResetMouseCursor(); void SetMouseCursor(const us::ModuleResource, int hotspotX, int hotspotY); void InitializeListeners(); /// \brief Checks if two images have the same size and geometry bool CheckForSameGeometry(const mitk::Image *image1, const mitk::Image *image2) const; QString GetLastFileOpenPath(); void SetLastFileOpenPath(const QString &path); /// \brief the Qt parent of our GUI (NOT of this object) QWidget *m_Parent; /// \brief Qt GUI file Ui::QmitkMultiLabelSegmentationControls m_Controls; mitk::IRenderWindowPart *m_IRenderWindowPart; mitk::ToolManager *m_ToolManager; mitk::DataNode::Pointer m_ReferenceNode; mitk::DataNode::Pointer m_WorkingNode; mitk::NodePredicateAnd::Pointer m_ReferencePredicate; mitk::NodePredicateAnd::Pointer m_SegmentationPredicate; bool m_AutoSelectionEnabled; bool m_MouseCursorSet; mitk::SegmentationInteractor::Pointer m_Interactor; /** * Reference to the service registration of the observer, * it is needed to unregister the observer on unload. */ us::ServiceRegistration m_ServiceRegistration; }; #endif // QmitkMultiLabelSegmentationView_h diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkThresholdAction.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkThresholdAction.h index 53f3169acd..05fb0d8afe 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkThresholdAction.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/QmitkThresholdAction.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKTHRESHOLDACTION_H #define QMITKTHRESHOLDACTION_H #include // Parent classes #include #include // Data members #include #include class MITK_QT_SEGMENTATION QmitkThresholdAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkThresholdAction(); - ~QmitkThresholdAction(); + ~QmitkThresholdAction() override; // IContextMenuAction - void Run(const QList &selectedNodes); - void SetDataStorage(mitk::DataStorage *dataStorage); - void SetSmoothed(bool smoothed); - void SetDecimated(bool decimated); - void SetFunctionality(berry::QtViewPart *functionality); + void Run(const QList &selectedNodes) override; + void SetDataStorage(mitk::DataStorage *dataStorage) override; + void SetSmoothed(bool smoothed) override; + void SetDecimated(bool decimated) override; + void SetFunctionality(berry::QtViewPart *functionality) override; void OnThresholdingToolManagerToolModified(); private: QmitkThresholdAction(const QmitkThresholdAction &); QmitkThresholdAction & operator=(const QmitkThresholdAction &); mitk::DataNode::Pointer m_SelectedNode; mitk::DataStorage::Pointer m_DataStorage; mitk::ToolManager::Pointer m_ThresholdingToolManager; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h index 67fb74ba47..d0e0ffee86 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkBooleanOperationsWidget_h #define QmitkBooleanOperationsWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include class QmitkBooleanOperationsWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: explicit QmitkBooleanOperationsWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - ~QmitkBooleanOperationsWidget(); + ~QmitkBooleanOperationsWidget() override; private slots: void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); void OnDifferenceButtonClicked(); void OnIntersectionButtonClicked(); void OnUnionButtonClicked(); private: void EnableButtons(bool enable = true); void DoBooleanOperation(mitk::BooleanOperation::Type type); Ui::QmitkBooleanOperationsWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ConvertToMl/QmitkConvertToMlWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ConvertToMl/QmitkConvertToMlWidget.h index a9e35e4243..780ea27841 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ConvertToMl/QmitkConvertToMlWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ConvertToMl/QmitkConvertToMlWidget.h @@ -1,41 +1,41 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkConvertToMlWidget_h #define QmitkConvertToMlWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include class QmitkConvertToMlWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: explicit QmitkConvertToMlWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - ~QmitkConvertToMlWidget(); + ~QmitkConvertToMlWidget() override; private slots: void SelectionChanged(); void Convert(); private: void EnableButtons(bool enable = true); Ui::QmitkConvertToMlWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h index c89e361a5c..fa8c8c06b9 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkImageMaskingWidget_h #define QmitkImageMaskingWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include #include /*! \brief QmitkImageMaskingWidget Tool masks an image with a binary image or a surface. The Method requires an image and a binary image mask or a surface. The input image and the binary image mask must be of the same size. Masking with a surface creates first a binary image of the surface and then use this for the masking of the input image. */ class QmitkImageMaskingWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */ explicit QmitkImageMaskingWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); /** @brief Defaul destructor. */ - ~QmitkImageMaskingWidget(); + ~QmitkImageMaskingWidget() override; private slots: /** @brief This slot is called if the selection in the workbench is changed. */ void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); /** @brief This slot is called if user activates the radio button for masking an image with a binary image mask. */ void OnImageMaskingToggled(bool); /** @brief This slot is called if user activates the radio button for masking an image with a surface. */ void OnSurfaceMaskingToggled(bool); /** @brief This slot is called if user activates the button to mask an image. */ void OnMaskImagePressed(); private: /** @brief Check if selections is valid. */ void SelectionControl( unsigned int index, const mitk::DataNode* selection); /** @brief Enable buttons if data selction is valid. */ void EnableButtons(bool enable = true); /** @brief Mask an image with a given binary mask. Note that the input image and the mask image must be of the same size. */ mitk::Image::Pointer MaskImage(mitk::Image::Pointer referenceImage, mitk::Image::Pointer maskImage ); /** @brief Convert a surface into an binary image. */ mitk::Image::Pointer ConvertSurfaceToImage( mitk::Image::Pointer image, mitk::Surface::Pointer surface ); /** @brief Adds a new data object to the DataStorage.*/ void AddToDataStorage(mitk::DataStorage::Pointer dataStorage, mitk::Image::Pointer segmentation, const std::string& name, mitk::DataNode::Pointer parent = nullptr); Ui::QmitkImageMaskingWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h index 64d6610adf..b3277a52db 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMorphologicalOperationsWidget_h #define QmitkMorphologicalOperationsWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include /** \brief GUI class for morphological segmentation tools. */ class QmitkMorphologicalOperationsWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: explicit QmitkMorphologicalOperationsWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - ~QmitkMorphologicalOperationsWidget(); + ~QmitkMorphologicalOperationsWidget() override; public slots: void OnClosingButtonClicked(); void OnOpeningButtonClicked(); void OnDilatationButtonClicked(); void OnErosionButtonClicked(); void OnFillHolesButtonClicked(); void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); void OnRadioButtonsClicked(); protected: void EnableButtons(bool enable); private: Ui::QmitkMorphologicalOperationsWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkMultiLabelSegmentationUtilitiesView.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkMultiLabelSegmentationUtilitiesView.h index a770534960..d514c0b8dc 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkMultiLabelSegmentationUtilitiesView.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkMultiLabelSegmentationUtilitiesView.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMultiLabelSegmentationUtilitiesView_h #define QmitkMultiLabelSegmentationUtilitiesView_h #include #include #include class QmitkBooleanOperationsWidget; class QmitkSurfaceToImageWidget; class QmitkImageMaskingWidget; class QmitkMorphologicalOperationsWidget; class QmitkMorphologicalOperationsWidget; class QmitkConvertToMlWidget; class QmitkMultiLabelSegmentationUtilitiesView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: QmitkMultiLabelSegmentationUtilitiesView(); - ~QmitkMultiLabelSegmentationUtilitiesView(); + ~QmitkMultiLabelSegmentationUtilitiesView() override; - void CreateQtPartControl(QWidget* parent); - void SetFocus(); + void CreateQtPartControl(QWidget* parent) override; + void SetFocus() override; - void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; private: void AddUtilityWidget(QWidget* widget, const QIcon& icon, const QString& text); QmitkBooleanOperationsWidget* m_BooleanOperationsWidget; QmitkMorphologicalOperationsWidget* m_MorphologicalOperationsWidget; QmitkSurfaceToImageWidget* m_SurfaceToImageWidget; QmitkImageMaskingWidget* m_ImageMaskingWidget; QmitkConvertToMlWidget* m_ConvertToMlWidget; Ui::QmitkMultiLabelSegmentationUtilitiesViewControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h index 6df2662242..d260a12c91 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSegmentationUtilityWidget_h #define QmitkSegmentationUtilityWidget_h #include namespace mitk { class SliceNavigationController; } /** \brief Base class for segmentation utility widgets that need access to the time navigation controller. * * Call GetTimeNavigationController() in your derived class to gain access to the time navigation controller. * The time navigation controller is not not available at all times and hence this method can return nullptr. */ class QmitkSegmentationUtilityWidget : public QWidget { Q_OBJECT public: explicit QmitkSegmentationUtilityWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - virtual ~QmitkSegmentationUtilityWidget(); + ~QmitkSegmentationUtilityWidget() override; /** \brief Usually called only from QmitkSegmentationUtilitiesView::RenderWindowPartActivated() and QmitkSegmentationUtilitiesView::RenderWindowPartDeactivated(). */ void SetTimeNavigationController(mitk::SliceNavigationController* timeNavigationController); protected: /** \brief Call this method to access the time navigation controller. * * \return Pointer to the time navigation controller or nullptr, if it is not available. */ mitk::SliceNavigationController* GetTimeNavigationController() const; private: mitk::SliceNavigationController* m_TimeNavigationController; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h index ccb8081ff3..5f7ef123f6 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSurfaceToImageWidget_h #define QmitkSurfaceToImageWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include #include /*! \brief QmitkSurfaceToImageWidget The Tool converts a surface to a binary image. The Method requires a surface and an image, which header information defines the output image. The resulting binary image has the same dimension, size, and Geometry3D as the input image. */ class QmitkSurfaceToImageWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */ explicit QmitkSurfaceToImageWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); /** @brief Defaul destructor. */ - ~QmitkSurfaceToImageWidget(); + ~QmitkSurfaceToImageWidget() override; private slots: /** @brief This slot is called if the selection in the workbench is changed. */ void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); /** @brief This slot is called if user activates the button to convert a surface into a binary image. */ void OnSurface2ImagePressed(); void OnMakeOutputBinaryChanged(bool value); private: /** @brief Enable buttons if data selction is valid. */ void EnableButtons(bool enable = true); /** @brief Convert a surface into an binary image. */ mitk::Image::Pointer ConvertSurfaceToImage( mitk::Image::Pointer image, mitk::Surface::Pointer surface ); Ui::QmitkSurfaceToImageWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/mitkPluginActivator.h index af9792be73..3ef597313f 100644 --- a/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/mitkPluginActivator.h +++ b/Plugins/org.mitk.gui.qt.multilabelsegmentation/src/internal/mitkPluginActivator.h @@ -1,41 +1,41 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_multilabelsegmentation_Activator_h #define org_mitk_gui_qt_multilabelsegmentation_Activator_h #include namespace mitk { class PluginActivator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_multilabelsegmentation") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext *context); - void stop(ctkPluginContext *context); + void start(ctkPluginContext *context) override; + void stop(ctkPluginContext *context) override; static ctkPluginContext* getContext(); private: static ctkPluginContext* m_Context; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h index e6b0fc143d..1eb9133db3 100755 --- a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h +++ b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkPointSetInteraction_H__INCLUDED) #define QmitkPointSetInteraction_H__INCLUDED #include #include #include #include #include #include namespace Ui { class QmitkPointSetInteractionControls; }; /*! \brief QmitkPointSetInteractionView */ class QmitkPointSetInteractionView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: static const std::string VIEW_ID; QmitkPointSetInteractionView(QObject *parent=0); - virtual ~QmitkPointSetInteractionView(); + ~QmitkPointSetInteractionView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; - virtual void NodeChanged(const mitk::DataNode* node) override; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void NodeChanged(const mitk::DataNode* node) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; protected slots: void OnAddPointSetClicked(); protected: Ui::QmitkPointSetInteractionControls * m_Controls; mitk::WeakPointer m_SelectedPointSetNode; }; #endif // !defined(QmitkPointSetInteraction_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingView.h b/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingView.h index 59979f8458..b22646b7c6 100644 --- a/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingView.h +++ b/Plugins/org.mitk.gui.qt.remeshing/src/internal/QmitkRemeshingView.h @@ -1,46 +1,46 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkRemeshingView_h #define QmitkRemeshingView_h #include #include class QmitkRemeshingView : public QmitkAbstractView { Q_OBJECT public: QmitkRemeshingView(); - ~QmitkRemeshingView(); + ~QmitkRemeshingView() override; void CreateQtPartControl(QWidget* parent) override; void SetFocus() override; private slots: void OnSelectedSurfaceChanged(const mitk::DataNode *node); void OnDensityChanged(int numVertices); void OnRemeshButtonClicked(); private: void EnableWidgets(bool enable); Ui::QmitkRemeshingViewControls m_Controls; int m_MaxNumberOfVertices; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h index 6182a0ea54..f7cd1dad02 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSegmentationPreferencePage_h_included #define QmitkSegmentationPreferencePage_h_included #include "org_mitk_gui_qt_segmentation_Export.h" #include #include "berryIQtPreferencePage.h" class QWidget; class QCheckBox; class QRadioButton; class QDoubleSpinBox; class MITK_QT_SEGMENTATION QmitkSegmentationPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkSegmentationPreferencePage(); - ~QmitkSegmentationPreferencePage(); + ~QmitkSegmentationPreferencePage() override; void Init(berry::IWorkbench::Pointer workbench) override; void CreateQtControl(QWidget* widget) override; QWidget* GetQtControl() const override; /// /// \see IPreferencePage::PerformOk() /// - virtual bool PerformOk() override; + bool PerformOk() override; /// /// \see IPreferencePage::PerformCancel() /// - virtual void PerformCancel() override; + void PerformCancel() override; /// /// \see IPreferencePage::Update() /// - virtual void Update() override; + void Update() override; protected slots: void OnVolumeRenderingCheckboxChecked(int); void OnSmoothingCheckboxChecked(int); protected: QWidget* m_MainControl; QCheckBox* m_SlimViewCheckBox; QRadioButton* m_RadioOutline; QRadioButton* m_RadioOverlay; QCheckBox* m_VolumeRenderingCheckBox; QCheckBox* m_SmoothingCheckBox; QDoubleSpinBox* m_SmoothingSpinBox; QDoubleSpinBox* m_DecimationSpinBox; QDoubleSpinBox* m_ClosingSpinBox; QCheckBox* m_SelectionModeCheckBox; bool m_Initializing; berry::IPreferences::Pointer m_SegmentationPreferencesNode; }; #endif /* QMITKDATAMANAGERPREFERENCEPAGE_H_ */ diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkDataSelectionWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkDataSelectionWidget.h index 26c5f39cdb..486e9dcb2e 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkDataSelectionWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkDataSelectionWidget.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDataSelectionWidget_h #define QmitkDataSelectionWidget_h #include #include #include #include namespace mitk { class NodePredicateBase; } class QmitkDataStorageComboBox; class QmitkDataSelectionWidget : public QWidget { Q_OBJECT public: enum Predicate { ImagePredicate, SegmentationPredicate, SurfacePredicate, ImageAndSegmentationPredicate, ContourModelPredicate }; explicit QmitkDataSelectionWidget(QWidget* parent = nullptr); - ~QmitkDataSelectionWidget(); + ~QmitkDataSelectionWidget() override; unsigned int AddDataStorageComboBox(Predicate predicate); unsigned int AddDataStorageComboBox(mitk::NodePredicateBase* predicate = nullptr); unsigned int AddDataStorageComboBox(const QString &labelText, Predicate predicate); unsigned int AddDataStorageComboBox(const QString &labelText, mitk::NodePredicateBase* predicate = nullptr); mitk::DataStorage::Pointer GetDataStorage() const; mitk::DataNode::Pointer GetSelection(unsigned int index); void SetPredicate(unsigned int index, Predicate predicate); void SetPredicate(unsigned int index, mitk::NodePredicateBase* predicate); void SetHelpText(const QString& text); signals: void SelectionChanged(unsigned int index, const mitk::DataNode* selection); private slots: void OnSelectionChanged(const mitk::DataNode* selection); private: Ui::QmitkDataSelectionWidgetControls m_Controls; std::vector m_DataStorageComboBoxes; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h index 7077a51602..5d2fcef732 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_AUTOCROPACTION_H #define QMITK_AUTOCROPACTION_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_segmentation_Export.h" #include "vector" #include "mitkDataNode.h" #include "mitkImage.h" class MITK_QT_SEGMENTATION QmitkAutocropAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkAutocropAction(); - virtual ~QmitkAutocropAction(); + ~QmitkAutocropAction() override; //interface methods void Run( const QList& selectedNodes ) override; void SetDataStorage(mitk::DataStorage* dataStorage) override; void SetSmoothed(bool smoothed) override; void SetDecimated(bool decimated) override; void SetFunctionality(berry::QtViewPart* view) override; protected: mitk::Image::Pointer IncreaseCroppedImageSize( mitk::Image::Pointer image ); private: typedef QList NodeList; }; #endif // QMITK_AUTOCROPACTION_H diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h index 0711757314..57ecf3e03d 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKCREATEPOLYGONMODELACTION_H #define QMITKCREATEPOLYGONMODELACTION_H #include // Parent classes #include #include // Data members #include class MITK_QT_SEGMENTATION QmitkCreatePolygonModelAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkCreatePolygonModelAction(); - ~QmitkCreatePolygonModelAction(); + ~QmitkCreatePolygonModelAction() override; // IContextMenuAction void Run(const QList &selectedNodes) override; void SetDataStorage(mitk::DataStorage *dataStorage) override; void SetSmoothed(bool smoothed) override; void SetDecimated(bool decimated) override; void SetFunctionality(berry::QtViewPart* view) override; void OnSurfaceCalculationDone(); private: QmitkCreatePolygonModelAction(const QmitkCreatePolygonModelAction &); QmitkCreatePolygonModelAction & operator=(const QmitkCreatePolygonModelAction &); mitk::DataStorage::Pointer m_DataStorage; bool m_IsSmoothed; bool m_IsDecimated; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h index b8c2d9d1a4..6f1419c0fb 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkDeformableClippingPlaneView.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKDEFORMABLECLIPPINGPLANEVIEW_H_INCLUDED #define _QMITKDEFORMABLECLIPPINGPLANEVIEW_H_INCLUDED #include #include #include typedef itk::RGBPixel< float > Color; /*! * \ingroup org_mitk_gui_qt_deformableSurface * * \brief QmitkDeformableClippingPlaneView * * Document your class here. */ class QmitkDeformableClippingPlaneView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; QmitkDeformableClippingPlaneView(); - virtual ~QmitkDeformableClippingPlaneView(); + ~QmitkDeformableClippingPlaneView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; protected slots: void OnComboBoxSelectionChanged(const mitk::DataNode* node); void OnCreateNewClippingPlane(); void OnCalculateClippingVolume(); void OnTranslationMode(bool check); void OnRotationMode(bool check); void OnDeformationMode(bool check); protected: virtual void OnSelectionChanged(mitk::DataNode* node); - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; - virtual void NodeRemoved(const mitk::DataNode* node) override; - virtual void NodeChanged(const mitk::DataNode* node) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void NodeRemoved(const mitk::DataNode* node) override; + void NodeChanged(const mitk::DataNode* node) override; void UpdateView(); Ui::QmitkDeformableClippingPlaneViewControls m_Controls; private: mitk::DataStorage::SetOfObjects::ConstPointer GetAllClippingPlanes(); mitk::Color GetLabelColor(int label); void DeactivateInteractionButtons(); mitk::DataNode::Pointer m_ReferenceNode; mitk::DataNode::Pointer m_WorkingNode; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h index e9a0a66a09..1e839bc857 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h @@ -1,173 +1,173 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSEGMENTATIONVIEW_H #define QMITKSEGMENTATIONVIEW_H #include #include #include #include #include "ui_QmitkSegmentationControls.h" class QmitkRenderWindow; /** * \ingroup ToolManagerEtAl * \ingroup org_mitk_gui_qt_segmentation_internal * \warning Implementation of this class is split up into two .cpp files to make things more compact. Check both this file and QmitkSegmentationOrganNamesHandling.cpp */ class QmitkSegmentationView : public QmitkAbstractView, public mitk::ILifecycleAwarePart, public mitk::IRenderWindowPartListener { Q_OBJECT public: QmitkSegmentationView(); - virtual ~QmitkSegmentationView(); + ~QmitkSegmentationView() override; typedef std::map NodeTagMapType; /*! \brief Invoked when the DataManager selection changed */ virtual void OnSelectionChanged(mitk::DataNode* node); - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; // reaction to new segmentations being created by segmentation tools void NewNodesGenerated(); void NewNodeObjectsGenerated(mitk::ToolManager::DataVectorType*); - virtual void Activated() override; - virtual void Deactivated() override; - virtual void Visible() override; - virtual void Hidden() override; + void Activated() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; // BlueBerry's notification about preference changes (e.g. from a dialog) - virtual void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override; + void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override; // observer to mitk::RenderingManager's RenderingManagerViewsInitializedEvent event void RenderingManagerReinitialized(); // observer to mitk::SliceController's SliceRotation event void SliceRotation(const itk::EventObject&); static const std::string VIEW_ID; protected slots: void OnPatientComboBoxSelectionChanged(const mitk::DataNode* node); void OnSegmentationComboBoxSelectionChanged(const mitk::DataNode* node); // reaction to the button "New segmentation" void CreateNewSegmentation(); void OnManualTool2DSelected(int id); void OnVisiblePropertyChanged(); void OnBinaryPropertyChanged(); void OnShowMarkerNodes(bool); void OnTabWidgetChanged(int); protected: // a type for handling lists of DataNodes typedef std::vector NodeList; // GUI setup - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; // reactions to selection events from data manager (and potential other senders) //void BlueBerrySelectionChanged(berry::IWorkbenchPart::Pointer sourcepart, berry::ISelection::ConstPointer selection); mitk::DataNode::Pointer FindFirstRegularImage(std::vector nodes); mitk::DataNode::Pointer FindFirstSegmentation(std::vector nodes); // initially set the tool manager selection from the combo boxes void InitToolManagerSelection(const mitk::DataNode* referenceData, const mitk::DataNode* workingData); // propagate BlueBerry selection to ToolManager for manual segmentation void SetToolManagerSelection(const mitk::DataNode* referenceData, const mitk::DataNode* workingData); // checks if given render window aligns with the slices of given image bool IsRenderWindowAligned(QmitkRenderWindow* renderWindow, mitk::Image* image); // make sure all images/segmentations look as selected by the users in this view's preferences void ForceDisplayPreferencesUponAllImages(); // decorates a DataNode according to the user preference settings void ApplyDisplayOptions(mitk::DataNode* node); void ResetMouseCursor(); void SetMouseCursor(const us::ModuleResource&, int hotspotX, int hotspotY); void SetToolSelectionBoxesEnabled(bool); // If a contourmarker is selected, the plane in the related widget will be reoriented according to the marker`s geometry void OnContourMarkerSelected(const mitk::DataNode* node); void NodeRemoved(const mitk::DataNode* node) override; void NodeAdded(const mitk::DataNode *node) override; bool CheckForSameGeometry(const mitk::DataNode*, const mitk::DataNode*) const; void UpdateWarningLabel(QString text/*, bool overwriteExistingText = true*/); // the Qt parent of our GUI (NOT of this object) QWidget* m_Parent; // our GUI Ui::QmitkSegmentationControls* m_Controls; mitk::IRenderWindowPart* m_RenderWindowPart; unsigned long m_VisibilityChangedObserverTag; bool m_MouseCursorSet; bool m_DataSelectionChanged; NodeTagMapType m_WorkingDataObserverTags; NodeTagMapType m_BinaryPropertyObserverTags; unsigned int m_RenderingManagerObserverTag; bool m_AutoSelectionEnabled; mitk::NodePredicateNot::Pointer m_IsNotAHelperObject; mitk::NodePredicateAnd::Pointer m_IsOfTypeImagePredicate; mitk::NodePredicateOr::Pointer m_IsASegmentationImagePredicate; mitk::NodePredicateAnd::Pointer m_IsAPatientImagePredicate; }; #endif // QMITKSEGMENTATIONVIEW_H diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkThresholdAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkThresholdAction.h index 30ee4f4c04..3e81d95e61 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkThresholdAction.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkThresholdAction.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKTHRESHOLDACTION_H #define QMITKTHRESHOLDACTION_H #include // Parent classes #include #include // Data members #include #include class MITK_QT_SEGMENTATION QmitkThresholdAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkThresholdAction(); - ~QmitkThresholdAction(); + ~QmitkThresholdAction() override; // IContextMenuAction void Run(const QList &selectedNodes) override; void SetDataStorage(mitk::DataStorage *dataStorage) override; void SetSmoothed(bool smoothed) override; void SetDecimated(bool decimated) override; void SetFunctionality(berry::QtViewPart* view) override; void OnThresholdingToolManagerToolModified(); private: QmitkThresholdAction(const QmitkThresholdAction &); QmitkThresholdAction & operator=(const QmitkThresholdAction &); mitk::DataNode::Pointer m_SelectedNode; mitk::DataStorage::Pointer m_DataStorage; mitk::ToolManager::Pointer m_ThresholdingToolManager; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h index 67fb74ba47..d0e0ffee86 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/BooleanOperations/QmitkBooleanOperationsWidget.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkBooleanOperationsWidget_h #define QmitkBooleanOperationsWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include class QmitkBooleanOperationsWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: explicit QmitkBooleanOperationsWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - ~QmitkBooleanOperationsWidget(); + ~QmitkBooleanOperationsWidget() override; private slots: void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); void OnDifferenceButtonClicked(); void OnIntersectionButtonClicked(); void OnUnionButtonClicked(); private: void EnableButtons(bool enable = true); void DoBooleanOperation(mitk::BooleanOperation::Type type); Ui::QmitkBooleanOperationsWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ContourModelToImage/QmitkContourModelToImageWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ContourModelToImage/QmitkContourModelToImageWidget.h index acb99bdcfd..6a824db71a 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ContourModelToImage/QmitkContourModelToImageWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ContourModelToImage/QmitkContourModelToImageWidget.h @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkContourModelToImageWidget_h #define QmitkContourModelToImageWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include class QmitkContourModelToImageWidgetPrivate; namespace mitk { class Image; class ContourModelSet; class ContourModel; class Geometry3D; class PlaneGeometry; } /*! \brief QmitkContourModelToImageWidget Tool masks an image with a binary image or a surface. The Method requires an image and a binary image mask or a surface. The input image and the binary image mask must be of the same size. Masking with a surface creates first a binary image of the surface and then use this for the masking of the input image. */ class QmitkContourModelToImageWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */ explicit QmitkContourModelToImageWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); /** @brief Defaul destructor. */ - ~QmitkContourModelToImageWidget(); + ~QmitkContourModelToImageWidget() override; private slots: /** @brief This slot is called if the selection in the workbench is changed. */ void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); /** @brief This slot is called if user activates the button to mask an image. */ void OnProcessPressed(); /** @brief This slot is called after processing is finished */ void OnProcessingFinished(); private: QScopedPointer d_ptr; Q_DECLARE_PRIVATE(QmitkContourModelToImageWidget) Q_DISABLE_COPY(QmitkContourModelToImageWidget) }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h index 6814004b06..d4f12b2005 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/ImageMasking/QmitkImageMaskingWidget.h @@ -1,84 +1,84 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkImageMaskingWidget_h #define QmitkImageMaskingWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include namespace mitk { class Image; } /*! \brief QmitkImageMaskingWidget Tool masks an image with a binary image or a surface. The Method requires an image and a binary image mask or a surface. The input image and the binary image mask must be of the same size. Masking with a surface creates first a binary image of the surface and then use this for the masking of the input image. */ class QmitkImageMaskingWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */ explicit QmitkImageMaskingWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); /** @brief Defaul destructor. */ - ~QmitkImageMaskingWidget(); + ~QmitkImageMaskingWidget() override; private slots: /** @brief This slot is called if the selection in the workbench is changed. */ void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); /** @brief This slot is called if user activates the radio button for masking an image with a binary image mask. */ void OnImageMaskingToggled(bool); /** @brief This slot is called if user activates the radio button for masking an image with a surface. */ void OnSurfaceMaskingToggled(bool); /** @brief This slot is called if user activates the button to mask an image. */ void OnMaskImagePressed(); private: /** @brief Check if selections is valid. */ void SelectionControl( unsigned int index, const mitk::DataNode* selection); /** @brief Enable buttons if data selction is valid. */ void EnableButtons(bool enable = true); /** @brief Mask an image with a given binary mask. Note that the input image and the mask image must be of the same size. */ itk::SmartPointer MaskImage(itk::SmartPointer referenceImage, itk::SmartPointer maskImage ); /** @brief Convert a surface into an binary image. */ itk::SmartPointer ConvertSurfaceToImage( itk::SmartPointer image, mitk::Surface::Pointer surface ); /** @brief Adds a new data object to the DataStorage.*/ void AddToDataStorage(mitk::DataStorage::Pointer dataStorage, itk::SmartPointer segmentation, const std::string& name, mitk::DataNode::Pointer parent = nullptr); Ui::QmitkImageMaskingWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h index 22674a345e..85752d6574 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/MorphologicalOperations/QmitkMorphologicalOperationsWidget.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMorphologicalOperationsWidget_h #define QmitkMorphologicalOperationsWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include #include /** \brief GUI class for morphological segmentation tools. */ class QmitkMorphologicalOperationsWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: explicit QmitkMorphologicalOperationsWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - ~QmitkMorphologicalOperationsWidget(); + ~QmitkMorphologicalOperationsWidget() override; public slots: void OnClosingButtonClicked(); void OnOpeningButtonClicked(); void OnDilatationButtonClicked(); void OnErosionButtonClicked(); void OnFillHolesButtonClicked(); void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); void OnRadioButtonsClicked(); protected: void EnableButtons(bool enable); private: Ui::QmitkMorphologicalOperationsWidgetControls m_Controls; mitk::MorphologicalOperations::StructuralElementType CreateStructerElement_UI(); }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilitiesView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilitiesView.h index 20fdeb6070..0a680f3708 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilitiesView.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilitiesView.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSegmentationUtilitiesView_h #define QmitkSegmentationUtilitiesView_h #include #include #include class QmitkBooleanOperationsWidget; class QmitkContourModelToImageWidget; class QmitkImageMaskingWidget; class QmitkMorphologicalOperationsWidget; class QmitkSurfaceToImageWidget; class QmitkSegmentationUtilitiesView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: QmitkSegmentationUtilitiesView(); - ~QmitkSegmentationUtilitiesView(); + ~QmitkSegmentationUtilitiesView() override; void CreateQtPartControl(QWidget* parent) override; void SetFocus() override; void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; private: void AddUtilityWidget(QWidget* widget, const QIcon& icon, const QString& text); Ui::QmitkSegmentationUtilitiesViewControls m_Controls; QmitkBooleanOperationsWidget* m_BooleanOperationsWidget; QmitkContourModelToImageWidget* m_ContourModelToImageWidget; QmitkImageMaskingWidget* m_ImageMaskingWidget; QmitkMorphologicalOperationsWidget* m_MorphologicalOperationsWidget; QmitkSurfaceToImageWidget* m_SurfaceToImageWidget; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h index 6df2662242..d260a12c91 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/QmitkSegmentationUtilityWidget.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSegmentationUtilityWidget_h #define QmitkSegmentationUtilityWidget_h #include namespace mitk { class SliceNavigationController; } /** \brief Base class for segmentation utility widgets that need access to the time navigation controller. * * Call GetTimeNavigationController() in your derived class to gain access to the time navigation controller. * The time navigation controller is not not available at all times and hence this method can return nullptr. */ class QmitkSegmentationUtilityWidget : public QWidget { Q_OBJECT public: explicit QmitkSegmentationUtilityWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); - virtual ~QmitkSegmentationUtilityWidget(); + ~QmitkSegmentationUtilityWidget() override; /** \brief Usually called only from QmitkSegmentationUtilitiesView::RenderWindowPartActivated() and QmitkSegmentationUtilitiesView::RenderWindowPartDeactivated(). */ void SetTimeNavigationController(mitk::SliceNavigationController* timeNavigationController); protected: /** \brief Call this method to access the time navigation controller. * * \return Pointer to the time navigation controller or nullptr, if it is not available. */ mitk::SliceNavigationController* GetTimeNavigationController() const; private: mitk::SliceNavigationController* m_TimeNavigationController; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h index 71cae691aa..5b62945360 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/SegmentationUtilities/SurfaceToImage/QmitkSurfaceToImageWidget.h @@ -1,68 +1,68 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkSurfaceToImageWidget_h #define QmitkSurfaceToImageWidget_h #include "../QmitkSegmentationUtilityWidget.h" #include namespace mitk { class Surface; class Image; class LabelSetImage; } /*! \brief QmitkSurfaceToImageWidget The Tool converts a surface to a binary image. The Method requires a surface and an image, which header information defines the output image. The resulting binary image has the same dimension, size, and Geometry3D as the input image. */ class QmitkSurfaceToImageWidget : public QmitkSegmentationUtilityWidget { Q_OBJECT public: /** @brief Default constructor, including creation of GUI elements and signals/slots connections. */ explicit QmitkSurfaceToImageWidget(mitk::SliceNavigationController* timeNavigationController, QWidget* parent = nullptr); /** @brief Defaul destructor. */ - ~QmitkSurfaceToImageWidget(); + ~QmitkSurfaceToImageWidget() override; private slots: /** @brief This slot is called if the selection in the workbench is changed. */ void OnSelectionChanged(unsigned int index, const mitk::DataNode* selection); /** @brief This slot is called if user activates the button to convert a surface into a binary image. */ void OnSurface2ImagePressed(); private: /** @brief Enable buttons if data selction is valid. */ void EnableButtons(bool enable = true); /** @brief Convert a surface into an binary image. */ itk::SmartPointer ConvertSurfaceToImage( itk::SmartPointer image, itk::SmartPointer surface ); Ui::QmitkSurfaceToImageWidgetControls m_Controls; }; #endif diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h index b9fa5eeb09..60dc7f6b44 100644 --- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h +++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h @@ -1,49 +1,49 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPLUGINACTIVATOR_H #define MITKPLUGINACTIVATOR_H // Parent classes #include namespace mitk { class PluginActivator : public berry::AbstractUICTKPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_segmentation") Q_INTERFACES(ctkPluginActivator) public: PluginActivator(); - ~PluginActivator(); + ~PluginActivator() override; void start(ctkPluginContext *context) override; void stop(ctkPluginContext *context) override; static PluginActivator* getDefault(); static ctkPluginContext* getContext(); private: static ctkPluginContext* m_context; static PluginActivator* m_Instance; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h index f08e84c28e..27460ff3a1 100644 --- a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h +++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h @@ -1,92 +1,92 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKViewNavigatorWidget_H_INCLUDED #define _QMITKViewNavigatorWidget_H_INCLUDED //QT headers #include #include #include #include "ui_QmitkViewNavigatorWidgetControls.h" #include #include #include #include #include #include #include #include #include #include class ClassFilterProxyModel; /** @brief */ class QmitkViewNavigatorWidget : public QWidget { //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: QmitkViewNavigatorWidget (berry::IWorkbenchWindow::Pointer window, QWidget* parent = nullptr, Qt::WindowFlags f = nullptr); - virtual ~QmitkViewNavigatorWidget(); + ~QmitkViewNavigatorWidget() override; virtual void CreateQtPartControl(QWidget *parent); void setFocus(); bool FillTreeList(); void UpdateTreeList(QStandardItem* item = nullptr, berry::IWorkbenchPartReference* partRef=nullptr, const std::string& changeId=""); QScopedPointer m_PerspectiveListener; QScopedPointer m_WindowListener; public slots: void CustomMenuRequested(QPoint pos); void ItemClicked(const QModelIndex &index); void SaveCurrentPerspectiveAs(); void ResetCurrentPerspective(); void CloseAllPerspectives(); void ClosePerspective(); void ExpandAll(); void CollapseAll(); void FilterChanged(); protected: friend class ViewNavigatorPerspectiveListener; // member variables Ui::QmitkViewNavigatorWidgetControls m_Controls; QWidget* m_Parent; QStandardItemModel* m_TreeModel; ClassFilterProxyModel* m_FilterProxyModel; QMenu* m_ContextMenu; berry::IPerspectiveDescriptor::Pointer m_ActivePerspective; bool m_Generated; private: berry::IWorkbenchWindow::Pointer m_Window; }; #endif // _QMITKViewNavigatorWidget_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/ViewNavigatorView.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/ViewNavigatorView.h index 9adcdefef8..bc5e8cc70a 100644 --- a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/ViewNavigatorView.h +++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/ViewNavigatorView.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ViewNavigatorView_h #define ViewNavigatorView_h #include class QmitkViewNavigatorWidget; /** \brief ViewNavigatorView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class ViewNavigatorView : public QmitkAbstractView { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; private: QmitkViewNavigatorWidget* m_ViewNavigatorWidget; }; #endif // ViewNavigatorView_h diff --git a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h index 8bd075f564..7d39e8e840 100755 --- a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h +++ b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h @@ -1,82 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKVOLUMEVISUALIZATIONVIEW_H_ #define QMITKVOLUMEVISUALIZATIONVIEW_H_ #include #include #include #include #include "mitkDataStorage.h" #include #include #include #include "ui_QmitkVolumeVisualizationViewControls.h" /** * \ingroup org_mitk_gui_qt_volumevisualization_internal */ class QmitkVolumeVisualizationView : public QmitkAbstractView { Q_OBJECT public: void SetFocus() override; QmitkVolumeVisualizationView(); - virtual ~QmitkVolumeVisualizationView(); + ~QmitkVolumeVisualizationView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// /// Invoked when the DataManager selection changed /// - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList& nodes) override; static const std::string VIEW_ID; protected slots: void OnMitkInternalPreset( int mode ); void OnEnableRendering( bool state ); void OnRenderMode( int mode ); void OnBlendMode(int mode); protected: Ui::QmitkVolumeVisualizationViewControls* m_Controls; private: mitk::WeakPointer m_SelectedNode; void UpdateInterface(); void NodeRemoved(const mitk::DataNode* node) override; }; #endif /*QMITKVOLUMEVISUALIZATIONVIEW_H_*/ diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/internal/MatchPointBrowserPreferencesPage.h b/Plugins/org.mitk.matchpoint.core.helper/src/internal/MatchPointBrowserPreferencesPage.h index 56028f3ec3..c72b364659 100644 --- a/Plugins/org.mitk.matchpoint.core.helper/src/internal/MatchPointBrowserPreferencesPage.h +++ b/Plugins/org.mitk.matchpoint.core.helper/src/internal/MatchPointBrowserPreferencesPage.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __MATCHPOINT_BROWSER_PREFERENCE_PAGE_H #define __MATCHPOINT_BROWSER_PREFERENCE_PAGE_H #include "berryIQtPreferencePage.h" class QWidget; class QCheckBox; class QComboBox; class QSpinBox; class QmitkDirectoryListWidget; class QmitkFileListWidget; class ctkDirectoryButton; class berryIPreferences; /** * \class MatchPointBrowserPreferencesPage * \brief Preference page for the MatchPoint Browser plugin */ class MatchPointBrowserPreferencesPage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: MatchPointBrowserPreferencesPage(); - ~MatchPointBrowserPreferencesPage(); + ~MatchPointBrowserPreferencesPage() override; /** * \brief Called by framework to initialise this preference page, but currently does nothing. * \param workbench The workbench. */ - void Init(berry::IWorkbench::Pointer workbench); + void Init(berry::IWorkbench::Pointer workbench) override; /** * \brief Called by framework to create the GUI, and connect signals and slots. * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget. */ - void CreateQtControl(QWidget* widget); + void CreateQtControl(QWidget* widget) override; /** * \brief Required by framework to get hold of the GUI. * \return QWidget* the top most QWidget for the GUI. */ - QWidget* GetQtControl() const; + QWidget* GetQtControl() const override; /** * \see IPreferencePage::PerformOk */ - virtual bool PerformOk(); + bool PerformOk() override; /** * \see IPreferencePage::PerformCancel */ - virtual void PerformCancel(); + void PerformCancel() override; /** * \see IPreferencePage::Update */ - virtual void Update(); + void Update() override; public slots: protected: QWidget* m_MainControl; QCheckBox* m_DebugOutput; QmitkDirectoryListWidget* m_AlgDirectories; QmitkFileListWidget* m_AlgFiles; QCheckBox* m_LoadFromHomeDir; QCheckBox* m_LoadFromCurrentDir; QCheckBox* m_LoadFromApplicationDir; QCheckBox* m_LoadFromAutoLoadPathDir; berry::IPreferences::Pointer m_BrowserPreferencesNode; private: QString ConvertToString(const QStringList& list); }; #endif // COMMANDLINEMODULESPREFERENCESPAGE_H diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/internal/org_mitk_matchpoint_core_helper_Activator.h b/Plugins/org.mitk.matchpoint.core.helper/src/internal/org_mitk_matchpoint_core_helper_Activator.h index 9a7de83b5f..443f8147a8 100644 --- a/Plugins/org.mitk.matchpoint.core.helper/src/internal/org_mitk_matchpoint_core_helper_Activator.h +++ b/Plugins/org.mitk.matchpoint.core.helper/src/internal/org_mitk_matchpoint_core_helper_Activator.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_matchpoint_core_helper_Activator_h #define org_mitk_matchpoint_core_helper_Activator_h #include class org_mitk_matchpoint_core_helper_Activator : public berry::AbstractUICTKPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_matchpoint_core_helper") Q_INTERFACES(ctkPluginActivator) public: org_mitk_matchpoint_core_helper_Activator(); - ~org_mitk_matchpoint_core_helper_Activator(); + ~org_mitk_matchpoint_core_helper_Activator() override; void start(ctkPluginContext* context) override; void stop(ctkPluginContext* context) override; static org_mitk_matchpoint_core_helper_Activator* getDefault(); static ctkPluginContext* getContext(); private: static ctkPluginContext* m_Context; static org_mitk_matchpoint_core_helper_Activator* m_Instance; }; // org_mitk_gui_qt_algorithmcontrol_Activator #endif // org_mitk_gui_qt_algorithmcontrol_Activator_h diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h index ee57ee920f..328087730f 100644 --- a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h +++ b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_MAP_ALGORITHM_INFO_OBJECT_H #define _MITK_MAP_ALGORITHM_INFO_OBJECT_H #include #include #include #include "org_mitk_matchpoint_core_helper_Export.h" namespace mitk { /** * @Class berry wrapper for a MatchPoint algorithm deployment info * Used by mitk::MAPAlgorithmInfoSelection. */ class MITK_MATCHPOINT_CORE_HELPER_EXPORT MAPAlgorithmInfoObject : public berry::Object { public: berryObjectMacro(mitk::MAPAlgorithmInfoObject) MAPAlgorithmInfoObject(); MAPAlgorithmInfoObject(::map::deployment::DLLInfo::ConstPointer info); const ::map::deployment::DLLInfo* GetInfo() const; - bool operator==(const berry::Object* obj) const; + bool operator==(const berry::Object* obj) const override; private: ::map::deployment::DLLInfo::ConstPointer m_Info; }; } #endif \ No newline at end of file diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h index 223ff730b2..0c47c0ab38 100644 --- a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h +++ b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_MAP_ALGORITHM_INFO_SELECTION_H #define _MITK_MAP_ALGORITHM_INFO_SELECTION_H #include #include #include "org_mitk_matchpoint_core_helper_Export.h" namespace mitk { /** * @class Used by plugins to communicate selections of deployed algorithms * E.G. used by the algorithm browser to inform about the currently selected algorithm. */ class MITK_MATCHPOINT_CORE_HELPER_EXPORT MAPAlgorithmInfoSelection : public virtual berry::IStructuredSelection { public: berryObjectMacro(MAPAlgorithmInfoSelection); typedef ::map::deployment::DLLInfo AlgorithmInfoType; typedef std::vector AlgorithmInfoVectorType; MAPAlgorithmInfoSelection(); MAPAlgorithmInfoSelection(AlgorithmInfoType::ConstPointer info); MAPAlgorithmInfoSelection(const AlgorithmInfoVectorType& infos); - virtual Object::Pointer GetFirstElement() const; - virtual iterator Begin() const; - virtual iterator End() const; + Object::Pointer GetFirstElement() const override; + iterator Begin() const override; + iterator End() const override; - virtual int Size() const; + int Size() const override; - virtual ContainerType::Pointer ToVector() const; + ContainerType::Pointer ToVector() const override; AlgorithmInfoVectorType GetSelectedAlgorithmInfo() const; /** * @see berry::ISelection::IsEmpty() */ - bool IsEmpty() const; + bool IsEmpty() const override; - bool operator==(const berry::Object* obj) const; + bool operator==(const berry::Object* obj) const override; protected: ContainerType::Pointer m_Selection; }; } #endif \ No newline at end of file