VTK
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 =========================================================================*/
65 #ifndef vtkMNITagPointWriter_h
66 #define vtkMNITagPointWriter_h
67 
68 #include "vtkIOMINCModule.h" // For export macro
69 #include "vtkWriter.h"
70 
71 class vtkDataSet;
72 class vtkPointSet;
73 class vtkStringArray;
74 class vtkDoubleArray;
75 class vtkIntArray;
76 class vtkPoints;
77 
78 class VTKIOMINC_EXPORT vtkMNITagPointWriter : public vtkWriter
79 {
80 public:
82 
83  static vtkMNITagPointWriter *New();
84  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
85 
89  virtual const char* GetFileExtensions() {
90  return ".tag"; }
91 
95  virtual const char* GetDescriptiveName() {
96  return "MNI tags"; }
97 
99 
102  virtual void SetPoints(int port, vtkPoints *points);
103  virtual void SetPoints(vtkPoints *points) {
104  this->SetPoints(0, points); }
105  virtual vtkPoints *GetPoints(int port);
106  virtual vtkPoints *GetPoints() {
107  return this->GetPoints(0); }
109 
111 
115  virtual void SetLabelText(vtkStringArray *a);
116  vtkGetObjectMacro(LabelText, vtkStringArray);
118 
120 
124  virtual void SetWeights(vtkDoubleArray *a);
125  vtkGetObjectMacro(Weights, vtkDoubleArray);
127 
129 
133  virtual void SetStructureIds(vtkIntArray *a);
134  vtkGetObjectMacro(StructureIds, vtkIntArray);
136 
138 
142  virtual void SetPatientIds(vtkIntArray *a);
143  vtkGetObjectMacro(PatientIds, vtkIntArray);
145 
147 
150  vtkSetStringMacro(Comments);
151  vtkGetStringMacro(Comments);
153 
157  int Write() VTK_OVERRIDE;
158 
162  vtkMTimeType GetMTime() VTK_OVERRIDE;
163 
165 
168  vtkSetStringMacro(FileName);
169  vtkGetStringMacro(FileName);
171 
172 protected:
174  ~vtkMNITagPointWriter() VTK_OVERRIDE;
175 
176  vtkPoints *Points[2];
181  char *Comments;
182 
183  void WriteData() VTK_OVERRIDE {}
184  virtual void WriteData(vtkPointSet *inputs[2]);
185 
186  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
187 
189  vtkInformationVector *) VTK_OVERRIDE;
190 
191  char* FileName;
192 
193  int FileType;
194 
195  ostream *OpenFile();
196  void CloseFile(ostream *fp);
197 
198 private:
199  vtkMNITagPointWriter(const vtkMNITagPointWriter&) VTK_DELETE_FUNCTION;
200  void operator=(const vtkMNITagPointWriter&) VTK_DELETE_FUNCTION;
201 
202 };
203 
204 #endif
vtkStringArray * LabelText
A writer for MNI tag point files.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
a vtkAbstractArray subclass for strings
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:39
virtual const char * GetDescriptiveName()
Get the name of this file format.
dynamic, self-adjusting array of double
abstract class to write data to file(s)
Definition: vtkWriter.h:42
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of int
Definition: vtkIntArray.h:39
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
virtual void SetPoints(vtkPoints *points)
Set the points (unless you set them as inputs).
virtual const char * GetFileExtensions()
Get the entension for this file format.
virtual int Write()
Write data to output.
Store zero or more vtkInformation instances.
virtual vtkPoints * GetPoints()
Set the points (unless you set them as inputs).
static vtkAlgorithm * New()
virtual void WriteData()=0
represent and manipulate 3D points
Definition: vtkPoints.h:33