Mapping the pixel data from one range to [0,255]

302 views
Skip to first unread message

kev n

unread,
Sep 22, 2016, 9:40:26 AM9/22/16
to cornerstone platform
Hi Chris - hope all is well,

I have been working with cornerstone for a while and I was wondering how to map a given set of pixel data range - say [0,2003] to [0,255]. I'm working on fusing two dicom images with different different resolutions. Any help would be of great value.

Thanks and regards,
Kevin

Chris Hafey

unread,
Sep 22, 2016, 9:59:14 AM9/22/16
to cornerstone platform
Hi Kevin - I am not exactly sure what you are asking.  Cornerstone includes code to convert 16 bit grayscale data to 8 bit grayscale data via the display pipeline.  The display pipeline applies the Modality LUT and VOI LUT transforms to produce 8 bit gray data as output.  Perhaps you can use this code?  Or maybe explain better about what you are trying to do?

kev n

unread,
Sep 22, 2016, 12:36:36 PM9/22/16
to cornerstone platform
Hi Chris - I apologize for not explaining the problem well.

I think that's what I'm looking for. So I should be able to map an image with min and max pixel values of 0 and 2033 to an image of min and max pixel values of 0 and 255, right?

Thanks.

Chris Hafey

unread,
Sep 22, 2016, 2:23:49 PM9/22/16
to cornerstone platform
Hi Kev,

Many medical images have more than 8 bits per pixel of grayscale data (this is called stored pixel data).  Standard video cards only support 8 bits per pixel of grayscale data (these are called display pixels).  To deal with this mismatch, the display pipeline converts stored pixels (e.g. 16 bit data) to display pixels (8 bit data) by applying a mathematical formula. The window width and window center viewport properties are inputs to the mathematical formula that controls how 16 bit data is mapped to 8 bit data.  Cornerstone implements this display pipeline and allows you to specify the window width and window center values that are used to map the data.  This mapping is done here:


Chris

kev n

unread,
Sep 22, 2016, 4:07:34 PM9/22/16
to cornerstone platform
Hi Chris,

Let me see if I got this right - whenever cornerstone displays an image it internally converts all images to 8 bit data.
Also, can I just go ahead and do an image fusion using your dynamic Image example as a base? Or is there another better way to achieve this? Which blending algorithm would be best suited for fusing two grayscale images?

Thanks,
Kevin

Chris Hafey

unread,
Sep 23, 2016, 8:38:17 AM9/23/16
to cornerstone platform
Yes you have it right.  You can do image fusion using the dynamic image example.  We are also working on a more robust composite renderer that may be a better choice once it is ready.  Hard to advise you any further without more detail

kev n

unread,
Sep 23, 2016, 11:22:10 AM9/23/16
to cornerstone platform
Hi Chris - it's alright,I got the basics of the fusion down and have been able to fuse two images.

The problem arises in registering the images. How do I go about tackling the registration of images, of say an MRI and CT from the same study.

Thanks,
Kevin

Chris Hafey

unread,
Sep 23, 2016, 11:42:49 AM9/23/16
to cornerstone platform
Registration is outside the scope of this forum, good luck

kev n

unread,
Sep 23, 2016, 1:53:38 PM9/23/16
to cornerstone platform
Ahh, alright. Thanks for your time.

Regards,
Kevin
Reply all
Reply to author
Forward
0 new messages