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 
52  static vtkNIFTIImageWriter *New();
55 
59  void PrintSelf(ostream& os, vtkIndent indent) 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 
139  void SetQFormMatrix(vtkMatrix4x4 *);
140  vtkMatrix4x4 *GetQFormMatrix() { return this->QFormMatrix; }
141 
149  void SetSFormMatrix(vtkMatrix4x4 *);
150  vtkMatrix4x4 *GetSFormMatrix() { return this->SFormMatrix; }
151 
153 
160  void SetNIFTIHeader(vtkNIFTIImageHeader *hdr);
161  vtkNIFTIImageHeader *GetNIFTIHeader();
163 
164 protected:
166  ~vtkNIFTIImageWriter() override;
167 
171  int GenerateHeader(vtkInformation *info, bool singleFile);
172 
176  int RequestData(vtkInformation *request,
177  vtkInformationVector** inputVector,
178  vtkInformationVector* outputVector) override;
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&) = delete;
239  void operator=(const vtkNIFTIImageWriter&) = delete;
240 };
241 
242 #endif // vtkNIFTIImageWriter_h
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
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:39
Writes images to files.
double RescaleIntercept
Information for rescaling data to quantitative units.
static vtkImageWriter * New()
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.
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()