From: dsarrut Date: Mon, 2 May 2011 09:16:49 +0000 (+0200) Subject: delete duplicate file X-Git-Tag: v1.2.0^2~3 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=4b6d68eb5dc8055d11f1354f5059cdf2dace1464;p=clitk.git delete duplicate file --- diff --git a/segmentation/clitkReconstructThroughDilationImageFilter.txx b/segmentation/clitkReconstructThroughDilationImageFilter.txx deleted file mode 100644 index 613f10b..0000000 --- a/segmentation/clitkReconstructThroughDilationImageFilter.txx +++ /dev/null @@ -1,173 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef clitkReconstructThroughDilationImageFilter_txx -#define clitkReconstructThroughDilationImageFilter_txx - -namespace clitk -{ - - //------------------------------------------------------------------- - // Update with the number of dimensions - //------------------------------------------------------------------- - template - ReconstructThroughDilationImageFilter::ReconstructThroughDilationImageFilter() - { - m_Verbose=false; - m_BackgroundValue=0; - m_ForegroundValue=1; - m_ErosionPaddingValue=static_cast(-1); - for (unsigned int i=0; i - void - ReconstructThroughDilationImageFilter::GenerateData() - { - - //--------------------------------- - // Typedefs - //--------------------------------- - - // Internal type - typedef itk::Image InternalImageType; - - // Filters used - typedef itk::CastImageFilter InputCastImageFilterType; - typedef itk::ThresholdImageFilter InputThresholdImageFilterType; - typedef itk::StatisticsImageFilter StatisticsImageFilterType; - typedef itk::BinaryBallStructuringElement KernelType; - typedef clitk::ConditionalBinaryDilateImageFilter ConditionalBinaryDilateImageFilterType; - typedef itk::DifferenceImageFilter DifferenceImageFilterType; - typedef itk::CastImageFilter OutputCastImageFilterType; - typedef clitk::SetBackgroundImageFilter SetBackgroundImageFilterType; - - //--------------------------------- - // Cast - //--------------------------------- - typename InputCastImageFilterType::Pointer castImageFilter=InputCastImageFilterType::New(); - castImageFilter->SetInput(this->GetInput()); - castImageFilter->Update(); - - //--------------------------------- - // Threshold - //--------------------------------- - typename InputThresholdImageFilterType::Pointer thresholdImageFilter=InputThresholdImageFilterType::New(); - thresholdImageFilter->SetInput(castImageFilter->GetOutput()); - thresholdImageFilter->ThresholdAbove(m_MaximumNumberOfLabels); - thresholdImageFilter->SetOutsideValue(m_ForegroundValue); - if(m_Verbose) std::cout<<"Thresholding the input to "<Update(); - - //--------------------------------- - // Set -1 to padding value - //--------------------------------- - typename SetBackgroundImageFilterType::Pointer setBackgroundFilter =SetBackgroundImageFilterType::New(); - setBackgroundFilter->SetInput(thresholdImageFilter->GetOutput()); - setBackgroundFilter->SetInput2(castImageFilter->GetOutput()); - setBackgroundFilter->SetMaskValue(m_ErosionPaddingValue); - setBackgroundFilter->SetOutsideValue(-1); - if(m_Verbose) std::cout<<"Setting the eroded region from "<SetInput(setBackgroundFilter->GetOutput()); - if(m_Verbose) std::cout<<"Counting the initial labels..."<Update(); - unsigned int initialNumberOfLabels= inputStatisticsImageFilter->GetMaximum(); - if(m_Verbose) std::cout<<"The input contained "<::AccumulateType difference=1; - typename InternalImageType::Pointer labelImage=inputStatisticsImageFilter->GetOutput(); - typename InternalImageType::Pointer oldLabelImage=inputStatisticsImageFilter->GetOutput(); - - // element - KernelType structuringElement; - structuringElement.SetRadius(m_Radius); - structuringElement.CreateStructuringElement(); - - while( difference) - { - // Dilate all labels once - for ( int label=0; label<(int)numberOfConsideredLabels+1;label++) - if ( m_BackgroundValue != label) - { - typename ConditionalBinaryDilateImageFilterType::Pointer dilateFilter=ConditionalBinaryDilateImageFilterType::New(); - dilateFilter->SetBoundaryToForeground(false); - dilateFilter->SetKernel(structuringElement); - dilateFilter->SetBackgroundValue (-1); - dilateFilter->SetInput (labelImage); - dilateFilter->SetForegroundValue (label); - if(m_Verbose) std::cout<<"Dilating the label "<Update(); - labelImage=dilateFilter->GetOutput(); - } - - // Difference with previous labelImage - typename DifferenceImageFilterType::Pointer differenceFilter=DifferenceImageFilterType::New(); - differenceFilter->SetValidInput(oldLabelImage); - differenceFilter->SetTestInput(labelImage); - differenceFilter->Update(); - difference =differenceFilter->GetTotalDifference(); - if(m_Verbose) std::cout<<"The change in this iteration was "<SetInput(labelImage); - setBackgroundFilter2->SetInput2(labelImage); - setBackgroundFilter2->SetMaskValue(-1); - setBackgroundFilter2->SetOutsideValue(m_ErosionPaddingValue); - if(m_Verbose) std::cout<<"Setting the eroded region to "<SetInput(setBackgroundFilter2->GetOutput()); - if(m_Verbose) std::cout<<"Casting the output..."<Update(); - - //--------------------------------- - // SetOutput - //--------------------------------- - this->SetNthOutput(0, outputCastImageFilter->GetOutput()); - - - } - - -}//end clitk - -#endif //#define clitkReconstructThroughDilationImageFilter_txx