VTK  9.3.20240417
vtkTIFFReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
56 #ifndef vtkTIFFReader_h
57 #define vtkTIFFReader_h
58 
59 #include "vtkImageReader2.h"
60 
61 VTK_ABI_NAMESPACE_BEGIN
62 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
63 {
64 public:
65  static vtkTIFFReader* New();
67  void PrintSelf(ostream& os, vtkIndent indent) override;
68 
72  int CanReadFile(VTK_FILEPATH const char* fname) override;
73 
79  const char* GetFileExtensions() override { return ".tif .tiff"; }
80 
85  const char* GetDescriptiveName() override { return "TIFF"; }
86 
99  void SetOrientationType(unsigned int orientationType);
100  vtkGetMacro(OrientationType, unsigned int);
101 
103 
106  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
108 
110 
113  vtkSetMacro(OriginSpecifiedFlag, bool);
114  vtkGetMacro(OriginSpecifiedFlag, bool);
115  vtkBooleanMacro(OriginSpecifiedFlag, bool);
117 
119 
122  vtkSetMacro(SpacingSpecifiedFlag, bool);
123  vtkGetMacro(SpacingSpecifiedFlag, bool);
124  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
126 
128 
132  vtkSetMacro(IgnoreColorMap, bool);
133  vtkGetMacro(IgnoreColorMap, bool);
134  vtkBooleanMacro(IgnoreColorMap, bool);
136 protected:
138  ~vtkTIFFReader() override;
139 
140  enum
141  {
147  OTHER
148  };
149 
150  void ExecuteInformation() override;
152 
153  class vtkTIFFReaderInternal;
155 
156 private:
157  vtkTIFFReader(const vtkTIFFReader&) = delete;
158  void operator=(const vtkTIFFReader&) = delete;
159 
163  template <typename T>
164  int EvaluateImageAt(T* out, T* in);
165 
169  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
170 
171  // To support Zeiss images
172  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
173 
174  unsigned int GetFormat();
175 
179  void Initialize();
180 
184  template <typename T>
185  void ReadImageInternal(T* buffer);
186 
190  template <typename T>
191  void ReadVolume(T* buffer);
192 
196  void ReadTiles(void* buffer);
197 
201  template <typename T>
202  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
203 
207  template <typename T>
208  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
209 
213  template <typename T>
214  void Process2(T* outPtr, int* outExt);
215 
216  unsigned short* ColorRed;
217  unsigned short* ColorGreen;
218  unsigned short* ColorBlue;
219  int TotalColors;
220  unsigned int ImageFormat;
221  int OutputExtent[6];
222  vtkIdType OutputIncrements[3];
223  unsigned int OrientationType;
224  bool OrientationTypeSpecifiedFlag;
225  bool OriginSpecifiedFlag;
226  bool SpacingSpecifiedFlag;
227  bool IgnoreColorMap;
228 };
229 
230 VTK_ABI_NAMESPACE_END
231 #endif
general representation of visualization data
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:108
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:63
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:79
~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:85
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in.
@ height
Definition: vtkX3D.h:254
@ index
Definition: vtkX3D.h:246
int vtkIdType
Definition: vtkType.h:315
#define VTK_FILEPATH