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

Home » Public Forums » archive » Re: Matrix Stretching Problem
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
Re: Matrix Stretching Problem [message #2937] Fri, 07 October 1994 04:39
sjt is currently offline  sjt
Messages: 72
Registered: November 1993
Member
Kay Behnke (behnke@mpi.nl) wrote:
: idlusers-news-gateway:
: id AA25504; Fri, 7 Oct 94 10:40:41 +0100
: id KAA20918 (8.6.9/2.4) for <idlusers@maz.sma.ch>; Fri, 7 Oct 1994 10:40:35 +0100
: id AA14100; Fri, 7 Oct 1994 10:42:03 +0100
: Mime-Version: 1.0


: Hi there,

: I have a problem of displaying the content of a matrix with values between
: 0 and 1 in a drawing widget. The problem is not the display itself, but
: the fact that the size of the matrix (msize x msize) and the size of the
: drawing area (dsize x dsize) are different (dsize > msize) and that I
: would like to use the whole drawing area for this output.

: What I am doing at the moment is the following:

: First, let's assume that the size of the drawing area is strFactor larger
: than the size of the matrix. So, I allocate a matrix of dsize x dsize and
: copy each value of the original matrix strFactor x strFactor times into
: the new allocated matrix (actually the procedure copies the original value
: to a square of size strFactor to the new matrix).

: xxxyyyzzz
: xxxyyyzzz
: xxxyyyzzz
: xyz aaabbbccc
: abc -> aaabbbccc (to illustrate it ...)
: def aaabbbccc
: dddeeefff
: dddeeefff
: dddeeefff

: That this procedure takes some time (for a drawing area of 600 x 600
: pixels and a matrix of 100 x 100) is easy to imagine, I think.

: So my question is, whether YOU know of any features which would improve
: this procedure and would make it faster.

: Thanks for any suggestions,

: Kay (behnke@mpi.nl)
: ---

: Kay Behnke
: Max Planck Institute for Psycholinguistics
: Nijmegen
: The Netherlands

Provided the stretch is by an integer factor there is a built-in routine
to do the job--REBIN. For example in the instance you give you could use:

newim = rebin(oldim, 600, 600, /sample)

The /SAMPLE keyword is needed to stop IDL trying to use a bilinear
interpolation for the intermediate points.

--
James Tappin, School of Physics & Space Research
University of Birmingham
sjt@xun8.sr.bham.ac.uk
"If all else fails--read the instructions!"

O__
-- \/`
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Matrix Stretching Problem
Next Topic: Color terminal

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

Current Time: Wed Oct 08 19:20:26 PDT 2025

Total time taken to generate the page: 0.00681 seconds