VTK
vtkTIFFReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTIFFReader.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 =========================================================================*/
31 #ifndef vtkTIFFReader_h
32 #define vtkTIFFReader_h
33 
34 #include "vtkImageReader2.h"
35 
37 {
38 public:
39  static vtkTIFFReader *New();
41  virtual void PrintSelf(ostream& os, vtkIndent indent);
42 
44  virtual int CanReadFile(const char* fname);
45 
47 
49  virtual const char* GetFileExtensions()
50  {
51  return ".tif .tiff";
52  }
54 
56 
58  virtual const char* GetDescriptiveName()
59  {
60  return "TIFF";
61  }
63 
65 
75  void SetOrientationType(unsigned int orientationType);
76  vtkGetMacro(OrientationType, unsigned int)
78 
80 
81  vtkGetMacro(OrientationTypeSpecifiedFlag, bool)
83 
85 
86  vtkSetMacro(OriginSpecifiedFlag, bool)
87  vtkGetMacro(OriginSpecifiedFlag, bool)
88  vtkBooleanMacro(OriginSpecifiedFlag, bool)
90 
92 
93  vtkSetMacro(SpacingSpecifiedFlag, bool)
94  vtkGetMacro(SpacingSpecifiedFlag, bool)
95  vtkBooleanMacro(SpacingSpecifiedFlag, bool)
97 
98 protected:
99  vtkTIFFReader();
100  ~vtkTIFFReader();
101 
102  enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
103 
104  virtual void ExecuteInformation();
105  virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo);
106 
107 private:
108  vtkTIFFReader(const vtkTIFFReader&); // Not implemented.
109  void operator=(const vtkTIFFReader&); // Not implemented.
110 
112 
113  template<typename T>
114  int EvaluateImageAt(T* out, T* in);
116 
118 
119  void GetColor(int index,
120  unsigned short *r, unsigned short *g, unsigned short *b);
122 
123  // To support Zeiss images
124  void ReadTwoSamplesPerPixelImage(void *out,
125  unsigned int vtkNotUsed(width),
126  unsigned int height);
127 
128  unsigned int GetFormat();
129 
131  void Initialize();
132 
134 
135  template<typename T>
136  void ReadImageInternal(T* buffer);
138 
140 
141  template<typename T>
142  void ReadVolume(T* buffer);
144 
146  void ReadTiles(void* buffer);
147 
149 
150  template<typename T>
151  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
153 
155 
157  template <typename T>
158  void Process(T *outPtr, int outExtent[6], vtkIdType outIncr[3]);
160 
162 
163  template <typename T>
164  void Process2(T *outPtr, int *outExt);
166 
167  class vtkTIFFReaderInternal;
168 
169  unsigned short *ColorRed;
170  unsigned short *ColorGreen;
171  unsigned short *ColorBlue;
172  int TotalColors;
173  unsigned int ImageFormat;
174  vtkTIFFReaderInternal *InternalImage;
175  int OutputExtent[6];
176  vtkIdType OutputIncrements[3];
177  unsigned int OrientationType;
178  bool OrientationTypeSpecifiedFlag;
179  bool OriginSpecifiedFlag;
180  bool SpacingSpecifiedFlag;
181 };
182 
183 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:36
int vtkIdType
Definition: vtkType.h:275
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual void ExecuteInformation()
Superclass of binary file readers.
virtual const char * GetDescriptiveName()
Definition: vtkTIFFReader.h:58
#define VTKIOIMAGE_EXPORT
virtual void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo)
general representation of visualization data
Definition: vtkDataObject.h:64