VTK
vtkMNITagPointReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMNITagPointReader.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 
17 Copyright (c) 2006 Atamai, Inc.
18 
19 Use, modification and redistribution of the software, in source or
20 binary forms, are permitted provided that the following terms and
21 conditions are met:
22 
23 1) 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 
28 2) 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 
33 3) 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 
36 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45 POSSIBILITY OF SUCH DAMAGES.
46 
47 =========================================================================*/
67 #ifndef vtkMNITagPointReader_h
68 #define vtkMNITagPointReader_h
69 
70 #include "vtkIOMINCModule.h" // For export macro
71 #include "vtkPolyDataAlgorithm.h"
72 #include "vtkStdString.h" // needed for std::string
73 
74 class vtkPolyData;
75 class vtkPoints;
76 class vtkStringArray;
77 class vtkDoubleArray;
78 class vtkIntArray;
79 
81 {
82 public:
84 
86  virtual void PrintSelf(ostream& os, vtkIndent indent);
87 
89 
90  vtkSetStringMacro(FileName);
91  vtkGetStringMacro(FileName);
93 
95 
96  virtual const char* GetFileExtensions() {
97  return ".tag"; }
99 
101 
102  virtual const char* GetDescriptiveName() {
103  return "MNI tags"; }
105 
107  virtual int CanReadFile(const char* name);
108 
113  virtual int GetNumberOfVolumes();
114 
116 
119  virtual vtkPoints *GetPoints(int port);
120  virtual vtkPoints *GetPoints() { return this->GetPoints(0); }
122 
127 
132 
137 
142 
144  virtual const char *GetComments();
145 
146 protected:
149 
150  char *FileName;
152 
154  char *Comments;
155 
156  int ReadLine(istream &infile, std::string &linetext,
157  std::string::iterator &pos);
158  int ReadLineAfterComments(istream &infile, std::string &linetext,
159  std::string::iterator &pos);
160  int SkipWhitespace(istream &infile, std::string &linetext,
161  std::string::iterator &pos, int nl);
162  int ParseLeftHandSide(istream &infile, std::string &linetext,
163  std::string::iterator &pos,
164  std::string &identifier);
165  int ParseStringValue(istream &infile, std::string &linetext,
166  std::string::iterator &pos,
167  std::string &data);
168  int ParseIntValues(istream &infile, std::string &linetext,
169  std::string::iterator &pos,
170  int *values, int count);
171  int ParseFloatValues(istream &infile, std::string &linetext,
172  std::string::iterator &pos,
173  double *values, int count);
174 
175  virtual int ReadFile(vtkPolyData *output1, vtkPolyData *output2);
176 
177  virtual int RequestData(vtkInformation* request,
178  vtkInformationVector** inInfo,
179  vtkInformationVector* outInfo);
180 
181 private:
182  vtkMNITagPointReader(const vtkMNITagPointReader&); // Not implemented
183  void operator=(const vtkMNITagPointReader&); // Not implemented
184 
185 };
186 
187 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkStdString.h
vtkgl::data
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: vtkgl.h:11339
vtkMNITagPointReader::GetFileExtensions
virtual const char * GetFileExtensions()
Definition: vtkMNITagPointReader.h:96
vtkMNITagPointReader::ReadLine
int ReadLine(istream &infile, std::string &linetext, std::string::iterator &pos)
vtkgl::count
GLuint GLuint GLsizei count
Definition: vtkgl.h:11315
vtkMNITagPointReader::SkipWhitespace
int SkipWhitespace(istream &infile, std::string &linetext, std::string::iterator &pos, int nl)
vtkMNITagPointReader::LineNumber
int LineNumber
Definition: vtkMNITagPointReader.h:153
VTKIOMINC_EXPORT
#define VTKIOMINC_EXPORT
Definition: vtkIOMINCModule.h:15
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkMNITagPointReader::ParseStringValue
int ParseStringValue(istream &infile, std::string &linetext, std::string::iterator &pos, std::string &data)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkMNITagPointReader::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkMNITagPointReader::New
static vtkMNITagPointReader * New()
vtkPolyDataAlgorithm.h
vtkMNITagPointReader::ReadFile
virtual int ReadFile(vtkPolyData *output1, vtkPolyData *output2)
vtkMNITagPointReader::vtkMNITagPointReader
vtkMNITagPointReader()
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkMNITagPointReader::GetPatientIds
virtual vtkIntArray * GetPatientIds()
vtkgl::values
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
vtkMNITagPointReader::GetWeights
virtual vtkDoubleArray * GetWeights()
vtkMNITagPointReader::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
vtkMNITagPointReader::ParseFloatValues
int ParseFloatValues(istream &infile, std::string &linetext, std::string::iterator &pos, double *values, int count)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMNITagPointReader::CanReadFile
virtual int CanReadFile(const char *name)
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:53
vtkMNITagPointReader::GetDescriptiveName
virtual const char * GetDescriptiveName()
Definition: vtkMNITagPointReader.h:102
vtkMNITagPointReader::GetPoints
virtual vtkPoints * GetPoints()
Definition: vtkMNITagPointReader.h:120
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkMNITagPointReader::GetLabelText
virtual vtkStringArray * GetLabelText()
vtkMNITagPointReader::GetPoints
virtual vtkPoints * GetPoints(int port)
vtkMNITagPointReader::GetStructureIds
virtual vtkIntArray * GetStructureIds()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkMNITagPointReader
A reader for MNI tag files.
Definition: vtkMNITagPointReader.h:81
vtkMNITagPointReader::FileName
char * FileName
Definition: vtkMNITagPointReader.h:150
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkMNITagPointReader::ParseLeftHandSide
int ParseLeftHandSide(istream &infile, std::string &linetext, std::string::iterator &pos, std::string &identifier)
vtkIOMINCModule.h
vtkMNITagPointReader::GetNumberOfVolumes
virtual int GetNumberOfVolumes()
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkMNITagPointReader::NumberOfVolumes
int NumberOfVolumes
Definition: vtkMNITagPointReader.h:151
vtkMNITagPointReader::GetComments
virtual const char * GetComments()
vtkMNITagPointReader::ParseIntValues
int ParseIntValues(istream &infile, std::string &linetext, std::string::iterator &pos, int *values, int count)
vtkMNITagPointReader::ReadLineAfterComments
int ReadLineAfterComments(istream &infile, std::string &linetext, std::string::iterator &pos)
vtkMNITagPointReader::Comments
char * Comments
Definition: vtkMNITagPointReader.h:154
vtkgl::string
GLsizei const GLchar ** string
Definition: vtkgl.h:12011
vtkMNITagPointReader::~vtkMNITagPointReader
~vtkMNITagPointReader()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44