VTK  9.7.20260805
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
17
18#ifndef vtkTIFFReader_h
19#define vtkTIFFReader_h
20
21#include "vtkImageReader2.h"
22
23VTK_ABI_NAMESPACE_BEGIN
24class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
25{
26public:
27 static vtkTIFFReader* New();
29 void PrintSelf(ostream& os, vtkIndent indent) override;
30
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);
99protected:
101 ~vtkTIFFReader() override;
102
103 enum
104 {
111 };
112
113 void ExecuteInformation() override;
115
118
119private:
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
193VTK_ABI_NAMESPACE_END
194#endif
general representation of visualization data
virtual int CanReadFile(const char *fname)
Return non zero if the reader can read the given file name.
vtkImageReader2()
Return a descriptive name for the file format that might be useful in a GUI.
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
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:363
#define VTK_FILEPATH