Download presentation
Presentation is loading. Please wait.
1
Region of Interest Part II Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University
2
22004/05/12Medical Imaging System Outline Get DC Drawing Mode - XOR Complete ROI
3
32004/05/12Medical Imaging System Get DC Provided by the framework void C***View::OnDraw(CDC* pDC) void C***View::OnDraw(CDC* pDC) To obtain DC elsewhere CDC * pDC = GetDC(); : // use pDC … // use pDC … :ReleaseDC(pDC);
4
42004/05/12Medical Imaging System Drawing Mode - XOR AB A B 000 011 101 110 A B ) B = A ( A B ) B = A
5
52004/05/12Medical Imaging System Drawing Mode - XOR Specifies the new drawing mode. pDC->SetROP2(R2_XORPEN); pDC->SetROP2(R2_XORPEN);
6
62004/05/12Medical Imaging System Complete ROI Add a state variable m_bLBtnDown into C***View To keep track of the status of the mouse’s left button To keep track of the status of the mouse’s left button Initialization : set to be ‘false’ Initialization : set to be ‘false’ OnLButtonDown : set to be ‘true’ OnLButtonDown : set to be ‘true’ OnLButtonUp : set to be ‘false’ OnLButtonUp : set to be ‘false’
7
72004/05/12Medical Imaging System Complete ROI Use two variables to record the first and second points (C***View) m_ptFirst and m_ptSecond m_ptFirst and m_ptSecondOnLButtonDown m_ptFirst = point; m_ptFirst = point; m_ptSecond = point; m_ptSecond = point;OnLButtonUp
8
82004/05/12Medical Imaging System Complete ROI OnMouseMove Check m_bLBtnDown Check m_bLBtnDown Erase previous (old) ROI Erase previous (old) ROI m_ptFirst and m_ptSecond m_ptSecond = point; m_ptSecond = point; Draw new ROI Draw new ROI m_ptFirst and m_ptSecond
9
92004/05/12Medical Imaging System Other Considerations Scrollbar CPoint GetScrollPosition() CPoint GetScrollPosition() Display ratio m_nDisplayRatio m_nDisplayRatio
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.