VTK: IO/MINC/vtkMNITransformReader.h Source File

| VTK 9.3.1

vtkMNITransformReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2006 Atamai, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
23 #ifndef vtkMNITransformReader_h
24 #define vtkMNITransformReader_h
25
26 #include "vtkAlgorithm.h"
27 #include "vtkIOMINCModule.h" // For export macro
28
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkAbstractTransform;
31 class vtkDoubleArray;
32 class vtkCollection;
33
34 class VTKIOMINC_EXPORT vtkMNITransformReader : public vtkAlgorithm
35 {
36 public:
37 vtkTypeMacro(vtkMNITransformReader, vtkAlgorithm);
38
39 static vtkMNITransformReader* New();
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
46 vtkSetFilePathMacro(FileName);
47 vtkGetFilePathMacro(FileName);
49
53 virtual const char* GetFileExtensions() { return ".xfm"; }
54
58 virtual const char* GetDescriptiveName() { return "MNI Transform"; }
59
63 virtual int CanReadFile(VTK_FILEPATH const char* name);
64
68 virtual int GetNumberOfTransforms();
69
73 virtual vtkAbstractTransform* GetNthTransform(int i);
74
80 virtual vtkAbstractTransform* GetTransform();
81
85 virtual const char* GetComments();
86
87 protected:
88 vtkMNITransformReader();
89 ~vtkMNITransformReader() override;
90
91 char* FileName;
92 vtkAbstractTransform* Transform;
93 vtkCollection* Transforms;
94 int LineNumber;
95 char* Comments;
96
97 void SetTransform(vtkAbstractTransform* transform);
98
99 int ReadLine(istream& infile, char result[256]);
100 int ReadLineAfterComments(istream& infile, char result[256]);
101 int SkipWhitespace(istream& infile, char linetext[256], char** cpp);
102 int ParseLeftHandSide(istream& infile, char linetext[256], char** cpp, char identifier[256]);
103 int ParseStringValue(istream& infile, char linetext[256], char** cpp, char data[256]);
104 int ParseFloatValues(istream& infile, char linetext[256], char** cpp, vtkDoubleArray* array);
105 int ParseInvertFlagValue(istream& infile, char linetext[256], char** cpp, int* invertFlag);
106
107 int ReadLinearTransform(istream& infile, char linetext[256], char** cp);
108 int ReadThinPlateSplineTransform(istream& infile, char linetext[256], char** cp);
109 int ReadGridTransform(istream& infile, char linetext[256], char** cp);
110
111 virtual int ReadNextTransform(istream& infile, char linetext[256]);
112
113 virtual int ReadFile();
114
115 vtkTypeBool ProcessRequest(
116 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
117
118 private:
119 vtkMNITransformReader(const vtkMNITransformReader&) = delete;
120 void operator=(const vtkMNITransformReader&) = delete;
121 };
122
123 VTK_ABI_NAMESPACE_END
124 #endif
vtkAbstractTransform
superclass for all geometric transformations
Definition: vtkAbstractTransform.h:39
vtkAlgorithm
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkCollection
create and manipulate ordered lists of objects
Definition: vtkCollection.h:45
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMNITransformReader
A reader for MNI transformation files.
Definition: vtkMNITransformReader.h:35
vtkMNITransformReader::ReadLinearTransform
int ReadLinearTransform(istream &infile, char linetext[256], char **cp)
vtkMNITransformReader::ReadLine
int ReadLine(istream &infile, char result[256])
vtkMNITransformReader::GetFileExtensions
virtual const char * GetFileExtensions()
Get the extension for this file format.
Definition: vtkMNITransformReader.h:53
vtkMNITransformReader::ParseInvertFlagValue
int ParseInvertFlagValue(istream &infile, char linetext[256], char **cpp, int *invertFlag)
vtkMNITransformReader::ReadLineAfterComments
int ReadLineAfterComments(istream &infile, char result[256])
vtkMNITransformReader::GetComments
virtual const char * GetComments()
Get any comments that are included in the file.
vtkMNITransformReader::ParseLeftHandSide
int ParseLeftHandSide(istream &infile, char linetext[256], char **cpp, char identifier[256])
vtkMNITransformReader::vtkSetFilePathMacro
vtkSetFilePathMacro(FileName)
Set the file name.
vtkMNITransformReader::vtkGetFilePathMacro
vtkGetFilePathMacro(FileName)
Set the file name.
vtkMNITransformReader::SetTransform
void SetTransform(vtkAbstractTransform *transform)
vtkMNITransformReader::~vtkMNITransformReader
~vtkMNITransformReader() override
vtkMNITransformReader::vtkMNITransformReader
vtkMNITransformReader()
vtkMNITransformReader::LineNumber
int LineNumber
Definition: vtkMNITransformReader.h:94
vtkMNITransformReader::CanReadFile
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the specified file can be read.
vtkMNITransformReader::ReadFile
virtual int ReadFile()
vtkMNITransformReader::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
vtkMNITransformReader::FileName
char * FileName
Definition: vtkMNITransformReader.h:91
vtkMNITransformReader::Transforms
vtkCollection * Transforms
Definition: vtkMNITransformReader.h:93
vtkMNITransformReader::ReadNextTransform
virtual int ReadNextTransform(istream &infile, char linetext[256])
vtkMNITransformReader::ReadThinPlateSplineTransform
int ReadThinPlateSplineTransform(istream &infile, char linetext[256], char **cp)
vtkMNITransformReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMNITransformReader::New
static vtkMNITransformReader * New()
vtkMNITransformReader::ParseFloatValues
int ParseFloatValues(istream &infile, char linetext[256], char **cpp, vtkDoubleArray *array)
vtkMNITransformReader::Transform
vtkAbstractTransform * Transform
Definition: vtkMNITransformReader.h:92
vtkMNITransformReader::GetDescriptiveName
virtual const char * GetDescriptiveName()
Get the name of this file format.
Definition: vtkMNITransformReader.h:58
vtkMNITransformReader::GetNthTransform
virtual vtkAbstractTransform * GetNthTransform(int i)
Get one of the transforms listed in the file.
vtkMNITransformReader::Comments
char * Comments
Definition: vtkMNITransformReader.h:95
vtkMNITransformReader::ReadGridTransform
int ReadGridTransform(istream &infile, char linetext[256], char **cp)
vtkMNITransformReader::GetNumberOfTransforms
virtual int GetNumberOfTransforms()
Get the number of transforms in the file.
vtkMNITransformReader::GetTransform
virtual vtkAbstractTransform * GetTransform()
Get the transform that results from concatenating all of the transforms in the file.
vtkMNITransformReader::ParseStringValue
int ParseStringValue(istream &infile, char linetext[256], char **cpp, char data[256])
vtkMNITransformReader::SkipWhitespace
int SkipWhitespace(istream &infile, char linetext[256], char **cpp)
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkAlgorithm.h
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:34