Thread Subject: Flip horizontal axis on image

Subject: Flip horizontal axis on image

From: Sven

Date: 30 Mar, 2009 20:49:02

Message: 1 of 3

Hi there,

I have an image with known pixel locations on which I want to overlay some points. Something like:

figure
imagesc(xScale, yScale, myImage)
hold on
plot(myPts(:,1), myPts(:,2),'ro')

Now, imagine that I wanted to flip the image (and associated points) vertically. I could simply do this by toggling between 'axis xy' and 'axis ij'. I like this.

What I want to do next, however, is to flip things horizontally. I don't think there's a built in axis command to do this. Also, I cannot do the following due to an imagesc error (x and y axes must be increasing):

myImage = flipdim(myImage,2);
yScale = flipdim(yScale,2);
figure
imagesc(xScale, yScale, myImage)

Is there a fix to this? I essentially have an X-Ray image with bone locations stored, and I want to flip it horizontally so that I'm looking from the 'other side' of the xray.

Let me know if you've got any clues.
Cheers,
Sven.

Subject: Flip horizontal axis on image

From: Jos

Date: 30 Mar, 2009 20:55:04

Message: 2 of 3

"Sven" <sven.holcombe@gmail.deleteme.com> wrote in message <gqrb7u$jfs$1@fred.mathworks.com>...
<SNIP ... in need of direction change ...

set(gca,'xdir','reverse')

hth
Jos

Subject: Flip horizontal axis on image

From: Sven

Date: 30 Mar, 2009 21:02:01

Message: 3 of 3

"Jos " <#10584@fileexchange.com> wrote in message <gqrbj8$b8g$1@fred.mathworks.com>...
> "Sven" <sven.holcombe@gmail.deleteme.com> wrote in message <gqrb7u$jfs$1@fred.mathworks.com>...
> <SNIP ... in need of direction change ...
>
> set(gca,'xdir','reverse')
>
> hth
> Jos

Ha, knew it had to be in there somewhere. Thanks!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
imagesc Sven 30 Mar, 2009 16:50:21
axis flip Sven 30 Mar, 2009 16:50:21
rssFeed for this Thread

Contact us at files@mathworks.com