VTK  9.3.20240423
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
27#ifndef vtkMNITagPointWriter_h
28#define vtkMNITagPointWriter_h
29
30#include "vtkIOMINCModule.h" // For export macro
31#include "vtkWriter.h"
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkDataSet;
35class vtkPointSet;
36class vtkStringArray;
37class vtkDoubleArray;
38class vtkIntArray;
39class vtkPoints;
40
41class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
42{
43public:
45
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
52 virtual const char* GetFileExtensions() { return ".tag"; }
53
57 virtual const char* GetDescriptiveName() { return "MNI tags"; }
58
60
63 virtual void SetPoints(int port, vtkPoints* points);
64 virtual void SetPoints(vtkPoints* points) { this->SetPoints(0, points); }
65 virtual vtkPoints* GetPoints(int port);
66 virtual vtkPoints* GetPoints() { return this->GetPoints(0); }
68
70
74 virtual void SetLabelText(vtkStringArray* a);
75 vtkGetObjectMacro(LabelText, vtkStringArray);
77
79
83 virtual void SetWeights(vtkDoubleArray* a);
84 vtkGetObjectMacro(Weights, vtkDoubleArray);
86
88
92 virtual void SetStructureIds(vtkIntArray* a);
93 vtkGetObjectMacro(StructureIds, vtkIntArray);
95
97
101 virtual void SetPatientIds(vtkIntArray* a);
102 vtkGetObjectMacro(PatientIds, vtkIntArray);
104
106
109 vtkSetStringMacro(Comments);
110 vtkGetStringMacro(Comments);
112
116 int Write() override;
117
122
124
130
131protected:
134
135 vtkPoints* Points[2];
140 char* Comments;
141
142 void WriteData() override {}
143 virtual void WriteData(vtkPointSet* inputs[2]);
144
145 int FillInputPortInformation(int port, vtkInformation* info) override;
146
148
149 char* FileName;
150
152
153 ostream* OpenFile();
154 void CloseFile(ostream* fp);
155
156private:
158 void operator=(const vtkMNITagPointWriter&) = delete;
159};
160
161VTK_ABI_NAMESPACE_END
162#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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
dynamic, self-adjusting array of int
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:98
represent and manipulate 3D points
Definition vtkPoints.h:139
a vtkAbstractArray subclass for strings
abstract class to write data to file(s)
Definition vtkWriter.h:35
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270