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
31 class vtkDoubleArray;
32 class vtkCollection;
33 
34 class VTKIOMINC_EXPORT vtkMNITransformReader : public vtkAlgorithm
35 {
36 public:
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:
89  ~vtkMNITransformReader() override;
90 
91  char* FileName;
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 
116  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
117 
118 private:
120  void operator=(const vtkMNITransformReader&) = delete;
121 };
122 
123 VTK_ABI_NAMESPACE_END
124 #endif
Store vtkAlgorithm input/output information.
virtual const char * GetFileExtensions()
Get the extension for this file format.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:64
virtual vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Upstream/Downstream requests form the generalized interface through which executives invoke a algorit...
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:51
a simple class to control print indentation
Definition: vtkIndent.h:28
superclass for all geometric transformations
virtual const char * GetDescriptiveName()
Get the name of this file format.
vtkAbstractTransform * Transform
#define VTK_FILEPATH
create and manipulate ordered lists of objects
Definition: vtkCollection.h:44
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
A reader for MNI transformation files.