Skip to content

Commit

Permalink
ENH: Remove the ITK_USE_CONCEPT_CHECKING option
Browse files Browse the repository at this point in the history
  • Loading branch information
sbelsk authored and hjmjohnson committed Jan 24, 2025
1 parent 5a6d1e9 commit 9e582fd
Show file tree
Hide file tree
Showing 349 changed files with 35 additions and 1,406 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -494,11 +494,11 @@ option(
mark_as_advanced(ITK_USE_64BITS_IDS)

# ITK turn on concept checking
option(
ITK_USE_CONCEPT_CHECKING
"Turn on concept checking to give helpful errors at compile time if a type cannot be used as a template parameter."
ON)
mark_as_advanced(ITK_USE_CONCEPT_CHECKING)
if(ITK_USE_CONCEPT_CHECKING)
message(
WARNING
"Ignoring ITK_USE_CONCEPT_CHECKING, as concept checking is performed unconditionally. This variable is no longer used")
endif()
if(ITK_USE_STRICT_CONCEPT_CHECKING)
message(
WARNING
Expand Down
3 changes: 1 addition & 2 deletions Modules/Bridge/VTK/include/itkVTKImageExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ class ITK_TEMPLATE_EXPORT VTKImageExport : public VTKImageExportBase
/** The type of the input image. */
using InputImageType = TInputImage;

#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro(ImageDimensionCheck, (Concept::SameDimensionOrMinusOneOrTwo<3, Self::InputImageDimension>));
#endif

/** Set the input image of this image exporter. */
using Superclass::SetInput;
void
Expand Down
4 changes: 1 addition & 3 deletions Modules/Core/Common/include/itkCompensatedSummation.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ class ITK_TEMPLATE_EXPORT CompensatedSummation
AccumulateType m_Sum{};
AccumulateType m_Compensation{};

// Maybe support more types in the future with template specialization.
#ifdef ITK_USE_CONCEPT_CHECKING
// Maybe support more types in the future with template specialization.
itkConceptMacro(OnlyDefinedForFloatingPointTypes, (itk::Concept::IsFloatingPoint<TFloat>));
#endif // ITK_USE_CONCEPT_CHECKING
};

void ITKCommon_EXPORT
Expand Down
5 changes: 0 additions & 5 deletions Modules/Core/Common/include/itkExtractImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,7 @@ class ITK_TEMPLATE_EXPORT ExtractImageFilter : public InPlaceImageFilter<TInputI
void
SetExtractionRegion(InputImageRegionType extractRegion);
itkGetConstMacro(ExtractionRegion, InputImageRegionType);

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputCovertibleToOutputCheck, (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
// End concept checking
#endif

protected:
ExtractImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ class ITK_TEMPLATE_EXPORT FiniteCylinderSpatialFunction : public InteriorExterio
OutputType
Evaluate(const InputType & position) const override;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(DimensionShouldBe3, (Concept::SameDimension<VDimension, 3u>));
itkConceptMacro(PointDimensionShouldBe3, (Concept::SameDimension<InputType::Dimension, 3u>));
// End concept checking
#endif

protected:
FiniteCylinderSpatialFunction();
Expand Down
2 changes: 0 additions & 2 deletions Modules/Core/Common/include/itkHeavisideStepFunctionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,9 @@ class ITK_TEMPLATE_EXPORT HeavisideStepFunctionBase : public FunctionBase<TInput
virtual OutputType
EvaluateDerivative(const InputType & input) const = 0;

#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro(DoubleConvertibleToInputCheck, (Concept::Convertible<double, TInput>));

itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, TOutput>));
#endif // ITK_USE_CONCEPT_CHECKING

protected:
HeavisideStepFunctionBase()
Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkKernelFunctionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ class ITK_TEMPLATE_EXPORT KernelFunctionBase : public FunctionBase<TRealValueTyp
TRealValueType
Evaluate(const TRealValueType & u) const override = 0;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(TRealValueTypeIsFloatingPointCheck, (Concept::IsFloatingPoint<TRealValueType>));
// End concept checking
#endif

protected:
KernelFunctionBase() = default;
Expand Down
2 changes: 0 additions & 2 deletions Modules/Core/Common/include/itkMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,8 @@ template <typename TReturn, typename TInput>
inline TReturn
CastWithRangeCheck(TInput x)
{
#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro(OnlyDefinedForIntegerTypes1, (itk::Concept::IsInteger<TReturn>));
itkConceptMacro(OnlyDefinedForIntegerTypes2, (itk::Concept::IsInteger<TInput>));
#endif // ITK_USE_CONCEPT_CHECKING

auto ret = static_cast<TReturn>(x);
if constexpr (sizeof(TReturn) > sizeof(TInput) &&
Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkSobelOperator.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ class ITK_TEMPLATE_EXPORT SobelOperator : public NeighborhoodOperator<TPixel, VD
// virtual void CreateToRadius(const unsigned long);

protected:
#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(SignedOutputPixelType, (Concept::Signed<typename NumericTraits<TPixel>::ValueType>));
// End concept checking
#endif

/** Type alias support for coefficient vector type.*/
using typename Superclass::CoefficientVector;
Expand Down
4 changes: 0 additions & 4 deletions Modules/Core/Common/include/itkStreamingImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,8 @@ class ITK_TEMPLATE_EXPORT StreamingImageFilter : public ImageToImageFilter<TInpu
void
PropagateRequestedRegion(DataObject * output) override;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(SameDimensionCheck, (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
itkConceptMacro(InputConvertibleToOutputCheck, (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
// End concept checking
#endif

protected:
StreamingImageFilter();
Expand Down
1 change: 0 additions & 1 deletion Modules/Core/Common/src/itkConfigure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
#cmakedefine ITK_LEGACY_REMOVE
#cmakedefine ITK_LEGACY_SILENT
#cmakedefine ITK_FUTURE_LEGACY_REMOVE
#cmakedefine ITK_USE_CONCEPT_CHECKING
#cmakedefine ITK_USE_FFTWF
#cmakedefine ITK_USE_FFTWD
#cmakedefine ITK_USE_CUFFTW
Expand Down
5 changes: 1 addition & 4 deletions Modules/Core/Common/test/itkSimpleFilterWatcherTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,9 @@ class TanHelperImageFilter
/** \see LightObject::GetNameOfClass() */
itkOverrideGetNameOfClassMacro(TanHelperImageFilter);

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputConvertibleToDoubleCheck, (Concept::Convertible<typename TInputImage::PixelType, double>));
itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, typename TOutputImage::PixelType>));
// End concept checking
#endif

protected:
TanHelperImageFilter() = default;
~TanHelperImageFilter() override = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,10 @@ class ITK_TEMPLATE_EXPORT DenseFiniteDifferenceImageFilter
/** The container type for the update buffer. */
using UpdateBufferType = OutputImageType;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputTimesDoubleCheck, (Concept::MultiplyOperator<PixelType, double>));
itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
itkConceptMacro(OutputAdditiveAndAssignOperatorsCheck, (Concept::AdditiveAndAssignOperators<PixelType>));
itkConceptMacro(InputConvertibleToOutputCheck, (Concept::Convertible<typename TInputImage::PixelType, PixelType>));
// End concept checking
#endif

protected:
DenseFiniteDifferenceImageFilter() { m_UpdateBuffer = UpdateBufferType::New(); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,7 @@ class ITK_TEMPLATE_EXPORT FiniteDifferenceImageFilter : public InPlaceImageFilte
this->SetIsInitialized(true);
}

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputPixelIsFloatingPointCheck, (Concept::IsFloatingPoint<OutputPixelValueType>));
// End concept checking
#endif

protected:
FiniteDifferenceImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,9 @@ class ITK_TEMPLATE_EXPORT GPUDenseFiniteDifferenceImageFilter
/** The container type for the update buffer. */
using UpdateBufferType = OutputImageType;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputTimesDoubleCheck, (Concept::MultiplyOperator<PixelType, double>));
itkConceptMacro(OutputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
itkConceptMacro(InputConvertibleToOutputCheck, (Concept::Convertible<typename TInputImage::PixelType, PixelType>));
// End concept checking
#endif

/** Get OpenCL Kernel source as a string, creates a GetOpenCLSource method */
itkGetOpenCLSourceFromKernelMacro(GPUDenseFiniteDifferenceImageFilterKernel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ class ITK_TEMPLATE_EXPORT GPUFiniteDifferenceImageFilter
itkGetConstReferenceMacro(State, GPUFiniteDifferenceFilterEnum);
#endif

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputPixelIsFloatingPointCheck, (Concept::IsFloatingPoint<OutputPixelValueType>));
// End concept checking
#endif

/** Methods to get timers */
itkGetConstReferenceMacro(InitTime, TimeProbe);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,9 @@ class ComplexConjugateImageAdaptor
/** \see LightObject::GetNameOfClass() */
itkOverrideGetNameOfClassMacro(ComplexConjugateImageAdaptor);

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking. */
itkConceptMacro(InputConvertibleToComplex,
(Concept::Convertible<std::complex<typename NumericTraits<typename TImage::PixelType>::ValueType>,
typename TImage::PixelType>));
// End concept checking. */
#endif

protected:
ComplexConjugateImageAdaptor() = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,10 @@ class ITK_TEMPLATE_EXPORT BSplineDecompositionImageFilter : public ImageToImageF
itkGetConstMacro(NumberOfPoles, unsigned int);


#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(DimensionCheck, (Concept::SameDimension<ImageDimension, OutputImageDimension>));
itkConceptMacro(InputConvertibleToOutputCheck,
(Concept::Convertible<typename TInputImage::PixelType, typename TOutputImage::PixelType>));
itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, typename TOutputImage::PixelType>));
// End concept checking
#endif

protected:
BSplineDecompositionImageFilter();
Expand Down
5 changes: 0 additions & 5 deletions Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,6 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMesh : public Mesh<TPixel, VDimension, TTraits
PointIdentifier
Splice(QEPrimal * a, QEPrimal * b);

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
// End concept checking
#endif

// for reusability of a mesh in the MeshToMesh filter
void
ClearFreePointAndCellIndexesLists()
Expand Down
5 changes: 0 additions & 5 deletions Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMeshPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ class ITK_TEMPLATE_EXPORT QuadEdgeMeshPoint : public Point<TCoordinate, VPointDi

using ValueArrayType = ValueType[Self::PointDimension];

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
// End concept checking
#endif

public:
QuadEdgeMeshPoint() = default;
QuadEdgeMeshPoint(const Self &) = default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,7 @@ class ITK_TEMPLATE_EXPORT ExtractSliceImageFilter : public ImageSource<TOutputIm
const TInputImage *
GetInput() const;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputCovertibleToOutputCheck, (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
// End concept checking
#endif

protected:
ExtractSliceImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,10 @@ class ITK_TEMPLATE_EXPORT StretchIntensityImageFilter : public ImageSource<TOutp
const TInputImage *
GetInput() const;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<InputPixelType>));
itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<OutputPixelType>));
itkConceptMacro(RealTypeMultiplyOperatorCheck, (Concept::MultiplyOperator<RealType>));
itkConceptMacro(RealTypeAdditiveOperatorsCheck, (Concept::AdditiveOperators<RealType>));
// End concept checking
#endif

protected:
StretchIntensityImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,8 @@ class ITK_TEMPLATE_EXPORT TransformGeometryImageFilter : public InPlaceImageFilt
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
itkConceptMacro(SameDimensionCheck, (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
itkConceptMacro(InputConvertibleToOutputCheck, (Concept::Convertible<InputImagePixelType, OutputImagePixelType>));
#endif

/** Transform type alias */
using TransformType = Transform<double, InputImageDimension, OutputImageDimension>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,7 @@ class ITK_TEMPLATE_EXPORT CurvatureAnisotropicDiffusionImageFilter
/** Extract superclass image dimension. */
static constexpr unsigned int ImageDimension = Superclass::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(OutputHasNumericTraitsCheck, (Concept::HasNumericTraits<typename TOutputImage::PixelType>));
// End concept checking
#endif

protected:
CurvatureAnisotropicDiffusionImageFilter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ class ITK_TEMPLATE_EXPORT GradientAnisotropicDiffusionImageFilter
/** Extract information from the superclass. */
static constexpr unsigned int ImageDimension = Superclass::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(UpdateBufferHasNumericTraitsCheck, (Concept::HasNumericTraits<typename UpdateBufferType::PixelType>));
// End concept checking
#endif

protected:
GradientAnisotropicDiffusionImageFilter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,9 @@ class ITK_TEMPLATE_EXPORT VectorCurvatureAnisotropicDiffusionImageFilter
/** Determine the image dimension. */
static constexpr unsigned int ImageDimension = Superclass::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
itkConceptMacro(OutputHasNumericTraitsCheck,
(Concept::HasNumericTraits<typename TOutputImage::PixelType::ValueType>));
// End concept checking
#endif

protected:
VectorCurvatureAnisotropicDiffusionImageFilter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,9 @@ class ITK_TEMPLATE_EXPORT VectorGradientAnisotropicDiffusionImageFilter
/** Determine the image dimension from the superclass. */
static constexpr unsigned int ImageDimension = Superclass::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(InputHasNumericTraitsCheck, (Concept::HasNumericTraits<typename TInputImage::PixelType::ValueType>));
itkConceptMacro(OutputHasNumericTraitsCheck,
(Concept::HasNumericTraits<typename TOutputImage::PixelType::ValueType>));
// End concept checking
#endif

protected:
VectorGradientAnisotropicDiffusionImageFilter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,8 @@ class ITK_TEMPLATE_EXPORT AntiAliasBinaryImageFilter : public SparseFieldLevelSe
return this->GetNumberOfIterations();
}

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, typename TOutputImage::PixelType>));
itkConceptMacro(InputOStreamWritableCheck, (Concept::OStreamWritable<typename TInputImage::PixelType>));
// End concept checking
#endif

protected:
AntiAliasBinaryImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,11 @@ class ITK_TEMPLATE_EXPORT BinaryPruningImageFilter : public ImageToImageFilter<T
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(SameDimensionCheck, (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
itkConceptMacro(SameTypeCheck, (Concept::SameType<PixelType, typename TOutputImage::PixelType>));
itkConceptMacro(AdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
itkConceptMacro(IntConvertibleToPixelTypeCheck, (Concept::Convertible<int, PixelType>));
itkConceptMacro(PixelLessThanIntCheck, (Concept::LessThanComparable<PixelType, int>));
// End concept checking
#endif

protected:
BinaryPruningImageFilter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,11 @@ class ITK_TEMPLATE_EXPORT BinaryThinningImageFilter : public ImageToImageFilter<
static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;

#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro(SameDimensionCheck, (Concept::SameDimension<InputImageDimension, OutputImageDimension>));
itkConceptMacro(InputAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType>));
itkConceptMacro(InputConvertibleToIntCheck, (Concept::Convertible<PixelType, int>));
itkConceptMacro(IntConvertibleToInputCheck, (Concept::Convertible<int, PixelType>));
itkConceptMacro(SameTypeCheck, (Concept::SameType<PixelType, typename TOutputImage::PixelType>));
// End concept checking
#endif

protected:
BinaryThinningImageFilter();
Expand Down
Loading

0 comments on commit 9e582fd

Please sign in to comment.