9
Region of Interest Region of Interest Part II Part II Ku-Yaw Chang Ku-Yaw Chang [email protected] [email protected] Assistant Professor, Department of Assistant Professor, Department of Computer Science and Information Engineering Computer Science and Information Engineering Da-Yeh University Da-Yeh University

Region of Interest Part II

Embed Size (px)

DESCRIPTION

Region of Interest Part II. Ku-Yaw Chang [email protected] Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University. Outline. Get DC Drawing Mode - XOR Complete ROI. Get DC. Provided by the framework void C***View::OnDraw(CDC* pDC) - PowerPoint PPT Presentation

Citation preview

Page 1: Region of Interest Part II

Region of InterestRegion of InterestPart IIPart II

Ku-Yaw ChangKu-Yaw [email protected]@mail.dyu.edu.tw

Assistant Professor, Department of Assistant Professor, Department of Computer Science and Information EngineeringComputer Science and Information Engineering

Da-Yeh UniversityDa-Yeh University

Page 2: Region of Interest Part II

222004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

OutlineOutline

Get DCGet DC

Drawing Mode - XORDrawing Mode - XOR

Complete ROIComplete ROI

Page 3: Region of Interest Part II

332004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Get DCGet DC

Provided by the frameworkProvided by the framework void C***View::OnDraw(CDC* pDC)void C***View::OnDraw(CDC* pDC)

To obtain DC elsewhereTo obtain DC elsewhereCDC * pDC = GetDC();CDC * pDC = GetDC();

::

// use pDC …// use pDC …

::

ReleaseDC(pDC);ReleaseDC(pDC);

Page 4: Region of Interest Part II

442004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Drawing Mode - XORDrawing Mode - XOR

AA BB A A B B

00 00 00

00 11 11

11 00 11

11 11 00

( A A B ) B ) B = A B = A

Page 5: Region of Interest Part II

552004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Drawing Mode - XORDrawing Mode - XOR

Specifies the new drawing mode. Specifies the new drawing mode. pDC->SetROP2(R2_XORPEN);pDC->SetROP2(R2_XORPEN);

Page 6: Region of Interest Part II

662004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Complete ROIComplete ROI

Add a state variable m_bLBtnDown into Add a state variable m_bLBtnDown into C***ViewC***View To keep track of the status of the mouse’s left To keep track of the status of the mouse’s left

buttonbutton 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’

Page 7: Region of Interest Part II

772004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Complete ROIComplete ROI

Use two variables to record the first and Use two variables to record the first and second points (C***View)second points (C***View) m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond

OnLButtonDownOnLButtonDown m_ptFirst = point;m_ptFirst = point; m_ptSecond = point; m_ptSecond = point;

OnLButtonUpOnLButtonUp m_ptSecond = point; m_ptSecond = point;

Page 8: Region of Interest Part II

882004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Complete ROIComplete ROI

OnMouseMoveOnMouseMove Check m_bLBtnDownCheck m_bLBtnDown Erase previous (old) ROIErase previous (old) ROI

m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond m_ptSecond = point;m_ptSecond = point; Draw new ROIDraw new ROI

m_ptFirst and m_ptSecondm_ptFirst and m_ptSecond

Page 9: Region of Interest Part II

992004/05/122004/05/12 Medical Imaging SystemMedical Imaging System

Other ConsiderationsOther Considerations

ScrollbarScrollbar CPoint GetScrollPosition()CPoint GetScrollPosition()

Display ratioDisplay ratio m_nDisplayRatiom_nDisplayRatio