VTK
vtkMNITransformReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMNITransformReader.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=========================================================================*/
67#ifndef vtkMNITransformReader_h
68#define vtkMNITransformReader_h
69
70#include "vtkIOMINCModule.h" // For export macro
71#include "vtkAlgorithm.h"
72
74class vtkDoubleArray;
75class vtkCollection;
76
77class VTKIOMINC_EXPORT vtkMNITransformReader : public vtkAlgorithm
78{
79public:
81
83 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
84
86
89 vtkSetStringMacro(FileName);
92
96 virtual const char* GetFileExtensions() {
97 return ".xfm"; }
98
102 virtual const char* GetDescriptiveName() {
103 return "MNI Transform"; }
104
108 virtual int CanReadFile(const char* name);
109
114
119
126
130 virtual const char *GetComments();
131
132protected:
135
136 char *FileName;
140 char *Comments;
141
143
144 int ReadLine(istream &infile, char result[256]);
145 int ReadLineAfterComments(istream &infile, char result[256]);
146 int SkipWhitespace(istream &infile, char linetext[256], char **cpp);
147 int ParseLeftHandSide(istream &infile, char linetext[256], char **cpp,
148 char identifier[256]);
149 int ParseStringValue(istream &infile, char linetext[256], char **cpp,
150 char data[256]);
151 int ParseFloatValues(istream &infile, char linetext[256], char **cpp,
152 vtkDoubleArray *array);
153 int ParseInvertFlagValue(istream &infile, char linetext[256], char **cpp,
154 int *invertFlag);
155
156 int ReadLinearTransform(istream &infile, char linetext[256], char **cp);
157 int ReadThinPlateSplineTransform(istream &infile, char linetext[256],
158 char **cp);
159 int ReadGridTransform(istream &infile, char linetext[256], char **cp);
160
161 virtual int ReadNextTransform(istream &infile, char linetext[256]);
162
163 virtual int ReadFile();
164
165 virtual int ProcessRequest(vtkInformation* request,
166 vtkInformationVector** inInfo,
167 vtkInformationVector* outInfo);
168
169private:
170 vtkMNITransformReader(const vtkMNITransformReader&) VTK_DELETE_FUNCTION;
171 void operator=(const vtkMNITransformReader&) VTK_DELETE_FUNCTION;
172
173};
174
175#endif
superclass for all geometric transformations
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
create and manipulate unsorted lists of objects
Definition: vtkCollection.h:52
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
A reader for MNI transformation files.
int ReadLinearTransform(istream &infile, char linetext[256], char **cp)
int ReadLine(istream &infile, char result[256])
int ParseInvertFlagValue(istream &infile, char linetext[256], char **cpp, int *invertFlag)
int ReadLineAfterComments(istream &infile, char result[256])
virtual const char * GetFileExtensions()
Get the entension for this file format.
int ParseLeftHandSide(istream &infile, char linetext[256], char **cpp, char identifier[256])
virtual vtkAbstractTransform * GetTransform()
Get the transform that results from concatenating all of the transforms in the file.
void SetTransform(vtkAbstractTransform *transform)
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual int ReadFile()
virtual vtkAbstractTransform * GetNthTransform(int i)
Get one of the transforms listed in the file.
virtual int CanReadFile(const char *name)
Test whether the specified file can be read.
virtual int ReadNextTransform(istream &infile, char linetext[256])
int ReadThinPlateSplineTransform(istream &infile, char linetext[256], char **cp)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int ParseFloatValues(istream &infile, char linetext[256], char **cpp, vtkDoubleArray *array)
vtkAbstractTransform * Transform
virtual const char * GetDescriptiveName()
Get the name of this file format.
static vtkMNITransformReader * New()
virtual const char * GetComments()
Get any comments that are included in the file.
int ReadGridTransform(istream &infile, char linetext[256], char **cp)
virtual int GetNumberOfTransforms()
Get the number of transforms in the file.
int ParseStringValue(istream &infile, char linetext[256], char **cpp, char data[256])
int SkipWhitespace(istream &infile, char linetext[256], char **cpp)
@ name
Definition: vtkX3D.h:219
@ data
Definition: vtkX3D.h:315
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.