VTK  9.1.0
vtkTIFFReader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTIFFReader.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
85#ifndef vtkTIFFReader_h
86#define vtkTIFFReader_h
87
88#include "vtkImageReader2.h"
89
90class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
91{
92public:
93 static vtkTIFFReader* New();
95 void PrintSelf(ostream& os, vtkIndent indent) override;
96
100 int CanReadFile(VTK_FILEPATH const char* fname) override;
101
107 const char* GetFileExtensions() override { return ".tif .tiff"; }
108
113 const char* GetDescriptiveName() override { return "TIFF"; }
114
127 void SetOrientationType(unsigned int orientationType);
128 vtkGetMacro(OrientationType, unsigned int);
129
131
134 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
136
138
141 vtkSetMacro(OriginSpecifiedFlag, bool);
142 vtkGetMacro(OriginSpecifiedFlag, bool);
143 vtkBooleanMacro(OriginSpecifiedFlag, bool);
145
147
150 vtkSetMacro(SpacingSpecifiedFlag, bool);
151 vtkGetMacro(SpacingSpecifiedFlag, bool);
152 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
154
156
160 vtkSetMacro(IgnoreColorMap, bool);
161 vtkGetMacro(IgnoreColorMap, bool);
162 vtkBooleanMacro(IgnoreColorMap, bool);
164protected:
166 ~vtkTIFFReader() override;
167
168 enum
169 {
175 OTHER
176 };
177
178 void ExecuteInformation() override;
180
183
184private:
185 vtkTIFFReader(const vtkTIFFReader&) = delete;
186 void operator=(const vtkTIFFReader&) = delete;
187
191 template <typename T>
192 int EvaluateImageAt(T* out, T* in);
193
197 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
198
199 // To support Zeiss images
200 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
201
202 unsigned int GetFormat();
203
207 void Initialize();
208
212 template <typename T>
213 void ReadImageInternal(T* buffer);
214
218 template <typename T>
219 void ReadVolume(T* buffer);
220
224 void ReadTiles(void* buffer);
225
229 template <typename T>
230 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
231
235 template <typename T>
236 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
237
241 template <typename T>
242 void Process2(T* outPtr, int* outExt);
243
244 unsigned short* ColorRed;
245 unsigned short* ColorGreen;
246 unsigned short* ColorBlue;
247 int TotalColors;
248 unsigned int ImageFormat;
249 int OutputExtent[6];
250 vtkIdType OutputIncrements[3];
251 unsigned int OrientationType;
252 bool OrientationTypeSpecifiedFlag;
253 bool OriginSpecifiedFlag;
254 bool SpacingSpecifiedFlag;
255 bool IgnoreColorMap;
256};
257
258#endif
general representation of visualization data
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:113
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:91
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:332
#define VTK_FILEPATH