Scaling of images

Hi all,

I have two images of the same object, but with different field of view (Field-of-view (FOV) refers the distance (in cm or mm) over which a magnetic resonance image is acquired or displayed), i.e. this object looks small in one image and big in another image. How can I scale these images to make the object have the same sizes in these two images? Please find attached the figure clarifying the problem.

two images with different field of view

I think you need to know the pixel size for each image and the ratio between them and then do ImageInterpolate with the /TRNS flag to rescale the appropriate image.

If you use wave scaling and then have the X and Y axis share the same respective ranges in both images is another way to have them appear the same.

Note: If you are going to do some image processing those operations work on the pixel not the scaled dimension.

 

Andy

In reply to by hegedus

I load two images, each of them has matrix 512 x 512. Then I do Data --> Change Wave Scaling, choose SetScaleMode --> Start and Right, Units = mm, and write 24 mm for X, 31 mm for Y, and similarly for the second image (49 mm, 40 mm). So what is the next step? Could you please tell me, what command should I use to make the object have the same sizes in these two images? It is like zooming.

Create two image plots with each wave respectively.  Set the X and Y scale range the same for both graphs and make the overall graphs the same size.  The features should now appear the same size.

 

In reply to by hegedus

Sorry for misunderstanding, but how can I set the X and Y scale range the same for both graphs? If I set X = 24 mm and Y = 31 mm for both images, or X = 49 mm and Y = 40 mm for both images, it will be incorrect, because one image has FOV = 24 mm x 31 mm, and another image has FOV = 49 mm x 40 mm. If I set equal X and Y scale for both images, I will set wrong FOV for one image.

Hi,

There are two scales to set or to be a bit more precise: There is a scale for your data/image and then there is the scale or range of the axis in your graph.  The setscale operation allows you to use IP built-in functionality to define the dimensionality of the data.  Good.

When you create a graph of your data the default action is to set the axis range to the full scale of your data both in X and Y. Most graphing software does this and it is a best practice.  The issue you are facing is that the default scaling of the axis cause a difference in perception.  To overcome this issue, the range of the axis in both graphs should be the same.  For your example the x axis range should be 0-49 (or 0-50) in both graphs.  Likewise the y xis range should be 0-40 for both graphs.  And if the overall graph size is the same then the objects should appear to be same size.

 

There is another way to do this with scaled images though with some limitations.  Create a new image graph and then append the second image to that graph taking care to use the same axis (newimage uses a top x axis and reversed y axis). The second image will obscure the first but the x and y axis will now be the same for both.  In the image menu there is a reorder image operation to allow you to bring a particular image to the fore.  Unfortunately for color images there is no option I have found to hide the other.  That is the limitation.  With grayscale images you can play some tricks to make an image transparent, but they are not available for RGB image.

I mocked up an experiment to help explain.  In it are the original FOV scaled images, the first with x and Y axis to match the range of the second image, and lastly an image plot with both and a popup control to bring a specific one to the front.

Andy

experiment example

You are welcome.

 

One nice feature to add to the wishlist is the ability to hide an image in graph.  Currently you can hide traces, but not images.

Andy

Forum

Support

Gallery

Igor Pro 8

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More