VTK
vtkMINCImageReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMINCImageReader.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 =========================================================================*/
73 #ifndef vtkMINCImageReader_h
74 #define vtkMINCImageReader_h
75 
76 #include "vtkIOMINCModule.h" // For export macro
77 #include "vtkImageReader2.h"
78 
79 class vtkStringArray;
80 class vtkIdTypeArray;
81 class vtkDoubleArray;
82 class vtkMatrix4x4;
83 
84 // A special class that holds the attributes
86 
88 {
89 public:
91 
93  virtual void PrintSelf(ostream& os, vtkIndent indent);
94 
96  virtual void SetFileName(const char *name);
97 
99 
100  virtual const char* GetFileExtensions() {
101  return ".mnc"; }
103 
105 
106  virtual const char* GetDescriptiveName() {
107  return "MINC"; }
109 
111  virtual int CanReadFile(const char* name);
112 
117 
119 
122  virtual double GetRescaleSlope();
123  virtual double GetRescaleIntercept();
125 
127 
130  vtkSetMacro(RescaleRealValues, int);
131  vtkBooleanMacro(RescaleRealValues, int);
132  vtkGetMacro(RescaleRealValues, int);
134 
136 
140  virtual double *GetDataRange();
141  virtual void GetDataRange(double range[2]) {
142  double *r = this->GetDataRange();
143  range[0] = r[0]; range[1] = r[1]; };
145 
147  virtual int GetNumberOfTimeSteps();
148 
150 
151  vtkSetMacro(TimeStep, int);
152  vtkGetMacro(TimeStep, int);
154 
158 
159 protected:
162 
165 
166  double ValidRange[2];
167  double ImageRange[2];
168  double DataRange[2];
169 
171  int TimeStep;
173  double RescaleSlope;
177 
179 
180  virtual int OpenNetCDFFile(const char *filename, int& ncid);
181  virtual int CloseNetCDFFile(int ncid);
182  virtual int IndexFromDimensionName(const char *dimName);
183  virtual int ReadMINCFileAttributes();
185  static int ConvertMINCTypeToVTKType(int minctype, int mincsigned);
186 
187  virtual void ExecuteInformation();
189 
190 private:
191  vtkMINCImageReader(const vtkMINCImageReader&); // Not implemented
192  void operator=(const vtkMINCImageReader&); // Not implemented
193 
194 };
195 
196 #endif
vtkMINCImageReader::RescaleRealValues
int RescaleRealValues
Definition: vtkMINCImageReader.h:175
vtkMINCImageReader::GetDescriptiveName
virtual const char * GetDescriptiveName()
Definition: vtkMINCImageReader.h:106
vtkMINCImageReader::RescaleIntercept
double RescaleIntercept
Definition: vtkMINCImageReader.h:174
vtkMINCImageReader::ImageAttributes
vtkMINCImageAttributes * ImageAttributes
Definition: vtkMINCImageReader.h:176
vtkMINCImageReader::GetRescaleSlope
virtual double GetRescaleSlope()
vtkMINCImageReader::GetImageAttributes
virtual vtkMINCImageAttributes * GetImageAttributes()
vtkMINCImageReader::GetDirectionCosines
virtual vtkMatrix4x4 * GetDirectionCosines()
VTKIOMINC_EXPORT
#define VTKIOMINC_EXPORT
Definition: vtkIOMINCModule.h:15
vtkMINCImageReader::NumberOfTimeSteps
int NumberOfTimeSteps
Definition: vtkMINCImageReader.h:170
vtkMINCImageReader::IndexFromDimensionName
virtual int IndexFromDimensionName(const char *dimName)
vtkMINCImageReader::~vtkMINCImageReader
~vtkMINCImageReader()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkMINCImageReader::SetFileName
virtual void SetFileName(const char *name)
vtkgl::range
GLenum GLint * range
Definition: vtkgl.h:14180
vtkMINCImageReader::CloseNetCDFFile
virtual int CloseNetCDFFile(int ncid)
vtkMINCImageReader::DirectionCosines
vtkMatrix4x4 * DirectionCosines
Definition: vtkMINCImageReader.h:172
vtkMINCImageReader::OpenNetCDFFile
virtual int OpenNetCDFFile(const char *filename, int &ncid)
vtkMINCImageReader
A reader for MINC files.
Definition: vtkMINCImageReader.h:88
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkMINCImageReader::RescaleSlope
double RescaleSlope
Definition: vtkMINCImageReader.h:173
vtkMINCImageReader::PrintSelf
virtual void PrintSelf(ostream &os, vtkIndent indent)
vtkMINCImageReader::GetNumberOfTimeSteps
virtual int GetNumberOfTimeSteps()
vtkMINCImageReader::ExecuteInformation
virtual void ExecuteInformation()
vtkMINCImageReader::CanReadFile
virtual int CanReadFile(const char *name)
vtkMINCImageReader::FileNameHasChanged
int FileNameHasChanged
Definition: vtkMINCImageReader.h:178
vtkMINCImageReader::FindRangeAndRescaleValues
virtual void FindRangeAndRescaleValues()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkMINCImageReader::GetFileExtensions
virtual const char * GetFileExtensions()
Definition: vtkMINCImageReader.h:100
vtkMINCImageReader::ConvertMINCTypeToVTKType
static int ConvertMINCTypeToVTKType(int minctype, int mincsigned)
vtkMINCImageReader::GetRescaleIntercept
virtual double GetRescaleIntercept()
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:58
vtkMINCImageReader::TimeStep
int TimeStep
Definition: vtkMINCImageReader.h:171
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkMINCImageReader::GetDataRange
virtual double * GetDataRange()
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkMINCImageReader::New
static vtkMINCImageReader * New()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:49
vtkMINCImageReader::MINCImageType
int MINCImageType
Definition: vtkMINCImageReader.h:163
vtkMINCImageReader::GetDataRange
virtual void GetDataRange(double range[2])
Definition: vtkMINCImageReader.h:141
vtkMINCImageReader::vtkMINCImageReader
vtkMINCImageReader()
vtkIOMINCModule.h
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
vtkMINCImageReader::ExecuteDataWithInformation
virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo)
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkMINCImageReader::MINCImageTypeSigned
int MINCImageTypeSigned
Definition: vtkMINCImageReader.h:164
vtkMINCImageAttributes
A container for a MINC image header.
Definition: vtkMINCImageAttributes.h:86
vtkMINCImageReader::ReadMINCFileAttributes
virtual int ReadMINCFileAttributes()
vtkImageReader2.h