WindowCenter \ windowWidth

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
cool_head
Posts: 9
Joined: Sun, 2005-11-20, 08:06

WindowCenter \ windowWidth

#1 Post by cool_head »

Hi ,

How can I calculate window Center and window width
during MouseMove on an image. (needed to apply brightness and
contrast)

Is there any formula or any way to do so . plz help me


......cool

Michael Onken
DCMTK Developer
Posts: 2051
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: WindowCenter \ windowWidth

#2 Post by Michael Onken »

Hi,

perhaps section C.11.2.1.2 in part 3 of the standard might give the right answers;-)

Regards,
Michael

Alexander Fedotov
Posts: 53
Joined: Thu, 2005-04-14, 15:07
Location: St. Petersburg, Russia

Re: WindowCenter \ windowWidth

#3 Post by Alexander Fedotov »

[quote="cool_head"]Hi ,

How can I calculate [b]window Center [/b] and [b]window width [/b]
during MouseMove on an image.
[/quote]


void CElMiniViewerView::OnMouseMove(UINT nFlags, CPoint point)
{
.....
if (m_bRightMouseDown)
// if (nFlags & MK_RBUTTON) - is another way but I need this one
{
CPoint pointShift = point - m_pointRightStart; // this is the shift value

if (pointShift.x)
// change the window center or width calling finally
/// DicomImage::setWindow
if (pointShift.y)
// change the window center or width calling finally
/// DicomImage::setWindow

m_pointRightStart = point;
}
}


I had implemented it in my Miniviewer according Dr. Marco Eichelberg's piece of advice.

Alexander.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest