Merge a Plot and image into Matlab

Asked

Viewed 2,434 times

2

I’m conducting a medical imaging work that aims to isolate the area of the lungs and place an outline. I isolated the area corresponding to the lungs and created a Plot with the contours. My question is how I can join the image with the Plot to get the image with the contours that is requested.

1 answer

1

If I understand correctly you need a hold on to keep the two Plots together...

It’s quite simple, to demonstrate I’m going to use the following audio signal:

inserir a descrição da imagem aqui

Now I’m going to apply an algorithm to extract information about where the glottis in this sign and get the following Plot:

inserir a descrição da imagem aqui

Perfect now I want to put the pictures together, so I do this:

figure(1)
plot(sinal)
hold on
plot(glote)

inserir a descrição da imagem aqui

Keep an eye out for the axle X of both plots are the same size, if one is different from the other you will need to cut out the piece of one or interpolar so that both are the same size. As you are working with images (matrix) you can define where to plot on top of an image by pointing the row and column to a pixel position of the image.

A very simple example for image is this:

imagesc(img);
hold on
scatter(10,40);

In this example I am filling a circle above the image in row 10 and column 40.

Here a very interesting link, http://www.peteryu.ca/tutorials/matlab/plot_over_image_background

I hope that’s what you need.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.