Mathcad for Medical Imaging and Nuclear Medicine
Author Message
Senseineo

Joined: 12 Aug 2009
Posts: 6
Location: Australia

Senseineo

Joined: 12 Aug 2009
Posts: 6
Location: Australia

 Posted: Mon Sep 21, 2009 4:45 am    Post subject: Function and Level Mapping for MathCAD Webinar Function and Level Mapping Function and level mapping shows the different levels of intensities across an existing image which will allow for different areas of the image to be more defined. This can be done to eliminate the amount of background noise as we saw in the equalisation step for the first webinar. To activate this function, type in funmap(M,f) where M is the image matrix which needs to be generated first. The character f in the command is for the function to be performed at each vector or cells in the image matrix (256 levels to map the different intensities) which is going to be used to help define the details on the image. This means that every time that the image matrix is processed by the new function, the mapping image matrix will be also calculated with the new changes to the image at each intensity each time separate as it is applied. To use this function, we type in R := READ_IMAGE("C:\Program Files\Mathcad\Mathcad 14\Handbook\improc\brain.gif"). This allows us to setup first variable for the function mapping. Next we will use a function to help us generate the desired effect. Now there are a number of other functions which can be used for this or custom made for their desired effect. However this will require doing some experimenting and testing of the function applied to the image. For now we will be using the following function to create the desired effect. Here is a small list of possible functions which can be used for the function mapping. Once we have completed that we enter in fmap := Re(funmap(R,F)) Since that we have generated the function as well the image matrix to use, using an output image you can see the results. Level Mapping Level Mapping allows for the replacement of the intensities with in a specified image by a specified area or vector of intensity. In other to simply put it, to increase the intensity levels within a specific area by use a defined vector. An example of this can be said to be the same of having a 29th element in a vector will give a new level for the pixels with an intensity of 29. It is important to note that images have entries within 0 and the length of the vector used of minus 1. An example of this is that we would like to create an image with a squared intensity scale. We would create a Vector within: r := 0 …255 This will result in the creation of the following curve constructed given us the what the vector will look like. Now given by imaging pack we can use a number of examples as shown here, to refine the image for better screening and printing resolution. This therefore, helps in enhancing the image for better diagnosis of the patient. Note to remember is that a particular function map or look-up table can be created with monitor or sensor, which maps irregularities cause by the display to their corrected values. Once we are satisfied with the vector created we apply the vector to the Level mapping function with the following command and specify the image to be used in the level mapping as well. R := READ_IMAGE("C:\Program Files\Mathcad\Mathcad 14\Handbook\improc\brain.gif"). level :=levelmap(R, vec) Last edited by Senseineo on Mon Sep 21, 2009 6:06 am; edited 1 time in total
Senseineo

Joined: 12 Aug 2009
Posts: 6
Location: Australia

Senseineo

Joined: 12 Aug 2009
Posts: 6
Location: Australia

Senseineo

Joined: 12 Aug 2009
Posts: 6
Location: Australia

 Posted: Mon Sep 21, 2009 6:07 am    Post subject: Noise Filtering for Mathcad Webinar Noise Filtering Noise filtering requires experience in the types of noise that the person is dealing with in each image. Depending on what generated the noise, what sort of edge distortions are acceptable in the output and what sort of noise it is will great depend on what sort of filtering which will be used. We will start of with a simple scattering of noise (otherwise known as salt and paper noise). We will simulate this and see if this can be reversed. Orig :=READ_IMAGE(“C:\Program Files\Mathcad\Mathcad 14\Handbook\improc\brain.gif”) Noisy: = addnoise(orig,.2,128) Now to remove this type of noise there are two ways in which can be done to this. Firstly, the use of an averaging function such as smoothing or secondly a more complex method of median filtering. So we will look at the first method of doing this the smoothing filtering. Smoothing of the image can be done by the following command: Smooth := unismooth(noisy) To use the median filtering, type in the following command: Med :=medfilt(noisy) Now the following images will show the difference of the filtering methods as we show the orginal image, the noise generated one, smoothing and the median filtering images. As the images prove, the median filtering is a better filtering method for the scatter noise because it doesn’t change the intensity levels of the images, but uses what is available in the image. To observe these levels, 4 histograms are provide from each image to see the differences between them. To enable this simply type in Intensity := imhist(,256) k:= 0.. length(intensity1) – 1 As shown through the histogram, the original and the median filtering histogram exhibit very similar intensities proving that median filtering is a much more appropriate method in filtering the noise. Median filtering is a better way to filter this type of noise because it does not change the intensity levels in the image, but only uses available levels. To see this, look at the histograms of the four images. The next webinar will cover the wavelet smoothing for noise filtering. If you want to try Mathcad yourself, you can download the Mathcad trial HERE.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1