| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- #pragma once
- #include "afx.h"
- #include "OTSFieldData.h"
- #include "OTSImageProcessParam.h"
- #include "PosXray.h"
- #include "OTSXRayParam.h"
- #include "OTSBrukerImpl_const.h"
- #include "MsrResults.h"
- #include "MsrSampleStatus.h"
- namespace OTSMODEL {
- using namespace OTSController;
- class __declspec(dllexport) COTSFieldMgr
- {
- public:
- COTSFieldMgr();
- virtual ~COTSFieldMgr();
- // init
- BOOL Init(COTSFieldDataPtr a_pFieldData, CBSEImgPtr a_pBSEImg);
- COTSFieldDataPtr GetOTSFieldData() { return m_pFieldData; }
- void SetOTSFieldData(COTSFieldDataPtr a_pOTSFieldData);
-
- // BSE image
- CBSEImgPtr GetBSEImage() { return m_pBSEImg; }
- void SetBSEImage(CBSEImgPtr a_pBSEImg);
- void SetMsrStatus(CMsrSampleStatusPtr s) { m_pMsrStatus = s; }
- CMsrSampleStatusPtr GetMsrStatus() { return m_pMsrStatus; }
- // searching x ray list
- CPosXraysList GetSearchPosXrayList() { return m_listSearchPosXray; }
- void SetSearchPosXayList(CPosXraysList& a_listPosXray, BOOL a_bClear = TRUE);
-
- // analysis x ray list
- CPosXraysList GetAnalysisPosXrayList() { return m_listAnalysisPosXray; }
- void SetAnalysisPosXayList(CPosXraysList& a_listPosXray, BOOL a_bClear = TRUE);
- // remove BES image background
- BOOL RemoveBSEImageBG(COTSImageProcessParamPtr a_pImageProcessParam);
- // remove oversize particles and small particles
- BOOL ProcessParticles(COTSImageProcessParamPtr a_pImageProcessParam, double a_dPixelSize, COTSParticleList& a_listParticlesOut);
- BOOL IdentifyParticle(COTSImageProcessParamPtr a_pImageProcessParam, CPosXraysList& a_listXRay);
- // create x-ray list for a set of particles
- static BOOL CreateXrayList(COTSParticleList& a_listParticles, CPosXraysList& a_listPosXRay);
- // find out analysis (remove low count and particles contain no interesting elements)
- /*BOOL GetAnalysisParticles(COTSParticleList& a_listSearchParticles,
- CPosXraysList& a_listSearchPosXRay,
- int a_nLowCountLimit,
- CElementsList& a_listElements,
- COTSParticleList& a_listAnalysisParticles,
- CPosXraysList& a_listAnalysisXRay);*/
- // field on-line classification
- BOOL OnLineClassification();
- CMsrResultsPtr GetMsrResult() { return m_pMsrResults; }
- void SetMsrResult(CMsrResultsPtr a_pMsrResults);
- // save field files
- BOOL SaveFieldFiles();
- // search X-Ray analysis
- BOOL DoSearchXRayAnalysis(COTSXRayParamPtr a_pXrayParam, std::vector<std::vector<BrukerSegment>>& a_listFeatures, CPosXraysList& a_listXRay);
- // analysis X-Ray analysis
- //BOOL DoAnalysisXRayAnalysis(COTSXRayParamPtr a_pXrayParam, COTS);
- // Check if is there any particles
- BOOL NoParticle();
- BOOL CalIncAParticleImageProp(double a_pixelSize);
- static BOOL CalMergedParticleImageProp(COTSParticleList mergedParticles, double a_pixelSize);//process merged particles
- protected:
- // field data
- COTSFieldDataPtr m_pFieldData;
- // BSE image
- CBSEImgPtr m_pBSEImg;
- // searching x ray list
- CPosXraysList m_listSearchPosXray;
- // analysis x ray list
- CPosXraysList m_listAnalysisPosXray;
- // sample result
- CMsrResultsPtr m_pMsrResults;
- CMsrSampleStatusPtr m_pMsrStatus;
- //get segment list of a image
- BOOL GetSegmentList(long a_nWidth, long a_nHeight,const BYTE* a_pPixel, COTSSegmentsList& a_listSegments);
- BOOL GetFeatureList1(COTSSegmentsList & a_listSegments, COTSFeatureList & a_listFeatures);
- //get feature list of up-down segment
- //BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures);
- //change feature into particle
- BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle);
- // get particles from image
- BOOL GetParticles(long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
- BOOL GetIncAParticleList(COTSParticleList & a_listParticleOut);
- // form particle from particle list
- //BOOL GetParticleFromParticleList(COTSParticleList& a_listParticle, COTSParticlePtr a_pParticleIn, COTSParticlePtr a_pParticleOut);
- //// get particle from particle list according the particle in
- //BOOL GetParticleListFromParticlelist(COTSParticleList& a_listParticleIn, COTSParticleList& a_listParticleOut);
- //// check if two particle is neighbor
- //BOOL CheckParticleNeight(const COTSParticlePtr a_pParticleCur, const COTSParticlePtr a_pParticleNew);
-
- // get inclusion particle
-
- };
- typedef std::shared_ptr<COTSFieldMgr> __declspec(dllexport) COTSFieldMgrPtr;
- typedef std::vector<COTSFieldMgrPtr> __declspec(dllexport) COTSFieldMgrList;
- }
|