X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FMacheteImageFilter.hxx;fp=lib%2FcpExtensions%2FAlgorithms%2FMacheteImageFilter.hxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=a984df17784e2548021efbb44c7047ba6689e3d0;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/MacheteImageFilter.hxx b/lib/cpExtensions/Algorithms/MacheteImageFilter.hxx deleted file mode 100644 index a984df1..0000000 --- a/lib/cpExtensions/Algorithms/MacheteImageFilter.hxx +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__HXX__ -#define __CPEXTENSIONS__ALGORITHMS__MACHETEIMAGEFILTER__HXX__ - -#include - -//filter stuff -#include "itkObjectFactory.h" -#include "itkImageRegionIterator.h" -#include "itkImageRegionConstIterator.h" - -//typedef itk::Image ImageType; - -template< class I, class O> -void cpExtensions::Algorithms::MacheteImageFilter< I, O> -::GenerateData() -{ - //const typename Superclass::OutputImageRegionType& region; - - typename I::ConstPointer input = this->GetInput(); - - typename O::Pointer output = this->GetOutput(); - output->SetRegions(input->GetLargestPossibleRegion()); - output->Allocate(); - - itk::ImageRegionIterator outputIterator(output, output->GetLargestPossibleRegion()); - itk::ImageRegionConstIterator inputIterator(input, input->GetLargestPossibleRegion()); - - while (!outputIterator.IsAtEnd()) - { - auto p0 = inputIterator.GetIndex(); - itk::Point otherPoint; - otherPoint[0] = p0[0]; - otherPoint[1] = p0[1]; - otherPoint[2] = p0[2]; - //otherPoint[2] = this->point[2]; // TODO : Solve this hammer - - double dist = this->point.EuclideanDistanceTo(otherPoint); - if (dist <= this->m_Radius) - { - outputIterator.Set(0); - } - else - { - outputIterator.Set(inputIterator.Get()); - } - - ++inputIterator; - ++outputIterator; - } - - -} - -template< class I, class O> -void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusType & rad) -{ - if (this->m_Radius != rad) - { - this->m_Radius = rad; - this->Modified(); - } -} - -//template< class I, class O> -//void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusValueType & rad) -//{ -// RadiusType r; -// r.Fill(rad); -// this->SetRadius(r); -//} - -template< class I, class O> -void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(itk::Point & p){ - if (point != p) - { - this->point = p; - this->Modified(); - } -} - -template< class I, class O> -void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(const double & x, const double & y, const double & z) -{ - this->point[0] = x; - this->point[1] = y; - this->point[2] = z; - this->Modified(); -} - - - -#endif \ No newline at end of file