VTK  9.5.20251010
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
57#ifndef vtkTIFFReader_h
58#define vtkTIFFReader_h
59
60#include "vtkImageReader2.h"
61
62VTK_ABI_NAMESPACE_BEGIN
63class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
64{
65public:
66 static vtkTIFFReader* New();
68 void PrintSelf(ostream& os, vtkIndent indent) override;
69
73 int CanReadFile(VTK_FILEPATH const char* fname) override;
74
80 const char* GetFileExtensions() override { return ".tif .tiff"; }
81
86 const char* GetDescriptiveName() override { return "TIFF"; }
87
100 void SetOrientationType(unsigned int orientationType);
101 vtkGetMacro(OrientationType, unsigned int);
102
104
107 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
109
111
114 vtkSetMacro(OriginSpecifiedFlag, bool);
115 vtkGetMacro(OriginSpecifiedFlag, bool);
116 vtkBooleanMacro(OriginSpecifiedFlag, bool);
118
120
123 vtkSetMacro(SpacingSpecifiedFlag, bool);
124 vtkGetMacro(SpacingSpecifiedFlag, bool);
125 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
127
129
133 vtkSetMacro(IgnoreColorMap, bool);
134 vtkGetMacro(IgnoreColorMap, bool);
135 vtkBooleanMacro(IgnoreColorMap, bool);
137protected:
139 ~vtkTIFFReader() override;
140
141 enum
142 {
148 OTHER
149 };
150
151 void ExecuteInformation() override;
153
156
157private:
158 vtkTIFFReader(const vtkTIFFReader&) = delete;
159 void operator=(const vtkTIFFReader&) = delete;
160
164 template <typename T>
165 int EvaluateImageAt(T* out, T* in);
166
170 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
171
172 // To support Zeiss images
173 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
174
175 unsigned int GetFormat();
176
180 void Initialize();
181
185 template <typename T>
186 void ReadImageInternal(T* buffer);
187
191 template <typename T>
192 void ReadVolume(T* buffer);
193
197 void ReadTiles(void* buffer);
198
202 template <typename T>
203 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
204
208 template <typename T>
209 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
210
214 template <typename T>
215 void Process2(T* outPtr, int* outExt);
216
217 unsigned short* ColorRed;
218 unsigned short* ColorGreen;
219 unsigned short* ColorBlue;
220 int TotalColors;
221 unsigned int ImageFormat;
222 int OutputExtent[6];
223 vtkIdType OutputIncrements[3];
224 unsigned int OrientationType;
225 bool OrientationTypeSpecifiedFlag;
226 bool OriginSpecifiedFlag;
227 bool SpacingSpecifiedFlag;
228 bool IgnoreColorMap;
229};
230
231VTK_ABI_NAMESPACE_END
232#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
vtkTIFFReaderInternal * InternalImage
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
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.
~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,...
static vtkTIFFReader * New()
const char * GetFileExtensions() override
Get the file extensions for this format.
int vtkIdType
Definition vtkType.h:367
#define VTK_FILEPATH