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://oncora1.lyon.fnclcc.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
24 //-------------------------------------------------------------------
25 // Update with the number of dimensions
26 //-------------------------------------------------------------------
27 template<class InputImageType, class OutputImageType>
28 DecomposeAndReconstructImageFilter<InputImageType, OutputImageType>::DecomposeAndReconstructImageFilter()
31 for (unsigned int i=0; i<InputImageDimension; i++)
33 m_NumberOfNewLabels=1;
34 m_FullyConnected=true;
37 m_MaximumNumberOfLabels=10;
38 m_MinimumObjectSize=10;
39 m_MinimumNumberOfIterations=1;
44 //-------------------------------------------------------------------
45 // Update with the number of dimensions and the pixeltype
46 //-------------------------------------------------------------------
47 template <class InputImageType, class OutputImageType>
49 DecomposeAndReconstructImageFilter<InputImageType, OutputImageType>::GenerateData()
54 typedef itk::Image<InternalPixelType, InputImageDimension> InternalImageType;
57 typedef clitk::DecomposeThroughErosionImageFilter<InputImageType, InternalImageType> DecomposeThroughErosionImageFilterType;
58 typedef clitk::ReconstructThroughDilationImageFilter<InternalImageType, InputImageType> ReconstructThroughDilationImageFilterType;
61 typename DecomposeThroughErosionImageFilterType::Pointer erosionFilter=DecomposeThroughErosionImageFilterType::New();
62 erosionFilter->SetInput(this->GetInput());
63 erosionFilter->SetVerbose(m_Verbose);
64 erosionFilter->SetFullyConnected(m_FullyConnected);
65 erosionFilter->SetRadius(m_Radius);
66 erosionFilter->SetNumberOfNewLabels(m_NumberOfNewLabels);
67 erosionFilter->SetMinimumObjectSize(m_MinimumObjectSize);
68 erosionFilter->SetMinimumNumberOfIterations(m_MinimumNumberOfIterations);
69 erosionFilter->Update();
72 typename ReconstructThroughDilationImageFilterType::Pointer reconstructionFilter =ReconstructThroughDilationImageFilterType::New();
73 reconstructionFilter->SetInput(erosionFilter->GetOutput());
74 reconstructionFilter->SetVerbose(m_Verbose);
75 reconstructionFilter->SetRadius(m_Radius);
76 reconstructionFilter->SetMaximumNumberOfLabels(m_MaximumNumberOfLabels);
77 reconstructionFilter->SetBackgroundValue(m_BackgroundValue);
78 reconstructionFilter->SetForegroundValue(m_ForegroundValue);
79 reconstructionFilter->Update();
82 this->SetNthOutput(0,reconstructionFilter->GetOutput());
88 #endif //#define clitkDecomposeAndReconstructImageFilter_txx