Region of Interest Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University
22004/04/21Medical Imaging System ROI ROI Region of Interest Region of InterestRectangleEllipsePolygonVOI Volume of Interest Volume of Interest
32004/04/21Medical Imaging System Mouse Events WM_LBUTTONDOWN OnLButtonDown(UINT nFlags, CPoint point) OnLButtonDown(UINT nFlags, CPoint point)WM_LBUTTONUP OnLButtonUp(UINT nFlags, CPoint point) OnLButtonUp(UINT nFlags, CPoint point)WM_LBUTTONDBLCLK OnLButtonDblClk(UINT nFlags, CPoint point) OnLButtonDblClk(UINT nFlags, CPoint point)
42004/04/21Medical Imaging System Parameters nFlags Indicates whether various virtual keys are down. This parameter can be any combination of the following values: Indicates whether various virtual keys are down. This parameter can be any combination of the following values: MK_CONTROL Set if the CTRL key is down. MK_LBUTTON Set if the left mouse button is down. MK_MBUTTON Set if the middle mouse button is down. MK_RBUTTON Set if the right mouse button is down. MK_SHIFT Set if the SHIFT key is down. point Specifies the x- and y-coordinate of the cursor. Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper- left corner of the window. These coordinates are always relative to the upper- left corner of the window.
52004/04/21Medical Imaging System CRect Basic data members left left Specifies the x-coordinate of the upper-left corner of a rectangle. top top Specifies the y-coordinate of the upper-left corner of a rectangle. right right Specifies the x-coordinate of the lower-right corner of a rectangle. bottom bottom Specifies the y-coordinate of the lower-right corner of a rectangle.
62004/04/21Medical Imaging System ROI Recorded as a rectangle CRect CRect OnLButtonDown OnLButtonDown CRect::left, CRect::top CRect::left, CRect::top OnLButtonUp OnLButtonUp CRect::right, CRect::bottom CRect::right, CRect::bottom
72004/04/21Medical Imaging System CRect::NormalizeRect Example CRect rect1(110, 100, 250, 310); CRect rect2(250, 310, 110, 100); rect1.NormalizeRect(); rect2.NormalizeRect(); // rect1 should be unchanged // rect2 becomes (110, 100, 250, 310)
82004/04/21Medical Imaging System Draw an ROI CPen while while solid solidCBrush
92004/04/21Medical Imaging System CPen CPen( int nPenStyle, int nWidth, COLORREF crColor ); nPenStyle Specifies the pen style. Specifies the pen style. PS_SOLID Creates a solid pen. PS_DASH Creates a dashed pen. PS_DOT Creates a dotted pen. PS_NULL Creates a null pen. nWidth Specifies the width of the pen. Specifies the width of the pen.crColor Contains an RGB color for the pen. Contains an RGB color for the pen.
102004/04/21Medical Imaging System SelectObject Pen APen B Pen A Pen B (1) (2) (3)
112004/04/21Medical Imaging System Draw an ROI CRect rc(100,100, 200, 200); COLORREF crPen; crPen = RGB(255, 0, 0); CPen penRed(PS_SOLID, 1, crPen); CPen * pOldPen; pOldPen = pDC->SelectObject(&penRed); pDC->SelectStockObject(HOLLOW_BRUSH);pDC->Rectangle(&rc);pDC->SelectObject(pOldPen);
122004/04/21Medical Imaging System ROIs Use list to store more than one CRect Standard Template Library (STL) List List Stack Stack Queue Queue Vector Vector …
132004/04/21Medical Imaging System list Include #include #include using namespace std; using namespace std;Declaration list listROI; list listROI;Add push_back, push_front push_back, push_frontRemove pop_back, pop_front pop_back, pop_front
142004/04/21Medical Imaging System list Iterate list ::iterator i; list ::iterator i; for (i = listPoint.begin(); i != listPoint.end(); ++i) for (i = listPoint.begin(); i != listPoint.end(); ++i)Miscel size() size() clear() clear() front() front() back() back()