00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkBMPReader_h
00012 #define __mitkBMPReader_h
00013
00014 #include "mitkVolumeReader.h"
00015
00039 class MITK_COMMON_API mitkBMPReader : public mitkVolumeReader
00040 {
00041 public:
00042 MITK_TYPE(mitkBMPReader,mitkVolumeReader)
00043
00044 virtual void PrintSelf(ostream& os);
00045
00046 mitkBMPReader();
00047
00052 void SetSpacingX(float px){ m_Spacings[0] = px ;}
00053
00058 void SetSpacingY(float py){ m_Spacings[1] = py ;}
00059
00064 void SetSpacingZ(float pz){ m_Spacings[2] = pz ;}
00065
00072 void SetSpacings(float s[3])
00073 {
00074 m_Spacings[0] = s[0];
00075 m_Spacings[1] = s[1];
00076 m_Spacings[2] = s[2];
00077 }
00078
00079 protected:
00080 virtual ~mitkBMPReader();
00081
00082 virtual bool Execute();
00083
00084 #pragma pack(2)
00085 typedef struct tagBITMAPFILEHEADER
00086 {
00087 unsigned short bfType;
00088 unsigned long bfSize;
00089 unsigned short bfReserved1;
00090 unsigned short bfReserved2;
00091 unsigned long bfOffBits;
00092 } BITMAPFILEHEADER;
00093 #pragma pack()
00094
00095
00096 typedef struct tagBITMAPINFOHEADER
00097 {
00098 unsigned long biSize;
00099 unsigned long biWidth;
00100 unsigned long biHeight;
00101 unsigned short biPlanes;
00102 unsigned short biBitCount;
00103 unsigned long biCompression;
00104 unsigned long biSizeImage;
00105 unsigned long biXPelsPerMeter;
00106 unsigned long biYPelsPerMeter;
00107 unsigned long biClrUsed;
00108 unsigned long biClrImportant;
00109 } BITMAPINFOHEADER;
00110
00111
00112 typedef struct tag_bmp_core_header
00113 {
00114 unsigned long bcSize;
00115 unsigned short bcWidth;
00116 unsigned short bcHeight;
00117 unsigned short bcPlanes;
00118 unsigned short bcBitCount;
00119 } BMP_CORE_HEADER;
00120
00121 float m_Spacings[3];
00122
00123 private:
00124 mitkBMPReader(const mitkBMPReader&){};
00125 void operator=(const mitkBMPReader&){};
00126
00127 };
00128
00129 #endif
00130