Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkVOLImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkVOLImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/05/07 22:39:53 $
00007   Version:   $Revision: 1.20 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkVOLImageIO_h
00018 #define __itkVOLImageIO_h
00019 
00020 #include "itkImageIOBase.h"
00021 #include "stdio.h"
00022 #include <string>
00023 
00024 #ifndef VOL_MAGIC_NUMBER
00025 #define VOL_MAGIC_NUMBER 0x21654387
00026 #endif
00027 
00028 
00029 namespace itk
00030 {
00031 
00039 class ITK_EXPORT VOLImageIO : public ImageIOBase
00040 {
00041 public:
00043   typedef VOLImageIO Self;
00044   typedef ImageIOBase  Superclass;
00045   typedef SmartPointer<Self>  Pointer;
00046   
00048   itkNewMacro(Self);
00049 
00051   itkTypeMacro(VOLImageIO, Superclass);
00052 
00053   /*-------- This part of the interfaces deals with reading data. ----- */
00054 
00057   virtual bool CanReadFile(const char*);
00058 
00060   virtual void ReadImageInformation();
00061   void ReadVersion1_0(FILE * fp);
00062   void ReadVersion1_1(FILE * fp);
00063   void ReadVersion2_1(FILE * fp);
00064   void ReadVersion2_3(FILE * fp);
00065   
00067   virtual const std::type_info& GetPixelType() const ;
00068 
00070   virtual void Read(void* buffer);
00071 
00072   /*-------- This part of the interfaces deals with writing data. ----- */
00073 
00076   virtual bool CanWriteFile(const char*)
00077     { return false; }
00078 
00081   virtual void WriteImageInformation() {};
00082   
00085   virtual void Write(const void* buffer)
00086     { return; }
00087 
00090   unsigned int GetComponentSize() const;
00091   itkGetMacro(File_type, unsigned long);
00092   itkGetMacro(File_rev, char*);
00093   itkGetMacro(Description, char*);                 
00094   itkGetMacro(Date, char*);           
00095   itkGetMacro(Time, char*);              
00096   itkGetMacro(Patient, char*);            
00097   itkGetMacro(Clinic, char*);                   
00098   itkGetMacro(NumEchoFrames, unsigned long);     
00099   itkGetMacro(NumDopFrames, unsigned long);    
00100   itkGetMacro(Dopmode, char);            
00101   itkGetMacro(EchoLPF, long);            
00102   itkGetMacro(DopLPF, long);             
00103   itkGetMacro(Repetition, long);             
00104   itkGetMacro(Xducer_name, char*);            
00105   itkGetMacro(Xducer_ID, long);           
00106   itkGetMacro(Xducer_freq, double);         
00107   itkGetMacro(Depth, double);         
00108   itkGetMacro(Default_depth, double);         
00109   itkGetMacro(App_name, char*);           
00110   itkGetMacro(Application, char);            
00111   itkGetMacro(Scan_fmt, long);             
00112   itkGetMacro(Dataset_name, char*);           
00113   itkGetMacro(First_tx_line, short);            
00114   itkGetMacro(Last_tx_line, short);           
00115   itkGetMacro(Lines, short);            
00116   itkGetMacro(Az_lines, short);           
00117   itkGetMacro(Az_angle, double);          
00118   itkGetMacro(Az_angular_separation, double);         
00119   itkGetMacro(El_lines, short);           
00120   itkGetMacro(El_angle, double);          
00121   itkGetMacro(El_angular_separation, double);         
00122   itkGetMacro(Tx_offset, long);           
00123   itkGetMacro(Rx_offset, long);           
00124   itkGetMacro(MclkFreq, double);          
00125   itkGetMacro(SampleSize, double);          
00126   itkGetMacro(Mclk2Size, double);         
00127   itkGetMacro(SampleRate, long);            
00128   itkGetMacro(LineGroupSize, unsigned long);    
00129   itkGetMacro(NumECGSamples, unsigned long);    
00130   itkGetMacro(GrayImageSize, unsigned long);    
00131   itkGetMacro(DopplerImageSize, unsigned long);   
00132   itkGetMacro(EcgSize, unsigned long);    
00133   itkGetMacro(MiscDataSize, unsigned long);   
00134   itkGetMacro(GrayImageOffset, unsigned long);    
00135   itkGetMacro(DopplerImageOffset, unsigned long);   
00136   itkGetMacro(EcgOffset, unsigned long);    
00137   itkGetMacro(MiscDataOffset, unsigned long);   
00138   itkGetMacro(File_control_timing_type, char*);           
00139   itkGetMacro(DopplerVolInfo, char*);           
00140   itkGetMacro(ScanDepthCount,  short);            
00141   itkGetMacro(ScanDepth,  short);           
00142   itkGetMacro(Az_sector_tilt, double);           
00143   itkGetMacro(Elev_sector_tilt, double);           
00144   itkGetMacro(DopplerSegData, char*);            
00145   itkGetMacro(FrameRate, double);          
00146   itkGetMacro(Sweepspeed, long);             
00147   itkGetMacro(Update_interval, long);            
00148   itkGetMacro(Contrast_on, unsigned long);    
00149   itkGetMacro(Comp_curve_p0_x, long);           
00150   itkGetMacro(Comp_curve_p0_y, long);           
00151   itkGetMacro(Comp_curve_p1_x, long);           
00152   itkGetMacro(Comp_curve_p1_y, long);           
00153   itkGetMacro(Comp_curve_p2_x, long);           
00154   itkGetMacro(Comp_curve_p2_y, long);           
00155   itkGetMacro(Comp_curve_p3_x, long);           
00156   itkGetMacro(Comp_curve_p3_y, long);           
00157   itkGetMacro(Comp_curve_scaling_index, long);            
00158   itkGetMacro(Echo_reject, long);           
00159   const double** GetMt_tp() const;
00160   itkGetMacro(True_axis_defined, unsigned long);    
00161   itkGetMacro(True_axis_on, unsigned long);   
00162   itkGetMacro(Parallel_x_tilt, double);         
00163   itkGetMacro(Parallel_y_tilt, double);         
00164   itkGetMacro(Parallel_depth, double);          
00165   itkGetMacro(Parallel_spacing, double);          
00166   itkGetMacro(Parallel_thickness, long);            
00167   itkGetMacro(Viewport_transform_flags, unsigned long);   
00168   itkGetMacro(Stress_mode, unsigned long);    
00169   itkGetMacro(Stress_label, char*);           
00170   itkGetMacro(Heart_rate, double);          
00171   itkGetMacro(Stage_timer_value, long);           
00172   itkGetMacro(Ecg_display_on, unsigned long);   
00173   double GetBlanking();
00174   itkGetMacro(Samples, short);
00175   
00177   itkGetMacro(ColorImageSize, unsigned long);
00178   itkGetMacro(ColorImageOffset, unsigned long);
00179   itkGetMacro(Oag_params, char*);
00180   itkGetMacro(Cscanfmt, unsigned long);
00181   itkGetMacro(Oaglinear, unsigned long);
00182   itkGetMacro(Maxradius, unsigned long);
00183   itkGetMacro(Anglescale, double);
00184   double GetSkinoffset();
00185   
00186 protected:
00187   VOLImageIO();
00188   ~VOLImageIO();
00189   void PrintSelf(std::ostream& os, Indent indent) const;
00190 
00192   void ReadData(FILE * fp, void * buffer, size_t size, long pos = -1);
00193   void ReadData(FILE * fp, char * buffer, size_t size, long pos = -1);
00194   
00195 private:
00196   VOLImageIO(const Self&); //purposely not implemented
00197   void operator=(const Self&); //purposely not implemented
00198 
00200   unsigned long   m_File_type;
00201   char            m_File_rev[12];      
00202   char            m_Description[128];     
00203   char            m_Date[12];
00204   char            m_Time[12];   
00205   char            m_Patient[64];
00206   char            m_Clinic[64];        
00207   unsigned long   m_NumEchoFrames; 
00208   unsigned long   m_NumDopFrames; 
00209   char            m_Dopmode; 
00210   long            m_EchoLPF; 
00211   long            m_DopLPF; 
00212   long            m_Repetition; 
00213   char            m_Xducer_name[16];
00214   long            m_Xducer_ID;
00215   double          m_Xducer_freq;
00216   double          m_Depth;
00217   double          m_Default_depth;
00218   char            m_App_name[24];
00219   char            m_Application; 
00220   long            m_Scan_fmt; 
00221   char            m_Dataset_name[64];
00222   short           m_First_tx_line;
00223   short           m_Last_tx_line;
00224   short           m_Lines;
00225   short           m_Az_lines;
00226   double          m_Az_angle;
00227   double          m_Az_angular_separation;
00228   short           m_El_lines;
00229   double          m_El_angle;
00230   double          m_El_angular_separation;
00231   long            m_Tx_offset;
00232   long            m_Rx_offset;
00233   double          m_MclkFreq;
00234   double          m_SampleSize;
00235   double          m_Mclk2Size;
00236   long            m_SampleRate;
00237   unsigned long   m_LineGroupSize;
00238   unsigned long   m_NumECGSamples;
00239   unsigned long   m_GrayImageSize;
00240   unsigned long   m_DopplerImageSize;
00241   unsigned long   m_EcgSize;
00242   unsigned long   m_MiscDataSize;
00243   unsigned long   m_GrayImageOffset;
00244   unsigned long   m_DopplerImageOffset;
00245   unsigned long   m_EcgOffset;
00246   unsigned long   m_MiscDataOffset;
00247   char            m_File_control_timing_type[272];
00248   char            m_DopplerVolInfo[989];
00249   short           m_ScanDepthCount; 
00250   short           m_ScanDepth; 
00251   double          m_Az_sector_tilt; 
00252   double          m_Elev_sector_tilt; 
00253   char            m_DopplerSegData[68]; 
00254   double          m_FrameRate; 
00255   long            m_Sweepspeed; 
00256   long            m_Update_interval; 
00257   unsigned long   m_Contrast_on;
00258   long            m_Comp_curve_p0_x;
00259   long            m_Comp_curve_p0_y;
00260   long            m_Comp_curve_p1_x;
00261   long            m_Comp_curve_p1_y;
00262   long            m_Comp_curve_p2_x;
00263   long            m_Comp_curve_p2_y;
00264   long            m_Comp_curve_p3_x;
00265   long            m_Comp_curve_p3_y;
00266   long            m_Comp_curve_scaling_index;
00267   long            m_Echo_reject;
00268   double          m_Mt_tp[4][4];
00269   unsigned long   m_True_axis_defined;
00270   unsigned long   m_True_axis_on;
00271   double          m_Parallel_x_tilt;
00272   double          m_Parallel_y_tilt;
00273   double          m_Parallel_depth;
00274   double          m_Parallel_spacing;
00275   long            m_Parallel_thickness;
00276   unsigned long   m_Viewport_transform_flags;
00277   unsigned long   m_Stress_mode;
00278   char            m_Stress_label[64];
00279   double          m_Heart_rate;
00280   long            m_Stage_timer_value;
00281   unsigned long   m_Ecg_display_on; 
00282   //stuff inside file_control_timing_type
00283   double          m_Blanking;
00284   short           m_Samples;
00285   
00287   unsigned long   m_ColorImageSize;
00288   unsigned long   m_ColorImageOffset;
00289   char            m_Oag_params[28];
00290   unsigned long   m_Cscanfmt;
00291   unsigned long   m_Oaglinear;
00292   unsigned long   m_Maxradius;
00293   double          m_Anglescale;
00294   double          m_Skinoffset;
00295   };
00296 
00297 
00298 } // namespace itk
00299 
00300 
00301 #endif 
00302 

Generated at Wed Mar 12 01:13:12 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000