|
-
September 28th, 2009, 05:14 AM
#2
Re: Coming up with the histrogram of medical images
You're already drawing the X/Y axis, so adding the histogram itself should be obvious enough, just add the appropriate drawing commands.
If you're askign how to actually calculate the histogram data, you may be asking the wrong forum, we can help with programming issues, but I'm not sure anyone knows how to actually interpret the data you're handling and how to calculate the stuff you need.
Maybe we can help with developping it if you can give more detailed information about what exactly you're trying to do.
I have the vague impression you want to draw a curve from left/right (X-axis) displaying the count of each pixel value ? If yes, that should be something like:
Code:
pDC->MoveTo( 600 + 0, 400 - array1[0] );
for (int x=1; x<_countof(array1); ++x)
{
pDC->LineTo( 600 + x, 400 - array1[x] );
}
you may need to set pen and color beforehand. and may need to adjust coordinates, but you get the general idea.
You will likely also need to 'scale' the Y axis down to have it display withing reasonable values. (change 'array1[x]' to be divided by the scaling factor)
Last edited by OReubens; September 28th, 2009 at 05:17 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|