comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Get values from one image according to pixel locations of maxima on another image

Re: Get values from one image according to pixel locations of maxima on another image
type: item
description: Dry in water writes: > I have two tiff images (named A and B). Both have 7 layers at the same dimension (4169,6289,7). First I'd like to find location of max value in A image and then I need to get the values (not max values, reall values) of B image in matrix dimension (4169, 6289) according to location of max value which found from A image in previous step. I just wrote next code to achieve this purpose. Then I wrote output tiff image. But when I display this tiff image, whole screen is black. Can you tell me what's wrong with this code? > A_max_loc=MAX(A,INDEX,DIMENSION=3) > B_val=B[INDEX] > write_tiff,'D:\Output_IDL\B_val_2000.TIF',B_val Let's see if this little experiment sheds any light: IDL> a = [2, 3, 4, 4, 2, 2, 0, 4] IDL> maxOfA = Max(a, index) IDL> Print, maxOfA 4 IDL> Print, index 2 Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.idlcoyote.com/ Sepore ma de ni thue. ("Perhaps thou speakest truth.")
creator: David Fanning
date: 2012-12-21T14:34:33-00:00

Re: Get values from one image according to pixel locations of maxima on another image
type: item
description: On 12/21/12 9:05 AM, Dry in water wrote: > Hello all > > I have two tiff images (named A and B). Both have 7 layers at the same dimension (4169,6289,7). First I'd like to find location of max value in A image and then I need to get the values (not max values, reall values) of B image in matrix dimension (4169, 6289) according to location of max value which found from A image in previous step. I just wrote next code to achieve this purpose. Then I wrote output tiff image. But when I display this tiff image, whole screen is black. Can you tell me what's wrong with this code? > A_max_loc=MAX(A,INDEX,DIMENSION=3) > B_val=B[INDEX] > write_tiff,'D:\Output_IDL\B_val_2000.TIF',B_val > > Thank you so much > There's nothing obviously wrong in the code. Might there be NaNs in A? I would suggest taking a small (3x4) corner of the image and examining the values of A, B, and B_val to see if it appears to be doing what you expect. -Jeremy.
creator: Jeremy Bailin
date: 2012-12-24T03:58:16-00:00