How to apply a rectangular window on an image?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Faranak
el 10 de En. de 2014
Editada: Image Analyst
el 13 de En. de 2014
Hello, I want to scan a dicom picture with a rectangular window. I do not know how to apply the window. Also I want to know if my codes are correct for making a rectangular or not. These are my codes :
w=sigwin.rectwin; winwrite(w);
I guess it will create window by length 64. how can I change the length and width of my window?
Thanks
0 comentarios
Respuesta aceptada
Image Analyst
el 10 de En. de 2014
Editada: Image Analyst
el 10 de En. de 2014
Use conv2() or imfilter():
windowWidth = 63; % Should be an odd number!
windowHeight = 33; % Should be an odd number!
% Make uniform window which will take average and make it blurry.
kernel = ones(windowHeight, windowWidth ) / windowHeight * windowWidth;
output = conv2(grayImage, kernel, 'same');
% or
output = imfilter(grayImage, kernel);
4 comentarios
Image Analyst
el 13 de En. de 2014
Editada: Image Analyst
el 13 de En. de 2014
There are no non-zero pixels in that image. If you want to count all pixels darker than some threshold value then you can binarize the image first
thresholdValue = 50; % or whatever...
binaryImage = grayImage < thresholdValue;
output = conv2(binaryImage, kernel, 'same');
Más respuestas (0)
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!