I want to save the operation imshow(im16, [WC-WW/2,WC+WW/2]); in a new variable. It is an image that I'm displaying a certain range, but I don't want to use imshow(), I only want to save a new image with a certain range of intensity window result of the operation WC-WW/2,WC+WW/2.
I'm working with CT images in Matlab (in png format), and adjusting window width and window level.
What
imshow(im16,[WC-WW/2,WC+WW/2])does is to put every pixel inim16with intensity belowWC-WW/2to black (0) and every pixel with intensity aboveWC+WW/2to white (255), and then rescale the remaining pixels. One way to do this would be:Just to check: