programmatically guess image dimensions? [message #45121] |
Thu, 11 August 2005 08:41 |
Jeff N.
Messages: 120 Registered: April 2005
|
Senior Member |
|
|
Hi everyone,
I have managed to run across several situations where I've wanted to
take tabular data and make a "pseudo-image" cube out of the data so
that I could easily use some of ENVI's statisical routines. What I want
to do is write code that, given the number of records in the tabular
data, comes up with the best dimensions for the pseudo-image cube. So,
for example, if i have 9 records with 4 columns of tabular data, i'd
like my code to tell me that this should end up being a 3x3x4 cube. If
I have 13 records, I'd like it to tell me to arrange those in a 3x5
grid, with 2 "empty" pixels containing 0's. So my question is, does
anyone know a good way to come up with the largest rectangle I can make
to use as my image dimensions, with the fewest number of empty pixels?
I won't have a huge number of records, so I don't *think* I need to
make computational efficiency top priority. Anybody have any ideas to
get me started?
Thanks!
Jeff
|
|
|