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=========================================================================*/
35#ifndef vtkTIFFReader_h
36#define vtkTIFFReader_h
37
38#include "vtkImageReader2.h"
39
40class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
41{
42public:
43 static vtkTIFFReader* New();
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
50 int CanReadFile(VTK_FILEPATH const char* fname) override;
51
57 const char* GetFileExtensions() override { return ".tif .tiff"; }
58
63 const char* GetDescriptiveName() override { return "TIFF"; }
64
77 void SetOrientationType(unsigned int orientationType);
78 vtkGetMacro(OrientationType, unsigned int);
79
81
84 vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
86
88
91 vtkSetMacro(OriginSpecifiedFlag, bool);
92 vtkGetMacro(OriginSpecifiedFlag, bool);
93 vtkBooleanMacro(OriginSpecifiedFlag, bool);
95
97
100 vtkSetMacro(SpacingSpecifiedFlag, bool);
101 vtkGetMacro(SpacingSpecifiedFlag, bool);
102 vtkBooleanMacro(SpacingSpecifiedFlag, bool);
104
106
110 vtkSetMacro(IgnoreColorMap, bool);
111 vtkGetMacro(IgnoreColorMap, bool);
112 vtkBooleanMacro(IgnoreColorMap, bool);
114protected:
116 ~vtkTIFFReader() override;
117
118 enum
119 {
125 OTHER
126 };
127
128 void ExecuteInformation() override;
130
133
134private:
135 vtkTIFFReader(const vtkTIFFReader&) = delete;
136 void operator=(const vtkTIFFReader&) = delete;
137
141 template <typename T>
142 int EvaluateImageAt(T* out, T* in);
143
147 void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
148
149 // To support Zeiss images
150 void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
151
152 unsigned int GetFormat();
153
157 void Initialize();
158
162 template <typename T>
163 void ReadImageInternal(T* buffer);
164
168 template <typename T>
169 void ReadVolume(T* buffer);
170
174 void ReadTiles(void* buffer);
175
179 template <typename T>
180 void ReadGenericImage(T* out, unsigned int width, unsigned int height);
181
185 template <typename T>
186 void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
187
191 template <typename T>
192 void Process2(T* outPtr, int* outExt);
193
194 unsigned short* ColorRed;
195 unsigned short* ColorGreen;
196 unsigned short* ColorBlue;
197 int TotalColors;
198 unsigned int ImageFormat;
199 int OutputExtent[6];
200 vtkIdType OutputIncrements[3];
201 unsigned int OrientationType;
202 bool OrientationTypeSpecifiedFlag;
203 bool OriginSpecifiedFlag;
204 bool SpacingSpecifiedFlag;
205 bool IgnoreColorMap;
206};
207
208#endif
general representation of visualization data
Definition: vtkDataObject.h:69
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:43
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:41
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.
Definition: vtkTIFFReader.h:63
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.
Definition: vtkTIFFReader.h:57
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in.
@ height
Definition: vtkX3D.h:260
@ index
Definition: vtkX3D.h:252
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH