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
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) 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
282) 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
333) 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
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
68#ifndef vtkMNITagPointReader_h
69#define vtkMNITagPointReader_h
70
71#include "vtkIOMINCModule.h" // For export macro
73#include "vtkStdString.h" // needed for std::string
74
75class vtkPolyData;
76class vtkPoints;
77class vtkStringArray;
78class vtkDoubleArray;
79class vtkIntArray;
80
81class VTKIOMINC_EXPORT vtkMNITagPointReader : public vtkPolyDataAlgorithm
82{
83public:
85
87 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
88
90
93 vtkSetStringMacro(FileName);
96
100 virtual const char* GetFileExtensions() {
101 return ".tag"; }
102
106 virtual const char* GetDescriptiveName() {
107 return "MNI tags"; }
108
112 virtual int CanReadFile(const char* name);
113
120 virtual int GetNumberOfVolumes();
121
127 virtual vtkPoints *GetPoints(int port);
128 virtual vtkPoints *GetPoints() { return this->GetPoints(0); }
129
136
143
150
157
161 virtual const char *GetComments();
162
163protected:
166
167 char *FileName;
169
171 char *Comments;
172
173 int ReadLine(istream &infile, std::string &linetext,
174 std::string::iterator &pos);
175 int ReadLineAfterComments(istream &infile, std::string &linetext,
176 std::string::iterator &pos);
177 int SkipWhitespace(istream &infile, std::string &linetext,
178 std::string::iterator &pos, int nl);
179 int ParseLeftHandSide(istream &infile, std::string &linetext,
180 std::string::iterator &pos,
181 std::string &identifier);
182 int ParseStringValue(istream &infile, std::string &linetext,
183 std::string::iterator &pos,
185 int ParseIntValues(istream &infile, std::string &linetext,
186 std::string::iterator &pos,
187 int *values, int count);
188 int ParseFloatValues(istream &infile, std::string &linetext,
189 std::string::iterator &pos,
190 double *values, int count);
191
192 virtual int ReadFile(vtkPolyData *output1, vtkPolyData *output2);
193
194 virtual int RequestData(vtkInformation* request,
195 vtkInformationVector** inInfo,
196 vtkInformationVector* outInfo);
197
198private:
199 vtkMNITagPointReader(const vtkMNITagPointReader&) VTK_DELETE_FUNCTION;
200 void operator=(const vtkMNITagPointReader&) VTK_DELETE_FUNCTION;
201
202};
203
204#endif
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:46
A reader for MNI tag files.
virtual int CanReadFile(const char *name)
Test whether the specified file can be read.
int ParseLeftHandSide(istream &infile, std::string &linetext, std::string::iterator &pos, std::string &identifier)
int SkipWhitespace(istream &infile, std::string &linetext, std::string::iterator &pos, int nl)
virtual vtkPoints * GetPoints()
int ParseFloatValues(istream &infile, std::string &linetext, std::string::iterator &pos, double *values, int count)
int ParseIntValues(istream &infile, std::string &linetext, std::string::iterator &pos, int *values, int count)
int ParseStringValue(istream &infile, std::string &linetext, std::string::iterator &pos, std::string &data)
virtual const char * GetComments()
Get any comments that are included in the file.
virtual int GetNumberOfVolumes()
Get the number of volumes specified by the file, which will be equal to one or two.
virtual const char * GetDescriptiveName()
Get the name of this file format.
virtual const char * GetFileExtensions()
Get the entension for this file format.
static vtkMNITagPointReader * New()
int ReadLine(istream &infile, std::string &linetext, std::string::iterator &pos)
virtual vtkDoubleArray * GetWeights()
Get the weights.
virtual int ReadFile(vtkPolyData *output1, vtkPolyData *output2)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkIntArray * GetPatientIds()
Get the patient ids.
virtual vtkStringArray * GetLabelText()
Get the labels.
virtual vtkIntArray * GetStructureIds()
Get the structure ids.
virtual vtkPoints * GetPoints(int port)
Get the points.
int ReadLineAfterComments(istream &infile, std::string &linetext, std::string::iterator &pos)
virtual int RequestData(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
This is called by the superclass.
represent and manipulate 3D points
Definition: vtkPoints.h:40
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a vtkAbstractArray subclass for strings
@ port
Definition: vtkX3D.h:447
@ name
Definition: vtkX3D.h:219
@ data
Definition: vtkX3D.h:315
@ string
Definition: vtkX3D.h:490
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.