Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Convert DCMTK DicomImage into Mat OpenCV

$
0
0
I have some project that require me to get the most accurate data so that I can perform simple image thresholding to segments the bone area only. The DICOM library I use is DCMTK, and here is the way I did it: Mat image = Mat(int(mono->getHeight()), int(mono->getWidth()), CV_16UC1, (Uint16 *)(mono->getOutputData(16/* bits per sample */))); Strangly, if the depth is 13, the image I get is pretty good, but when the image depth is 17, the image contrast is getting low. here is the image of the 13bits depth I get ![image description](/upfiles/14692041936283536.png) and here is the image of 17bits ![image description](/upfiles/14692042068205174.png) how can I get the same result as the 13bits image from the 17bits image? In my current method, after the matrix has been saved, I turn the pixel value range into range 0-1 first, and then I normalize it by maximinzing the pixel range (sometimes the pixel value is 0.4=0.6 so I maximize it using linear interpolation to range 0-1). Sometimes this method is working, but since I use a static threshold value to recognize the bone, in many cases, this method failed to give the proper bone value.

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>