X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FAlgorithms%2FGaussianDensityImageFilter.h;fp=lib%2FcpExtensions%2FAlgorithms%2FGaussianDensityImageFilter.h;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=308b3c5c084f8ccbb2ab232bf21c4828d5b6d490;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/lib/cpExtensions/Algorithms/GaussianDensityImageFilter.h b/lib/cpExtensions/Algorithms/GaussianDensityImageFilter.h deleted file mode 100644 index 308b3c5..0000000 --- a/lib/cpExtensions/Algorithms/GaussianDensityImageFilter.h +++ /dev/null @@ -1,103 +0,0 @@ -// ------------------------------------------------------------------------- -// @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co) -// ------------------------------------------------------------------------- - -#ifndef __CPEXTENSIONS__ALGORITHMS__GAUSSIANDENSITYIMAGEFILTER__H__ -#define __CPEXTENSIONS__ALGORITHMS__GAUSSIANDENSITYIMAGEFILTER__H__ - -#include -#include -#include -#include - -namespace cpExtensions -{ - namespace Algorithms - { - /** - */ - template< class _TInputImage, class _TEstimator > - class GaussianDensityImageFilter - : public itk::ImageToImageFilter< _TInputImage, itk::Image< typename _TEstimator::TScalar, _TInputImage::ImageDimension > > - { - public: - typedef typename _TEstimator::TScalar TScalar; - typedef itk::Image< TScalar, _TInputImage::ImageDimension > TOutputImage; - typedef GaussianDensityImageFilter Self; - typedef itk::ImageToImageFilter< _TInputImage, TOutputImage > Superclass; - typedef itk::SmartPointer< Self > Pointer; - typedef itk::SmartPointer< const Self > ConstPointer; - - typedef _TInputImage TInputImage; - typedef _TEstimator TEstimator; - typedef typename TOutputImage::RegionType TRegion; - - public: - itkNewMacro( Self ); - itkTypeMacro( GaussianDensityImageFilter, itkImageToImageFilter ); - - itkGetConstObjectMacro( Estimator, TEstimator ); - itkSetConstObjectMacro( Estimator, TEstimator ); - - protected: - GaussianDensityImageFilter( ) - : Superclass( ) - { - } - virtual ~GaussianDensityImageFilter( ) - { - } - - virtual void ThreadedGenerateData( - const TRegion& region, - itk::ThreadIdType threadId - ) - { - const typename TRegion::SizeType& regionSize = region.GetSize( ); - if( regionSize[ 0 ] == 0 ) - return; - const TInputImage* in = this->GetInput( ); - TOutputImage* out = this->GetOutput( 0 ); - - const size_t nLines = region.GetNumberOfPixels( ) / regionSize[ 0 ]; - itk::ProgressReporter progress( this, threadId, nLines ); - - // Define the iterators - itk::ImageScanlineConstIterator< TInputImage > inIt( in, region ); - itk::ImageScanlineIterator< TOutputImage > outIt( out, region ); - - inIt.GoToBegin( ); - outIt.GoToBegin( ); - while( !inIt.IsAtEnd( ) ) - { - while( !inIt.IsAtEndOfLine( ) ) - { - if( this->m_Estimator.IsNotNull( ) ) - outIt.Set( this->m_Estimator->Density( inIt.Get( ) ) ); - ++inIt; - ++outIt; - - } // elihw - inIt.NextLine( ); - outIt.NextLine( ); - progress.CompletedPixel( ); - - } // elihw - } - - private: - // Purposely not implemented. - GaussianDensityImageFilter( const Self& ); - void operator=( const Self& ); - - protected: - typename TEstimator::ConstPointer m_Estimator; - }; - - } // ecapseman - -} // ecapseman - -#endif // __CPEXTENSIONS__ALGORITHMS__GAUSSIANDENSITYIMAGEFILTER__H__ - -// eof - $RCSfile$