]> Creatis software - clitk.git/blob - vv/vvImageWriter.h
removed headers
[clitk.git] / vv / vvImageWriter.h
1 #ifndef vvImageWriter_H
2 #define vvImageWriter_H
3 #include <string>
4
5 // ITK includes
6 #include "itkImage.h"
7 #include "itkCommand.h"
8 #include "vvImage.h"
9
10 class vvImageWriter {
11
12 public:
13     // constructor
14     vvImageWriter();
15     ~vvImageWriter();
16
17     void SetOutputFileName(std::string filename);
18     void SetObserver(itk::Command::Pointer o) {
19         mUseAnObserver = true;
20         mObserver = o;
21     }
22     void DisableObserver() {
23         mUseAnObserver = false;
24     }
25
26     void SetInput(vvImage::Pointer image) {
27         mImage = image;
28     }
29
30     std::string GetLastError() {
31         return mLastError;
32     }
33
34     //====================================================================
35     // Main function
36     void Update() {
37         Update(mImage->GetNumberOfDimensions(),mImage->GetScalarTypeAsString());
38     }
39     void Update(int dim, std::string OutputPixelType);
40
41 protected:
42     //====================================================================
43     std::string mOutputFilename;
44     itk::Command::Pointer mObserver;
45
46     std::string mLastError;
47     bool mUseAnObserver;
48
49     //====================================================================
50     template<unsigned int VImageDimension>
51     void UpdateWithDim(std::string OutputPixelType);
52
53     //====================================================================
54     template<class OutputPixelType, unsigned int VImageDimension>
55     void UpdateWithDimAndOutputPixelType();
56
57 private:
58     vvImage::Pointer mImage;
59
60 }; // end class vvImageWriter
61
62 #endif /* end #define vvImageWriter_H */