VTK  9.0.1
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 
17 Copyright (c) 2006 Atamai, Inc.
18 
19 Use, modification and redistribution of the software, in source or
20 binary forms, are permitted provided that the following terms and
21 conditions are met:
22 
23 1) 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 
28 2) 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 
33 3) 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 
36 THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37 WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40 MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42 (INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43 OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44 THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45 POSSIBILITY OF SUCH DAMAGES.
46 
47 =========================================================================*/
71 #ifndef vtkMNITagPointWriter_h
72 #define vtkMNITagPointWriter_h
73 
74 #include "vtkIOMINCModule.h" // For export macro
75 #include "vtkWriter.h"
76 
77 class vtkDataSet;
78 class vtkPointSet;
79 class vtkStringArray;
80 class vtkDoubleArray;
81 class vtkIntArray;
82 class vtkPoints;
83 
84 class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
85 {
86 public:
88 
89  static vtkMNITagPointWriter* New();
90  void PrintSelf(ostream& os, vtkIndent indent) override;
91 
95  virtual const char* GetFileExtensions() { return ".tag"; }
96 
100  virtual const char* GetDescriptiveName() { return "MNI tags"; }
101 
103 
106  virtual void SetPoints(int port, vtkPoints* points);
107  virtual void SetPoints(vtkPoints* points) { this->SetPoints(0, points); }
108  virtual vtkPoints* GetPoints(int port);
109  virtual vtkPoints* GetPoints() { return this->GetPoints(0); }
111 
113 
117  virtual void SetLabelText(vtkStringArray* a);
118  vtkGetObjectMacro(LabelText, vtkStringArray);
120 
122 
126  virtual void SetWeights(vtkDoubleArray* a);
127  vtkGetObjectMacro(Weights, vtkDoubleArray);
129 
131 
135  virtual void SetStructureIds(vtkIntArray* a);
136  vtkGetObjectMacro(StructureIds, vtkIntArray);
138 
140 
144  virtual void SetPatientIds(vtkIntArray* a);
145  vtkGetObjectMacro(PatientIds, vtkIntArray);
147 
149 
152  vtkSetStringMacro(Comments);
153  vtkGetStringMacro(Comments);
155 
159  int Write() override;
160 
164  vtkMTimeType GetMTime() override;
165 
167 
170  vtkSetStringMacro(FileName);
171  vtkGetStringMacro(FileName);
173 
174 protected:
176  ~vtkMNITagPointWriter() override;
177 
178  vtkPoints* Points[2];
183  char* Comments;
184 
185  void WriteData() override {}
186  virtual void WriteData(vtkPointSet* inputs[2]);
187 
188  int FillInputPortInformation(int port, vtkInformation* info) override;
189 
191 
192  char* FileName;
193 
194  int FileType;
195 
196  ostream* OpenFile();
197  void CloseFile(ostream* fp);
198 
199 private:
201  void operator=(const vtkMNITagPointWriter&) = delete;
202 };
203 
204 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkMNITagPointWriter::Weights
vtkDoubleArray * Weights
Definition: vtkMNITagPointWriter.h:180
vtkWriter::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkMNITagPointWriter::GetDescriptiveName
virtual const char * GetDescriptiveName()
Get the name of this file format.
Definition: vtkMNITagPointWriter.h:100
vtkAlgorithm::FillInputPortInformation
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkMNITagPointWriter::FileName
char * FileName
Definition: vtkMNITagPointWriter.h:192
vtkWriter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkWriter::Write
virtual int Write()
Write data to output.
vtkMNITagPointWriter::PatientIds
vtkIntArray * PatientIds
Definition: vtkMNITagPointWriter.h:182
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkMNITagPointWriter::SetPoints
virtual void SetPoints(vtkPoints *points)
Definition: vtkMNITagPointWriter.h:107
vtkWriter::WriteData
virtual void WriteData()=0
vtkMNITagPointWriter::StructureIds
vtkIntArray * StructureIds
Definition: vtkMNITagPointWriter.h:181
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkIntArray
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:39
vtkWriter
abstract class to write data to file(s)
Definition: vtkWriter.h:45
vtkMNITagPointWriter
A writer for MNI tag point files.
Definition: vtkMNITagPointWriter.h:84
vtkMNITagPointWriter::WriteData
void WriteData() override
Definition: vtkMNITagPointWriter.h:185
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkMNITagPointWriter::LabelText
vtkStringArray * LabelText
Definition: vtkMNITagPointWriter.h:179
vtkWriter.h
vtkMNITagPointWriter::FileType
int FileType
Definition: vtkMNITagPointWriter.h:194
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:62
vtkMNITagPointWriter::Comments
char * Comments
Definition: vtkMNITagPointWriter.h:183
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:36
vtkMNITagPointWriter::GetFileExtensions
virtual const char * GetFileExtensions()
Get the extension for this file format.
Definition: vtkMNITagPointWriter.h:95
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkMNITagPointWriter::GetPoints
virtual vtkPoints * GetPoints()
Definition: vtkMNITagPointWriter.h:109
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293