VTK
vtkTIFFReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTIFFReader.h,v
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 =========================================================================*/
31 #ifndef __vtkTIFFReader_h
32 #define __vtkTIFFReader_h
33 
34 #include "vtkImageReader2.h"
35 
36 //BTX
37 class vtkTIFFReaderInternal;
38 //ETX
39 
41 {
42 public:
43  static vtkTIFFReader *New();
45  virtual void PrintSelf(ostream& os, vtkIndent indent);
46 
48  virtual int CanReadFile(const char* fname);
49 
51 
53  virtual const char* GetFileExtensions()
54  {
55  return ".tif .tiff";
56  }
58 
60 
62  virtual const char* GetDescriptiveName()
63  {
64  return "TIFF";
65  }
67 
69  void InitializeColors();
70 
72  virtual void ReadVolume(void* buffer);
73 
75  virtual void ReadTiles(void* buffer);
76 
78 
88  void SetOrientationType( unsigned int orientationType );
89  vtkGetMacro( OrientationType, unsigned int );
91 
93 
94  vtkGetMacro( OrientationTypeSpecifiedFlag, bool );
96 
98 
99  vtkSetMacro( OriginSpecifiedFlag, bool );
100  vtkGetMacro( OriginSpecifiedFlag, bool );
101  vtkBooleanMacro( OriginSpecifiedFlag, bool );
103 
105  */
106  vtkSetMacro( SpacingSpecifiedFlag, bool );
107  vtkGetMacro( SpacingSpecifiedFlag, bool );
108  vtkBooleanMacro( SpacingSpecifiedFlag, bool );
110 
112 
113  void ReadImageInternal( void *, void *outPtr,
114  int *outExt, unsigned int size );
116 
117 protected:
118  vtkTIFFReader();
119  ~vtkTIFFReader();
120 
121  enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
122 
123  vtkTIFFReaderInternal *GetInternalImage() { return this->InternalImage; }
124 
125  int EvaluateImageAt( void*, void* );
126 
127  void GetColor( int index,
128  unsigned short *r, unsigned short *g, unsigned short *b );
129 
130  void ReadGenericImage( void *out,
131  unsigned int vtkNotUsed(width),
132  unsigned int height );
133 
134  // To support Zeiss images
135  void ReadTwoSamplesPerPixelImage( void *out,
136  unsigned int vtkNotUsed(width),
137  unsigned int height );
138 
139  unsigned int GetFormat();
140  virtual void ExecuteInformation();
141  virtual void ExecuteData(vtkDataObject *out);
142 
143 private:
144  vtkTIFFReader(const vtkTIFFReader&); // Not implemented.
145  void operator=(const vtkTIFFReader&); // Not implemented.
146 
147  unsigned short *ColorRed;
148  unsigned short *ColorGreen;
149  unsigned short *ColorBlue;
150  int TotalColors;
151  unsigned int ImageFormat;
152  vtkTIFFReaderInternal *InternalImage;
153  int *OutputExtent;
154  vtkIdType *OutputIncrements;
155  unsigned int OrientationType;
156  bool OrientationTypeSpecifiedFlag;
157  bool OriginSpecifiedFlag;
158  bool SpacingSpecifiedFlag;
159 };
160 #endif