VTK
vtkNIFTIImageWriter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkNIFTIImageWriter.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 =========================================================================*/
33 #ifndef vtkNIFTIImageWriter_h
34 #define vtkNIFTIImageWriter_h
35 
36 #include "vtkIOImageModule.h" // For export macro
37 #include "vtkImageWriter.h"
38 
39 class vtkMatrix4x4;
41 
42 class VTKIOIMAGE_EXPORT vtkNIFTIImageWriter : public vtkImageWriter
43 {
44 public:
46 
49  static vtkNIFTIImageWriter *New();
52 
56  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
57 
59 
65  vtkSetMacro(NIFTIVersion, int);
66  vtkGetMacro(NIFTIVersion, int);
68 
70 
74  vtkSetStringMacro(Description);
75  vtkGetStringMacro(Description);
77 
79 
85  vtkGetMacro(TimeDimension, int);
86  vtkSetMacro(TimeDimension, int);
87  vtkGetMacro(TimeSpacing, double);
88  vtkSetMacro(TimeSpacing, double);
90 
92 
100  vtkSetMacro(RescaleSlope, double);
101  vtkGetMacro(RescaleSlope, double);
102  vtkSetMacro(RescaleIntercept, double);
103  vtkGetMacro(RescaleIntercept, double);
105 
107 
114  vtkGetMacro(PlanarRGB, bool);
115  vtkSetMacro(PlanarRGB, bool);
116  vtkBooleanMacro(PlanarRGB, bool);
118 
120 
125  vtkSetMacro(QFac, double);
126  vtkGetMacro(QFac, double);
128 
136  void SetQFormMatrix(vtkMatrix4x4 *);
137  vtkMatrix4x4 *GetQFormMatrix() { return this->QFormMatrix; }
138 
146  void SetSFormMatrix(vtkMatrix4x4 *);
147  vtkMatrix4x4 *GetSFormMatrix() { return this->SFormMatrix; }
148 
150 
157  void SetNIFTIHeader(vtkNIFTIImageHeader *hdr);
158  vtkNIFTIImageHeader *GetNIFTIHeader();
160 
161 protected:
163  ~vtkNIFTIImageWriter() VTK_OVERRIDE;
164 
168  int GenerateHeader(vtkInformation *info, bool singleFile);
169 
173  int RequestData(vtkInformation *request,
174  vtkInformationVector** inputVector,
175  vtkInformationVector* outputVector) VTK_OVERRIDE;
176 
183  static char *ReplaceExtension(
184  const char *fname, const char *ext1, const char *ext2);
185 
187 
191  double TimeSpacing;
193 
195 
199  double RescaleSlope;
201 
205  double QFac;
206 
208 
214 
218  char *Description;
219 
221 
228 
232  bool PlanarRGB;
233 
234 private:
235  vtkNIFTIImageWriter(const vtkNIFTIImageWriter&) VTK_DELETE_FUNCTION;
236  void operator=(const vtkNIFTIImageWriter&) VTK_DELETE_FUNCTION;
237 };
238 
239 #endif // vtkNIFTIImageWriter_h
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
bool PlanarRGB
Use planar RGB instead of the default (packed).
int TimeDimension
The size and spacing of the Time dimension to use in the file.
Store vtkAlgorithm input/output information.
int NIFTIVersion
The header information.
vtkNIFTIImageHeader * NIFTIHeader
The header information.
vtkMatrix4x4 * SFormMatrix
The orientation matrices for the NIFTI file.
double QFac
Is -1 if VTK slice order is opposite to NIFTI slice order, +1 otherwise.
double RescaleSlope
Information for rescaling data to quantitative units.
vtkMatrix4x4 * QFormMatrix
The orientation matrices for the NIFTI file.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
Writes images to files.
double RescaleIntercept
Information for rescaling data to quantitative units.
static vtkImageWriter * New()
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkNIFTIImageHeader * OwnHeader
The header information.
char * Description
A description of how the file was produced.
vtkMatrix4x4 * GetQFormMatrix()
Write NIfTI-1 and NIfTI-2 medical image files.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double TimeSpacing
The size and spacing of the Time dimension to use in the file.
Store NIfTI header information.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
This is called in response to a REQUEST_DATA request from the executive.
vtkMatrix4x4 * GetSFormMatrix()