VTK  9.6.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
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
34 int CanReadFile(VTK_FILEPATH const char* fname) override;
35
41 const char* GetFileExtensions() override { return ".tif .tiff"; }
42
47 const char* GetDescriptiveName() override { return "TIFF"; }
48
61 void SetOrientationType(unsigned int orientationType);
62 vtkGetMacro(OrientationType, unsigned int);
63
65
68 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
70
72
75 vtkSetMacro(OriginSpecifiedFlag, bool);
76 vtkGetMacro(OriginSpecifiedFlag, bool);
77 vtkBooleanMacro(OriginSpecifiedFlag, bool);
79
81
84 vtkSetMacro(SpacingSpecifiedFlag, bool);
85 vtkGetMacro(SpacingSpecifiedFlag, bool);
86 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
88
90
94 vtkSetMacro(IgnoreColorMap, bool);
95 vtkGetMacro(IgnoreColorMap, bool);
96 vtkBooleanMacro(IgnoreColorMap, bool);
98protected:
100 ~vtkTIFFReader() override;
101
102 enum
103 {
110 };
111
112 void ExecuteInformation() override;
114
117
118private:
119 vtkTIFFReader(const vtkTIFFReader&) = delete;
120 void operator=(const vtkTIFFReader&) = delete;
121
125 template <typename T>
126 int EvaluateImageAt(T* out, T* in);
127
131 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
132
133 // To support Zeiss images
134 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
135
136 unsigned int GetFormat();
137
141 void Initialize();
142
146 template <typename T>
147 void ReadImageInternal(T* buffer);
148
152 template <typename T>
153 void ReadVolume(T* buffer);
154
158 void ReadTiles(void* buffer);
159
163 template <typename T>
164 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
165
169 template <typename T>
170 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
171
175 template <typename T>
176 void Process2(T* outPtr, int* outExt);
177
178 unsigned short* ColorRed;
179 unsigned short* ColorGreen;
180 unsigned short* ColorBlue;
181 int TotalColors;
182 unsigned int ImageFormat;
183 int OutputExtent[6];
184 vtkIdType OutputIncrements[3];
185 unsigned int OrientationType;
186 bool OrientationTypeSpecifiedFlag;
187 bool OriginSpecifiedFlag;
188 bool SpacingSpecifiedFlag;
189 bool IgnoreColorMap;
190};
191
192VTK_ABI_NAMESPACE_END
193#endif
general representation of visualization data
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.
virtual void Initialize()
int vtkIdType
Definition vtkType.h:368
#define VTK_FILEPATH