VTK  9.3.0
vtkMNITagPointWriter.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 vtkMNITagPointWriter_h
25#define vtkMNITagPointWriter_h
26
27#include "vtkIOMINCModule.h" // For export macro
28#include "vtkWriter.h"
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkDataSet;
32class vtkPointSet;
33class vtkStringArray;
34class vtkDoubleArray;
35class vtkIntArray;
36class vtkPoints;
37
38class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
39{
40public:
42
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
49 virtual const char* GetFileExtensions() { return ".tag"; }
50
54 virtual const char* GetDescriptiveName() { return "MNI tags"; }
55
57
60 virtual void SetPoints(int port, vtkPoints* points);
61 virtual void SetPoints(vtkPoints* points) { this->SetPoints(0, points); }
62 virtual vtkPoints* GetPoints(int port);
63 virtual vtkPoints* GetPoints() { return this->GetPoints(0); }
65
67
71 virtual void SetLabelText(vtkStringArray* a);
72 vtkGetObjectMacro(LabelText, vtkStringArray);
74
76
80 virtual void SetWeights(vtkDoubleArray* a);
81 vtkGetObjectMacro(Weights, vtkDoubleArray);
83
85
89 virtual void SetStructureIds(vtkIntArray* a);
90 vtkGetObjectMacro(StructureIds, vtkIntArray);
92
94
98 virtual void SetPatientIds(vtkIntArray* a);
99 vtkGetObjectMacro(PatientIds, vtkIntArray);
101
103
106 vtkSetStringMacro(Comments);
107 vtkGetStringMacro(Comments);
109
113 int Write() override;
114
119
121
127
128protected:
131
132 vtkPoints* Points[2];
137 char* Comments;
138
139 void WriteData() override {}
140 virtual void WriteData(vtkPointSet* inputs[2]);
141
142 int FillInputPortInformation(int port, vtkInformation* info) override;
143
145
146 char* FileName;
147
149
150 ostream* OpenFile();
151 void CloseFile(ostream* fp);
152
153private:
155 void operator=(const vtkMNITagPointWriter&) = delete;
156};
157
158VTK_ABI_NAMESPACE_END
159#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:53
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
Definition vtkIntArray.h:35
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
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:59
represent and manipulate 3D points
Definition vtkPoints.h:29
a vtkAbstractArray subclass for strings
abstract class to write data to file(s)
Definition vtkWriter.h:32
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270