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

Home » Public Forums » archive » Re: divise image envi-idl
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: divise image envi-idl [message #70966 is a reply to message #70959] Tue, 18 May 2010 12:22 Go to previous messageGo to previous message
jeffnettles4870 is currently offline  jeffnettles4870
Messages: 111
Registered: October 2006
Senior Member
On May 18, 3:03 pm, jeanh
<jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
> On 18/05/2010 1:50 PM, tonino wrote:
>
>> Thank you very much Jean,
>
>> I'm sure those advices will be useful for the next step. For now, the
>> problem concerns the line :
>
>> result = image[i:i+((NSimage/5)-1),j:j+((NLimage/2)-1),0:NBimage-1]
>
>> the error message is :
>
>> Subscript range values of the form low:high must be>= 0,<  size, with
>> low<= high: IMAGE.
>> % Execution halted at: TUILAGE            18 C:\Documents and Settings
>> \Administrateur\Mes documents\tuilage.pro
>
> try to print these values... It it probably happening for your last i
> and/or j in the loop. Are you sure than NS is a multiple of 5 and NL of
> 2? if not, you can prepare your index before doing the subscript:
> subNS = (i+((NSimage/5)-1)) < (NSimage-1)
> subNL = (j+((NLimage/2)-1)) < (NLimage-1)
> result = image[i:subNS,j:subNL,0:NBimage-1]
>
> be sure, when you save the result with envi_write_envi_file, to compute
> the proper ns and nl!
>
> Jean
>
>
>
>> and it still comes if I change the data type or if I transform the
>> variable 'result' into a float array...
>
>> I think I don't write the terms of the loop properly
>
>> ... if you have an idea.
>
>> thanks again for your answer
>> nestonino
>
>

Also, the variable named 'image' is not actually holding image data,
it's holding a string that's the path to the file. You need to read
the image data into memory if you want to subscript it this way. You
might eventually think about better ways to do what you want than a
double for-loop like you're doing, but for now, your first problem is
to get the data into memory.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: x-y offsets
Next Topic: Why do I get the string in ytitle in vertical direction

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

Current Time: Sat Oct 11 10:27:14 PDT 2025

Total time taken to generate the page: 0.15987 seconds