Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Flip horizontal axis on image

63 views
Skip to first unread message

Sven

unread,
Mar 30, 2009, 4:49:02 PM3/30/09
to
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.

Jos

unread,
Mar 30, 2009, 4:55:04 PM3/30/09
to
"Sven" <sven.h...@gmail.deleteme.com> wrote in message <gqrb7u$jfs$1...@fred.mathworks.com>...
<SNIP ... in need of direction change ...

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

hth
Jos

Sven

unread,
Mar 30, 2009, 5:02:01 PM3/30/09
to
"Jos " <#10...@fileexchange.com> wrote in message <gqrbj8$b8g$1...@fred.mathworks.com>...

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

0 new messages