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

Home » Public Forums » archive » Re: How to define resolution (not dimension!) for IDLanRoi->computeMask
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to define resolution (not dimension!) for IDLanRoi->computeMask [message #65118 is a reply to message #65056] Tue, 10 February 2009 05:26 Go to previous messageGo to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Feb 10, 7:00 am, justspa...@yahoo.de wrote:

> Still, if I may ask again: is anyone aware of the difference between
> the 'location' and
> the 'pixel_center' keyword of IDLanROI->computeMask?
>

Hi,

My assumption has always been that Location specifies the overall
position of the mask and that Pixel_Center allows you to "jiggle"
around that. The picture I have in my mind is of the old "quadrat
mapping" from high school biology class. We staked out an area,
randomly placed squares ("quadrats" 1 m^2) and then within each
quadrat determined the average number ant hills (or something) per 10
cm^2. To me, "location" referred to the location of the quadrat
relative to the study area and the "pixel_center" to the relative
location of anthills within each quadrat.

But now that you have pressed the question, I am not at all sure that
I have the right picture. I have a small example routine (see below)
that shifts around location and pixel_center. I am pretty sure that
pixel center determines the "filling" of pixels, much as described in
the intro to PolyFillV. But, the more I look at the output the fuzzy
my thinking gets. As I my story book hero (Freddy The Pig) says,
"It's no use, thinking just confuses things."

For the benefit of all, I have pasted in the online descriptions of
Location and Pixel_Center from IDLanROI::ComputeMask.


LOCATION
Set this keyword to a vector of the form [X, Y[, Z]] specifying the
location of the origin of the mask. The default is [0, 0, 0]. IDL
converts and maintains this value in double-precision floating-point.

PIXEL_CENTER
Set this keyword to a 2-element vector, [x, y], to indicate where the
lower-left mask pixel is centered relative to a Cartesian grid. The
default value is [0.0, 0.0], indicating that the lower-left pixel is
centered at [0.0, 0.0].

**** BEGIN
pro loc_test

loc1 = [0,0]
loc2 = [0,0]
loc3 = [0,0]
loc4 = [0,0]

pc1 = [0,0]
pc2 = [0.5, 0]
pc3 = [1,0]
pc4 = [-0.5,0]

x = [2,2,3,3]
y = [2,3,3,2]
roi = OBJ_NEW('IDLanROI', x,y)

print, "******* Constant Location, Varying Center *********"
mask1 = roi->ComputeMask(Loc = loc1, Pixel_Center = pc1, DIM =
[5,5])
mask2 = roi->ComputeMask(Loc = loc2, Pixel_Center = pc2, DIM =
[5,5])
mask3 = roi->ComputeMask(Loc = loc3, Pixel_Center = pc3, DIM =
[5,5])
mask4 = roi->ComputeMask(Loc = loc4, Pixel_Center = pc4, DIM =
[5,5])

print, "Pixel_Center = ", pc1
print, "Location = ", loc1
print, mask1

print, "Pixel_Center = ", pc2
print, "Location = ", loc2
print, mask2

print, "Pixel_Center = ", pc3
print, "Location = ", loc3
print, mask3

print, "Pixel_Center = ", pc4
print, "Location = ", loc4
print, mask4


print, "******* Constant Center, Varying Location *********"

loc1 = [0,0]
loc2 = [0.5,0]
loc3 = [1,0]
loc4 = [2,0]

pc1 = [0,0]
pc2 = [0,0]
pc3 = [0,0]
pc4 = [0,0]

mask1 = roi->ComputeMask(Loc = loc1, Pixel_Center = pc1, DIM =
[5,5])
mask2 = roi->ComputeMask(Loc = loc2, Pixel_Center = pc2, DIM =
[5,5])
mask3 = roi->ComputeMask(Loc = loc3, Pixel_Center = pc3, DIM =
[5,5])
mask4 = roi->ComputeMask(Loc = loc4, Pixel_Center = pc4, DIM =
[5,5])

print, "Pixel_Center = ", pc1
print, "Location = ", loc1
print, mask1

print, "Pixel_Center = ", pc2
print, "Location = ", loc2
print, mask2

print, "Pixel_Center = ", pc3
print, "Location = ", loc3
print, mask3

print, "Pixel_Center = ", pc4
print, "Location = ", loc4
print, mask4

end

***** END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: NASA IDL Astronomy Library Still There?
Next Topic: Re: How to know how much memory (in Mb) takes an object ? 1700 on memory grObjects is too much?

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

Current Time: Thu Oct 09 22:00:18 PDT 2025

Total time taken to generate the page: 0.79991 seconds