VTK  9.3.20240423
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
29VTK_ABI_NAMESPACE_BEGIN
31class vtkDoubleArray;
32class vtkCollection;
33
34class VTKIOMINC_EXPORT vtkMNITransformReader : public vtkAlgorithm
35{
36public:
38
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
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
74
81
85 virtual const char* GetComments();
86
87protected:
90
91 char* FileName;
95 char* Comments;
96
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
116 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
117
118private:
120 void operator=(const vtkMNITransformReader&) = delete;
121};
122
123VTK_ABI_NAMESPACE_END
124#endif
superclass for all geometric transformations
Superclass for all sources, filters, and sinks in VTK.
create and manipulate ordered lists of objects
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:108
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 extension 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.
vtkSetFilePathMacro(FileName)
Set the file name.
vtkGetFilePathMacro(FileName)
Set the file name.
void SetTransform(vtkAbstractTransform *transform)
~vtkMNITransformReader() override
virtual int CanReadFile(VTK_FILEPATH const char *name)
Test whether the specified file can be read.
virtual int ReadFile()
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
virtual vtkAbstractTransform * GetNthTransform(int i)
Get one of the transforms listed in the file.
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)
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH