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 vvImageWriter_H
19 #define vvImageWriter_H
24 #include "itkCommand.h"
27 class vvImageWriter : public itk::LightObject {
30 typedef vvImageWriter Self;
31 typedef itk::SmartPointer<Self> Pointer;
34 void SetOutputFileName(std::string filename);
35 void SetObserver(itk::Command::Pointer o) {
36 mUseAnObserver = true;
39 void DisableObserver() {
40 mUseAnObserver = false;
43 void SetInput(vvImage::Pointer image) {
47 std::string GetLastError() {
51 bool GetSaveTransform() { return mSaveTransform; }
52 void SetSaveTransform(bool b) { mSaveTransform = b; }
54 //====================================================================
57 Update(mImage->GetNumberOfDimensions(),mImage->GetScalarTypeAsITKString());
59 void Update(int dim, std::string OutputPixelType);
66 //====================================================================
67 std::string mOutputFilename;
68 itk::Command::Pointer mObserver;
70 std::string mLastError;
74 //====================================================================
75 template<unsigned int VImageDimension>
76 void UpdateWithDim(std::string OutputPixelType);
78 //====================================================================
79 template<class OutputPixelType, unsigned int VImageDimension>
80 void UpdateWithDimAndOutputPixelType();
83 vvImage::Pointer mImage;
85 }; // end class vvImageWriter
87 #endif /* end #define vvImageWriter_H */