VTK  9.3.0
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#ifndef vtkTIFFReader_h
18#define vtkTIFFReader_h
19
20#include "vtkImageReader2.h"
21
22VTK_ABI_NAMESPACE_BEGIN
23class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
24{
25public:
26 static vtkTIFFReader* New();
28 void PrintSelf(ostream& os, vtkIndent indent) override;
29
33 int CanReadFile(VTK_FILEPATH const char* fname) override;
34
40 const char* GetFileExtensions() override { return ".tif .tiff"; }
41
46 const char* GetDescriptiveName() override { return "TIFF"; }
47
60 void SetOrientationType(unsigned int orientationType);
61 vtkGetMacro(OrientationType, unsigned int);
62
64
67 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
69
71
74 vtkSetMacro(OriginSpecifiedFlag, bool);
75 vtkGetMacro(OriginSpecifiedFlag, bool);
76 vtkBooleanMacro(OriginSpecifiedFlag, bool);
78
80
83 vtkSetMacro(SpacingSpecifiedFlag, bool);
84 vtkGetMacro(SpacingSpecifiedFlag, bool);
85 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
87
89
93 vtkSetMacro(IgnoreColorMap, bool);
94 vtkGetMacro(IgnoreColorMap, bool);
95 vtkBooleanMacro(IgnoreColorMap, bool);
97protected:
99 ~vtkTIFFReader() override;
100
101 enum
102 {
108 OTHER
109 };
110
111 void ExecuteInformation() override;
113
116
117private:
118 vtkTIFFReader(const vtkTIFFReader&) = delete;
119 void operator=(const vtkTIFFReader&) = delete;
120
124 template <typename T>
125 int EvaluateImageAt(T* out, T* in);
126
130 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
131
132 // To support Zeiss images
133 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
134
135 unsigned int GetFormat();
136
140 void Initialize();
141
145 template <typename T>
146 void ReadImageInternal(T* buffer);
147
151 template <typename T>
152 void ReadVolume(T* buffer);
153
157 void ReadTiles(void* buffer);
158
162 template <typename T>
163 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
164
168 template <typename T>
169 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
170
174 template <typename T>
175 void Process2(T* outPtr, int* outExt);
176
177 unsigned short* ColorRed;
178 unsigned short* ColorGreen;
179 unsigned short* ColorBlue;
180 int TotalColors;
181 unsigned int ImageFormat;
182 int OutputExtent[6];
183 vtkIdType OutputIncrements[3];
184 unsigned int OrientationType;
185 bool OrientationTypeSpecifiedFlag;
186 bool OriginSpecifiedFlag;
187 bool SpacingSpecifiedFlag;
188 bool IgnoreColorMap;
189};
190
191VTK_ABI_NAMESPACE_END
192#endif
general representation of visualization data
Superclass of binary file readers.
a simple class to control print indentation
Definition vtkIndent.h:29
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