VTK  9.7.1
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
18 #ifndef vtkTIFFReader_h
19 #define vtkTIFFReader_h
20 
21 #include "vtkImageReader2.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
25 {
26 public:
27  static vtkTIFFReader* New();
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
31  using Superclass::CanReadFile;
35  int CanReadFile(VTK_FILEPATH const char* fname) override;
36 
42  const char* GetFileExtensions() override { return ".tif .tiff"; }
43 
48  const char* GetDescriptiveName() override { return "TIFF"; }
49 
62  void SetOrientationType(unsigned int orientationType);
63  vtkGetMacro(OrientationType, unsigned int);
64 
66 
69  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
71 
73 
76  vtkSetMacro(OriginSpecifiedFlag, bool);
77  vtkGetMacro(OriginSpecifiedFlag, bool);
78  vtkBooleanMacro(OriginSpecifiedFlag, bool);
80 
82 
85  vtkSetMacro(SpacingSpecifiedFlag, bool);
86  vtkGetMacro(SpacingSpecifiedFlag, bool);
87  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
89 
91 
95  vtkSetMacro(IgnoreColorMap, bool);
96  vtkGetMacro(IgnoreColorMap, bool);
97  vtkBooleanMacro(IgnoreColorMap, bool);
99 protected:
100  vtkTIFFReader();
101  ~vtkTIFFReader() override;
102 
103  enum
104  {
110  OTHER
111  };
112 
113  void ExecuteInformation() override;
114  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
115 
118 
119 private:
120  vtkTIFFReader(const vtkTIFFReader&) = delete;
121  void operator=(const vtkTIFFReader&) = delete;
122 
126  template <typename T>
127  int EvaluateImageAt(T* out, T* in);
128 
132  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
133 
134  // To support Zeiss images
135  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
136 
137  unsigned int GetFormat();
138 
142  void Initialize();
143 
147  template <typename T>
148  void ReadImageInternal(T* buffer);
149 
153  template <typename T>
154  void ReadVolume(T* buffer);
155 
159  void ReadTiles(void* buffer);
160 
164  template <typename T>
165  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
166 
170  template <typename T>
171  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
172 
176  template <typename T>
177  void Process2(T* outPtr, int* outExt);
178 
179  unsigned short* ColorRed;
180  unsigned short* ColorGreen;
181  unsigned short* ColorBlue;
182  int TotalColors;
183  unsigned int ImageFormat;
184  int OutputExtent[6];
185  vtkIdType OutputIncrements[3];
186  unsigned int OrientationType;
187  bool OrientationTypeSpecifiedFlag;
188  bool OriginSpecifiedFlag;
189  bool SpacingSpecifiedFlag;
190  bool IgnoreColorMap;
191 };
192 
193 VTK_ABI_NAMESPACE_END
194 #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:48
read TIFF files
Definition: vtkTIFFReader.h:24
int vtkIdType
Definition: vtkType.h:363
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in...
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void ExecuteInformation()
Superclass of binary file readers.
vtkTIFFReaderInternal * InternalImage
#define VTK_FILEPATH
virtual int CanReadFile(const char *fname)
Return non zero if the reader can read the given file name.
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkTIFFReader.h:42
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:55