VTK  9.6.20260211
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
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
74 int CanReadFile(VTK_FILEPATH const char* fname) override;
75
81 const char* GetFileExtensions() override { return ".tif .tiff"; }
82
87 const char* GetDescriptiveName() override { return "TIFF"; }
88
101 void SetOrientationType(unsigned int orientationType);
102 vtkGetMacro(OrientationType, unsigned int);
103
105
108 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
110
112
115 vtkSetMacro(OriginSpecifiedFlag, bool);
116 vtkGetMacro(OriginSpecifiedFlag, bool);
117 vtkBooleanMacro(OriginSpecifiedFlag, bool);
119
121
124 vtkSetMacro(SpacingSpecifiedFlag, bool);
125 vtkGetMacro(SpacingSpecifiedFlag, bool);
126 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
128
130
134 vtkSetMacro(IgnoreColorMap, bool);
135 vtkGetMacro(IgnoreColorMap, bool);
136 vtkBooleanMacro(IgnoreColorMap, bool);
138protected:
140 ~vtkTIFFReader() override;
141
142 enum
143 {
150 };
151
152 void ExecuteInformation() override;
154
157
158private:
159 vtkTIFFReader(const vtkTIFFReader&) = delete;
160 void operator=(const vtkTIFFReader&) = delete;
161
165 template <typename T>
166 int EvaluateImageAt(T* out, T* in);
167
171 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
172
173 // To support Zeiss images
174 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
175
176 unsigned int GetFormat();
177
181 void Initialize();
182
186 template <typename T>
187 void ReadImageInternal(T* buffer);
188
192 template <typename T>
193 void ReadVolume(T* buffer);
194
198 void ReadTiles(void* buffer);
199
203 template <typename T>
204 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
205
209 template <typename T>
210 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
211
215 template <typename T>
216 void Process2(T* outPtr, int* outExt);
217
218 unsigned short* ColorRed;
219 unsigned short* ColorGreen;
220 unsigned short* ColorBlue;
221 int TotalColors;
222 unsigned int ImageFormat;
223 int OutputExtent[6];
224 vtkIdType OutputIncrements[3];
225 unsigned int OrientationType;
226 bool OrientationTypeSpecifiedFlag;
227 bool OriginSpecifiedFlag;
228 bool SpacingSpecifiedFlag;
229 bool IgnoreColorMap;
230};
231
232VTK_ABI_NAMESPACE_END
233#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:108
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:354
#define VTK_FILEPATH