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 clitkSplitImageGenericFilter_H
19 #define clitkSplitImageGenericFilter_H
21 -------------------------------------------------------------------
22 * @file clitkSplitImageGenericFilter.h
23 * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
25 -------------------------------------------------------------------*/
29 #include "clitkCommon.h"
30 #include "clitkImageCommon.h"
31 #include "clitkImageToImageGenericFilter.h"
35 #include "itkImageIOBase.h"
36 #include "itkImageRegionIterator.h"
37 #include "itkImageRegionConstIterator.h"
41 //--------------------------------------------------------------------
42 class SplitImageGenericFilter:
43 public clitk::ImageToImageGenericFilter<SplitImageGenericFilter> {
48 SplitImageGenericFilter ();
51 typedef SplitImageGenericFilter Self;
52 typedef itk::SmartPointer<Self> Pointer;
53 typedef itk::SmartPointer<const Self> ConstPointer;
59 void SetSplitDimension (int dim) { mSplitDimension = dim; }
60 void SetVerbose (const bool v) { m_Verbose = v; }
61 void SetPng (const bool v) { m_Png = v; }
62 void SetWindowLevel(const double w, const double l){ m_Window = w; m_Level = l;}
64 //--------------------------------------------------------------------
65 // Main function called each time the filter is updated
66 template<class InputImageType>
67 void UpdateWithInputImageType();
70 template <class ImageType>
74 typedef typename ImageType::Pointer ImagePointer;
75 typedef itk::Image< unsigned char, ImageType::ImageDimension > OutputPngImageType;
76 typedef typename OutputPngImageType::Pointer OutputPngImagePointer;
77 OutputPngImagePointer Do(double window, double level, ImagePointer input);
79 template<unsigned int> struct PixelDimType {};
80 template<unsigned int Dim> OutputPngImagePointer Do(double window,
84 OutputPngImagePointer Do(double window, double level, ImagePointer input, PixelDimType<1> *);
87 template<unsigned int Dim> void InitializeImageType();
91 double m_Window, m_Level;
93 }; // end class SplitImageGenericFilter
94 //--------------------------------------------------------------------
97 //--------------------------------------------------------------------
99 #endif //#define clitkSplitImageGenericFilter_H