]> Creatis software - clitk.git/blob - itk/clitkComposeVFFilter.h
Add preserve studyUID in clitkImage2Dicom
[clitk.git] / itk / clitkComposeVFFilter.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
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
8
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.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkComposeVFFilter_h
19 #define __clitkComposeVFFilter_h
20 #include "clitkImageCommon.h"
21
22 #include "itkImageToImageFilter.h"
23 #include "itkImage.h"
24 #include "itkImageRegionIterator.h"
25 #include "itkImageRegionIteratorWithIndex.h"
26 #include "itkNumericTraits.h"
27
28 namespace clitk
29 {
30   
31   template <class InputImageType, class OutputImageType>  
32   class ITK_EXPORT ComposeVFFilter : public itk::ImageToImageFilter<InputImageType, OutputImageType>
33   
34   {
35   public:
36     typedef ComposeVFFilter     Self;
37     typedef itk::ImageToImageFilter<InputImageType, OutputImageType>     Superclass;
38     typedef itk::SmartPointer<Self>            Pointer;
39     typedef itk::SmartPointer<const Self>      ConstPointer;
40    
41     /** Method for creation through the object factory. */
42     itkNewMacro(Self);  
43
44     /** Run-time type information (and related methods) */
45     itkTypeMacro( ComposeVFFilter, ImageToImageFilter );
46   
47     /** Determine the image dimension. */
48     itkStaticConstMacro(ImageDimension, unsigned int,
49                         InputImageType::ImageDimension );
50
51     /** Typedef to describe the output image region type. */
52     typedef typename OutputImageType::RegionType OutputImageRegionType;
53     
54     //========================================================================================
55     //typedefs
56     typedef double CoordRepType;
57     typedef typename OutputImageType::PixelType PixelType;
58     typedef itk::Point<CoordRepType, ImageDimension> PointType;
59
60     //Set Methods(inline)
61     void SetEdgePaddingValue(PixelType m);
62     void SetVerbose(bool m){m_Verbose=m;}
63     void SetInput1(typename InputImageType::Pointer m)
64     {
65       //call the superclass method (at least one input required!)
66       this->SetInput(m);
67       m_Input1=m;
68     }
69     void SetInput2(typename InputImageType::Pointer m){m_Input2=m;}
70
71   protected:
72     ComposeVFFilter();
73     ~ComposeVFFilter() {};
74
75
76     //========================================================================================
77     //Threaded execution should implement generate threaded data
78     void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId );
79   
80     bool m_Verbose;
81     PixelType m_EdgePaddingValue;
82     typename InputImageType::Pointer m_Input1;
83     typename InputImageType::Pointer m_Input2;
84   };
85
86
87 } // end namespace clitk
88 #ifndef ITK_MANUAL_INSTANTIATION
89 #include "clitkComposeVFFilter.txx"
90 #endif
91
92 #endif // #define __clitkComposeVFFilter_h