VTK  9.2.6
vtkMINCImageAttributes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMINCImageAttributes.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 vtkMINCImageAttributes_h
72 #define vtkMINCImageAttributes_h
73 
74 #include "vtkIOMINCModule.h" // For export macro
75 #include "vtkObject.h"
76 
77 class vtkDataArray;
78 class vtkStringArray;
79 class vtkIdTypeArray;
80 class vtkDoubleArray;
81 class vtkMatrix4x4;
82 
83 // A special class that holds the attributes
84 class vtkMINCImageAttributeMap;
85 
86 class VTKIOMINC_EXPORT vtkMINCImageAttributes : public vtkObject
87 {
88 public:
90 
91  static vtkMINCImageAttributes* New();
92  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
98  virtual void Reset();
99 
101 
106  vtkSetStringMacro(Name);
107  vtkGetStringMacro(Name);
109 
111 
117  vtkSetMacro(DataType, int);
118  vtkGetMacro(DataType, int);
120 
122 
128  virtual void AddDimension(const char* dimension) { this->AddDimension(dimension, 0); }
129  virtual void AddDimension(const char* dimension, vtkIdType length);
131 
139  virtual vtkStringArray* GetDimensionNames() { return this->DimensionNames; }
140 
146  virtual vtkIdTypeArray* GetDimensionLengths() { return this->DimensionLengths; }
147 
151  virtual vtkStringArray* GetVariableNames() { return this->VariableNames; }
152 
157  virtual vtkStringArray* GetAttributeNames(const char* variable);
158 
160 
165  virtual void SetImageMin(vtkDoubleArray* imageMin);
166  virtual void SetImageMax(vtkDoubleArray* imageMax);
167  virtual vtkDoubleArray* GetImageMin() { return this->ImageMin; }
168  virtual vtkDoubleArray* GetImageMax() { return this->ImageMax; }
170 
172 
175  vtkGetMacro(NumberOfImageMinMaxDimensions, int);
176  vtkSetMacro(NumberOfImageMinMaxDimensions, int);
178 
182  virtual int HasAttribute(const char* variable, const char* attribute);
183 
185 
189  virtual void SetAttributeValueAsArray(
190  const char* variable, const char* attribute, vtkDataArray* array);
191  virtual vtkDataArray* GetAttributeValueAsArray(const char* variable, const char* attribute);
193 
195 
201  virtual void SetAttributeValueAsString(
202  const char* variable, const char* attribute, const char* value);
203  virtual const char* GetAttributeValueAsString(const char* variable, const char* attribute);
205 
207 
213  virtual void SetAttributeValueAsInt(const char* variable, const char* attribute, int value);
214  virtual int GetAttributeValueAsInt(const char* variable, const char* attribute);
216 
218 
224  virtual void SetAttributeValueAsDouble(const char* variable, const char* attribute, double value);
225  virtual double GetAttributeValueAsDouble(const char* variable, const char* attribute);
227 
237  virtual int ValidateAttribute(const char* varname, const char* attname, vtkDataArray* array);
238 
240 
244  vtkSetMacro(ValidateAttributes, vtkTypeBool);
245  vtkBooleanMacro(ValidateAttributes, vtkTypeBool);
246  vtkGetMacro(ValidateAttributes, vtkTypeBool);
248 
257  virtual void ShallowCopy(vtkMINCImageAttributes* source);
258 
263  virtual void FindValidRange(double range[2]);
264 
269  virtual void FindImageRange(double range[2]);
270 
272 
276  virtual void PrintFileHeader();
277  virtual void PrintFileHeader(ostream& os);
279 
280 protected:
282  ~vtkMINCImageAttributes() override;
283 
284  const char* ConvertDataArrayToString(vtkDataArray* array);
285 
286  virtual int ValidateGlobalAttribute(const char* attrib, vtkDataArray* array);
287  virtual int ValidateGeneralAttribute(
288  const char* varname, const char* attname, vtkDataArray* array);
289  virtual int ValidateDimensionAttribute(
290  const char* varname, const char* attname, vtkDataArray* array);
291  virtual int ValidateImageAttribute(const char* varname, const char* attname, vtkDataArray* array);
292  virtual int ValidateImageMinMaxAttribute(
293  const char* varname, const char* attname, vtkDataArray* array);
294  virtual int ValidatePatientAttribute(
295  const char* varname, const char* attname, vtkDataArray* array);
296  virtual int ValidateStudyAttribute(const char* varname, const char* attname, vtkDataArray* array);
297  virtual int ValidateAcquisitionAttribute(
298  const char* varname, const char* attname, vtkDataArray* array);
299 
302 
304  vtkMINCImageAttributeMap* AttributeNames;
305  vtkMINCImageAttributeMap* AttributeValues;
306 
308 
312 
313  int DataType;
314  char* Name;
315 
317 
318 private:
320  void operator=(const vtkMINCImageAttributes&) = delete;
321 };
322 
323 #endif /* vtkMINCImageAttributes_h */
vtkMINCImageAttributeMap * AttributeValues
abstract base class for most VTK objects
Definition: vtkObject.h:62
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
virtual vtkDoubleArray * GetImageMax()
Get the image min and max arrays.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a vtkAbstractArray subclass for strings
vtkMINCImageAttributeMap * AttributeNames
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:332
virtual vtkDoubleArray * GetImageMin()
Get the image min and max arrays.
virtual vtkStringArray * GetDimensionNames()
Get the dimension names.
dynamic, self-adjusting array of double
int vtkTypeBool
Definition: vtkABI.h:69
virtual vtkIdTypeArray * GetDimensionLengths()
Get the lengths of all the dimensions.
A container for a MINC image header.
virtual void AddDimension(const char *dimension)
Add the names of up to five dimensions.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkStringArray * GetVariableNames()
Get the names of all the variables.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...