VTK  9.2.6
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 =========================================================================*/
38 #ifndef vtkTIFFReader_h
39 #define vtkTIFFReader_h
40 
41 #include "vtkImageReader2.h"
42 
43 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
44 {
45 public:
46  static vtkTIFFReader* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
53  int CanReadFile(VTK_FILEPATH const char* fname) override;
54 
60  const char* GetFileExtensions() override { return ".tif .tiff"; }
61 
66  const char* GetDescriptiveName() override { return "TIFF"; }
67 
80  void SetOrientationType(unsigned int orientationType);
81  vtkGetMacro(OrientationType, unsigned int);
82 
84 
87  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
89 
91 
94  vtkSetMacro(OriginSpecifiedFlag, bool);
95  vtkGetMacro(OriginSpecifiedFlag, bool);
96  vtkBooleanMacro(OriginSpecifiedFlag, bool);
98 
100 
103  vtkSetMacro(SpacingSpecifiedFlag, bool);
104  vtkGetMacro(SpacingSpecifiedFlag, bool);
105  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
107 
109 
113  vtkSetMacro(IgnoreColorMap, bool);
114  vtkGetMacro(IgnoreColorMap, bool);
115  vtkBooleanMacro(IgnoreColorMap, bool);
117 protected:
119  ~vtkTIFFReader() override;
120 
121  enum
122  {
128  OTHER
129  };
130 
131  void ExecuteInformation() override;
133 
134  class vtkTIFFReaderInternal;
136 
137 private:
138  vtkTIFFReader(const vtkTIFFReader&) = delete;
139  void operator=(const vtkTIFFReader&) = delete;
140 
144  template <typename T>
145  int EvaluateImageAt(T* out, T* in);
146 
150  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
151 
152  // To support Zeiss images
153  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
154 
155  unsigned int GetFormat();
156 
160  void Initialize();
161 
165  template <typename T>
166  void ReadImageInternal(T* buffer);
167 
171  template <typename T>
172  void ReadVolume(T* buffer);
173 
177  void ReadTiles(void* buffer);
178 
182  template <typename T>
183  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
184 
188  template <typename T>
189  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
190 
194  template <typename T>
195  void Process2(T* outPtr, int* outExt);
196 
197  unsigned short* ColorRed;
198  unsigned short* ColorGreen;
199  unsigned short* ColorBlue;
200  int TotalColors;
201  unsigned int ImageFormat;
202  int OutputExtent[6];
203  vtkIdType OutputIncrements[3];
204  unsigned int OrientationType;
205  bool OrientationTypeSpecifiedFlag;
206  bool OriginSpecifiedFlag;
207  bool SpacingSpecifiedFlag;
208  bool IgnoreColorMap;
209 };
210 
211 #endif
general representation of visualization data
Definition: vtkDataObject.h:75
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:49
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:44
vtkTIFFReaderInternal * InternalImage
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
int CanReadFile(VTK_FILEPATH const char *fname) override
Is the given file name a tiff file?
static vtkTIFFReader * New()
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:60
~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:66
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in.
@ height
Definition: vtkX3D.h:260
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH