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 CLITKIMAGEARITHMGENERICFILTER_H
19 #define CLITKIMAGEARITHMGENERICFILTER_H
21 -------------------------------------------------------------------
22 * @file clitkImageArithmGenericFilter.h
23 * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
24 * @date 23 Feb 2008 08:37:53
27 -------------------------------------------------------------------*/
30 #include "clitkCommon.h"
31 #include "clitkImageToImageGenericFilter.h"
32 #include "clitkImageArithm_ggo.h"
36 #include "itkImageIOBase.h"
37 #include "itkImageRegionIterator.h"
38 #include "itkImageRegionConstIterator.h"
40 //--------------------------------------------------------------------
43 template<class args_info_type>
44 class ITK_EXPORT ImageArithmGenericFilter:
45 public clitk::ImageToImageGenericFilter<ImageArithmGenericFilter<args_info_type> > {
50 ImageArithmGenericFilter ();
53 typedef ImageArithmGenericFilter Self;
54 typedef ImageToImageGenericFilterBase Superclass;
55 typedef itk::SmartPointer<Self> Pointer;
56 typedef itk::SmartPointer<const Self> ConstPointer;
61 //--------------------------------------------------------------------
62 void SetArgsInfo(const args_info_type & a);
65 void SetDefaultPixelValue (double value) { mDefaultPixelValue = value ;}
66 void SetTypeOfOperation (int value) { mTypeOfOperation = value ;}
67 void SetScalar (double value) { mScalar = value ;}
68 void EnableOverwriteInputImage(bool b);
71 double GetDefaultPixelValue () { return mDefaultPixelValue ;}
72 int GetTypeOfOperation () { return mTypeOfOperation ;}
73 double GetScalar () { return mScalar ;}
75 //--------------------------------------------------------------------
76 // Main function called each time the filter is updated
77 template<class InputImageType>
78 void UpdateWithInputImageType();
81 template<unsigned int Dim> void InitializeImageType();
82 bool mIsOperationUseASecondImage;
84 double mDefaultPixelValue;
86 args_info_type mArgsInfo;
87 bool mOverwriteInputImage;
90 template<class Iter1, class Iter2>
91 void ComputeImage(Iter1 it, Iter2 ito);
93 template<class Iter1, class Iter2, class Iter3>
94 void ComputeImage(Iter1 it1, Iter2 it2, Iter3 ito);
96 //--------------------------------------------------------------------
98 }; // end class ImageArithmGenericFilter
100 template<> template<>
101 void ImageArithmGenericFilter<args_info_clitkImageArithm>::UpdateWithInputImageType< itk::Image< itk::Vector<float, 3u>, 3u > >();
103 template<> template<>
104 void ImageArithmGenericFilter<args_info_clitkImageArithm>::ComputeImage<
105 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > >,
106 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > >
108 (itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > > it,
109 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > > ito);
111 template<> template<>
112 void ImageArithmGenericFilter<args_info_clitkImageArithm>::ComputeImage<
113 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > >,
114 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > >,
115 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > >
117 (itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > > it1,
118 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > > it2,
119 itk::ImageRegionIterator< itk::Image< itk::Vector<float, 3u>, 3u > > ito);
122 //--------------------------------------------------------------------
125 #ifndef ITK_MANUAL_INSTANTIATION
126 #include "clitkImageArithmGenericFilter.txx"
129 #endif //#define CLITKIMAGEARITHMGENERICFILTER_H