www.pudn.com > 医学图像处理示例源代码.rar > AllImage.h


 
#include "image.h" 
#include "JpegFile.h" 
#include "GifFile.h" 
#include "RGBQuant.h" 
 
#ifndef _ALLIMAGE_H 
#define _ALLIMAGE_H 
 
enum eProcessType  
{  
	PT_Sharpen_Sobel = 10, 
	PT_Sharpen_Roberts, 
	PT_Sharpen_Prewitt, 
	PT_Sharpen_Laplacian, 
		 
	PT_Smoothing_Mean = 20, 
	PT_Smoothing_RecursiveMiddle, 
	PT_Smoothing_NonRecursiveMiddle, 
	PT_Smoothing_FastMiddle, 
	 
	PT_Segment_ManualBinary = 30, 
	PT_Segment_AutoBinary, 
	PT_Segment_AutoBinary_ME, 
	PT_Segment_AutoBinary_Qtsu, 
	PT_Segment_AutoBinary_EC, 
	PT_Segment_RoInvarOperator, 
 
	PT_Enhance_Histogram = 46, 
 
	PT_Morphology_Dilation = 50, 
	PT_Morphology_Erosion, 
	PT_Morphology_Opening, 
	PT_Morphology_Closing, 
 
	PT_ShowFFTMagnitude = 60, 
	PT_ShowPyramidImage, 
	PT_ShowMosaicImage, 
	PT_EdgeOrention_Sobel, 
	PT_EdgeOrention_RoInvarOperator, 
 
	PT_Binary_Thin_Hilditch = 70, 
	PT_Binary_Thin_ZhangSuen, 
	PT_Binary_Thin_Somebody, 
	PT_Binary_Transform_Hough, 
	PT_Binary_Transform_Radon, 
	PT_Binary_Edge_Simple, 
 
	PT_Edge_Gray_Moment = 80, 
	PT_Edge_Spatial_Moment, 
	PT_Edge_Spatial_Zernike_Moment 
}; 
 
class CAllImage :public CImage 
{ 
public: 
	 CAllImage(); 
	~CAllImage(); 
     CAllImage(CAllImage & source); 
     CAllImage(P_LONG width, P_LONG height, int PixelDepth,DWORD colornum); 
     CAllImage(CAllImage &source,CPoint <p, CPoint &RBp); 
 
public: 
	GIFFile            GifImage; 
	BOOL               IsColorGifImage; 
	BOOL               IsColorPCXImage; 
	BOOL               IsColorTGAImage; 
public: 
	BOOL ReadImageFromFile(LPCTSTR lpszFileName); 
	BOOL SaveImageToFile(LPCTSTR lpszFileName); 
	 
	BOOL ReadImageAsJPG(CString fileName); 
    BOOL SaveImageAsJPG(CString fileName); 
 
	BOOL ReadImageAsGIF(CString fileName); 
    BOOL SaveImageAsGIF(CString fileName); 
     
	BOOL ReadImageAsPCX(LPCTSTR fileName); 
    BOOL SaveImageAsPCX(LPCTSTR fileName); 
 
	void GetImageDimensions(LPCTSTR fileName,  
		                     unsigned int &width,  
				             unsigned int &height,  
							 unsigned int &Depth); 
	//BOOL ReadImageAsTGA(LPCTSTR fileName); 
    //BOOL SaveImageAsTGA(LPCTSTR fileName);	 
	 
	//-----------不需要参数的处理函数------------// 
	//灰度图像的一般处理函数 
	BOOL ImageProcess(CPoint LTPt,CPoint RBPt, eProcessType ProcType); 
	BOOL ImageProcess(eProcessType ProcType); 
     
	//二值图像的细化处理函数 
	BOOL Binary_Process(eProcessType ProcType, BYTE TargetGray, CPoint LTPt,CPoint RBPt); 
	BOOL Binary_Process(eProcessType ProcType, BYTE TargetGray); 
 
	// 需要模板的函数 
	BOOL ImageNeedMaskProcess(eProcessType ProcType, int masksize , CPoint LTPt, CPoint RBPt); 
	BOOL ImageNeedMaskProcess(eProcessType ProcType, int masksize); 
 
	//-----------一些需要参数的处理函数-----------// 
	BOOL Binary2(int threshold,  int Type, CPoint LTPt,CPoint RBPt); 
	BOOL Binary2(int threshold,  int Type); 
 
	BOOL Wallis2(CPoint LTPt,CPoint RBPt,double Ia, int Imean, int Isigma, int Iam); 
	BOOL Wallis2(double Ia, int Imean, int Isigma, int Iam); 
 
	BOOL SusanNormalFilter2(int bt, double dt, CPoint LTPt, CPoint RBPt); 
	BOOL SusanNormalFilter2(int tb, double dt); 
 
	BOOL SusanNormalEdge2(int bt, CPoint LTPt, CPoint RBPt); 
	BOOL SusanNormalEdge2(int tb); 
 
	BOOL SusanPrinciple2(int bt, CPoint LTPt, CPoint RBPt); 
	BOOL SusanPrinciple2(int tb); 
 
	BOOL EnhaceLinear(CPoint LTPt, CPoint RBPt,int a2,int b2, int type= 0); 
	BOOL EnhaceLinear(int a2,int b2, int type= 0); 
 
	BOOL BinaryMorph2(CPoint LTPt,CPoint RBPt, eProcessType ProcType,  
		              BYTE *Mask,int MaskR,BYTE TargetGray); 
	BOOL BinaryMorph2(eProcessType ProcType, BYTE *Mask, int MaskR, BYTE TargetGray); 
 
	BOOL GrayMorph2(CPoint LTPt,CPoint RBPt, eProcessType ProcType, BYTE *Mask,int MaskR); 
	BOOL GrayMorph2(eProcessType ProcType, BYTE *Mask, int MaskR); 
 
	BOOL Binary_AreaLabel(CPoint LTPt,CPoint RBPt, BYTE TargetGray); 
	BOOL Binary_AreaLabel(BYTE TargetGray, CPoint *OutPutPt, int &PtMum); 
 
	BOOL Gauss_Blur2(double Sigma, CPoint LTPt, CPoint RBPt); 
	BOOL Gauss_Blur2(double Sigma);   
 
	BOOL Gauss_Sharpen2(double Sigma, CPoint LTPt, CPoint RBPt); 
	BOOL Gauss_Sharpen2(double Sigma);   
 
	BOOL Marr_Hildreth2(double Sigma, CPoint LTPt, CPoint RBPt); 
	BOOL Marr_Hildreth2(double Sigma);   
}; 
#endif