VTK  9.2.6
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
42class vtkMatrix4x4;
44
45class VTKIOIMAGE_EXPORT vtkNIFTIImageWriter : public vtkImageWriter
46{
47public:
49
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
140 vtkMatrix4x4* GetQFormMatrix() { return this->QFormMatrix; }
141
150 vtkMatrix4x4* GetSFormMatrix() { return this->SFormMatrix; }
151
153
163
164protected:
167
171 int GenerateHeader(vtkInformation* info, bool singleFile);
172
177 vtkInformationVector* outputVector) override;
178
185 static char* ReplaceExtension(const char* filename, const char* ext1, const char* ext2);
186
188
194
196
202
206 double QFac;
207
209
215
220
222
229
234
235private:
237 void operator=(const vtkNIFTIImageWriter&) = delete;
238};
239
240#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
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.
double TimeSpacing
The size and spacing of the Time dimension to use in the file.
void PrintSelf(ostream &os, vtkIndent indent) override
Print information about this object.
vtkNIFTIImageHeader * OwnHeader
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.
bool PlanarRGB
Use planar RGB instead of the default (packed).
double RescaleSlope
Information for rescaling data to quantitative units.
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.
vtkNIFTIImageHeader * GetNIFTIHeader()
Set the NIFTI header information to use when writing the file.
void SetQFormMatrix(vtkMatrix4x4 *)
Set the "qform" orientation and offset for the image data.
static char * ReplaceExtension(const char *filename, const char *ext1, const char *ext2)
Make a new filename by replacing extension "ext1" with "ext2".
int GenerateHeader(vtkInformation *info, bool singleFile)
Generate the header information for the file.
~vtkNIFTIImageWriter() override
vtkMatrix4x4 * QFormMatrix
The orientation matrices for the NIFTI file.
vtkMatrix4x4 * GetSFormMatrix()
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
The main execution method, which writes the file.
int NIFTIVersion
The header information.
double RescaleIntercept
Information for rescaling data to quantitative units.
static vtkNIFTIImageWriter * New()
Static method for construction.
vtkNIFTIImageHeader * NIFTIHeader
The header information.
vtkMatrix4x4 * GetQFormMatrix()
void SetSFormMatrix(vtkMatrix4x4 *)
Set a matrix for the "sform" transformation stored in the file.