Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How do I code for a buttom grpup using the tags i made for them

1 Ansicht (letzte 30 Tage)
Diana Sofia Ramirez Villamil
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I am making a GUI program that show a CT images with noise and without noise, I have it set up but i dont know how to code for the noises using randi. Make a GUI program that will display CT images from .tif files in a window as shown
below. GUI layout is shown in Figure 1 and GUI Display is shown in Figure 2. Load the
files in OpeningFcn reading with ‘Files=dir('*.tif')’ and load the first image from the list
of the files using the command 'slide=imread(Files(1).name) and imshow(slide)'. Link
the slider correspondingly and control the images with the slider to review different
slides manually.
• cthead-8bit is uploaded in blackboard to use for CT images.
• Video of an example project is also uploaded in blackboard.
• Use ‘dir’ to select the files for file management. Read each slide from a .tif file. Use
‘imread’ to read and use ‘imshow’ while showing the images through slider manipulation.
• Show corresponding slide numbers for the each CT slide.
• Use ‘set’ and ‘get’ to manipulate the handles.
• Use 'randi' function to create random noise.

Antworten (1)

Raunak Gupta
Raunak Gupta am 2 Mai 2020
Bearbeitet: Raunak Gupta am 2 Mai 2020
Hi,
From the question I assume you have the GUI ready for displaying original image to a UI Axes in App Designer. For plotting the second image which have noise level dependent on the slider you can create a new UI Axes adjacent to the first one by dragging another UI Axes in display mode in App Designer.
From the slider object you can take the mean and variance inputs using callbacks such as ValueChangingFcn. This mean and variance can then be used in imnoise to create a noisy image. You may plot this image with imshow on to the second UI Axes. Following syntax can be used to create noisy image
noisyImage = imnoise(originalImage,'gaussian',mean,variance_gauss);
If you want to use set and get commands there is no need to define callbacks and you can write them in the code for one time display of the result. For using randi as noise you can create a matrix of same size as original image from randi and add it to the original image. Resulting image will be a noisy image. The maximum value in randi function can be taken from the slider.
Hope it helps to get started.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by