[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Preserving data with ROT
- Subject: Preserving data with ROT
- From: btt <btupper(at)bigelow.org>
- Date: Wed, 06 Dec 2000 14:44:26 -0500
- Newsgroups: comp.lang.idl-pvwave
- Organization: Bigelow Laboratory for Ocean Sciences
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:22491
The ROT function returns an array that is the same size as the input
array. That's fine until the function starts loping off the data I
would like to hang onto. As an example, an image of a long skinny cell
that sloping across the image from lower left to upper right will be
chopped by the ROT function when rotated such that the long axis is horizontal.
Here's an example:
in = replicate(128B, 50, 50)
in[25:*, 25:*] = 255B
out = rot(arr,45,missing = 128)
tv, out, 100,0
Currently, I predict the size of the output image that would preserve
the data (using an affine transform). Then I make an array of the
required size, paste the center of mass of the original array (which in
my real data case is the CM of the cell) and then call ROT. It
certainly works well, but I have a nagging feeling that I'm doing it the
hard way. Everytime I do something using the brute-force-and-ignorance
method, I discover there is an easier way to do the job.
I have tried using the result of the transform, but it tends to create
small gaps and ragged edges for an otherwise 'nice' blob.
So, is there a better mousetrap?
Thanks for any advice.
P.S. ROT calls POLY_2D so perhaps my question should be about that
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575