X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=segmentation%2FclitkDecomposeAndReconstructImageFilter.txx;fp=segmentation%2FclitkDecomposeAndReconstructImageFilter.txx;h=6773be88df44a0e53146498708097bf59b840884;hb=2f5b335da5621bdfc86cb594cc667d0929f4d8e3;hp=0000000000000000000000000000000000000000;hpb=e61455caad373a138edde0716ce5a556f4d1a624;p=clitk.git diff --git a/segmentation/clitkDecomposeAndReconstructImageFilter.txx b/segmentation/clitkDecomposeAndReconstructImageFilter.txx new file mode 100755 index 0000000..6773be8 --- /dev/null +++ b/segmentation/clitkDecomposeAndReconstructImageFilter.txx @@ -0,0 +1,98 @@ +/*========================================================================= + 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 clitkDecomposeAndReconstructImageFilter_txx +#define clitkDecomposeAndReconstructImageFilter_txx + +/* ================================================= + * @file clitkDecomposeAndReconstructImageFilter.txx + * @author + * @date + * + * @brief + * + ===================================================*/ + + +namespace clitk +{ + + //------------------------------------------------------------------- + // Update with the number of dimensions + //------------------------------------------------------------------- + template + DecomposeAndReconstructImageFilter::DecomposeAndReconstructImageFilter() + { + m_Verbose=false; + for (unsigned int i=0; i + void + DecomposeAndReconstructImageFilter::GenerateData() + { + + + // Internal type + typedef itk::Image InternalImageType; + + // Filters used + typedef clitk::DecomposeThroughErosionImageFilter DecomposeThroughErosionImageFilterType; + typedef clitk::ReconstructThroughDilationImageFilter ReconstructThroughDilationImageFilterType; + + // Erode + typename DecomposeThroughErosionImageFilterType::Pointer erosionFilter=DecomposeThroughErosionImageFilterType::New(); + erosionFilter->SetInput(this->GetInput()); + erosionFilter->SetVerbose(m_Verbose); + erosionFilter->SetFullyConnected(m_FullyConnected); + erosionFilter->SetRadius(m_Radius); + erosionFilter->SetNumberOfNewLabels(m_NumberOfNewLabels); + erosionFilter->SetMinimumObjectSize(m_MinimumObjectSize); + erosionFilter->SetMinimumNumberOfIterations(m_MinimumNumberOfIterations); + erosionFilter->Update(); + + // Reconstruct + typename ReconstructThroughDilationImageFilterType::Pointer reconstructionFilter =ReconstructThroughDilationImageFilterType::New(); + reconstructionFilter->SetInput(erosionFilter->GetOutput()); + reconstructionFilter->SetVerbose(m_Verbose); + reconstructionFilter->SetRadius(m_Radius); + reconstructionFilter->SetMaximumNumberOfLabels(m_MaximumNumberOfLabels); + reconstructionFilter->SetBackgroundValue(m_BackgroundValue); + reconstructionFilter->SetForegroundValue(m_ForegroundValue); + reconstructionFilter->Update(); + + // Output + this->SetNthOutput(0,reconstructionFilter->GetOutput()); + } + + +}//end clitk + +#endif //#define clitkDecomposeAndReconstructImageFilter_txx