VTK  9.0.3
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 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) 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 
137  vtkMatrix4x4* GetQFormMatrix() { return this->QFormMatrix; }
138 
147  vtkMatrix4x4* GetSFormMatrix() { return this->SFormMatrix; }
148 
150 
160 
161 protected:
164 
168  int GenerateHeader(vtkInformation* info, bool singleFile);
169 
173  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
174  vtkInformationVector* outputVector) override;
175 
182  static char* ReplaceExtension(const char* fname, const char* ext1, const char* ext2);
183 
185 
189  double TimeSpacing;
191 
193 
197  double RescaleSlope;
199 
203  double QFac;
204 
206 
212 
216  char* Description;
217 
219 
226 
230  bool PlanarRGB;
231 
232 private:
233  vtkNIFTIImageWriter(const vtkNIFTIImageWriter&) = delete;
234  void operator=(const vtkNIFTIImageWriter&) = delete;
235 };
236 
237 #endif // vtkNIFTIImageWriter_h
Writes images to files.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
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.
~vtkNIFTIImageWriter() override
vtkMatrix4x4 * QFormMatrix
The orientation matrices for the NIFTI file.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
The main execution method, which writes the 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:382