comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » laying a grid on top of an image
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
laying a grid on top of an image [message #15829] Wed, 16 June 1999 00:00 Go to next message
Lazzar is currently offline  Lazzar
Messages: 9
Registered: February 1999
Junior Member
Does anyone know of a quick easy way to put a grid of lines over top of
an existing image. I want to be able to specify the spacing on the grid
(in pixels), for example 40 columns by 100 rows, and have a grid placed
over top of an image which is already displayed in a window.

Thanks,

Brian
Re: laying a grid on top of an image [message #15908 is a reply to message #15829] Fri, 18 June 1999 00:00 Go to previous message
Vapuser is currently offline  Vapuser
Messages: 63
Registered: November 1998
Member
Brian Nagy <lazzar@gte.net> writes:


x=!d.x_size
y=!d.y_size
for r=0,nrows do plots,[0,

You will
> Does anyone know of a quick easy way to put a grid of lines over top of
> an existing image. I want to be able to specify the spacing on the grid
> (in pixels), for example 40 columns by 100 rows, and have a grid placed
> over top of an image which is already displayed in a window.
>
> Thanks,
>
> Brian
>

--
William Daffer: 818-354-0161: vapuser@catspaw.jpl.nasa.gov
Re: laying a grid on top of an image [message #15910 is a reply to message #15829] Fri, 18 June 1999 00:00 Go to previous message
Daniel Peduzzi is currently offline  Daniel Peduzzi
Messages: 29
Registered: June 1999
Junior Member
Daniel Peduzzi wrote in message <6Rja3.16621$AB2.371314@wbnws01.ne.mediaone.net>...
>
> Brian Nagy wrote in message <37684EAA.334F0A42@gte.net>...
>> Does anyone know of a quick easy way to put a grid of lines over top of
>> an existing image. I want to be able to specify the spacing on the grid
>> (in pixels), for example 40 columns by 100 rows, and have a grid placed
>> over top of an image which is already displayed in a window.
>>
>
>
> Could you alter the image before you display it in a window?
>
> If I had a 2D array called "my_image", and I wanted different spacings in the
> row and column directions, I'd do something like this:
>
> row_freq=20
> col_freq=40
>
> s=size(my_image)
> col_indices = indgen(s[1]/col_freq+1)
> row_indices = indgen(s[2]/row_freq+1)
>


Oops, forgot the multipliers. These lines should be

col_indices = indgen(s[1]/col_freq+1) * col_freq
row_indices = indgen(s[2]/row_freq+1) * row_freq


Dan Peduzzi
peduzzi@mediaone.net
Re: laying a grid on top of an image [message #15913 is a reply to message #15829] Fri, 18 June 1999 00:00 Go to previous message
Daniel Peduzzi is currently offline  Daniel Peduzzi
Messages: 29
Registered: June 1999
Junior Member
Brian Nagy wrote in message <37684EAA.334F0A42@gte.net>...
> Does anyone know of a quick easy way to put a grid of lines over top of
> an existing image. I want to be able to specify the spacing on the grid
> (in pixels), for example 40 columns by 100 rows, and have a grid placed
> over top of an image which is already displayed in a window.
>


Could you alter the image before you display it in a window?

If I had a 2D array called "my_image", and I wanted different spacings in the
row and column directions, I'd do something like this:

row_freq=20
col_freq=40

s=size(my_image)
col_indices = indgen(s[1]/col_freq+1)
row_indices = indgen(s[2]/row_freq+1)

my_image[col_indices, *]=255
my_image[*, row_indices]=255

tvlct, [255], [0], [0], 255 ; Make last colormap entry "red"
tv, my_image

This would display a red grid, with the above spacings, over the image.


Dan Peduzzi
peduzzi@mediaone.net
Re: laying a grid on top of an image [message #15924 is a reply to message #15829] Thu, 17 June 1999 00:00 Go to previous message
mirko_vukovic is currently offline  mirko_vukovic
Messages: 50
Registered: January 1998
Member
In article <37684EAA.334F0A42@gte.net>,
Brian Nagy <lazzar@gte.net> wrote:
> Does anyone know of a quick easy way to put a grid of lines over top
of
> an existing image. I want to be able to specify the spacing on the
grid
> (in pixels), for example 40 columns by 100 rows, and have a grid
placed
> over top of an image which is already displayed in a window.
>
> Thanks,
>
> Brian
>
>
use plots,x,y,...,/device ? Will recquire some coordinate
conversions, allways a joy.



mirko


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: dialog_pickfile problem
Next Topic: Improved plotting of DOUBLE data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:12:02 PDT 2025

Total time taken to generate the page: 0.00494 seconds