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

Home » Public Forums » archive » Re: Can i avoid the loop,help me speed up,thanks
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: Can i avoid the loop,help me speed up,thanks [message #61889 is a reply to message #61885] Mon, 04 August 2008 14:31 Go to previous messageGo to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Aug 4, 3:44 pm, "ben.bighair" <ben.bigh...@gmail.com> wrote:
> On Aug 4, 9:29 am, Rongchang Chen <chenrc1...@gmail.com> wrote:
>
>
>
>> I wrote a procedure to create sinograms from projections in
>> tomography,the main part of procedure please see below.
>> For large size and number projections,it's very very slow.
>> Can i avoid the loop(one is OK) to speed up,or another way to create
>> sinograms?
>> Thank you very much!!
>
>> ************
>> n_sinogra:number of sinogram
>> n_projection:number of projection
>> files_projection:a string vector contain Directory and name of
>> projection
>> files_sino:a string vector contain Directory and name of sinogram
>
>> for jj = 0,n_sinogram-1 do begin
>>     print,'now creating',jj+1,'th sinogram'
>>     sino = fltarr(sizepro[0],n_projection)
>
>>     for ii=0, n_projection-1 do begin
>>         image = float(read_image(files_projection[ii]))
>>         some processing of image
>>         sino(*,ii) = image(*,jj)
>>     endfor
>
>>     write_tiff,files_sino(jj),sino,/short,/float
>> endfor
>> *****************
>
> Hi,
>
> I don't think it is possible for anyone to penetrate where you are
> having trouble with the given information.  I think you might try
> using the builtin PROFILER routine for a start.  It should reveal to
> you where you are spending most of your time.
>
> Unrelated to the speed issue, you seem to be specifying TIFF output
> simultaneously as a SHORT integer and a FLOAT.  What type of image do
> you want to be saving?
>
> Cheers,
> Ben

I agree with Ben - the question is: what is in the "some processing of
image" step? If this can be "vectorized", then you might be able to
avoid some looping.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Counting the lengths of continuous numbers in an array
Next Topic: Short array memory allocation

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

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

Total time taken to generate the page: 0.00426 seconds