VTK  9.3.1
vtkMNITagPointReader.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
24 #ifndef vtkMNITagPointReader_h
25 #define vtkMNITagPointReader_h
26 
27 #include "vtkIOMINCModule.h" // For export macro
28 #include "vtkPolyDataAlgorithm.h"
29 
30 VTK_ABI_NAMESPACE_BEGIN
31 class vtkPolyData;
32 class vtkPoints;
33 class vtkStringArray;
34 class vtkDoubleArray;
35 class vtkIntArray;
36 
37 class VTKIOMINC_EXPORT vtkMNITagPointReader : public vtkPolyDataAlgorithm
38 {
39 public:
41 
42  static vtkMNITagPointReader* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
49  vtkSetFilePathMacro(FileName);
50  vtkGetFilePathMacro(FileName);
52 
56  virtual const char* GetFileExtensions() { return ".tag"; }
57 
61  virtual const char* GetDescriptiveName() { return "MNI tags"; }
62 
66  virtual int CanReadFile(VTK_FILEPATH const char* name);
67 
74  virtual int GetNumberOfVolumes();
75 
81  virtual vtkPoints* GetPoints(int port);
82  virtual vtkPoints* GetPoints() { return this->GetPoints(0); }
83 
89  virtual vtkStringArray* GetLabelText();
90 
96  virtual vtkDoubleArray* GetWeights();
97 
103  virtual vtkIntArray* GetStructureIds();
104 
110  virtual vtkIntArray* GetPatientIds();
111 
115  virtual const char* GetComments();
116 
117 protected:
119  ~vtkMNITagPointReader() override;
120 
121  char* FileName;
123 
125  char* Comments;
126 
127  int ReadLine(istream& infile, std::string& linetext, std::string::iterator& pos);
128  int ReadLineAfterComments(istream& infile, std::string& linetext, std::string::iterator& pos);
129  int SkipWhitespace(istream& infile, std::string& linetext, std::string::iterator& pos, int nl);
130  int ParseLeftHandSide(
131  istream& infile, std::string& linetext, std::string::iterator& pos, std::string& identifier);
132  int ParseStringValue(
133  istream& infile, std::string& linetext, std::string::iterator& pos, std::string& data);
134  int ParseIntValues(
135  istream& infile, std::string& linetext, std::string::iterator& pos, int* values, int count);
136  int ParseFloatValues(
137  istream& infile, std::string& linetext, std::string::iterator& pos, double* values, int count);
138 
139  virtual int ReadFile(vtkPolyData* output1, vtkPolyData* output2);
140 
141  int RequestData(
142  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
143 
144 private:
146  void operator=(const vtkMNITagPointReader&) = delete;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #endif
virtual vtkPoints * GetPoints()
virtual const char * GetDescriptiveName()
Get the name of this file format.
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
A reader for MNI tag files.
a vtkAbstractArray subclass for strings
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:34
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_FILEPATH
virtual const char * GetFileExtensions()
Get the extension for this file format.
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.