diff --git a/Modules/Filtering/MeshNoise/CMakeLists.txt b/Modules/Filtering/MeshNoise/CMakeLists.txt new file mode 100644 index 000000000000..9da2e8335965 --- /dev/null +++ b/Modules/Filtering/MeshNoise/CMakeLists.txt @@ -0,0 +1 @@ +itk_module_impl() diff --git a/Modules/Filtering/MeshNoise/README.md b/Modules/Filtering/MeshNoise/README.md new file mode 100644 index 000000000000..4811f5847f27 --- /dev/null +++ b/Modules/Filtering/MeshNoise/README.md @@ -0,0 +1,19 @@ +# MeshNoise + +In-tree ITK module providing additive-noise filters for `itk::Mesh` +and `itk::QuadEdgeMesh` point coordinates. The flagship class is +`itk::AdditiveGaussianNoiseMeshFilter`, which perturbs every mesh +point by an independent Gaussian-distributed offset with +configurable mean and standard deviation. Useful for testing +mesh-based registration, surface reconstruction, and shape-analysis +pipelines under controlled perturbation. + +## Origin + +Ingested from the standalone remote module +[**InsightSoftwareConsortium/ITKMeshNoise**](https://github.com/InsightSoftwareConsortium/ITKMeshNoise) +on 2026-04-28. The upstream repository will be archived read-only +after this PR merges; it remains reachable at the URL above. + +This ingest also resolves the long-open compile error reported in +[InsightSoftwareConsortium/ITK#5174](https://github.com/InsightSoftwareConsortium/ITK/issues/5174). diff --git a/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.h b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.h new file mode 100644 index 000000000000..7d56cd9149c3 --- /dev/null +++ b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.h @@ -0,0 +1,101 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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 itkAdditiveGaussianNoiseMeshFilter_h +#define itkAdditiveGaussianNoiseMeshFilter_h + +#include + +namespace itk +{ +/** \class AdditiveGaussianNoiseMeshFilter + * \brief Add Gaussian noise to the points defining an itkMesh. + * + * \author Davis Vigneault + * + * This class adds Gaussian noise with a specified mean and standard + * deviation to the coordinates of the points defining an itkMesh. + * Mesh topology and other data is passed unaltered. This may be + * useful in testing the robustness of an algorithm to small changes + * in the input mesh, augmenting datasets for machine learning, and + * counteracting deleterious effects which highly regular regions + * of a mesh may occassionally have on mesh processing. + * + * \ingroup MeshNoise + */ +template +class AdditiveGaussianNoiseMeshFilter : public MeshToMeshFilter +{ + +public: + ITK_DISALLOW_COPY_AND_MOVE(AdditiveGaussianNoiseMeshFilter); + + /** Standard class type alias. */ + using Self = AdditiveGaussianNoiseMeshFilter; + using Superclass = MeshToMeshFilter; + using Pointer = SmartPointer; + using ConstPointer = SmartPointer; + + using InputMeshType = TInput; + using OutputMeshType = TOutput; + using InputMeshPointer = typename InputMeshType::Pointer; + using OutputMeshPointer = typename OutputMeshType::Pointer; + + /** Type for representing coordinates. */ + using CoordinateType = typename TInput::CoordinateType; + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Run-time type information (and related methods). */ + itkOverrideGetNameOfClassMacro(AdditiveGaussianNoiseMeshFilter); + + /** Mean of noise. */ + itkGetConstMacro(Mean, CoordinateType); + itkSetMacro(Mean, CoordinateType); + + /** Variance of noise. */ + itkGetConstMacro(Sigma, CoordinateType); + itkSetMacro(Sigma, CoordinateType); + + /** Initialization seed. */ + itkGetConstMacro(Seed, int); + itkSetMacro(Seed, int); + +protected: + AdditiveGaussianNoiseMeshFilter(); + ~AdditiveGaussianNoiseMeshFilter() override = default; + + void + PrintSelf(std::ostream & os, Indent indent) const override; + + /** Generate Requested Data */ + void + GenerateData() override; + + CoordinateType m_Mean; + CoordinateType m_Sigma; + int m_Seed; +}; + +} // namespace itk + +#ifndef ITK_MANUAL_INSTANTIATION +# include "itkAdditiveGaussianNoiseMeshFilter.hxx" +#endif + +#endif diff --git a/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.hxx b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.hxx new file mode 100644 index 000000000000..17d81d955c85 --- /dev/null +++ b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseMeshFilter.hxx @@ -0,0 +1,107 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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 itkAdditiveGaussianNoiseMeshFilter_hxx +#define itkAdditiveGaussianNoiseMeshFilter_hxx + +#include "itkNormalVariateGenerator.h" + +namespace itk +{ + +template +AdditiveGaussianNoiseMeshFilter::AdditiveGaussianNoiseMeshFilter() +{ + this->m_Mean = 0.0; + this->m_Sigma = 1.0; + this->m_Seed = 0; +} + +template +void +AdditiveGaussianNoiseMeshFilter::PrintSelf(std::ostream & os, Indent indent) const +{ + Superclass::PrintSelf(os, indent); + os << indent << "Mean: " << this->m_Mean << std::endl; + os << indent << "Sigma: " << this->m_Sigma << std::endl; +} + +template +void +AdditiveGaussianNoiseMeshFilter::GenerateData() +{ + using InputPointsContainer = typename TInputMesh::PointsContainer; + using OutputPointsContainer = typename TOutputMesh::PointsContainer; + + using InputPointsContainerConstPointer = typename TInputMesh::PointsContainerConstPointer; + using OutputPointsContainerPointer = typename TOutputMesh::PointsContainerPointer; + + const InputMeshType * inputMesh = this->GetInput(); + OutputMeshPointer outputMesh = this->GetOutput(); + + if (!inputMesh) + { + itkExceptionMacro(<< "Missing Input Mesh"); + } + + if (!outputMesh) + { + itkExceptionMacro(<< "Missing Output Mesh"); + } + + outputMesh->SetBufferedRegion(outputMesh->GetRequestedRegion()); + + InputPointsContainerConstPointer inPoints = inputMesh->GetPoints(); + OutputPointsContainerPointer outPoints = outputMesh->GetPoints(); + + outPoints->Reserve(inputMesh->GetNumberOfPoints()); + outPoints->Squeeze(); + + typename InputPointsContainer::ConstIterator inputPoint = inPoints->Begin(); + typename OutputPointsContainer::Iterator outputPoint = outPoints->Begin(); + + unsigned int maxDimension = TInputMesh::MaxTopologicalDimension; + + using GeneratorType = itk::Statistics::NormalVariateGenerator; + GeneratorType::Pointer generator = GeneratorType::New(); + generator->Initialize(this->m_Seed); + + while (inputPoint != inPoints->End()) + { + for (unsigned int dim = 0; dim < maxDimension; ++dim) + { + outputPoint.Value()[dim] = inputPoint.Value()[dim] + generator->GetVariate() * this->m_Sigma + this->m_Mean; + } + ++inputPoint; + ++outputPoint; + } + + // Create duplicate references to the rest of data on the mesh + this->CopyInputMeshToOutputMeshPointData(); + this->CopyInputMeshToOutputMeshCellLinks(); + this->CopyInputMeshToOutputMeshCells(); + this->CopyInputMeshToOutputMeshCellData(); + + for (unsigned int dim = 0; dim < maxDimension; ++dim) + { + outputMesh->SetBoundaryAssignments(dim, inputMesh->GetBoundaryAssignments(dim)); + } +} + +} // namespace itk + +#endif diff --git a/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.h b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.h new file mode 100644 index 000000000000..a106096b4747 --- /dev/null +++ b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.h @@ -0,0 +1,95 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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 itkAdditiveGaussianNoiseQuadEdgeMeshFilter_h +#define itkAdditiveGaussianNoiseQuadEdgeMeshFilter_h + +#include "itkQuadEdgeMeshToQuadEdgeMeshFilter.h" + +namespace itk +{ +/** \class AdditiveGaussianNoiseQuadEdgeMeshFilter + * \brief Add Gaussian noise to the points defining an itkQuadEdgeMesh. + * + * \author Davis Vigneault + * + * This class adds Gaussian noise with a specified mean and standard + * deviation to the coordinates of the points defining an itkMesh. + * Mesh topology and other data is passed unaltered. This may be + * useful in testing the robustness of an algorithm to small changes + * in the input mesh, augmenting datasets for machine learning, and + * counteracting deleterious effects which highly regular regions + * of a mesh may occassionally have on mesh processing. + * + * \ingroup MeshNoise + */ +template +class AdditiveGaussianNoiseQuadEdgeMeshFilter : public QuadEdgeMeshToQuadEdgeMeshFilter +{ +public: + ITK_DISALLOW_COPY_AND_MOVE(AdditiveGaussianNoiseQuadEdgeMeshFilter); + + /** Standard class type alias. */ + using Self = AdditiveGaussianNoiseQuadEdgeMeshFilter; + using Superclass = QuadEdgeMeshToQuadEdgeMeshFilter; + using Pointer = SmartPointer; + using ConstPointer = SmartPointer; + + /** Type for representing coordinates. */ + using CoordinateType = typename TInputMesh::CoordinateType; + + /** Method for creation through the object factory. */ + itkNewMacro(Self); + + /** Run-time type information (and related methods). */ + itkOverrideGetNameOfClassMacro(AdditiveGaussianNoiseQuadEdgeMeshFilter); + + /** Mean of noise. */ + itkGetConstMacro(Mean, CoordinateType); + itkSetMacro(Mean, CoordinateType); + + /** Variance of noise. */ + itkGetConstMacro(Sigma, CoordinateType); + itkSetMacro(Sigma, CoordinateType); + + /** Initialization seed. */ + itkGetConstMacro(Seed, int); + itkSetMacro(Seed, int); + +protected: + AdditiveGaussianNoiseQuadEdgeMeshFilter(); + ~AdditiveGaussianNoiseQuadEdgeMeshFilter() override = default; + + void + PrintSelf(std::ostream & os, Indent indent) const override; + + /** Generate Requested Data */ + void + GenerateData() override; + + CoordinateType m_Mean; + CoordinateType m_Sigma; + int m_Seed; +}; + +} // end namespace itk + +#ifndef ITK_MANUAL_INSTANTIATION +# include "itkAdditiveGaussianNoiseQuadEdgeMeshFilter.hxx" +#endif + +#endif diff --git a/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.hxx b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.hxx new file mode 100644 index 000000000000..c32d7546439b --- /dev/null +++ b/Modules/Filtering/MeshNoise/include/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.hxx @@ -0,0 +1,69 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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 itkAdditiveGaussianNoiseQuadEdgeMeshFilter_hxx +#define itkAdditiveGaussianNoiseQuadEdgeMeshFilter_hxx + +#include "itkNormalVariateGenerator.h" + +namespace itk +{ + +template +AdditiveGaussianNoiseQuadEdgeMeshFilter::AdditiveGaussianNoiseQuadEdgeMeshFilter() +{ + this->m_Mean = 0.0; + this->m_Sigma = 1.0; + this->m_Seed = 0; +} + +template +void +AdditiveGaussianNoiseQuadEdgeMeshFilter::PrintSelf(std::ostream & os, Indent indent) const +{ + Superclass::PrintSelf(os, indent); + os << indent << "Mean: " << this->m_Mean << std::endl; + os << indent << "Sigma: " << this->m_Sigma << std::endl; +} + +template +void +AdditiveGaussianNoiseQuadEdgeMeshFilter::GenerateData() +{ + typename TInputMesh::ConstPointer inputMesh = this->GetInput(); + typename TOutputMesh::Pointer outputMesh = this->GetOutput(); + + this->CopyInputMeshToOutputMesh(); + + typename TOutputMesh::PointsContainer::Iterator it = outputMesh->GetPoints()->Begin(); + + using GeneratorType = itk::Statistics::NormalVariateGenerator; + GeneratorType::Pointer generator = GeneratorType::New(); + generator->Initialize(this->m_Seed); + + while (it != outputMesh->GetPoints()->End()) + { + for (unsigned int d = 0; d < TOutputMesh::MeshTraits::PointDimension; ++d) + { + it.Value()[d] += (generator->GetVariate() * this->m_Sigma + this->m_Mean); + } + ++it; + } +} +} // end namespace itk + +#endif diff --git a/Modules/Filtering/MeshNoise/itk-module.cmake b/Modules/Filtering/MeshNoise/itk-module.cmake new file mode 100644 index 000000000000..970dcd92a904 --- /dev/null +++ b/Modules/Filtering/MeshNoise/itk-module.cmake @@ -0,0 +1,19 @@ +set( + DOCUMENTATION + "Apply additive noise (Gaussian, Poisson, etc.) to ITK mesh point coordinates. +Useful for testing mesh-based registration and surface-reconstruction pipelines +with controlled perturbation." +) + +itk_module( + MeshNoise + DEPENDS + ITKCommon + ITKMesh + ITKQuadEdgeMesh + ITKStatistics + TEST_DEPENDS + ITKTestKernel + EXCLUDE_FROM_DEFAULT + DESCRIPTION "${DOCUMENTATION}" +) diff --git a/Modules/Filtering/MeshNoise/test/CMakeLists.txt b/Modules/Filtering/MeshNoise/test/CMakeLists.txt new file mode 100644 index 000000000000..0edc054285f0 --- /dev/null +++ b/Modules/Filtering/MeshNoise/test/CMakeLists.txt @@ -0,0 +1,22 @@ +itk_module_test() + +set( + ${itk-module}Tests + itkAdditiveGaussianNoiseMeshFilterTest.cxx + itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest.cxx +) + +createtestdriver(${itk-module} "${${itk-module}-Test_LIBRARIES}" "${${itk-module}Tests}") + +itk_add_test( + NAME itkAdditiveGaussianNoiseMeshFilterTest + COMMAND + ${itk-module}TestDriver + itkAdditiveGaussianNoiseMeshFilterTest +) +itk_add_test( + NAME itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest + COMMAND + ${itk-module}TestDriver + itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest +) diff --git a/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseMeshFilterTest.cxx b/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseMeshFilterTest.cxx new file mode 100644 index 000000000000..17ea42600ce7 --- /dev/null +++ b/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseMeshFilterTest.cxx @@ -0,0 +1,73 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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. + * + *=========================================================================*/ +#include +#include +#include +#include "itkTestingMacros.h" + +int +itkAdditiveGaussianNoiseMeshFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +{ + + using TPixel = double; + constexpr unsigned int Dimension = 3; + + ////////////// + // Typedefs // + ////////////// + + using TMesh = itk::Mesh; + using TSphere = itk::RegularSphereMeshSource; + using TNoise = itk::AdditiveGaussianNoiseMeshFilter; + + //////////////// + // Parameters // + //////////////// + + constexpr int SPHERE_RESOLUTION = 5; + constexpr double SPHERE_SCALE = 10.0; + + constexpr int NOISE_SEED = 100; + const TMesh::CoordinateType NOISE_SIGMA = SPHERE_SCALE * 0.01; + constexpr TMesh::CoordinateType NOISE_MEAN = 1.0; + + /////////// + // Logic // + /////////// + + TSphere::Pointer sphere = TSphere::New(); + + sphere->SetResolution(SPHERE_RESOLUTION); + sphere->SetScale(TSphere::VectorType::Filled(static_cast(SPHERE_SCALE))); + + TNoise::Pointer noise = TNoise::New(); + + ITK_EXERCISE_BASIC_OBJECT_METHODS(noise, AdditiveGaussianNoiseMeshFilter, MeshToMeshFilter); + + noise->SetInput(sphere->GetOutput()); + noise->SetSeed(NOISE_SEED); + ITK_TEST_SET_GET_VALUE(NOISE_SEED, noise->GetSeed()); + noise->SetSigma(NOISE_SIGMA); + ITK_TEST_SET_GET_VALUE(NOISE_SIGMA, noise->GetSigma()); + noise->SetMean(NOISE_MEAN); + ITK_TEST_SET_GET_VALUE(NOISE_MEAN, noise->GetMean()); + + noise->Update(); + + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest.cxx b/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest.cxx new file mode 100644 index 000000000000..9622d094e83f --- /dev/null +++ b/Modules/Filtering/MeshNoise/test/itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest.cxx @@ -0,0 +1,73 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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 + * + * https://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. + * + *=========================================================================*/ +#include +#include +#include +#include "itkTestingMacros.h" + +int +itkAdditiveGaussianNoiseQuadEdgeMeshFilterTest(int itkNotUsed(argc), char * itkNotUsed(argv)[]) +{ + + using TPixel = double; + constexpr unsigned int Dimension = 3; + + ////////////// + // Typedefs // + ////////////// + + using TMesh = itk::QuadEdgeMesh; + using TSphere = itk::RegularSphereMeshSource; + using TNoise = itk::AdditiveGaussianNoiseQuadEdgeMeshFilter; + + //////////////// + // Parameters // + //////////////// + + constexpr int SPHERE_RESOLUTION = 5; + constexpr double SPHERE_SCALE = 10.0; + + constexpr int NOISE_SEED = 100; + const TMesh::CoordinateType NOISE_SIGMA = SPHERE_SCALE * 0.01; + constexpr TMesh::CoordinateType NOISE_MEAN = 1.0; + + /////////// + // Logic // + /////////// + + TSphere::Pointer sphere = TSphere::New(); + + sphere->SetResolution(SPHERE_RESOLUTION); + sphere->SetScale(TSphere::VectorType::Filled(static_cast(SPHERE_SCALE))); + + TNoise::Pointer noise = TNoise::New(); + + ITK_EXERCISE_BASIC_OBJECT_METHODS(noise, AdditiveGaussianNoiseQuadEdgeMeshFilter, QuadEdgeMeshToQuadEdgeMeshFilter); + + noise->SetInput(sphere->GetOutput()); + noise->SetSeed(NOISE_SEED); + ITK_TEST_SET_GET_VALUE(NOISE_SEED, noise->GetSeed()); + noise->SetSigma(NOISE_SIGMA); + ITK_TEST_SET_GET_VALUE(NOISE_SIGMA, noise->GetSigma()); + noise->SetMean(NOISE_MEAN); + ITK_TEST_SET_GET_VALUE(NOISE_MEAN, noise->GetMean()); + + noise->Update(); + + return EXIT_SUCCESS; +} diff --git a/Modules/Filtering/MeshNoise/wrapping/CMakeLists.txt b/Modules/Filtering/MeshNoise/wrapping/CMakeLists.txt new file mode 100644 index 000000000000..b4fdc8685bb6 --- /dev/null +++ b/Modules/Filtering/MeshNoise/wrapping/CMakeLists.txt @@ -0,0 +1,10 @@ +itk_wrap_module(MeshNoise) + +set( + WRAPPER_SUBMODULE_ORDER + itkAdditiveGaussianNoiseMeshFilter + itkAdditiveGaussianNoiseQuadEdgeMeshFilter +) + +itk_auto_load_submodules() +itk_end_wrap_module() diff --git a/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseMeshFilter.wrap b/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseMeshFilter.wrap new file mode 100644 index 000000000000..33bcf7a2b58e --- /dev/null +++ b/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseMeshFilter.wrap @@ -0,0 +1,33 @@ +itk_wrap_include("itkMesh.h") +itk_wrap_include("itkDefaultStaticMeshTraits.h") +itk_wrap_include("itkDefaultDynamicMeshTraits.h") + +itk_wrap_class("itk::AdditiveGaussianNoiseMeshFilter" POINTER_WITH_2_SUPERCLASSES) + foreach(d ${ITK_WRAP_IMAGE_DIMS}) + foreach(t ${WRAP_ITK_REAL}) + itk_wrap_template("M${ITKM_${t}}${d}M${ITKM_${t}}${d}" + "itk::Mesh<${ITKT_${t}},${d}>, itk::Mesh<${ITKT_${t}},${d}>") + itk_wrap_template("M${ITKM_${t}}${d}DT${ITKM_${t}}${d}M${ITKM_${t}}${d}DT${ITKM_${t}}${d}" + "itk::Mesh<${ITKT_${t}},${d},itk::DefaultDynamicMeshTraits<${ITKT_${t}},${d}>>, itk::Mesh<${ITKT_${t}},${d},itk::DefaultDynamicMeshTraits<${ITKT_${t}},${d}>>") + endforeach() + endforeach() +itk_end_wrap_class() + + +itk_wrap_class("itk::Mesh" POINTER) + foreach(d ${ITK_WRAP_IMAGE_DIMS}) + foreach(t ${WRAP_ITK_REAL}) + itk_wrap_template("${ITKM_${t}}${d}DT${ITKM_${t}}${d}" + "${ITKT_${t}},${d},itk::DefaultDynamicMeshTraits<${ITKT_${t}},${d}>") + endforeach() + endforeach() +itk_end_wrap_class() + +itk_wrap_class("itk::PointSet" POINTER) + foreach(d ${ITK_WRAP_IMAGE_DIMS}) + foreach(t ${WRAP_ITK_REAL}) + itk_wrap_template("${ITKM_${t}}${d}DT${ITKM_${t}}${d}" + "${ITKT_${t}},${d},itk::DefaultDynamicMeshTraits<${ITKT_${t}},${d}>") + endforeach() + endforeach() +itk_end_wrap_class() diff --git a/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.wrap b/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.wrap new file mode 100644 index 000000000000..d429799f8d94 --- /dev/null +++ b/Modules/Filtering/MeshNoise/wrapping/itkAdditiveGaussianNoiseQuadEdgeMeshFilter.wrap @@ -0,0 +1,7 @@ +itk_wrap_include("itkQuadEdgeMesh.h") + +itk_wrap_class("itk::AdditiveGaussianNoiseQuadEdgeMeshFilter" POINTER) + foreach(d ${ITK_WRAP_IMAGE_DIMS}) + itk_wrap_template("QEM${ITKM_D}${d}QEM${ITKM_D}${d}" "itk::QuadEdgeMesh< ${ITKT_D},${d} >, itk::QuadEdgeMesh< ${ITKT_D},${d} >") + endforeach() +itk_end_wrap_class() diff --git a/Modules/Remote/MeshNoise.remote.cmake b/Modules/Remote/MeshNoise.remote.cmake deleted file mode 100644 index d9c2c2c6913a..000000000000 --- a/Modules/Remote/MeshNoise.remote.cmake +++ /dev/null @@ -1,55 +0,0 @@ -#-- # Grading Level Criteria Report -#-- EVALUATION DATE: 2020-03-01 -#-- EVALUATORS: [<>,<>] -#-- -#-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules) -#-- - [ ] Widespread community dependance -#-- - [ ] Above 90% code coverage -#-- - [ ] CI dashboards and testing monitored rigorously -#-- - [ ] Key API features are exposed in wrapping interface -#-- - [ ] All requirements of Levels 4,3,2,1 -#-- -#-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance) -#-- - [ ] Meets all ITK code style standards -#-- - [ ] No external requirements beyond those needed by ITK proper -#-- - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release -#-- - [ ] Windows Shared Library Build with Visual Studio -#-- - [ ] Mac with clang compiller -#-- - [ ] Linux with gcc compiler -#-- - [ ] Active developer community dedicated to maintaining code-base -#-- - [ ] 75% code coverage demonstrated for testing suite -#-- - [ ] Continuous integration testing performed -#-- - [ ] All requirements of Levels 3,2,1 -#-- -#-- ## Compliance Level 3 star (Quality beta code) -#-- - [ ] API | executable interface is considered mostly stable and feature complete -#-- - [ ] 10% C0-code coverage demonstrated for testing suite -#-- - [ ] Some tests exist and pass on at least some platform -#-- - [X] All requirements of Levels 2,1 -#-- -#-- ## Compliance Level 2 star (Alpha code feature API development or niche community/execution environment dependance ) -#-- - [X] Compiles for at least 1 niche set of execution envirionments, and perhaps others -#-- (may depend on specific external tools like a java environment, or specific external libraries to work ) -#-- - [X] All requirements of Levels 1 -#-- -#-- ## Compliance Level 1 star (Pre-alpha features under development and code of unknown quality) -#-- - [X] Code complies on at least 1 platform -#-- -#-- ## Compliance Level 0 star ( Code/Feature of known poor-quality or deprecated status ) -#-- - [ ] Code reviewed and explicitly identified as not recommended for use -#-- -#-- ### Please document here any justification for the criteria above -# Code style enforced by clang-format on 2020-02-19, and clang-tidy modernizations completed - -# Contact: Davis Marc Vigneault -itk_fetch_module( - MeshNoise - "Perturb itk::Mesh and itk::QuadEdgeMesh coordinates with Gaussian noise. - Please see the following Insight Journal article for an introduction to this module: - Vigneault, DM. Perturbing Mesh Vertices with Additive Gaussian Noise. - https://doi.org/10.54294/evr01z - " - MODULE_COMPLIANCE_LEVEL 2 - GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKMeshNoise.git - GIT_TAG 1fc67753923c315d2503ca340834b78fac9370a9 - ) diff --git a/pyproject.toml b/pyproject.toml index 75c5d8149738..0192403899be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,6 +55,7 @@ cmd = '''cmake -DModule_AnisotropicDiffusionLBR:BOOL=ON -DModule_Montage:BOOL=ON -DModule_GenericLabelInterpolator:BOOL=ON + -DModule_MeshNoise:BOOL=ON -DModule_MGHIO:BOOL=ON -DITK_COMPUTER_MEMORY_SIZE:STRING=11 -DModule_StructuralSimilarity:BOOL=ON'''