VTK  9.1.0
vtkMNITagPointWriter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkMNITagPointWriter.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=========================================================================*/
65#ifndef vtkMNITagPointWriter_h
66#define vtkMNITagPointWriter_h
67
68#include "vtkIOMINCModule.h" // For export macro
69#include "vtkWriter.h"
70
71class vtkDataSet;
72class vtkPointSet;
73class vtkStringArray;
74class vtkDoubleArray;
75class vtkIntArray;
76class vtkPoints;
77
78class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
79{
80public:
82
84 void PrintSelf(ostream& os, vtkIndent indent) override;
85
89 virtual const char* GetFileExtensions() { return ".tag"; }
90
94 virtual const char* GetDescriptiveName() { return "MNI tags"; }
95
97
100 virtual void SetPoints(int port, vtkPoints* points);
101 virtual void SetPoints(vtkPoints* points) { this->SetPoints(0, points); }
102 virtual vtkPoints* GetPoints(int port);
103 virtual vtkPoints* GetPoints() { return this->GetPoints(0); }
105
107
111 virtual void SetLabelText(vtkStringArray* a);
112 vtkGetObjectMacro(LabelText, vtkStringArray);
114
116
120 virtual void SetWeights(vtkDoubleArray* a);
121 vtkGetObjectMacro(Weights, vtkDoubleArray);
123
125
129 virtual void SetStructureIds(vtkIntArray* a);
130 vtkGetObjectMacro(StructureIds, vtkIntArray);
132
134
138 virtual void SetPatientIds(vtkIntArray* a);
139 vtkGetObjectMacro(PatientIds, vtkIntArray);
141
143
146 vtkSetStringMacro(Comments);
147 vtkGetStringMacro(Comments);
149
153 int Write() override;
154
159
161
167
168protected:
171
172 vtkPoints* Points[2];
177 char* Comments;
178
179 void WriteData() override {}
180 virtual void WriteData(vtkPointSet* inputs[2]);
181
183
185
186 char* FileName;
187
189
190 ostream* OpenFile();
191 void CloseFile(ostream* fp);
192
193private:
195 void operator=(const vtkMNITagPointWriter&) = delete;
196};
197
198#endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:113
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:149
A writer for MNI tag point files.
int Write() override
Write the file.
virtual void SetWeights(vtkDoubleArray *a)
Set the weights (unless the input PointData has an array called Weights).
virtual void SetLabelText(vtkStringArray *a)
Set the labels (unless the input PointData has an array called LabelText).
vtkSetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void CloseFile(ostream *fp)
virtual const char * GetDescriptiveName()
Get the name of this file format.
virtual void WriteData(vtkPointSet *inputs[2])
virtual vtkPoints * GetPoints(int port)
Set the points (unless you set them as inputs).
virtual void SetPoints(vtkPoints *points)
Set the points (unless you set them as inputs).
virtual void SetStructureIds(vtkIntArray *a)
Set the structure ids (unless the input PointData has an array called StructureIds).
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
vtkStringArray * LabelText
virtual void SetPoints(int port, vtkPoints *points)
Set the points (unless you set them as inputs).
virtual vtkPoints * GetPoints()
Set the points (unless you set them as inputs).
virtual void SetPatientIds(vtkIntArray *a)
Set the structure ids (unless the input PointData has an array called PatientIds).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMTimeType GetMTime() override
Get the MTime.
vtkGetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
static vtkMNITagPointWriter * New()
ostream * OpenFile()
~vtkMNITagPointWriter() override
virtual const char * GetFileExtensions()
Get the extension for this file format.
concrete class for storing a set of points
Definition: vtkPointSet.h:106
represent and manipulate 3D points
Definition: vtkPoints.h:143
a vtkAbstractArray subclass for strings
abstract class to write data to file(s)
Definition: vtkWriter.h:43
@ points
Definition: vtkX3D.h:452
@ info
Definition: vtkX3D.h:382
@ port
Definition: vtkX3D.h:453
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287