VTK  9.0.3
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) override;
37 
41  int CanReadFile(const char* fname) override;
42 
48  const char* GetFileExtensions() override { return ".tif .tiff"; }
49 
54  const char* GetDescriptiveName() override { return "TIFF"; }
55 
68  void SetOrientationType(unsigned int orientationType);
69  vtkGetMacro(OrientationType, unsigned int);
70 
72 
75  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
77 
79 
82  vtkSetMacro(OriginSpecifiedFlag, bool);
83  vtkGetMacro(OriginSpecifiedFlag, bool);
84  vtkBooleanMacro(OriginSpecifiedFlag, bool);
86 
88 
91  vtkSetMacro(SpacingSpecifiedFlag, bool);
92  vtkGetMacro(SpacingSpecifiedFlag, bool);
93  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
95 
97 
101  vtkSetMacro(IgnoreColorMap, bool);
102  vtkGetMacro(IgnoreColorMap, bool);
103  vtkBooleanMacro(IgnoreColorMap, bool);
105 protected:
107  ~vtkTIFFReader() override;
108 
109  enum
110  {
116  OTHER
117  };
118 
119  void ExecuteInformation() override;
121 
122  class vtkTIFFReaderInternal;
124 
125 private:
126  vtkTIFFReader(const vtkTIFFReader&) = delete;
127  void operator=(const vtkTIFFReader&) = delete;
128 
132  template <typename T>
133  int EvaluateImageAt(T* out, T* in);
134 
138  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
139 
140  // To support Zeiss images
141  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
142 
143  unsigned int GetFormat();
144 
148  void Initialize();
149 
153  template <typename T>
154  void ReadImageInternal(T* buffer);
155 
159  template <typename T>
160  void ReadVolume(T* buffer);
161 
165  void ReadTiles(void* buffer);
166 
170  template <typename T>
171  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
172 
176  template <typename T>
177  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
178 
182  template <typename T>
183  void Process2(T* outPtr, int* outExt);
184 
185  unsigned short* ColorRed;
186  unsigned short* ColorGreen;
187  unsigned short* ColorBlue;
188  int TotalColors;
189  unsigned int ImageFormat;
190  int OutputExtent[6];
191  vtkIdType OutputIncrements[3];
192  unsigned int OrientationType;
193  bool OrientationTypeSpecifiedFlag;
194  bool OriginSpecifiedFlag;
195  bool SpacingSpecifiedFlag;
196  bool IgnoreColorMap;
197 };
198 
199 #endif
general representation of visualization data
Definition: vtkDataObject.h:60
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:34
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:32
vtkTIFFReaderInternal * InternalImage
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
static vtkTIFFReader * New()
int CanReadFile(const char *fname) override
Is the given file name a tiff file?
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkTIFFReader.h:48
~vtkTIFFReader() override
void ExecuteInformation() override
void SetOrientationType(unsigned int orientationType)
Set orientation type ORIENTATION_TOPLEFT 1 (row 0 top, col 0 lhs) ORIENTATION_TOPRIGHT 2 (row 0 top,...
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkTIFFReader.h:54
@ height
Definition: vtkX3D.h:260
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:338