vtk-dicom  0.8.14
vtkImageWriter.h
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageWriter.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
26 #ifndef vtkImageWriter_h
27 #define vtkImageWriter_h
28 
29 #include "vtkIOImageModule.h" // For export macro
30 #include "vtkImageAlgorithm.h"
31 
32 class VTKIOIMAGE_EXPORT vtkImageWriter : public vtkImageAlgorithm
33 {
34 public:
35  static vtkImageWriter *New();
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40 
45  vtkSetStringMacro(FileName);
46  vtkGetStringMacro(FileName);
48 
50 
55  vtkSetStringMacro(FilePrefix);
56  vtkGetStringMacro(FilePrefix);
58 
60 
63  vtkSetStringMacro(FilePattern);
64  vtkGetStringMacro(FilePattern);
66 
68 
73  vtkSetMacro(FileDimensionality, int);
74  vtkGetMacro(FileDimensionality, int);
76 
80  vtkImageData *GetInput();
81 
85  virtual void Write();
86 
87  void DeleteFiles();
88 
89 protected:
91  ~vtkImageWriter();
92 
93  int FileDimensionality;
94  char *FilePrefix;
95  char *FilePattern;
96  char *FileName;
97  int FileNumber;
98  int FileLowerLeft;
99  char *InternalFileName;
100 
101  virtual void RecursiveWrite(int dim,
102  vtkImageData *region,
103  vtkInformation*inInfo,
104  ofstream *file);
105  virtual void RecursiveWrite(int dim,
106  vtkImageData *cache,
107  vtkImageData *data,
108  vtkInformation* inInfo,
109  ofstream *file);
110  virtual void WriteFile(ofstream *file, vtkImageData *data,
111  int extent[6], int wExtent[6]);
112  virtual void WriteFileHeader(ofstream *, vtkImageData *, int [6]) {}
113  virtual void WriteFileTrailer(ofstream *, vtkImageData *) {}
114 
115  // This is called by the superclass.
116  // This is the method you should override.
117  virtual int RequestData(vtkInformation *request,
118  vtkInformationVector** inputVector,
119  vtkInformationVector* outputVector);
120 
121  int MinimumFileNumber;
122  int MaximumFileNumber;
123  int FilesDeleted;
124 
125 private:
126  vtkImageWriter(const vtkImageWriter&) VTK_DELETE_FUNCTION;
127  void operator=(const vtkImageWriter&) VTK_DELETE_FUNCTION;
128 };
129 
130 #endif
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:38
Writes images to files.
Definition: vtkImageWriter.h:33
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void PrintSelf(ostream &os, vtkIndent indent)
virtual void Write()
vtkImageData * GetInput()