From d7293a9964c49ee538375accbefc8482f53f032f Mon Sep 17 00:00:00 2001 From: Paul Yushkevich Date: Fri, 4 Oct 2024 06:01:00 -0400 Subject: [PATCH] Removed boolean vectors from ITK-SNAP --- Common/IRISVectorTemplates.cxx | 0 GUI/Qt/Coupling/QtAbstractButtonCoupling.h | 15 +++++++++------ GUI/Qt/Coupling/QtWidgetArrayCoupling.h | 2 +- GUI/Qt/Coupling/QtWidgetCoupling.h | 2 +- .../EdgePreprocessingSettingsRenderer.cxx | 2 +- GUI/Renderer/GMMRenderer.cxx | 2 +- GUI/Renderer/IntensityCurveVTKRenderer.cxx | 8 +------- 7 files changed, 14 insertions(+), 17 deletions(-) delete mode 100644 Common/IRISVectorTemplates.cxx diff --git a/Common/IRISVectorTemplates.cxx b/Common/IRISVectorTemplates.cxx deleted file mode 100644 index e69de29b..00000000 diff --git a/GUI/Qt/Coupling/QtAbstractButtonCoupling.h b/GUI/Qt/Coupling/QtAbstractButtonCoupling.h index e0e44e74..fb0f496e 100644 --- a/GUI/Qt/Coupling/QtAbstractButtonCoupling.h +++ b/GUI/Qt/Coupling/QtAbstractButtonCoupling.h @@ -129,11 +129,14 @@ class DefaultWidgetDomainTraits, QColorButtonWidget> /** - * A simple coupling between a button and a boolean value. + * A simple coupling between a button and a true/false value strored in an int. */ -template <> -class DefaultWidgetValueTraits - : public WidgetValueTraitsBase +template +class DefaultWidgetValueTraits< + TAtomic, + QAbstractButton, + typename std::enable_if::value>::type> + : public WidgetValueTraitsBase { public: const char *GetSignal() @@ -141,12 +144,12 @@ class DefaultWidgetValueTraits return SIGNAL(toggled(bool)); } - bool GetValue(QAbstractButton *w) + TAtomic GetValue(QAbstractButton *w) { return w->isChecked(); } - void SetValue(QAbstractButton *w, const bool &value) + void SetValue(QAbstractButton *w, const TAtomic &value) { w->setChecked(value); } diff --git a/GUI/Qt/Coupling/QtWidgetArrayCoupling.h b/GUI/Qt/Coupling/QtWidgetArrayCoupling.h index 6d03fec2..99d1d140 100644 --- a/GUI/Qt/Coupling/QtWidgetArrayCoupling.h +++ b/GUI/Qt/Coupling/QtWidgetArrayCoupling.h @@ -97,7 +97,7 @@ class WidgetArrayValueTraits : // want that widget's value to be sent to the model, while using the cached // values for the other widgets. ValueType m_CachedModelValue, m_CachedWidgetValue; - iris_vector_fixed m_CacheValid; + iris_vector_fixed m_CacheValid; }; /** diff --git a/GUI/Qt/Coupling/QtWidgetCoupling.h b/GUI/Qt/Coupling/QtWidgetCoupling.h index 16f4d47e..0b1f7bf9 100644 --- a/GUI/Qt/Coupling/QtWidgetCoupling.h +++ b/GUI/Qt/Coupling/QtWidgetCoupling.h @@ -350,7 +350,7 @@ class WidgetDomainTraitsBase }; /** Empty template for default value traits. Specialize for different Qt widgets */ -template +template class DefaultWidgetValueTraits {}; /** Empty template for default domain traits. Specialize for different Qt widgets */ diff --git a/GUI/Renderer/EdgePreprocessingSettingsRenderer.cxx b/GUI/Renderer/EdgePreprocessingSettingsRenderer.cxx index c27a28c6..47520a61 100644 --- a/GUI/Renderer/EdgePreprocessingSettingsRenderer.cxx +++ b/GUI/Renderer/EdgePreprocessingSettingsRenderer.cxx @@ -40,7 +40,7 @@ EdgePreprocessingSettingsRenderer::EdgePreprocessingSettingsRenderer() // Set up the plot vtkPlot *plot = m_Chart->AddPlot(vtkChart::LINE); plot->SetInputData(m_PlotTable, 0, 1); - plot->SetColor(1, 0, 0); + plot->SetColorF(1, 0, 0); plot->SetWidth(2.0); plot->GetYAxis()->SetBehavior(vtkAxis::FIXED); plot->GetYAxis()->SetMinimum(-0.05); diff --git a/GUI/Renderer/GMMRenderer.cxx b/GUI/Renderer/GMMRenderer.cxx index a40f7dc6..b4880afb 100644 --- a/GUI/Renderer/GMMRenderer.cxx +++ b/GUI/Renderer/GMMRenderer.cxx @@ -165,7 +165,7 @@ void GMMRenderer::UpdatePlotValues() // Configure the plot Vector3d rgb = ColorLabelTable::GetDefaultColorLabel(i+1).GetRGBAsDoubleVector(); - plot->SetColor(rgb[0], rgb[1], rgb[2]); + plot->SetColorF(rgb[0], rgb[1], rgb[2]); plot->GetXAxis()->SetBehavior(vtkAxis::FIXED); plot->GetXAxis()->SetRange(cmin - hist->GetBinWidth(), cmax + hist->GetBinWidth()); plot->GetXAxis()->SetTitle("intensity"); diff --git a/GUI/Renderer/IntensityCurveVTKRenderer.cxx b/GUI/Renderer/IntensityCurveVTKRenderer.cxx index 3a695915..f952e2bb 100644 --- a/GUI/Renderer/IntensityCurveVTKRenderer.cxx +++ b/GUI/Renderer/IntensityCurveVTKRenderer.cxx @@ -12,8 +12,6 @@ #include "vtkContext2D.h" #include "vtkPen.h" #include "vtkBrush.h" -#include "vtkGenericOpenGLRenderWindow.h" -#include "vtkIdTypeArray.h" #include "vtkPlotPoints.h" #include "vtkTransform2D.h" #include "vtkScalarsToColorsItem.h" @@ -30,7 +28,6 @@ #include "IntensityCurveModel.h" #include "IntensityCurveInterface.h" #include "LayerHistogramPlotAssembly.h" -#include "ScalarImageHistogram.h" #include "ColorMapModel.h" @@ -240,9 +237,6 @@ class VerticalColorMapContextItem : public AbstractColorMapContextItem }; -#include "vtkPiecewiseControlPointsItem.h" - - class IntensityCurveControlPointsContextItem : public vtkControlPointsItem { public: @@ -483,7 +477,7 @@ IntensityCurveVTKRenderer::IntensityCurveVTKRenderer() // Set up the curve plot m_CurvePlot = m_Chart->AddPlot(vtkChart::LINE); m_CurvePlot->SetInputData(m_PlotTable, 0, 1); - m_CurvePlot->SetColor(1, 0, 0); + m_CurvePlot->SetColorF(1, 0, 0); m_CurvePlot->SetOpacity(0.85); m_CurvePlot->GetYAxis()->SetBehavior(vtkAxis::FIXED); m_CurvePlot->GetYAxis()->SetMinimumLimit(-0.1);