Skip to content

Commit

Permalink
Removed boolean vectors from ITK-SNAP
Browse files Browse the repository at this point in the history
  • Loading branch information
pyushkevich committed Oct 4, 2024
1 parent 681452b commit d7293a9
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
Empty file removed Common/IRISVectorTemplates.cxx
Empty file.
15 changes: 9 additions & 6 deletions GUI/Qt/Coupling/QtAbstractButtonCoupling.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,27 @@ class DefaultWidgetDomainTraits<NumericValueRange<TAtomic>, 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<bool, QAbstractButton>
: public WidgetValueTraitsBase<bool, QAbstractButton *>
template <typename TAtomic>
class DefaultWidgetValueTraits<
TAtomic,
QAbstractButton,
typename std::enable_if<std::is_integral<TAtomic>::value>::type>
: public WidgetValueTraitsBase<TAtomic, QAbstractButton *>
{
public:
const char *GetSignal()
{
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);
}
Expand Down
2 changes: 1 addition & 1 deletion GUI/Qt/Coupling/QtWidgetArrayCoupling.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool, VDim> m_CacheValid;
iris_vector_fixed<int, VDim> m_CacheValid;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion GUI/Qt/Coupling/QtWidgetCoupling.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class WidgetDomainTraitsBase
};

/** Empty template for default value traits. Specialize for different Qt widgets */
template <class TAtomic, class TWidget>
template <class TAtomic, class TWidget, typename Enable=void>
class DefaultWidgetValueTraits {};

/** Empty template for default domain traits. Specialize for different Qt widgets */
Expand Down
2 changes: 1 addition & 1 deletion GUI/Renderer/EdgePreprocessingSettingsRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion GUI/Renderer/GMMRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
8 changes: 1 addition & 7 deletions GUI/Renderer/IntensityCurveVTKRenderer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -30,7 +28,6 @@
#include "IntensityCurveModel.h"
#include "IntensityCurveInterface.h"
#include "LayerHistogramPlotAssembly.h"
#include "ScalarImageHistogram.h"
#include "ColorMapModel.h"


Expand Down Expand Up @@ -240,9 +237,6 @@ class VerticalColorMapContextItem : public AbstractColorMapContextItem
};


#include "vtkPiecewiseControlPointsItem.h"


class IntensityCurveControlPointsContextItem : public vtkControlPointsItem
{
public:
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d7293a9

Please sign in to comment.