VTK  9.4.20241219
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
61VTK_ABI_NAMESPACE_BEGIN
62class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
63{
64public:
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);
136protected:
138 ~vtkTIFFReader() override;
139
140 enum
141 {
147 OTHER
148 };
149
150 void ExecuteInformation() override;
152
155
156private:
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
230VTK_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
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(VTK_FILEPATH 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:315
#define VTK_FILEPATH