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 =========================================================================*/
26 #ifndef vtkTIFFReader_h
27 #define vtkTIFFReader_h
28 
29 #include "vtkImageReader2.h"
30 
31 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
32 {
33 public:
34  static vtkTIFFReader *New();
36  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
37 
41  int CanReadFile(const char* fname) VTK_OVERRIDE;
42 
48  const char* GetFileExtensions() VTK_OVERRIDE
49  {
50  return ".tif .tiff";
51  }
52 
57  const char* GetDescriptiveName() VTK_OVERRIDE
58  {
59  return "TIFF";
60  }
61 
74  void SetOrientationType(unsigned int orientationType);
75  vtkGetMacro(OrientationType, unsigned int)
76 
77  //@{
81  vtkGetMacro(OrientationTypeSpecifiedFlag, bool)
83 
85 
88  vtkSetMacro(OriginSpecifiedFlag, bool)
89  vtkGetMacro(OriginSpecifiedFlag, bool)
90  vtkBooleanMacro(OriginSpecifiedFlag, bool)
92 
94 
97  vtkSetMacro(SpacingSpecifiedFlag, bool)
98  vtkGetMacro(SpacingSpecifiedFlag, bool)
99  vtkBooleanMacro(SpacingSpecifiedFlag, bool)
101 
102 protected:
103  vtkTIFFReader();
104  ~vtkTIFFReader() VTK_OVERRIDE;
105 
106  enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
107 
108  void ExecuteInformation() VTK_OVERRIDE;
109  void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) VTK_OVERRIDE;
110 
111 private:
112  vtkTIFFReader(const vtkTIFFReader&) VTK_DELETE_FUNCTION;
113  void operator=(const vtkTIFFReader&) VTK_DELETE_FUNCTION;
114 
118  template<typename T>
119  int EvaluateImageAt(T* out, T* in);
120 
124  void GetColor(int index,
125  unsigned short *r, unsigned short *g, unsigned short *b);
126 
127  // To support Zeiss images
128  void ReadTwoSamplesPerPixelImage(void *out,
129  unsigned int vtkNotUsed(width),
130  unsigned int height);
131 
132  unsigned int GetFormat();
133 
137  void Initialize();
138 
142  template<typename T>
143  void ReadImageInternal(T* buffer);
144 
148  template<typename T>
149  void ReadVolume(T* buffer);
150 
154  void ReadTiles(void* buffer);
155 
159  template<typename T>
160  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
161 
165  template <typename T>
166  void Process(T *outPtr, int outExtent[6], vtkIdType outIncr[3]);
167 
171  template <typename T>
172  void Process2(T *outPtr, int *outExt);
173 
174  class vtkTIFFReaderInternal;
175 
176  unsigned short *ColorRed;
177  unsigned short *ColorGreen;
178  unsigned short *ColorBlue;
179  int TotalColors;
180  unsigned int ImageFormat;
181  vtkTIFFReaderInternal *InternalImage;
182  int OutputExtent[6];
183  vtkIdType OutputIncrements[3];
184  unsigned int OrientationType;
185  bool OrientationTypeSpecifiedFlag;
186  bool OriginSpecifiedFlag;
187  bool SpacingSpecifiedFlag;
188 };
189 
190 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkTIFFReader.h:57
read TIFF files
Definition: vtkTIFFReader.h:31
int vtkIdType
Definition: vtkType.h:345
virtual int CanReadFile(const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void ExecuteInformation()
Superclass of binary file readers.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkTIFFReader.h:48
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:58