fenêtrage d'une image scannographie
2 views (last 30 days)
Show older comments
si vous plait comment je peux appliquer un fenêtrage sur une image Dicom selon les paramètres de centre de la fenêtre et de largeur de la fenêtre voila les valeurs des paramètres (WL=40 WW=85)
0 Comments
Accepted Answer
Image Analyst
on 2 Jun 2024
help conv2
There are other windowed functions, for example stdfilt, imgaussfilt, etc.. It really depends on what you want to do with the pixels inside the window.
6 Comments
Image Analyst
on 4 Jun 2024
Don't use "image" as the name of your variable since it's the name of a built-in function.
Do not use the index j to loop over the width of the image. Since j is the column, not row, j should be the second index, not the first. Otherwise you'll get an index out of range error. Try this:
info = dicominfo('1.2.156.14702.1.1000.16.2.20220802014611796000200030141');
grayImage = int16(dicomread('1.2.156.14702.1.1000.16.2.20220802014611796000200030141'));
% Display image.
subplot(1, 2, 1);
imshow(grayImage,[])
axis('on', 'image');
impixelinfo
title('Original Image')
grayImage = grayImage.*info.RescaleSlope + info.RescaleIntercept;
maxGrayLevel = max(grayImage, 'all')
minGrayLevel = min(grayImage(:))
value1 = info.WindowCenter-floor(info.WindowWidth/2)
value2 = info.WindowCenter+floor(info.WindowWidth/2)
me = (maxGrayLevel-minGrayLevel) / (value2-value1)
b = minGrayLevel - (me * value1)
[rows, columns, numberOfColorChannels] = size(grayImage)
for row = 1 : rows
for column = 1 : columns
if grayImage(row, column)> = value2
grayImage(row, column) = maxGrayLevel;
elseif grayImage(row, column)<=value1
grayImage(row, column) = minGrayLevel;
else
grayImage(row, column) = me*grayImage(row, column)+b;
end
end
end
% Display image.
subplot(1, 2, 2);
imshow(grayImage,[])
axis('on', 'image');
impixelinfo
title('Modified Image')
More Answers (0)
See Also
Categories
Find more on DICOM Format in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!