VTK  9.1.0
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
17Copyright (c) 2006 Atamai, Inc.
18
19Use, modification and redistribution of the software, in source or
20binary forms, are permitted provided that the following terms and
21conditions are met:
22
231) 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
282) 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
333) 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
36THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS"
37WITHOUT EXPRESSED OR IMPLIED WARRANTY INCLUDING, BUT NOT LIMITED TO,
38THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39PURPOSE. IN NO EVENT SHALL ANY COPYRIGHT HOLDER OR OTHER PARTY WHO MAY
40MODIFY AND/OR REDISTRIBUTE THE SOFTWARE UNDER THE TERMS OF THIS LICENSE
41BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES
42(INCLUDING, BUT NOT LIMITED TO, LOSS OF DATA OR DATA BECOMING INACCURATE
43OR LOSS OF PROFIT OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF
44THE USE OR INABILITY TO USE THE SOFTWARE, EVEN IF ADVISED OF THE
45POSSIBILITY OF SUCH DAMAGES.
46
47=========================================================================*/
68#ifndef vtkMINCImageAttributes_h
69#define vtkMINCImageAttributes_h
70
71#include "vtkIOMINCModule.h" // For export macro
72#include "vtkObject.h"
73
74class vtkDataArray;
75class vtkStringArray;
76class vtkIdTypeArray;
77class vtkDoubleArray;
78class vtkMatrix4x4;
79
80// A special class that holds the attributes
81class vtkMINCImageAttributeMap;
82
83class VTKIOMINC_EXPORT vtkMINCImageAttributes : public vtkObject
84{
85public:
87
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
95 virtual void Reset();
96
98
103 vtkSetStringMacro(Name);
104 vtkGetStringMacro(Name);
106
108
114 vtkSetMacro(DataType, int);
115 vtkGetMacro(DataType, int);
117
119
125 virtual void AddDimension(const char* dimension) { this->AddDimension(dimension, 0); }
126 virtual void AddDimension(const char* dimension, vtkIdType length);
128
136 virtual vtkStringArray* GetDimensionNames() { return this->DimensionNames; }
137
143 virtual vtkIdTypeArray* GetDimensionLengths() { return this->DimensionLengths; }
144
148 virtual vtkStringArray* GetVariableNames() { return this->VariableNames; }
149
154 virtual vtkStringArray* GetAttributeNames(const char* variable);
155
157
162 virtual void SetImageMin(vtkDoubleArray* imageMin);
163 virtual void SetImageMax(vtkDoubleArray* imageMax);
164 virtual vtkDoubleArray* GetImageMin() { return this->ImageMin; }
165 virtual vtkDoubleArray* GetImageMax() { return this->ImageMax; }
167
169
172 vtkGetMacro(NumberOfImageMinMaxDimensions, int);
173 vtkSetMacro(NumberOfImageMinMaxDimensions, int);
175
179 virtual int HasAttribute(const char* variable, const char* attribute);
180
182
187 const char* variable, const char* attribute, vtkDataArray* array);
188 virtual vtkDataArray* GetAttributeValueAsArray(const char* variable, const char* attribute);
190
192
199 const char* variable, const char* attribute, const char* value);
200 virtual const char* GetAttributeValueAsString(const char* variable, const char* attribute);
202
204
210 virtual void SetAttributeValueAsInt(const char* variable, const char* attribute, int value);
211 virtual int GetAttributeValueAsInt(const char* variable, const char* attribute);
213
215
221 virtual void SetAttributeValueAsDouble(const char* variable, const char* attribute, double value);
222 virtual double GetAttributeValueAsDouble(const char* variable, const char* attribute);
224
234 virtual int ValidateAttribute(const char* varname, const char* attname, vtkDataArray* array);
235
237
241 vtkSetMacro(ValidateAttributes, vtkTypeBool);
242 vtkBooleanMacro(ValidateAttributes, vtkTypeBool);
243 vtkGetMacro(ValidateAttributes, vtkTypeBool);
245
255
260 virtual void FindValidRange(double range[2]);
261
266 virtual void FindImageRange(double range[2]);
267
269
273 virtual void PrintFileHeader();
274 virtual void PrintFileHeader(ostream& os);
276
277protected:
280
282
283 virtual int ValidateGlobalAttribute(const char* attrib, vtkDataArray* array);
285 const char* varname, const char* attname, vtkDataArray* array);
287 const char* varname, const char* attname, vtkDataArray* array);
288 virtual int ValidateImageAttribute(const char* varname, const char* attname, vtkDataArray* array);
290 const char* varname, const char* attname, vtkDataArray* array);
292 const char* varname, const char* attname, vtkDataArray* array);
293 virtual int ValidateStudyAttribute(const char* varname, const char* attname, vtkDataArray* array);
295 const char* varname, const char* attname, vtkDataArray* array);
296
299
301 vtkMINCImageAttributeMap* AttributeNames;
302 vtkMINCImageAttributeMap* AttributeValues;
303
305
309
311 char* Name;
312
314
315private:
317 void operator=(const vtkMINCImageAttributes&) = delete;
318};
319
320#endif /* vtkMINCImageAttributes_h */
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
A container for a MINC image header.
virtual double GetAttributeValueAsDouble(const char *variable, const char *attribute)
Set an attribute value as a double.
virtual const char * GetAttributeValueAsString(const char *variable, const char *attribute)
Set an attribute value as a string.
virtual vtkStringArray * GetVariableNames()
Get the names of all the variables.
virtual void FindImageRange(double range[2])
Find the image range of the data from the information stored in the attributes.
vtkMINCImageAttributeMap * AttributeNames
virtual vtkDoubleArray * GetImageMax()
Get the image min and max arrays.
virtual void FindValidRange(double range[2])
Find the valid range of the data from the information stored in the attributes.
vtkMINCImageAttributeMap * AttributeValues
virtual vtkIdTypeArray * GetDimensionLengths()
Get the lengths of all the dimensions.
virtual vtkStringArray * GetAttributeNames(const char *variable)
List the attribute names for a variable.
virtual vtkDataArray * GetAttributeValueAsArray(const char *variable, const char *attribute)
Set attribute values for a variable as a vtkDataArray.
virtual vtkStringArray * GetDimensionNames()
Get the dimension names.
virtual int ValidateStudyAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual void Reset()
Reset all the attributes in preparation for loading new information.
const char * ConvertDataArrayToString(vtkDataArray *array)
virtual void PrintFileHeader()
A diagnostic function.
virtual int ValidateDimensionAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual void PrintFileHeader(ostream &os)
A diagnostic function.
virtual void SetAttributeValueAsInt(const char *variable, const char *attribute, int value)
Set an attribute value as an int.
virtual void SetImageMax(vtkDoubleArray *imageMax)
Get the image min and max arrays.
virtual void SetAttributeValueAsString(const char *variable, const char *attribute, const char *value)
Set an attribute value as a string.
virtual vtkDoubleArray * GetImageMin()
Get the image min and max arrays.
virtual int ValidateImageMinMaxAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual int HasAttribute(const char *variable, const char *attribute)
Check to see if a particular attribute exists.
virtual void ShallowCopy(vtkMINCImageAttributes *source)
Do a shallow copy.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int GetAttributeValueAsInt(const char *variable, const char *attribute)
Set an attribute value as an int.
virtual int ValidateGeneralAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual void SetAttributeValueAsDouble(const char *variable, const char *attribute, double value)
Set an attribute value as a double.
virtual int ValidateAttribute(const char *varname, const char *attname, vtkDataArray *array)
Validate a particular attribute.
static vtkMINCImageAttributes * New()
virtual void AddDimension(const char *dimension)
Add the names of up to five dimensions.
virtual int ValidateGlobalAttribute(const char *attrib, vtkDataArray *array)
virtual void SetAttributeValueAsArray(const char *variable, const char *attribute, vtkDataArray *array)
Set attribute values for a variable as a vtkDataArray.
virtual int ValidateImageAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual void SetImageMin(vtkDoubleArray *imageMin)
Get the image min and max arrays.
~vtkMINCImageAttributes() override
virtual int ValidateAcquisitionAttribute(const char *varname, const char *attname, vtkDataArray *array)
virtual void AddDimension(const char *dimension, vtkIdType length)
Add the names of up to five dimensions.
virtual int ValidatePatientAttribute(const char *varname, const char *attname, vtkDataArray *array)
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
abstract base class for most VTK objects
Definition: vtkObject.h:73
a vtkAbstractArray subclass for strings
@ length
Definition: vtkX3D.h:399
@ value
Definition: vtkX3D.h:226
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
int vtkIdType
Definition: vtkType.h:332