VTK  9.3.20240327
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 
33 VTK_ABI_NAMESPACE_BEGIN
34 class vtkDataSet;
35 class vtkPointSet;
36 class vtkStringArray;
37 class vtkDoubleArray;
38 class vtkIntArray;
39 class vtkPoints;
40 
41 class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
42 {
43 public:
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 
121  vtkMTimeType GetMTime() override;
122 
124 
130 
131 protected:
134 
135  vtkPoints* Points[2];
140  char* Comments;
141 
142  void WriteData() override {}
143  virtual void WriteData(vtkPointSet* inputs[2]);
144 
146 
148 
149  char* FileName;
150 
151  int FileType;
152 
153  ostream* OpenFile();
154  void CloseFile(ostream* fp);
155 
156 private:
158  void operator=(const vtkMNITagPointWriter&) = delete;
159 };
160 
161 VTK_ABI_NAMESPACE_END
162 #endif
abstract class to specify dataset behavior
Definition: vtkDataSet.h:165
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
Definition: vtkIntArray.h:144
A writer for MNI tag point files.
virtual vtkPoints * GetPoints()
Set the points (unless you set them as inputs).
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)
static vtkMNITagPointWriter * New()
virtual void WriteData(vtkPointSet *inputs[2])
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).
ostream * OpenFile()
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(int port)
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.
virtual const char * GetDescriptiveName()
Get the name of this file format.
virtual const char * GetFileExtensions()
Get the extension for this file format.
vtkMTimeType GetMTime() override
Get the MTime.
vtkGetFilePathMacro(FileName)
Specify file name of vtk polygon data file to write.
~vtkMNITagPointWriter() override
concrete class for storing a set of points
Definition: vtkPointSet.h:97
represent and manipulate 3D points
Definition: vtkPoints.h:138
a vtkAbstractArray subclass for strings
abstract class to write data to file(s)
Definition: vtkWriter.h:35
@ points
Definition: vtkX3D.h:446
@ info
Definition: vtkX3D.h:376
@ port
Definition: vtkX3D.h:447
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270