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 =========================================================================*/
74 #ifndef vtkMINCImageReader_h
75 #define vtkMINCImageReader_h
76 
77 #include "vtkIOMINCModule.h" // For export macro
78 #include "vtkImageReader2.h"
79 
80 class vtkStringArray;
81 class vtkIdTypeArray;
82 class vtkDoubleArray;
83 class vtkMatrix4x4;
84 
85 // A special class that holds the attributes
87 
88 class VTKIOMINC_EXPORT vtkMINCImageReader : public vtkImageReader2
89 {
90 public:
92 
94  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
95 
99  virtual void SetFileName(const char *name);
100 
104  virtual const char* GetFileExtensions() {
105  return ".mnc"; }
106 
110  virtual const char* GetDescriptiveName() {
111  return "MINC"; }
112 
116  virtual int CanReadFile(const char* name);
117 
124 
126 
131  virtual double GetRescaleSlope();
132  virtual double GetRescaleIntercept();
134 
136 
141  vtkSetMacro(RescaleRealValues, int);
142  vtkBooleanMacro(RescaleRealValues, int);
143  vtkGetMacro(RescaleRealValues, int);
145 
147 
153  virtual double *GetDataRange();
154  virtual void GetDataRange(double range[2]) {
155  double *r = this->GetDataRange();
156  range[0] = r[0]; range[1] = r[1]; };
158 
162  virtual int GetNumberOfTimeSteps();
163 
165 
168  vtkSetMacro(TimeStep, int);
169  vtkGetMacro(TimeStep, int);
171 
177 
178 protected:
181 
184 
185  double ValidRange[2];
186  double ImageRange[2];
187  double DataRange[2];
188 
190  int TimeStep;
192  double RescaleSlope;
196 
198 
199  virtual int OpenNetCDFFile(const char *filename, int& ncid);
200  virtual int CloseNetCDFFile(int ncid);
201  virtual int IndexFromDimensionName(const char *dimName);
202  virtual int ReadMINCFileAttributes();
204  static int ConvertMINCTypeToVTKType(int minctype, int mincsigned);
205 
206  virtual void ExecuteInformation();
208 
209 private:
210  vtkMINCImageReader(const vtkMINCImageReader&) VTK_DELETE_FUNCTION;
211  void operator=(const vtkMINCImageReader&) VTK_DELETE_FUNCTION;
212 
213 };
214 
215 #endif
general representation of visualization data
Definition: vtkDataObject.h:65
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store vtkAlgorithm input/output information.
A container for a MINC image header.
A reader for MINC files.
virtual double GetRescaleIntercept()
virtual int CloseNetCDFFile(int ncid)
virtual double * GetDataRange()
Get the scalar range of the output from the information in the file header.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int IndexFromDimensionName(const char *dimName)
virtual double GetRescaleSlope()
Get the slope and intercept for rescaling the scalar values to real data values.
virtual int CanReadFile(const char *name)
Test whether the specified file can be read.
virtual vtkMINCImageAttributes * GetImageAttributes()
Get the image attributes, which contain patient information and other useful metadata.
static int ConvertMINCTypeToVTKType(int minctype, int mincsigned)
virtual void SetFileName(const char *name)
Set the file name.
virtual const char * GetFileExtensions()
Get the entension for this file format.
virtual const char * GetDescriptiveName()
Get the name of this file format.
virtual void ExecuteInformation()
static vtkMINCImageReader * New()
virtual int OpenNetCDFFile(const char *filename, int &ncid)
vtkMINCImageAttributes * ImageAttributes
virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo)
This is a convenience method that is implemented in many subclasses instead of RequestData.
virtual int ReadMINCFileAttributes()
virtual vtkMatrix4x4 * GetDirectionCosines()
Get a matrix that describes the orientation of the data.
virtual int GetNumberOfTimeSteps()
Get the number of time steps in the file.
virtual void FindRangeAndRescaleValues()
virtual void GetDataRange(double range[2])
vtkMatrix4x4 * DirectionCosines
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
a vtkAbstractArray subclass for strings
@ range
Definition: vtkX3D.h:238
@ name
Definition: vtkX3D.h:219
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.