// OverlayAttribDlg.cpp : implementation file // #include "stdafx.h" #include "overlay.h" #include "OverlayAttribDlg.h" #include "MainFrm.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern COverlayApp theApp; ///////////////////////////////////////////////////////////////////////////// // COverlayAttribDlg dialog COverlayAttribDlg::COverlayAttribDlg(CWnd* pParent /*=NULL*/) : CDialog(COverlayAttribDlg::IDD, pParent) { //{{AFX_DATA_INIT(COverlayAttribDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void COverlayAttribDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(COverlayAttribDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(COverlayAttribDlg, CDialog) //{{AFX_MSG_MAP(COverlayAttribDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // COverlayAttribDlg message handlers BOOL COverlayAttribDlg::OnInitDialog() { CDialog::OnInitDialog(); char szBuf[_MAX_PATH]; char szTemp[_MAX_PATH]; UINT uFlags = OVERLAYATTRIBUTES_ORIGIN | OVERLAYATTRIBUTES_COLOR | OVERLAYATTRIBUTES_FLAGS | OVERLAYATTRIBUTES_BITINDEX | OVERLAYATTRIBUTES_DICOM; CMainFrame* pFrame = (CMainFrame*) AfxGetApp()->GetMainWnd(); memset (&szBuf, 0, sizeof (szBuf)); memset (&szTemp, 0, sizeof (szTemp)); CLEADRasterImageListItem item = pFrame->m_pLeftPaneWnd->m_ImageListControl.Item(pFrame->m_nSelItemIndex); sprintf (szBuf, "%s Attributes", item.GetText()); SetWindowText(szBuf); theApp.m_pRasterProcess->GetOverlayAttributes(pFrame->m_pRightPaneWnd->m_RasterView.GetRaster(), pFrame->m_nSelItemIndex, uFlags); // Display overlay origin coordinates sprintf (szBuf, "X: %d\tY: %d", theApp.m_pRasterProcess->OverlayAttributes->GetOriginX(), theApp.m_pRasterProcess->OverlayAttributes->GetOriginY() ); GetDlgItem(IDC_ORIGIN)->SetWindowText(szBuf); // Display overlay color sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->Color); GetDlgItem(IDC_COLOR)->SetWindowText(szBuf); // Display overlay index sprintf (szBuf, "%d", pFrame->m_nSelItemIndex); GetDlgItem(IDC_INDEX)->SetWindowText(szBuf); // Display overlay BitPosition sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->BitPosition); GetDlgItem(IDC_BITPOSITION)->SetWindowText(szBuf); // Display overlay set flags if (theApp.m_pRasterProcess->OverlayAttributes->Flags & OVERLAY_AUTOPAINT ) GetDlgItem(IDC_AUTOPAINT_FLAG)->SetWindowText("On"); else GetDlgItem(IDC_AUTOPAINT_FLAG)->SetWindowText("Off"); if (theApp.m_pRasterProcess->OverlayAttributes->Flags & OVERLAY_AUTOPROCESS ) GetDlgItem(IDC_PROCESS_FLAG)->SetWindowText("On"); else GetDlgItem(IDC_PROCESS_FLAG)->SetWindowText("Off"); if (theApp.m_pRasterProcess->OverlayAttributes->Flags & OVERLAY_USEBITPLANE ) GetDlgItem(IDC_BITPLANE_FLAG)->SetWindowText("On"); else GetDlgItem(IDC_BITPLANE_FLAG)->SetWindowText("Off"); // Display overlay number of rows sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->Rows); GetDlgItem(IDC_ROWS)->SetWindowText(szBuf); // Display overlay number of columns sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->Columns); GetDlgItem(IDC_COLUMNS)->SetWindowText(szBuf); // Display overlay type GetDlgItem(IDC_TYPE)->SetWindowText(theApp.m_pRasterProcess->OverlayAttributes->Type); // Display number of bits allocated in overlay sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->BitsAllocated); GetDlgItem(IDC_ALLOCATED_BITS)->SetWindowText(szBuf); // Display overlay subtype GetDlgItem(IDC_SUBTYPE)->SetWindowText(theApp.m_pRasterProcess->OverlayAttributes->Subtype); // Display overlay subtype GetDlgItem(IDC_LABEL)->SetWindowText(theApp.m_pRasterProcess->OverlayAttributes->Label); // Display number of pixels in ROI area sprintf (szBuf, "%d", theApp.m_pRasterProcess->OverlayAttributes->ROIArea); GetDlgItem(IDC_ROI_AREA)->SetWindowText(szBuf); // Display ROI Mean sprintf (szBuf, "%f", theApp.m_pRasterProcess->OverlayAttributes->ROIMean ); GetDlgItem(IDC_ROI_MEAN)->SetWindowText(szBuf); // Display ROI standard deviation sprintf (szBuf, "%f", theApp.m_pRasterProcess->OverlayAttributes->ROIStandardDeviation); GetDlgItem(IDC_STANDARD_DEVIATION)->SetWindowText(szBuf); // Display number of frames in the overlay sprintf (szBuf, "%d", theApp.m_pRasterProcess->OverlayAttributes->NumberFramesInOverlay); GetDlgItem(IDC_FRAMES)->SetWindowText(szBuf); // Display the image frame origin sprintf (szBuf, "%u", theApp.m_pRasterProcess->OverlayAttributes->ImageFrameOrigin); GetDlgItem(IDC_FRAME_ORIGIN)->SetWindowText(szBuf); // Display the activation layer GetDlgItem(IDC_ACTIVATION_LAYER)->SetWindowText(theApp.m_pRasterProcess->OverlayAttributes->ActivationLayer); // Display the activation layer GetDlgItem(IDC_DESCRIPTION)->SetWindowText(theApp.m_pRasterProcess->OverlayAttributes->Description); return TRUE; }