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 =========================================================================*/
29 #ifndef vtkTIFFReader_h
30 #define vtkTIFFReader_h
31 
32 #include "vtkImageReader2.h"
33 
34 class VTKIOIMAGE_EXPORT vtkTIFFReader : public vtkImageReader2
35 {
36 public:
37  static vtkTIFFReader* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
44  int CanReadFile(VTK_FILEPATH const char* fname) override;
45 
51  const char* GetFileExtensions() override { return ".tif .tiff"; }
52 
57  const char* GetDescriptiveName() override { return "TIFF"; }
58 
71  void SetOrientationType(unsigned int orientationType);
72  vtkGetMacro(OrientationType, unsigned int);
73 
75 
78  vtkGetMacro(OrientationTypeSpecifiedFlag, bool);
80 
82 
85  vtkSetMacro(OriginSpecifiedFlag, bool);
86  vtkGetMacro(OriginSpecifiedFlag, bool);
87  vtkBooleanMacro(OriginSpecifiedFlag, bool);
89 
91 
94  vtkSetMacro(SpacingSpecifiedFlag, bool);
95  vtkGetMacro(SpacingSpecifiedFlag, bool);
96  vtkBooleanMacro(SpacingSpecifiedFlag, bool);
98 
100 
104  vtkSetMacro(IgnoreColorMap, bool);
105  vtkGetMacro(IgnoreColorMap, bool);
106  vtkBooleanMacro(IgnoreColorMap, bool);
108 protected:
109  vtkTIFFReader();
110  ~vtkTIFFReader() override;
111 
112  enum
113  {
119  OTHER
120  };
121 
122  void ExecuteInformation() override;
123  void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
124 
127 
128 private:
129  vtkTIFFReader(const vtkTIFFReader&) = delete;
130  void operator=(const vtkTIFFReader&) = delete;
131 
135  template <typename T>
136  int EvaluateImageAt(T* out, T* in);
137 
141  void GetColor(int index, unsigned short* r, unsigned short* g, unsigned short* b);
142 
143  // To support Zeiss images
144  void ReadTwoSamplesPerPixelImage(void* out, unsigned int vtkNotUsed(width), unsigned int height);
145 
146  unsigned int GetFormat();
147 
151  void Initialize();
152 
156  template <typename T>
157  void ReadImageInternal(T* buffer);
158 
162  template <typename T>
163  void ReadVolume(T* buffer);
164 
168  void ReadTiles(void* buffer);
169 
173  template <typename T>
174  void ReadGenericImage(T* out, unsigned int width, unsigned int height);
175 
179  template <typename T>
180  void Process(T* outPtr, int outExtent[6], vtkIdType outIncr[3]);
181 
185  template <typename T>
186  void Process2(T* outPtr, int* outExt);
187 
188  unsigned short* ColorRed;
189  unsigned short* ColorGreen;
190  unsigned short* ColorBlue;
191  int TotalColors;
192  unsigned int ImageFormat;
193  int OutputExtent[6];
194  vtkIdType OutputIncrements[3];
195  unsigned int OrientationType;
196  bool OrientationTypeSpecifiedFlag;
197  bool OriginSpecifiedFlag;
198  bool SpacingSpecifiedFlag;
199  bool IgnoreColorMap;
200 };
201 
202 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkTIFFReader.h:57
virtual int CanReadFile(VTK_FILEPATH const char *vtkNotUsed(fname))
Return non zero if the reader can read the given file name.
read TIFF files
Definition: vtkTIFFReader.h:34
int vtkIdType
Definition: vtkType.h:332
DatabaseFormatType GetFormat(const Ioss::GroupingEntity *entity)
Given any GroupingEntity pointer, returns the format that the associated database is in...
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void ExecuteInformation()
Superclass of binary file readers.
vtkTIFFReaderInternal * InternalImage
#define VTK_FILEPATH
const char * GetFileExtensions() override
Get the file extensions for this format.
Definition: vtkTIFFReader.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:65