image processing - Dicom: Matlab versus ImageJ grey level -


i processing group of dicom images using both imagej , matlab. in order processing, need find spots have grey levels between 110 , 120 in 8 bit-depth version of image.

the thing is: image matlab , imagej shows me different, using same source file. assume 1 of them performing sort of conversion in grey levels of when reading or before displaying. 1 of them? , in case, how can calibrate display same image?

the following image shows comparison of image read. in case of imagej, opened application , opened dicom image.

in second case, used following matlab script:

[image] = dicomread('i1400001');

figure (1) imshow(image,[]); title('original dicom image'); 

enter image description here

so 1 changing original image , if that's case, how can modify both version looks same?

it appears default imagej uses window center , window width tags in dicom header perform window , level contrast adjustment on raw pixel data before displaying it, whereas matlab code using full range of data display. taken imagej user's guide:

16 display range of dicom images

with dicom images, imagej sets initial display range based on window center (0028, 1050) , window width (0028, 1051) tags. click reset on w&l or b&c window , display range set minimum , maximum pixel values.

so, setting imagej use full range of pixel values should give image match 1 displayed in matlab. alternatively, use dicominfo in matlab 2 tag values header, apply window/leveling data before displaying it. code (using formula first link above):

img = dicomread('i1400001'); imginfo = dicominfo('i1400001'); c = double(imginfo.windowcenter); w = double(imginfo.windowwidth); imgscaled = 255.*((double(img)-(c-0.5))/(w-1)+0.5);  % rescale data imgscaled = uint8(min(max(imgscaled, 0), 255));      % clip edges 

note 1) double used convert double precision avoid integer arithmetic, 2) data assumed unsigned 8-bit integers (which result converted to), , 3) didn't use variable name image because there function name. ;)


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -