VTK  9.2.6
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 =========================================================================*/
88 #ifndef vtkTIFFReader_h
89 #define vtkTIFFReader_h
90 
91 #include "vtkImageReader2.h"
92 
93 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
94 {
95 public:
96  static vtkTIFFReader* New();
98  void PrintSelf(ostream& os, vtkIndent indent) override;
99 
103  int CanReadFile(VTK_FILEPATH const char* fname) override;
104 
110  const char* GetFileExtensions() override { return ".tif .tiff"; }
111 
116  const char* GetDescriptiveName() override { return "TIFF"; }
117 
130  void SetOrientationType(unsigned int orientationType);
131  vtkGetMacro(OrientationType, unsigned int);
132 
134 
137  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
139 
141 
144  vtkSetMacro(OriginSpecifiedFlag, bool);
145  vtkGetMacro(OriginSpecifiedFlag, bool);
146  vtkBooleanMacro(OriginSpecifiedFlag, bool);
148 
150 
153  vtkSetMacro(SpacingSpecifiedFlag, bool);
154  vtkGetMacro(SpacingSpecifiedFlag, bool);
155  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
157 
159 
163  vtkSetMacro(IgnoreColorMap, bool);
164  vtkGetMacro(IgnoreColorMap, bool);
165  vtkBooleanMacro(IgnoreColorMap, bool);
167 protected:
169  ~vtkTIFFReader() override;
170 
171  enum
172  {
178  OTHER
179  };
180 
181  void ExecuteInformation() override;
183 
184  class vtkTIFFReaderInternal;
186 
187 private:
188  vtkTIFFReader(const vtkTIFFReader&) = delete;
189  void operator=(const vtkTIFFReader&) = delete;
190 
194  template <typename T>
195  int EvaluateImageAt(T* out, T* in);
196 
200  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
201 
202  // To support Zeiss images
203  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
204 
205  unsigned int GetFormat();
206 
210  void Initialize();
211 
215  template <typename T>
216  void ReadImageInternal(T* buffer);
217 
221  template <typename T>
222  void ReadVolume(T* buffer);
223 
227  void ReadTiles(void* buffer);
228 
232  template <typename T>
233  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
234 
238  template <typename T>
239  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
240 
244  template <typename T>
245  void Process2(T* outPtr, int* outExt);
246 
247  unsigned short* ColorRed;
248  unsigned short* ColorGreen;
249  unsigned short* ColorBlue;
250  int TotalColors;
251  unsigned int ImageFormat;
252  int OutputExtent[6];
253  vtkIdType OutputIncrements[3];
254  unsigned int OrientationType;
255  bool OrientationTypeSpecifiedFlag;
256  bool OriginSpecifiedFlag;
257  bool SpacingSpecifiedFlag;
258  bool IgnoreColorMap;
259 };
260 
261 #endif
general representation of visualization data
Superclass of binary file readers.
a simple class to control print indentation
Definition: vtkIndent.h:119
Store vtkAlgorithm input/output information.
read TIFF files
Definition: vtkTIFFReader.h:94
vtkTIFFReaderInternal * InternalImage
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
int CanReadFile(VTK_FILEPATH const char *fname) override
Is the given file name a tiff file?
static vtkTIFFReader * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
const char * GetFileExtensions() override
Get the file extensions for this format.
~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,...
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
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