VTK  9.3.0
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
26 #ifndef vtkTIFFReader_h
27 #define vtkTIFFReader_h
28 
29 #include "vtkImageReader2.h"
30 
31 VTK_ABI_NAMESPACE_BEGIN
32 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
33 {
34 public:
35  static vtkTIFFReader* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  int CanReadFile(VTK_FILEPATH const char* fname) override;
43 
49  const char* GetFileExtensions() override { return ".tif .tiff"; }
50 
55  const char* GetDescriptiveName() override { return "TIFF"; }
56 
69  void SetOrientationType(unsigned int orientationType);
70  vtkGetMacro(OrientationType, unsigned int);
71 
73 
76  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
78 
80 
83  vtkSetMacro(OriginSpecifiedFlag, bool);
84  vtkGetMacro(OriginSpecifiedFlag, bool);
85  vtkBooleanMacro(OriginSpecifiedFlag, bool);
87 
89 
92  vtkSetMacro(SpacingSpecifiedFlag, bool);
93  vtkGetMacro(SpacingSpecifiedFlag, bool);
94  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
96 
98 
102  vtkSetMacro(IgnoreColorMap, bool);
103  vtkGetMacro(IgnoreColorMap, bool);
104  vtkBooleanMacro(IgnoreColorMap, bool);
106 protected:
108  ~vtkTIFFReader() override;
109 
110  enum
111  {
117  OTHER
118  };
119 
120  void ExecuteInformation() override;
122 
123  class vtkTIFFReaderInternal;
125 
126 private:
127  vtkTIFFReader(const vtkTIFFReader&) = delete;
128  void operator=(const vtkTIFFReader&) = delete;
129 
133  template <typename T>
134  int EvaluateImageAt(T* out, T* in);
135 
139  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
140 
141  // To support Zeiss images
142  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
143 
144  unsigned int GetFormat();
145 
149  void Initialize();
150 
154  template <typename T>
155  void ReadImageInternal(T* buffer);
156 
160  template <typename T>
161  void ReadVolume(T* buffer);
162 
166  void ReadTiles(void* buffer);
167 
171  template <typename T>
172  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
173 
177  template <typename T>
178  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
179 
183  template <typename T>
184  void Process2(T* outPtr, int* outExt);
185 
186  unsigned short* ColorRed;
187  unsigned short* ColorGreen;
188  unsigned short* ColorBlue;
189  int TotalColors;
190  unsigned int ImageFormat;
191  int OutputExtent[6];
192  vtkIdType OutputIncrements[3];
193  unsigned int OrientationType;
194  bool OrientationTypeSpecifiedFlag;
195  bool OriginSpecifiedFlag;
196  bool SpacingSpecifiedFlag;
197  bool IgnoreColorMap;
198 };
199 
200 VTK_ABI_NAMESPACE_END
201 #endif
general representation of visualization data
Definition: vtkDataObject.h:64
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:38
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:33
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:49
~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:55
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