From 87d15007a2f4691d186fb5cf1e1392e2a09ac451 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Wed, 29 Apr 2026 09:11:25 -0500 Subject: [PATCH] ENH: Migrate FastBilateral content to ITK main; archive this repo The FastBilateral module has been ingested into ITK main via InsightSoftwareConsortium/ITK#6159 (merge commit 2722d525d7). Remove the now-duplicated content from this repo's tree tip and add MIGRATION_README.md pointing future visitors at the authoritative in-tree location. Pre-ingest git history is preserved for blame and archaeology; this repo will be marked ARCHIVED in GitHub Settings after merge. --- CMakeLists.txt | 13 - CTestConfig.cmake | 7 - MIGRATION_README.md | 20 ++ include/itkFastBilateralImageFilter.h | 197 ----------- include/itkFastBilateralImageFilter.hxx | 311 ------------------ itk-module.cmake | 27 -- ...astBilateralImageFilterTest2Output.png.cid | 1 - ...astBilateralImageFilterTest3Output.png.cid | 1 - ...FastBilateralImageFilterTestOutput.mha.cid | 1 - test/CMakeLists.txt | 38 --- test/Input/cake_easy.png | Bin 8363 -> 0 bytes test/Input/cake_easy.png.cid | 1 - test/itkFastBilateralImageFilterTest.cxx | 100 ------ test/itkFastBilateralImageFilterTest2.cxx | 93 ------ test/itkFastBilateralImageFilterTest3.cxx | 92 ------ wrapping/CMakeLists.txt | 3 - wrapping/itkFastBilateralImageFilter.wrap | 4 - wrapping/test/CMakeLists.txt | 2 - 18 files changed, 20 insertions(+), 891 deletions(-) delete mode 100644 CMakeLists.txt delete mode 100644 CTestConfig.cmake create mode 100644 MIGRATION_README.md delete mode 100644 include/itkFastBilateralImageFilter.h delete mode 100644 include/itkFastBilateralImageFilter.hxx delete mode 100644 itk-module.cmake delete mode 100644 test/Baseline/itkFastBilateralImageFilterTest2Output.png.cid delete mode 100644 test/Baseline/itkFastBilateralImageFilterTest3Output.png.cid delete mode 100644 test/Baseline/itkFastBilateralImageFilterTestOutput.mha.cid delete mode 100644 test/CMakeLists.txt delete mode 100755 test/Input/cake_easy.png delete mode 100644 test/Input/cake_easy.png.cid delete mode 100644 test/itkFastBilateralImageFilterTest.cxx delete mode 100755 test/itkFastBilateralImageFilterTest2.cxx delete mode 100755 test/itkFastBilateralImageFilterTest3.cxx delete mode 100644 wrapping/CMakeLists.txt delete mode 100644 wrapping/itkFastBilateralImageFilter.wrap delete mode 100644 wrapping/test/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 5f6c506..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 3.16.3) -project(FastBilateral) - -# set(FastBilateral_LIBRARIES FastBilateral) - -if(NOT ITK_SOURCE_DIR) - find_package(ITK REQUIRED) - list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) - include(ITKModuleExternal) -else() - set(ITK_DIR ${CMAKE_BINARY_DIR}) - itk_module_impl() -endif() diff --git a/CTestConfig.cmake b/CTestConfig.cmake deleted file mode 100644 index 62f68ac..0000000 --- a/CTestConfig.cmake +++ /dev/null @@ -1,7 +0,0 @@ -set(CTEST_PROJECT_NAME "ITK") -set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") - -set(CTEST_DROP_METHOD "http") -set(CTEST_DROP_SITE "open.cdash.org") -set(CTEST_DROP_LOCATION "/submit.php?project=Insight") -set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/MIGRATION_README.md b/MIGRATION_README.md new file mode 100644 index 0000000..90ca4e6 --- /dev/null +++ b/MIGRATION_README.md @@ -0,0 +1,20 @@ +# Migrated to ITK main + +As of 2026-04-29, the `FastBilateral` module has been ingested into +the main ITK source tree. The authoritative location is: + + https://github.com/InsightSoftwareConsortium/ITK/tree/main/Modules/Filtering/FastBilateral + +See `Modules/Filtering/FastBilateral/README.md` (or any in-tree +documentation under that path) for details on what moved and what +remains in this archived repo. + +This repository is retained read-only for historical reference (deep +git history, paper material, example assets not migrated to ITK). It +will be marked ARCHIVED after this PR merges. + +Related: +- ITK ingest PR: InsightSoftwareConsortium/ITK#6159 +- ITK ingest merge commit: InsightSoftwareConsortium/ITK@2722d525d7 +- Tracking issue: InsightSoftwareConsortium/ITK#6160 +- Original integration attempt: InsightSoftwareConsortium/ITK#5134 (superseded) diff --git a/include/itkFastBilateralImageFilter.h b/include/itkFastBilateralImageFilter.h deleted file mode 100644 index b23e898..0000000 --- a/include/itkFastBilateralImageFilter.h +++ /dev/null @@ -1,197 +0,0 @@ -/*========================================================================= - * - * 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 itkFastBilateralImageFilter_h -#define itkFastBilateralImageFilter_h - -#include "itkImageToImageFilter.h" -#include "itkImage.h" -#include "itkDiscreteGaussianImageFilter.h" -#include "itkImageRegionIterator.h" -#include "itkImageRegionConstIteratorWithIndex.h" -#include "itkLinearInterpolateImageFunction.h" - -namespace itk -{ -/** - * \class FastBilateralImageFilter - * \brief A fast approximation to the bilateral filter - * \ingroup FastBilateral - * - * This filter is a fast approximation to the bilateral filter. - * Blurring is performed on an image based on the distance of pixels in - * both space and intensity. - * - * The algorithm used was originally proposed by Paris and - * Durand [1]. - * - * Instead of calculating a kernel for every pixel in - * an image, this filter places the values of each pixel into a higher - * dimensional image determined by the position and intensity of a pixel. - * How many bins are used is determined by the sigma values provided - * to the filter. Larger sigmas will result in more aggresive downsampling - * and less running time overall. After the data of an image - * has been organized into bins, a DiscreteGaussianImageFilter is applied. - * Finally, the output image is constructed by interpolating the - * values of the output pixels from the blurred higher - * dimensional image. - * - * [1] Sylvain Paris and Frédo Durand, - * A Fast Approximation of the Bilateral Filter using a Signal Processing - * Approach, - * European Conference on Computer Vision (ECCV'06) - * - * \sa BilateralImageFilter - * \sa GaussianOperator - * \sa AnisotropicDiffusionImageFilter - * \sa Image - * \sa Neighborhood - * \sa NeighborhoodOperator - * - * \ingroup ImageEnhancement - * \ingroup ImageFeatureExtraction - * - * \todo Support for color images - * \todo Support for vector images - */ - -template -class ITK_EXPORT FastBilateralImageFilter : public ImageToImageFilter -{ -public: - ITK_DISALLOW_COPY_AND_MOVE(FastBilateralImageFilter); - - /** Standard class type aliases. */ - using Self = FastBilateralImageFilter; - using Superclass = ImageToImageFilter; - using Pointer = SmartPointer; - using ConstPointer = SmartPointer; - - /** Method for creation through the object factory. */ - itkNewMacro(Self); - - /** Run-time type information (and related methods). */ - itkOverrideGetNameOfClassMacro(FastBilateralImageFilter); - - /** Dimensionality of the input image. Dimensionality of the output image - * is assumed to be the same. */ - static constexpr unsigned int ImageDimension = TInputImage::ImageDimension; - - /** Input image type aliases. */ - using InputImageType = TInputImage; - using InputImagePointer = typename TInputImage::Pointer; - using InputImageConstPointer = typename TInputImage::ConstPointer; - using InputImageSpacingType = typename TInputImage::SpacingType; - using InputImageSizeType = typename TInputImage::SizeType; - using InputImageIndexType = typename TInputImage::IndexType; - - /** Input image iterator type. */ - using InputImageConstIteratorType = ImageRegionConstIteratorWithIndex; - - /** Output image type aliases. */ - using OutputImageType = TOutputImage; - using OutputImagePointer = typename TOutputImage::Pointer; - - /** Output image iterator type. */ - using OutputImageIteratorType = ImageRegionIterator; - - /** Pixel types. */ - using OutputPixelType = typename TOutputImage::PixelType; - using InputPixelType = typename TInputImage::PixelType; - - /** Typedef for an array of doubles that specifies the DomainSigma - * in each spacial dimension. */ - using DomainSigmaArrayType = FixedArray; - - /** Standard get/set macros for filter parameters. - * DomainSigma is specified in the same units as the Image spacing. - * RangeSigma is specified in the units of intensity. */ - itkGetConstMacro(DomainSigma, const DomainSigmaArrayType); - itkSetMacro(DomainSigma, DomainSigmaArrayType); - itkGetConstMacro(RangeSigma, double); - itkSetMacro(RangeSigma, double); - - /** Convenience set method for setting all domain standard deviations to the - * same value. */ - void - SetDomainSigma(const double v) - { - m_DomainSigma.Fill(v); - } - -protected: - /** Default Constructor. Default value for DomainSigma is 4. Default - * value for RangeSigma is 50. These values were chosen match those of the - * BilateralImageFilter */ - FastBilateralImageFilter() - { - m_DomainSigma.Fill(4.0); - m_RangeSigma = 50.0; - } - - virtual ~FastBilateralImageFilter() {} - - /* - * The FastBilateralImageFilter needs a larger input requested - * region than the size of the output requested region. Like - * the BilateralImageFilter, the FastBilateralImageFilter needs - * an amount of padding in each dimension based on the domain sigma. - */ - void - GenerateInputRequestedRegion() override; - - /** Standard pipline method */ - void - GenerateData() override; - - /** Method to print member variables to an output stream */ - void - PrintSelf(std::ostream & os, Indent indent) const override; - - /** The type of image to use as the higher dimensional grid. - * The blurring is performed on this image type. */ - using GridType = typename itk::Image; - - /** Grid types */ - using GridPixelType = typename GridType::PixelType; - using GridIndexType = typename GridType::IndexType; - using GridSizeType = typename GridType::SizeType; - using GridSizeValueType = typename Size::SizeValueType; - using GridRegionType = typename GridType::RegionType; - - /** Grid image iterator type. */ - using GridImageIteratorType = ImageRegionIterator; - using GridImageConstIteratorType = ImageRegionConstIterator; - - /** The type of blurring to use on the grid. */ - using BlurType = DiscreteGaussianImageFilter; - - /** The type of interpolation done to calculate output pixels. */ - using InterpolatorType = LinearInterpolateImageFunction; - using InterpolatedIndexType = typename InterpolatorType::ContinuousIndexType; - - double m_RangeSigma; - DomainSigmaArrayType m_DomainSigma; -}; - -} // namespace itk - -#ifndef ITK_MANUAL_INSTANTIATION -# include "itkFastBilateralImageFilter.hxx" -#endif - -#endif // itkFastBilateralImageFilter diff --git a/include/itkFastBilateralImageFilter.hxx b/include/itkFastBilateralImageFilter.hxx deleted file mode 100644 index c3adeb0..0000000 --- a/include/itkFastBilateralImageFilter.hxx +++ /dev/null @@ -1,311 +0,0 @@ -/*========================================================================= - * - * 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 itkFastBilateralImageFilter_hxx -#define itkFastBilateralImageFilter_hxx - -#include "itkMinimumMaximumImageCalculator.h" -#include "itkImageDuplicator.h" -#include - -namespace itk -{ - -template -void -FastBilateralImageFilter::GenerateInputRequestedRegion() -{ - // call the superclass' implementation of this method. this should - // copy the output requested region to the input requested region - Superclass::GenerateInputRequestedRegion(); - - // get pointers to the input and output - typename Superclass::InputImagePointer inputPtr = const_cast(this->GetInput()); - - if (!inputPtr) - { - return; - } - - // Pad the image by 2*sigma (pixel units) - // this is done to ensure that nearby pixels are still - // included in calculations - // When the filter does the downsampling pixels are placed into - // bins based on their position/sigma. Therefore, assuming - // that the input region includes a pixel that would be placed into a new bin - // on its own, that bin and the bin beside it would need to be populated. - // Each bin can contain at most ceil(sigma) pixels - InputImageSizeType radius; - for (size_t i = 0; i < ImageDimension; ++i) - { - radius[i] = 2 * std::ceil(m_DomainSigma[i] / (this->GetInput()->GetSpacing()[i])); - } - - // get a copy of the input requested region (should equal the output - // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); - - // pad the input requested region by the operator radius - inputRequestedRegion.PadByRadius(radius); - - // crop the input requested region at the input's largest possible region - if (inputRequestedRegion.Crop(inputPtr->GetLargestPossibleRegion())) - { - inputPtr->SetRequestedRegion(inputRequestedRegion); - return; - } - else - { - // Couldn't crop the region (requested region is outside the largest - // possible region). Throw an exception. - - // store what we tried to request (prior to trying to crop) - inputPtr->SetRequestedRegion(inputRequestedRegion); - - // build an exception - InvalidRequestedRegionError e(__FILE__, __LINE__); - e.SetLocation(ITK_LOCATION); - e.SetDescription("Requested region is outside the largest possible region."); - e.SetDataObject(inputPtr); - throw e; - } -} - -template -void -FastBilateralImageFilter::GenerateData() -{ - this->AllocateOutputs(); - InputImageConstPointer input = this->GetInput(); - OutputImagePointer output = this->GetOutput(); - - // Array to store domain sigmas, used during down-sampling and reconstruction - DomainSigmaArrayType domainSigmaInPixels; - - // Minimum intensity of the input image, - // used during down-sampling and reconstruction - InputPixelType intensityMin; - - // Define the GridType - // These are pointers to the source and destination of the blurring filter - // Data from the input will be sorted into the first two images while the - // second two images will provide the output data. - // The parameters are determined by the size of the input image and the - // values of m_DomainSigma and m_RangeSigma - typename GridType::Pointer gridImage = GridType::New(); - typename GridType::Pointer gridWeight; - typename GridType::Pointer gridImageOut; - typename GridType::Pointer gridWeightOut; - - // The amount of padding around the grid images, required so that - // interpolation is not done outside of the grid during reconstruction - int padding = 2; - - // Setup the higher dimensional grids (gridImage and gridWeight). - { - GridIndexType gridStartPos; - GridSizeType gridSize; - - // Convert domain sigmas from spacing units to pixel units - // for the blurring in the grid. - // The set method for m_DomainSigma uses spacing units to be - // consistent with the itkBilateralImageFilter implementation. - // When the data is placed into bins in the grid the - // itkDiscreteGaussianImageFilter will be run on the grid using - // imageSpacingOff. - InputImageSizeType inputSize = input->GetRequestedRegion().GetSize(); - // InputImageSizeType fullSize = input->GetLargestPossibleRegion().GetSize(); - - const InputImageSpacingType & spacing = input->GetSpacing(); - for (size_t i = 0; i < ImageDimension; ++i) - { - domainSigmaInPixels[i] = m_DomainSigma[i] / spacing[i]; - gridSize[i] = std::floor((inputSize[i] - 1) / domainSigmaInPixels[i]) + 1 + 2 * padding; - } - - // Determine min/max intensities to calculate grid size in the intensity axis - using MinMaxCalculatorType = MinimumMaximumImageCalculator; - typename MinMaxCalculatorType::Pointer calculator = MinMaxCalculatorType::New(); - - calculator->SetImage(input); - calculator->Compute(); - intensityMin = calculator->GetMinimum(); - InputPixelType intensityMax = calculator->GetMaximum(); - InputPixelType intensityDelta = static_cast(intensityMax - intensityMin); - gridSize[ImageDimension] = static_cast((intensityDelta / m_RangeSigma) + 1 + 2 * padding); - - for (size_t i = 0; i < ImageDimension + 1; ++i) - { - gridStartPos[i] = 0; - } - - GridRegionType region; - region.SetSize(gridSize); - region.SetIndex(gridStartPos); - gridImage->SetRegions(region); - } - - // Allocate the memory for pixel data - // We now have an empty grid. Two will be needed total, - // one will be a container for the down-sampled data and one - // will remember how many pixels were placed into each bin - gridImage->Allocate(); - // Init values of image to 0 - gridImage->FillBuffer(0.0); - - // Duplicate our grid image for the weight image - { - using DuplicatorType = ImageDuplicator; - typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); - duplicator->SetInputImage(gridImage); - duplicator->Update(); - gridWeight = duplicator->GetOutput(); - } - - // Sort the input image in gridImage and keep track of weights in gridWeight - { - InputImageConstIteratorType iterInputImage(input, input->GetRequestedRegion()); - GridIndexType gridIndices; - size_t i; - InputPixelType current; - InputPixelType intensityDelta; - InputImageIndexType index; - - // For every pixel in the input image, place it into a bin in the grid - // This is a scatter type operation and will be inefficient, as far as I - // know, there is no way to place the pixels into the grid using iterators - for (iterInputImage.GoToBegin(); !iterInputImage.IsAtEnd(); ++iterInputImage) - { - index = iterInputImage.GetIndex(); - current = iterInputImage.Get(); - // Determine the position in the grid to place the pixel - for (i = 0; i < ImageDimension; ++i) - { - gridIndices[i] = static_cast(index[i] / domainSigmaInPixels[i] + 0.5 + padding); - } - intensityDelta = current - intensityMin; - gridIndices[ImageDimension] = static_cast(intensityDelta / m_RangeSigma + 0.5 + padding); - - // Update the bin and the weight - (gridImage->GetPixel(gridIndices)) += current; - (gridWeight->GetPixel(gridIndices)) += 1.0; - } - } - - // Perform blurring on gridImage and gridWeight - // outputs are pointed to by gridImageOut and gridWeightOut - { - - // This variance approximately corresponds to a 1D filter of [1 2 1] which is - // used in Paris and Durands C++ implementation to blur their down-sampled - // data. With this variance a kernel width larger than 5 is not necessary. - double variance = 1.59577; - int maxWidth = 5; - - // Setup the Gaussian filter - typename BlurType::Pointer gridImageBlurFilter = BlurType::New(); - typename BlurType::Pointer gridWeightBlurFilter = BlurType::New(); - - gridImageBlurFilter->SetVariance(variance); - gridWeightBlurFilter->SetVariance(variance); - - gridImageBlurFilter->UseImageSpacingOff(); - gridWeightBlurFilter->UseImageSpacingOff(); - - gridImageBlurFilter->SetMaximumKernelWidth(maxWidth); - gridWeightBlurFilter->SetMaximumKernelWidth(maxWidth); - - gridImageBlurFilter->SetInput(gridImage); - gridWeightBlurFilter->SetInput(gridWeight); - - gridImageOut = gridImageBlurFilter->GetOutput(); - gridWeightOut = gridWeightBlurFilter->GetOutput(); - - gridImageBlurFilter->Update(); - gridWeightBlurFilter->Update(); - } - - // Early division; in Paris and Durand's implementation early division can - // be done on the grid image, or interpolation on both the bin and the - // weights can be done then the division. Interpolation is an expensive - // operation so I've opted for the early division approach. - { - GridImageIteratorType iterGridImage(gridImageOut, gridImageOut->GetLargestPossibleRegion()); - GridImageConstIteratorType iterGridWeight(gridWeightOut, gridWeightOut->GetLargestPossibleRegion()); - - GridPixelType weight; - - for (iterGridImage.GoToBegin(), iterGridWeight.GoToBegin(); !iterGridImage.IsAtEnd(); - ++iterGridImage, ++iterGridWeight) - { - if ((weight = iterGridWeight.Get()) != 0.0) - { - iterGridImage.Value() /= weight; - } - } - } - - // Perform interpolation in order to construct the output. - // For every pixel in the input image, determine where in the grid the pixel - // was placed and interpolate for the output pixel's value. - { - - OutputImageIteratorType iterOutputImage(output, output->GetRequestedRegion()); - InputImageConstIteratorType iterInputImage(input, output->GetRequestedRegion()); - - InterpolatedIndexType gridIndices; - size_t i; - InputPixelType current; - InputPixelType intensityDelta; - InputImageIndexType index; - typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); - interpolator->SetInputImage(gridImageOut); - - for (iterOutputImage.GoToBegin(), iterInputImage.GoToBegin(); !iterOutputImage.IsAtEnd(); - ++iterOutputImage, ++iterInputImage) - { - index = iterInputImage.GetIndex(); - current = iterInputImage.Get(); - // Determine the position in the grid to get the data from - for (i = 0; i < ImageDimension; ++i) - { - gridIndices[i] = index[i] / domainSigmaInPixels[i] + padding; - } - - intensityDelta = current - intensityMin; - - gridIndices[ImageDimension] = intensityDelta / m_RangeSigma + padding; - - iterOutputImage.Set(static_cast(interpolator->EvaluateAtContinuousIndex(gridIndices))); - } - } -} - -template -void -FastBilateralImageFilter::PrintSelf(std::ostream & os, Indent indent) const -{ - Superclass::PrintSelf(os, indent); - - os << indent << "DomainSigma: " << m_DomainSigma << std::endl; - os << indent << "RangeSigma: " << m_RangeSigma << std::endl; -} - -} // namespace itk - -#endif diff --git a/itk-module.cmake b/itk-module.cmake deleted file mode 100644 index 4250eb6..0000000 --- a/itk-module.cmake +++ /dev/null @@ -1,27 +0,0 @@ -# the top-level README is used for describing this module, just -# re-used it for documentation here -get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION) - -# itk_module() defines the module dependencies in FastBilateral -# FastBilateral depends on ITKCommon -# The testing module in FastBilateral depends on ITKTestKernel -# and ITKMetaIO(besides FastBilateral and ITKCore) -# By convention those modules outside of ITK are not prefixed with -# ITK. - -# define the dependencies of the include module and the tests -itk_module(FastBilateral - DEPENDS - ITKCommon - ITKSmoothing - COMPILE_DEPENDS - ITKImageSources - TEST_DEPENDS - ITKTestKernel - ITKMetaIO - DESCRIPTION - "${DOCUMENTATION}" - EXCLUDE_FROM_DEFAULT - ENABLE_SHARED -) diff --git a/test/Baseline/itkFastBilateralImageFilterTest2Output.png.cid b/test/Baseline/itkFastBilateralImageFilterTest2Output.png.cid deleted file mode 100644 index 4644bf7..0000000 --- a/test/Baseline/itkFastBilateralImageFilterTest2Output.png.cid +++ /dev/null @@ -1 +0,0 @@ -bafkreiadhbzhtn4fsqlgw4lscdcwzkqbrs5gntgirpbobrdbwv6hskaozy diff --git a/test/Baseline/itkFastBilateralImageFilterTest3Output.png.cid b/test/Baseline/itkFastBilateralImageFilterTest3Output.png.cid deleted file mode 100644 index ad6fbbd..0000000 --- a/test/Baseline/itkFastBilateralImageFilterTest3Output.png.cid +++ /dev/null @@ -1 +0,0 @@ -bafkreibryts52hwb7mtu5lab6lvf36omn5jlpk6hmedue2itn7f3s5zrvm diff --git a/test/Baseline/itkFastBilateralImageFilterTestOutput.mha.cid b/test/Baseline/itkFastBilateralImageFilterTestOutput.mha.cid deleted file mode 100644 index 5f6fabb..0000000 --- a/test/Baseline/itkFastBilateralImageFilterTestOutput.mha.cid +++ /dev/null @@ -1 +0,0 @@ -bafkreickuip2r2uejp3bzrizyvis7vs77edil3kkuh45rnye5tvfrjof6i diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt deleted file mode 100644 index f3043ca..0000000 --- a/test/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -itk_module_test() - -set(FastBilateralTests - itkFastBilateralImageFilterTest.cxx - itkFastBilateralImageFilterTest2.cxx - itkFastBilateralImageFilterTest3.cxx - ) - -CreateTestDriver(FastBilateral "${FastBilateral-Test_LIBRARIES}" "${FastBilateralTests}") - -itk_add_test(NAME itkFastBilateralImageFilterTest - COMMAND FastBilateralTestDriver - --compare - DATA{Baseline/itkFastBilateralImageFilterTestOutput.mha} - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTestOutput.mha - itkFastBilateralImageFilterTest - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTestOutput.mha - ) - -itk_add_test(NAME itkFastBilateralImageFilterTest2 - COMMAND FastBilateralTestDriver - --compare - DATA{Baseline/itkFastBilateralImageFilterTest2Output.png} - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTest2Output.png - itkFastBilateralImageFilterTest2 - DATA{Input/cake_easy.png} - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTest2Output.png - ) - -itk_add_test(NAME itkFastBilateralImageFilterTest3 - COMMAND FastBilateralTestDriver - --compare - DATA{Baseline/itkFastBilateralImageFilterTest3Output.png} - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTest3Output.png - itkFastBilateralImageFilterTest3 - DATA{Input/cake_easy.png} - ${ITK_TEST_OUTPUT_DIR}/itkFastBilateralImageFilterTest3Output.png - ) diff --git a/test/Input/cake_easy.png b/test/Input/cake_easy.png deleted file mode 100755 index 530a14c12c02cef3864870901d3f9a509323c461..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8363 zcmV;cAXMLpP)9Z4x@WrQIY20I+OQyi4J-Z& z>{#(LSh3a%2?Zv23i0&RW_tSid&^g4ne^T#=fD>v9Tn6a)vRW>@E$(o{CF$m#>7xx z6zvI>(WK0&*!l4Hzkck5jspA0=*u|icrU;DJ9RXtI`Q|Bi81Y64GFbN?bK4F(j%$& zcm37*=l2_xA$$i9t8Oh|Z|%xs)(MWH&{iPXeIw!L?BW&$z?dw( z0_#|nQ|CR!>%dmct*NH}B$rAu#T)Qify)<`Sxpw(s|3p0yS_!EpgnC7JkS*u4{8*} zC`O#^u8@34(*0LPN-qNWYg0O~?0$kcW|Fk4vqOyT>a1cJZ%K1{i!nlA$w({PcfBC2 zhv19KLRcJV8zqC|i%;r80j#*-<$5jActPQ89o^~pB<4u(UP^mAcW7vl=g3i^qr_U< z@lX)NZ5*XNB7_zZFsreT+Hk2M+9I?f_V~Wasa#?A9fC`+wAP6wDiC{+3=np@{Q&2gwIv%IB*p}409Q(pjhhXWKVd>ZU1EF_UBW1H^{zhtll=-rRESO&p;8AMXu zV~q}_mT-sUisy?vr{SUHeDn>AgX(&CZ`Sm}$j5|4q|6lx#Oc~6 zRz2HK`X&i&sOkds!rrDiI~|0PQ^9!Xi)*18Y_~>h3(dP|Q3lG1o+Si6fsKM6ITcs0 zgMdi(VXNWc`K!|R<#o)mM{n$*axNYq@J`!msQm564MxpTlQ*x^dDaOgXv1+GySy#6 z5Q9dTdXM!**Xi#QHL{rUps|BpZQJmTZuF!|axVRe+oH?oOBWN{P8Yu z#sMna!=I!=&T7=ouGlCb1k^}y@_XG)Igvb41B2hUV)GJTG@ED%A|ge%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6DVITJa%Q(|+oCAN>V8+3IcO~^kY`cF)W;f%ju_BrIcz<( z+h2^6CzLJ-X-77=I;Ww$IM&Rj$-dp1(&h$V|9_*DF>S;xnyml;002ovPDHLkV1oQ! BW|aT{ diff --git a/test/Input/cake_easy.png.cid b/test/Input/cake_easy.png.cid deleted file mode 100644 index e4277c4..0000000 --- a/test/Input/cake_easy.png.cid +++ /dev/null @@ -1 +0,0 @@ -bafkreigza53i5anoecoz4zufifwdpuoxc375zr5x5eussjdahzivtrzjfa diff --git a/test/itkFastBilateralImageFilterTest.cxx b/test/itkFastBilateralImageFilterTest.cxx deleted file mode 100644 index 7303fe6..0000000 --- a/test/itkFastBilateralImageFilterTest.cxx +++ /dev/null @@ -1,100 +0,0 @@ -/*========================================================================= - * - * 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 "itkFastBilateralImageFilter.h" - -#include "itkCommand.h" -#include "itkImageFileWriter.h" -#include "itkTestingMacros.h" - -namespace -{ -class ShowProgress : public itk::Command -{ -public: - itkNewMacro(ShowProgress); - - void - Execute(itk::Object * caller, const itk::EventObject & event) override - { - Execute((const itk::Object *)caller, event); - } - - void - Execute(const itk::Object * caller, const itk::EventObject & event) override - { - if (!itk::ProgressEvent().CheckEvent(&event)) - { - return; - } - const auto * processObject = dynamic_cast(caller); - if (!processObject) - { - return; - } - std::cout << " " << processObject->GetProgress(); - } -}; -} // namespace - -int -itkFastBilateralImageFilterTest(int argc, char * argv[]) -{ - if (argc < 2) - { - std::cerr << "Missing parameters." << std::endl; - std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv); - std::cerr << " outputImage"; - std::cerr << std::endl; - return EXIT_FAILURE; - } - const char * outputImageFileName = argv[1]; - - constexpr unsigned int Dimension = 2; - using PixelType = float; - using ImageType = itk::Image; - - using FilterType = itk::FastBilateralImageFilter; - FilterType::Pointer filter = FilterType::New(); - - ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, FastBilateralImageFilter, ImageToImageFilter); - - // Create input image to avoid test dependencies. - ImageType::SizeType size; - size.Fill(128); - ImageType::Pointer image = ImageType::New(); - image->SetRegions(size); - image->Allocate(); - image->FillBuffer(1.1f); - - ShowProgress::Pointer showProgress = ShowProgress::New(); - filter->AddObserver(itk::ProgressEvent(), showProgress); - filter->SetInput(image); - - using WriterType = itk::ImageFileWriter; - WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(outputImageFileName); - writer->SetInput(filter->GetOutput()); - writer->SetUseCompression(true); - - ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); - - - std::cout << "Test finished." << std::endl; - return EXIT_SUCCESS; -} diff --git a/test/itkFastBilateralImageFilterTest2.cxx b/test/itkFastBilateralImageFilterTest2.cxx deleted file mode 100755 index 5d4241c..0000000 --- a/test/itkFastBilateralImageFilterTest2.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/*========================================================================= - * - * 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 "itkFastBilateralImageFilter.h" -#include "itkImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkImageRegionIterator.h" -#include "itkTestingMacros.h" - -/** - * This test was originally taken from the tests for the itkBilateralImageFilter - * and modified for the itkFastBilateralImageFilter. - */ -int -itkFastBilateralImageFilterTest2(int ac, char * av[]) -{ - if (ac < 3) - { - std::cerr << "Usage: " << av[0] << " InputImage OutputImage\n"; - return EXIT_FAILURE; - } - - using PixelType = unsigned char; - const unsigned int dimension = 2; - using ImageType = itk::Image; - auto input = itk::ImageFileReader::New(); - input->SetFileName(av[1]); - - // Create a filter - using FilterType = itk::FastBilateralImageFilter; - - auto filter = FilterType::New(); - - filter->SetInput(input->GetOutput()); - - // these settings reduce the amount of noise by a factor of 10 - // when the original signal to noise level is 5 - filter->SetDomainSigma(4.0); - filter->SetRangeSigma(50.0); - - - // Test itkSetVectorMacro - double domainSigma[dimension]; - for (unsigned int i = 0; i < dimension; i++) - { - domainSigma[i] = 4.0; - } - filter->SetDomainSigma(domainSigma); - - // Test itkGetMacro - std::cout << "filter->GetDomainSigma(): " << filter->GetDomainSigma() << std::endl; - std::cout << "filter->GetRangeSigma(): " << filter->GetRangeSigma() << std::endl; - - try - { - input->Update(); - filter->Update(); - } - catch (itk::ExceptionObject & e) - { - std::cerr << "Exception detected: " << e.GetDescription(); - return -1; - } - catch (...) - { - std::cerr << "Some other exception occurred" << std::endl; - return -2; - } - - // Generate test image - itk::ImageFileWriter::Pointer writer; - writer = itk::ImageFileWriter::New(); - writer->SetInput(filter->GetOutput()); - writer->SetFileName(av[2]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/test/itkFastBilateralImageFilterTest3.cxx b/test/itkFastBilateralImageFilterTest3.cxx deleted file mode 100755 index fc1c48e..0000000 --- a/test/itkFastBilateralImageFilterTest3.cxx +++ /dev/null @@ -1,92 +0,0 @@ -/*========================================================================= - * - * 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 "itkFastBilateralImageFilter.h" -#include "itkImageFileReader.h" -#include "itkImageFileWriter.h" -#include "itkImageRegionIterator.h" -#include "itkTestingMacros.h" - - -/** - * This test was originally taken from the tests for the itkBilateralImageFilter - * and modified for the itkFastBilateralImageFilter. - */ -int -itkFastBilateralImageFilterTest3(int ac, char * av[]) -{ - if (ac < 3) - { - std::cerr << "Usage: " << av[0] << " InputImage BaselineImage\n"; - return -1; - } - - using PixelType = unsigned char; - using ImageType = itk::Image; - auto input = itk::ImageFileReader::New(); - input->SetFileName(av[1]); - - // Create a filter - using FilterType = itk::FastBilateralImageFilter; - - FilterType::Pointer filter1 = FilterType::New(); - filter1->SetInput(input->GetOutput()); - FilterType::Pointer filter2 = FilterType::New(); - filter2->SetInput(filter1->GetOutput()); - FilterType::Pointer filter3 = FilterType::New(); - filter3->SetInput(filter2->GetOutput()); - - // Instead of using a single agressive smoothing filter, use 3 - // less aggressive filters. - // - // These settings match the "wedding" cake image (cake_easy.png) where - // the signal to noise ratio is 5 (step heights near 100 units, - // noise sigma near 20 units). A single filter stage with these - // settings cuts the noise level in half. These three stages should - // reduce the amount of noise by a factor of 8. This is comparable to - // the noise reduction in using a single stage with parameters - // (4.0, 50.0). The difference is that with 3 less aggressive stages - // the edges are preserved better. - filter1->SetDomainSigma(4.0); - filter1->SetRangeSigma(20.0); - filter2->SetDomainSigma(4.0); - filter2->SetRangeSigma(20.0); - filter3->SetDomainSigma(4.0); - filter3->SetRangeSigma(20.0); - - try - { - input->Update(); - filter3->Update(); - } - catch (itk::ExceptionObject & e) - { - std::cerr << "Exception detected: " << e.GetDescription(); - return -1; - } - - // Generate test image - itk::ImageFileWriter::Pointer writer; - writer = itk::ImageFileWriter::New(); - writer->SetInput(filter3->GetOutput()); - writer->SetFileName(av[2]); - writer->Update(); - - return EXIT_SUCCESS; -} diff --git a/wrapping/CMakeLists.txt b/wrapping/CMakeLists.txt deleted file mode 100644 index 70f80e4..0000000 --- a/wrapping/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -itk_wrap_module(FastBilateral) -itk_auto_load_submodules() -itk_end_wrap_module() diff --git a/wrapping/itkFastBilateralImageFilter.wrap b/wrapping/itkFastBilateralImageFilter.wrap deleted file mode 100644 index 1e025dd..0000000 --- a/wrapping/itkFastBilateralImageFilter.wrap +++ /dev/null @@ -1,4 +0,0 @@ -itk_wrap_class("itk::FastBilateralImageFilter" POINTER) - itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2) -itk_end_wrap_class() - diff --git a/wrapping/test/CMakeLists.txt b/wrapping/test/CMakeLists.txt deleted file mode 100644 index 31cb055..0000000 --- a/wrapping/test/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -itk_python_expression_add_test(NAME itkFastBilateralImageFilterPythonTest - EXPRESSION "instance = itk.FastBilateralImageFilter.New()")