1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================*/
18 #ifndef clitkDecomposeAndReconstructImageFilter_txx
19 #define clitkDecomposeAndReconstructImageFilter_txx
21 /* =================================================
22 * @file clitkDecomposeAndReconstructImageFilter.txx
28 ===================================================*/
34 //-------------------------------------------------------------------
35 // Update with the number of dimensions
36 //-------------------------------------------------------------------
37 template<class InputImageType, class OutputImageType>
38 DecomposeAndReconstructImageFilter<InputImageType, OutputImageType>::DecomposeAndReconstructImageFilter()
41 for (unsigned int i=0; i<InputImageDimension; i++)
43 m_NumberOfNewLabels=1;
44 m_FullyConnected=true;
47 m_MaximumNumberOfLabels=10;
48 m_MinimumObjectSize=10;
49 m_MinimumNumberOfIterations=1;
54 //-------------------------------------------------------------------
55 // Update with the number of dimensions and the pixeltype
56 //-------------------------------------------------------------------
57 template <class InputImageType, class OutputImageType>
59 DecomposeAndReconstructImageFilter<InputImageType, OutputImageType>::GenerateData()
64 typedef itk::Image<InternalPixelType, InputImageDimension> InternalImageType;
67 typedef clitk::DecomposeThroughErosionImageFilter<InputImageType, InternalImageType> DecomposeThroughErosionImageFilterType;
68 typedef clitk::ReconstructThroughDilationImageFilter<InternalImageType, InputImageType> ReconstructThroughDilationImageFilterType;
71 typename DecomposeThroughErosionImageFilterType::Pointer erosionFilter=DecomposeThroughErosionImageFilterType::New();
72 erosionFilter->SetInput(this->GetInput());
73 erosionFilter->SetVerbose(m_Verbose);
74 erosionFilter->SetFullyConnected(m_FullyConnected);
75 erosionFilter->SetRadius(m_Radius);
76 erosionFilter->SetNumberOfNewLabels(m_NumberOfNewLabels);
77 erosionFilter->SetMinimumObjectSize(m_MinimumObjectSize);
78 erosionFilter->SetMinimumNumberOfIterations(m_MinimumNumberOfIterations);
79 erosionFilter->Update();
82 typename ReconstructThroughDilationImageFilterType::Pointer reconstructionFilter =ReconstructThroughDilationImageFilterType::New();
83 reconstructionFilter->SetInput(erosionFilter->GetOutput());
84 reconstructionFilter->SetVerbose(m_Verbose);
85 reconstructionFilter->SetRadius(m_Radius);
86 reconstructionFilter->SetMaximumNumberOfLabels(m_MaximumNumberOfLabels);
87 reconstructionFilter->SetBackgroundValue(m_BackgroundValue);
88 reconstructionFilter->SetForegroundValue(m_ForegroundValue);
89 reconstructionFilter->Update();
92 this->SetNthOutput(0,reconstructionFilter->GetOutput());
98 #endif //#define clitkDecomposeAndReconstructImageFilter_txx