VTK
vtkMINCImageWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMINCImageWriter.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=========================================================================*/
15/*=========================================================================
16
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) Redistribution of the source code, in verbatim or modified
24 form, must retain the above copyright notice, this license,
25 the following disclaimer, and any notices that refer to this
26 license and/or the following disclaimer.
27
282) Redistribution in binary form must include the above copyright
29 notice, a copy of this license and the following disclaimer
30 in the documentation or with other materials provided with the
31 distribution.
32
333) Modified copies of the source code must be clearly marked as such,
34 and must not be misrepresented as verbatim copies of the source code.
35
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
71#ifndef vtkMINCImageWriter_h
72#define vtkMINCImageWriter_h
73
74#include "vtkIOMINCModule.h" // For export macro
75#include "vtkImageWriter.h"
76
77class vtkStringArray;
78class vtkIdTypeArray;
79class vtkDoubleArray;
80class vtkMatrix4x4;
81
82// A special class that holds the attributes
84
85class VTKIOMINC_EXPORT vtkMINCImageWriter : public vtkImageWriter
86{
87public:
89
91 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
92
96 virtual const char* GetFileExtensions() {
97 return ".mnc"; }
98
102 virtual const char* GetDescriptiveName() {
103 return "MINC"; }
104
108 virtual void SetFileName(const char *name);
109
116 virtual void Write();
117
119
130 virtual void SetDirectionCosines(vtkMatrix4x4 *matrix);
131 vtkGetObjectMacro(DirectionCosines, vtkMatrix4x4);
133
135
140 vtkSetMacro(RescaleSlope, double);
141 vtkGetMacro(RescaleSlope, double);
142 vtkSetMacro(RescaleIntercept, double);
143 vtkGetMacro(RescaleIntercept, double);
145
147
153 return this->ImageAttributes; };
155
157
161 vtkSetMacro(StrictValidation, int);
162 vtkBooleanMacro(StrictValidation, int);
163 vtkGetMacro(StrictValidation, int);
165
167
171 vtkSetStringMacro(HistoryAddition);
172 vtkGetStringMacro(HistoryAddition);
174
175protected:
178
182
187 int DataUpdateExtent[6];
188
190 double FileValidRange[2];
193
195
197
199
200 int Permutation[3];
201 int Flip[3];
202
205
207
208 virtual int OpenNetCDFFile(const char *filename, int& ncid);
209 virtual int CloseNetCDFFile(int ncid);
210
211 virtual int IndexFromDimensionName(const char *dimName);
212 virtual void ComputePermutationFromOrientation(int permutation[3],
213 int flip[3]);
214 virtual int CreateMINCDimensions(vtkImageData *input, int timeStep,
215 int *dimids);
216 virtual int CreateMINCVariables(vtkImageData *input, int timeStep,
217 int *dimids);
218 virtual int WriteMINCFileAttributes(vtkImageData *input, int timeStep);
219 virtual int WriteMINCData(vtkImageData *input,
220 int frameNumber,
221 int wholeExt[6],
222 int upExt[6]);
223 virtual void FindRescale(double &rescaleSlope, double &rescaleIntercept);
224 virtual void FindMINCValidRange(double range[2]);
225
227
228 virtual int RequestInformation(vtkInformation *request,
229 vtkInformationVector **inputVector,
230 vtkInformationVector *outputVector);
231
233 vtkInformationVector **inputVector,
234 vtkInformationVector *outputVector);
235
236 virtual int RequestData(vtkInformation* request,
237 vtkInformationVector** inputVector,
238 vtkInformationVector* outputVector);
239
240private:
241 vtkMINCImageWriter(const vtkMINCImageWriter&) VTK_DELETE_FUNCTION;
242 void operator=(const vtkMINCImageWriter&) VTK_DELETE_FUNCTION;
243
244};
245
246#endif
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
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.
A container for a MINC image header.
A writer for MINC files.
virtual void Write()
Write the data.
virtual void SetFileName(const char *name)
Set the file name.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
virtual int RequestUpdateExtent(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to translate the update extent requests from each output port ...
virtual int IndexFromDimensionName(const char *dimName)
virtual int CloseNetCDFFile(int ncid)
virtual void ComputePermutationFromOrientation(int permutation[3], int flip[3])
virtual const char * GetFileExtensions()
Get the entension for this file format.
virtual int OpenNetCDFFile(const char *filename, int &ncid)
virtual void FindMINCValidRange(double range[2])
virtual int CreateMINCDimensions(vtkImageData *input, int timeStep, int *dimids)
virtual int CreateMINCVariables(vtkImageData *input, int timeStep, int *dimids)
virtual const char * GetDescriptiveName()
Get the name of this file format.
vtkStringArray * FileDimensionNames
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
virtual void SetImageAttributes(vtkMINCImageAttributes *attributes)
Set the image attributes, which contain patient information and other useful metadata.
static vtkMINCImageWriter * New()
virtual int WriteMINCData(vtkImageData *input, int frameNumber, int wholeExt[6], int upExt[6])
virtual void FindRescale(double &rescaleSlope, double &rescaleIntercept)
vtkMatrix4x4 * DirectionCosines
vtkMINCImageAttributes * ImageAttributes
virtual void SetDirectionCosines(vtkMatrix4x4 *matrix)
Set a matrix that describes the orientation of the data.
virtual vtkMINCImageAttributes * GetImageAttributes()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int WriteMINCFileAttributes(vtkImageData *input, int timeStep)
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
a vtkAbstractArray subclass for strings
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
@ name
Definition: vtkX3D.h:219
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.