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 =========================================================================*/
36 #ifndef vtkNIFTIImageWriter_h
37 #define vtkNIFTIImageWriter_h
38 
39 #include "vtkIOImageModule.h" // For export macro
40 #include "vtkImageWriter.h"
41 
42 class vtkMatrix4x4;
44 
45 class VTKIOIMAGE_EXPORT vtkNIFTIImageWriter : public vtkImageWriter
46 {
47 public:
49 
55 
59  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
60 
62 
68  vtkSetMacro(NIFTIVersion, int);
69  vtkGetMacro(NIFTIVersion, int);
71 
73 
77  vtkSetStringMacro(Description);
78  vtkGetStringMacro(Description);
80 
82 
88  vtkGetMacro(TimeDimension, int);
89  vtkSetMacro(TimeDimension, int);
90  vtkGetMacro(TimeSpacing, double);
91  vtkSetMacro(TimeSpacing, double);
93 
95 
103  vtkSetMacro(RescaleSlope, double);
104  vtkGetMacro(RescaleSlope, double);
105  vtkSetMacro(RescaleIntercept, double);
106  vtkGetMacro(RescaleIntercept, double);
108 
110 
117  vtkGetMacro(PlanarRGB, bool);
118  vtkSetMacro(PlanarRGB, bool);
119  vtkBooleanMacro(PlanarRGB, bool);
121 
123 
128  vtkSetMacro(QFac, double);
129  vtkGetMacro(QFac, double);
131 
140  vtkMatrix4x4 *GetQFormMatrix() { return this->QFormMatrix; }
141 
150  vtkMatrix4x4 *GetSFormMatrix() { return this->SFormMatrix; }
151 
153 
163 
164 protected:
167 
171  int GenerateHeader(vtkInformation *info, bool singleFile);
172 
176  virtual int RequestData(vtkInformation *request,
177  vtkInformationVector** inputVector,
178  vtkInformationVector* outputVector);
179 
186  static char *ReplaceExtension(
187  const char *fname, const char *ext1, const char *ext2);
188 
190 
194  double TimeSpacing;
196 
198 
202  double RescaleSlope;
204 
208  double QFac;
209 
211 
217 
221  char *Description;
222 
224 
231 
235  bool PlanarRGB;
236 
237 private:
238  vtkNIFTIImageWriter(const vtkNIFTIImageWriter&) VTK_DELETE_FUNCTION;
239  void operator=(const vtkNIFTIImageWriter&) VTK_DELETE_FUNCTION;
240 };
241 
242 #endif // vtkNIFTIImageWriter_h
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
Store NIfTI header information.
Write NIfTI-1 and NIfTI-2 medical image files.
void SetNIFTIHeader(vtkNIFTIImageHeader *hdr)
Set the NIFTI header information to use when writing the file.
vtkMatrix4x4 * GetSFormMatrix()
static char * ReplaceExtension(const char *fname, const char *ext1, const char *ext2)
Make a new filename by replacing extension "ext1" with "ext2".
vtkNIFTIImageHeader * GetNIFTIHeader()
static vtkNIFTIImageWriter * New()
Static method for construction.
vtkMatrix4x4 * GetQFormMatrix()
void PrintSelf(ostream &os, vtkIndent indent) override
Print information about this object.
vtkNIFTIImageHeader * OwnHeader
vtkMatrix4x4 * SFormMatrix
double QFac
Is -1 if VTK slice order is opposite to NIFTI slice order, +1 otherwise.
bool PlanarRGB
Use planar RGB instead of the default (packed).
char * Description
A description of how the file was produced.
int TimeDimension
The size and spacing of the Time dimension to use in the file.
void SetQFormMatrix(vtkMatrix4x4 *)
Set the "qform" orientation and offset for the image data.
int GenerateHeader(vtkInformation *info, bool singleFile)
Generate the header information for the file.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
The main execution method, which writes the file.
vtkMatrix4x4 * QFormMatrix
The orientation matrices for the NIFTI file.
double RescaleIntercept
Information for rescaling data to quantitative units.
vtkNIFTIImageHeader * NIFTIHeader
The header information.
void SetSFormMatrix(vtkMatrix4x4 *)
Set a matrix for the "sform" transformation stored in the file.
@ info
Definition: vtkX3D.h:376
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.