I am modifying dicom images by replacing the actual pixel values with fixed numbers. Here is one line of my script (below).
image_list=dir('*.dcm');
for i=1:40
img=dicomread(image_list(i).name);
imgHdr = dicominfo(image_list(i).name);
%Bone
img(1:410,1:410) = 3000*uint16(img(1:410,1:410)>1590 & img(1:410,1:410) <=3000)+uint16(img(1:410,1:410)<=1590 | img(1:410,1:410)>2000).*img(1:410,1:410);
dicomwrite(img, ['N' num2str(i) '.dcm'], imgHdr,'CreateMode','Copy')
end
Then, I am trying to add random numbers (between 1 and 100) to these fixed values, i.e. 3000 (as shown in the script) so it will be between 3000 and 3100. How can I do that ?
Any assistance would be appreciated, thanks.