#ifndef __STRUCTURE_530_H__ #define __STRUCTURE_530_H__ #include #include using std::vector; using std::string; #define CR_DIR_TO_SAVE_CAL_FILES "DirToSaveCalFiles" namespace CareRay { //***************************************************************************************** // enum starts here. //***************************************************************************************** enum CR_TrigTypeOpt { CR_RadExtSync = 0x01, CR_RadSoftSync = 0x02, CR_RadAutoSync = 0x03, CR_RadManualSync = 0x04, CR_RadAedSync = 0x05, CR_RadDaecSync = 0x06, CR_FluReserved = 0x07, CR_FluExtSync = 0x08, CR_FluIntSync = 0x09, }; enum CR_GainLevelOpt { CR_G0 = 0, CR_G1 = 1, CR_G2 = 2, CR_G3 = 3, CR_G4 = 4, CR_G5 = 5, CR_G6 = 6, CR_G7 = 7, }; enum CR_PowerModeID { CR_PWR_STANDBY = 0, // set front-end into nap mode CR_PWR_FULL_RUNNING = 1, // set front-end into normal mode. CR_PWR_SMART_RUNNING = 2, // set front-end into nap mode at the integration phase. CR_PWR_DOWN_FE = 4, // set front-end into power-down mode. CR_PWR_SLEEPING = 5, CR_PWR_DEEP_SLEEPING = 6, CR_PWR_SUSPEND = 7, // power down }; enum CR_AcqModeOpt { CR_Radiography = 0x10, CR_Fluoroscopy = 0x11, CR_DaecMode = 0x12, CR_FluoroCustom = 0x13, CR_InnerTest = 0x14, CR_Bin22 = 0x15, CR_NondestructiveTesting = 0x16, CR_Preview = 0x17, CR_Bin11 = 0x18, }; enum CR_EventID { CR_EVT_SERVER_DISCONNECTED, CR_EVT_DETR_DISCONNECTED, CR_EVT_EXPOSURE_INFO, CR_EVT_TEMPERATURE_INFO, CR_EVT_BATTERY_INFO, CR_EVT_WIRELESS_INFO, CR_EVT_NEW_FRAME, CR_EVT_CALIBRATION_IN_PROGRESS, CR_EVT_CALIBRATION_FINISHED, CR_EVT_NEW_SPOT_FILM, CR_EVT_ACQ_STAT_INFO, CR_EVT_RAD_ACQ_IN_PROGRESS, CR_EVT_SERVER_RECONNECTED, CR_EVT_DETR_RECONNECTED, CR_EVT_IMAGE_QUEUE_BLOCKED, CR_EVT_DISCARD_FRAME }; enum CR_ExpStatus { CR_EXP_ERROR = -1, CR_EXP_INIT, CR_EXP_READY, CR_EXP_WAIT_PERMISSION, CR_EXP_PERMITTED, CR_EXP_EXPOSE, CR_EXP_COMPLETE, }; enum CR_ReturnCodeType { CR_INFOR = 1, CR_WARN, CR_ERROR, CR_FATALERROR }; enum CR_CalFileType { CR_OFFSET_FILE = 0, CR_GAIN_FILE = 1, CR_DEFECT_FILE = 2 }; enum CR_RefStatus { CR_REF_NOT_FOUND, CR_REF_VALID, CR_REF_ABOUT_TO_EXPIRE, CR_REF_INVALID }; enum CR_CalibFilterMethod { CR_CALIB_FILTER_BASE, CR_CALIB_FILTER_MEAN, CR_CALIB_FILTER_BOUNDARY }; enum CR_ProcChainOpt { CR_PROCCHAIN_SANITYCHECK = 0x01, CR_PROCCHAIN_DARKCORR = 0x02, CR_PROCCHAIN_GAINCORR = 0x04, CR_PROCCHAIN_DEFECTCORR = 0x08, CR_PROCCHAIN_LAGCORR = 0x10, CR_PROCCHAIN_IMGCROPPING = 0x20, CR_PROCCHAIN_RTPIXELCORR = 0x40, CR_PROCCHAIN_DENOISING = 0x80, CR_PROCCHAIN_STEPSUPPRESS = 0x100, CR_PROCCHAIN_ROTATE_IAMGE = 0x200, CR_PROCCHAIN_GAUSSFILTER = 0x80000000 }; enum CR_ProcChainID { CR_PROCCHAINID_FLUOROSCOPY = 1, CR_PROCCHAINID_RADIOGRAPHY = 2 }; //***************************************************************************************** // struct starts here. //***************************************************************************************** struct CR_SystemInfo { unsigned int nRawImageWidth; unsigned int nRawImageHeight; unsigned int nFrmHeaderLen; char szHardwareVersion[64]; char szSerialNumber[64]; char szSoftwareVersion[64]; char szFirmwareVersion[64]; char szDetrMachineID[64]; char szDetrDesc[128]; char szReserved[512]; }; struct CR_DefectInfo { unsigned int unNumBadPixel; unsigned int unNumBadRow; unsigned int unNumBadCol; unsigned short* pBadPixelPtr; unsigned short* pBadRowPtr; unsigned short* pBadColPtr; }; struct CR_ConnectionStatus { bool isServerConnected; bool isDetrConnected; }; struct CR_Temperature { float fMin; float fCpu; float fWiredNetwork; float fReserved; float fCurrent; float fMax; float fAvg; int nOverheat; }; struct CR_DetrStatus { CR_Temperature oDetrTemperature; }; struct CR_DetrIdxAndIPAddr { int nIdx; char szIPAddr[64]; char szReserved[128]; }; struct CR_RegAttrInfo { bool isWritable; bool isFloat; unsigned nVal; float fVal; char czPropertyName[32]; }; struct CR_ModeInfo { int nModeID; int nImageWidth; // ROI dimension along x direction after binning int nImageHeight; // ROI dimension along y direction after binning int nCutoffX; // number of cut-off lines (along x direction) from left after binning int nCutoffY; // number of cut-off lines (along y direction) from top after binning int nBinX; // binning scheme along x direction int nBinY; // binning scheme along y direction float fMaxFrmRate; // in Hz float fMaxExpTime; // in ms int nPixelDepth; // bit depth of each pixel sending out from detector int nTrigTypes[16]; int nTrigTypeNum; int nGainLevels[16]; int nGainLevelNum; int nDefaultTrigType; int nDefaultGainLevel; int nRoiX; // x coordinate of top left point after binning int nRoiY; // y coordinate of top left point after binning char szDesc[256]; // description of this mode }; struct CR_CalibrationInfo { int nTotalFrameNum; int nCurrentFrameNum; int nCurrentFrameMeanValue; char szErrorMsg[256]; int nResult; int nExpStatus; int nTargetGrayValue; }; struct CR_ConfItemInfo { int nId; string strName; string strModule; string strValue; string strDefaultValue; string strRegex; int nPermission; string strDesc; string strDescZH; int nReboot; }; struct CR_ProcessModule { int nModuleID; int nOrderID; string strName; int nEnabled; int nDefaultEnabled; int nAutoSave; int nUpdatePolicy; }; struct CR_ProcessChain { int nChainID; vector vecModule; }; struct CR_Event { int nDetrIndex; int nWidth; int nHeight; int nPixelDepth; void* pData; }; struct CR_AcquisitionStatInfo { int nTotalFrameNum; int nLostFrameNum; float fStatFrameRate; float fTransmissionSpeed; long long nAcqDuration; }; // Image quality statistics struct CR_SQualityStatistics { // Passed type count int m_nQualityPassedCount; // Failed type count int m_nQualityFailedCount; }; struct CR_ExpProgress { int nExpStatus; int bIsFetchable; int nResult; }; typedef struct CR_AedExpProgress { CR_ExpProgress oProgress; float fAedElapsedTimeSinceLastReadout; float fAedRefreshInterval; }CR_AedExpProgress; struct CR_CalFileInfo { int nCalType; float fFrameRate; int nGainId; float fTemperature; int nStatus; int nTrigType; char szModeName[256]; char szDatetime[64]; int nModeId; float fExpTime; }; //Reference status and expiration duration (unit: minute) of special application mode struct CR_RefStatusInfo { int nDarkStatus; int nGainStatus; int nDefectStatus; int nDarkMinsLeft; int nGainMinsLeft; int nDefectMinsLeft; }; //start-by-ts.wang /* * Structure used to read detector file header * */ struct CR_RAD_DetectorFileHeader { char szTypeCode[8]; int nImageSize; int nImgxSize; int nImgySize; int nPixelBits; int nCompressType; int nFrameNum; int nCorrectWay; int nCorrectPara; int nIsolatedPixels; int nIsolatedPixelspos; int nHoribadlines; int nHoribadlinespos; int nVertbadlines; int nVertbadlinespos; int nClusterpixels; int nClusterpixelspos; }; struct CR_RAD_DetectorInfoHeader { int nStartflag; int nEndiantype; char szDttVersion[32]; int nDttType; int nDttNum; int nModeID; int nImgProp; char szBuildTime[24]; float fVbias;// 4 bytes float float fVcmp;// 4 bytes floatdynam_range float fVtftOn;// 4 bytes float float fVtftOff;// 4 bytes float float fDynamRange; float fPgaDac; float fExpTime; float fDelayTime; float fWaitTime; float fTempLT; float fTempRT; float fTempLB; float fTempRB; float fTempM; float szReserver11[3]; char szMachineID[32]; float Reserved12[49]; int rgFpgaRegVersion[4]; int nBuildDate; int nRes000; int nIntRegCopy; int nIntMask; int nExpControl; int nFpgaStatus; int nCycleCount; int nAdcRsl; int rgRes024[15]; float fFpgaDynamRange; float fFpgaPgaDac; float fFpgaPgaDacControl; float fFpgaVbias; float fFpgaVcmp; float fFpgaVtftOn; float fFpgaVtftOff; float fFpgaExpTime; int nRes084; float fFpgaDelayTime; int nRes08c; float fFpgaWaitTime; int nRes094; int nPixelNum; int nLineNum; int nReadoutCnt; int nScanLine; int rgRes0a8[2]; int nXStart; int nXEnd; int nYStart; int nYEnd; int rgRes0c0[16]; int nFifoMax; int nFifoThrsh; int nFifoCount; int nEndflag; }; typedef struct CR_ActiveAreaInfo { int nX; int nY; int nWidth; int nHeight; float fWeight; }CR_ActiveAreaInfo; struct CR_BatteryInfo { unsigned char uId; // battery id unsigned char uAccessible; // is battery accessible unsigned short uRemainingCapacity; // unit: mAh unsigned short uFullCapacity; // unit: mAh unsigned short uVoltage; // unit: mV short nCurrent; // unit: mA unsigned short uChargingCurrent; // unit: mA unsigned short uRunTimeToEmpty; // unit: min unsigned short uAvgTimeToEmpty; // unit: min unsigned short uAvgTimeToFull; // unit: min unsigned short uCycleCount; // unit: cycles unsigned short uTemperature; // unit: 0.1K unsigned short uRelativeStateOfCharge; // relative capacity, unit: % unsigned short uAbsoluteStateOfCharge; // relative capacity, unit: % unsigned short rgReserved[7]; }; typedef struct CR_WirelessStatus { char szEssid[32]; char szPasswd[32]; char szProtocol[16]; char szDesc[32]; int nMode; int nChannel; double fFrequency; int nBitRate; int nStatus; int nQuality; int nLevel; int nNoise; unsigned int uIpv4; int nFactoryFlag; }CR_WirelessStatus; // worklist structures struct CR_CheckInfo { char szId[128]; char szBodyPartId[32]; char szSeriesTime[32]; }; struct CR_BodyPartInfo { char szId[32]; char szPartName[32]; }; struct CR_Examination { char szId[16]; char szChecklistNumber[64]; char szPatientId[64]; char szPatientName[64]; char szPatientSex[8]; char szPatientAge[4]; int nBodyPartNum; int nCheckInfoNum; CR_BodyPartInfo rgBodyPart[16]; CR_CheckInfo rgCheckInfos[32]; }; #define DTT_INFO_HEADER_OFFSET 16384 #define PCI_IMG_HEAD_OFFSET 32768 //end-by-ts.wang //typedef void(*CR_CallbackFunPtr)(int, CR_Event *); } #endif