00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkTIFFReader_h
00029 #define __vtkTIFFReader_h
00030
00031 #include "vtkImageReader2.h"
00032
00033
00034 class vtkTIFFReaderInternal;
00035
00036
00037 class VTK_IO_EXPORT vtkTIFFReader : public vtkImageReader2
00038 {
00039 public:
00040 static vtkTIFFReader *New();
00041 vtkTypeRevisionMacro(vtkTIFFReader,vtkImageReader2);
00042 virtual void PrintSelf(ostream& os, vtkIndent indent);
00043
00045 virtual int CanReadFile(const char* fname);
00046
00048
00050 virtual const char* GetFileExtensions()
00051 {
00052 return ".tif .tiff";
00053 }
00055
00057
00059 virtual const char* GetDescriptiveName()
00060 {
00061 return "TIFF";
00062 }
00064
00066 void InitializeColors();
00067
00069 virtual void ReadVolume(void* buffer);
00070
00072 virtual void ReadTiles(void* buffer);
00073
00075
00085 void SetOrientationType( unsigned int orientationType );
00086 vtkGetMacro( OrientationType, unsigned int );
00088
00090
00091 vtkGetMacro( OrientationTypeSpecifiedFlag, bool );
00093
00095
00096 vtkSetMacro( OriginSpecifiedFlag, bool );
00097 vtkGetMacro( OriginSpecifiedFlag, bool );
00098 vtkBooleanMacro( OriginSpecifiedFlag, bool );
00100
00102 */
00103 vtkSetMacro( SpacingSpecifiedFlag, bool );
00104 vtkGetMacro( SpacingSpecifiedFlag, bool );
00105 vtkBooleanMacro( SpacingSpecifiedFlag, bool );
00107
00108
00109 enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
00110
00111 void ReadImageInternal( void *, void *outPtr,
00112 int *outExt, unsigned int size );
00113
00115 vtkTIFFReaderInternal *GetInternalImage() { return this->InternalImage; }
00116
00117 int EvaluateImageAt( void*, void* );
00118
00119
00120 protected:
00121 vtkTIFFReader();
00122 ~vtkTIFFReader();
00123
00124 void GetColor( int index,
00125 unsigned short *r, unsigned short *g, unsigned short *b );
00126
00127 void ReadGenericImage( void *out,
00128 unsigned int vtkNotUsed(width),
00129 unsigned int height );
00130
00131
00132 void ReadTwoSamplesPerPixelImage( void *out,
00133 unsigned int vtkNotUsed(width),
00134 unsigned int height );
00135
00136 unsigned int GetFormat();
00137 virtual void ExecuteInformation();
00138 virtual void ExecuteData(vtkDataObject *out);
00139
00140 private:
00141 vtkTIFFReader(const vtkTIFFReader&);
00142 void operator=(const vtkTIFFReader&);
00143
00144 unsigned short *ColorRed;
00145 unsigned short *ColorGreen;
00146 unsigned short *ColorBlue;
00147 int TotalColors;
00148 unsigned int ImageFormat;
00149 vtkTIFFReaderInternal *InternalImage;
00150 int *OutputExtent;
00151 vtkIdType *OutputIncrements;
00152 unsigned int OrientationType;
00153 bool OrientationTypeSpecifiedFlag;
00154 bool OriginSpecifiedFlag;
00155 bool SpacingSpecifiedFlag;
00156 };
00157 #endif
00158
00159