pixelwise regression for time series images

Showing 1-6 of 6 messages
pixelwise regression for time series images blofton 5/12/10 2:18 PM
I’ve written a program that uses LINFIT to calculate a linear model to
each pixel in a multitemporal, registered series of images.  That is,
I fit a line in the time (z-) dimension at each x,y pixel location.
However, I am using nested loops to do this and it takes a while to
run.  For larger images (1024X1024) there is no hope.  I am wondering
if you’ve come across a better (IDL-esque) method of doing this; I’ve
not seen anything online.

Thanks for any suggestions,

brad

Re: pixelwise regression for time series images bstecklu 5/13/10 2:57 AM
One can do that without loops. Just write down the regression equations, keeping
in mind that the summation has to be done for the 3rd dimension.  Actually this
is what I like about IDL, you can think of bigger entities than just a single
value. I attached a function which works for me.

Regards,
                Bringfried

Re: pixelwise regression for time series images David Fanning 5/13/10 5:28 AM
Bringfried Stecklum writes:

> One can do that without loops. Just write down the regression equations, keeping
> in mind that the summation has to be done for the 3rd dimension.  Actually this
> is what I like about IDL, you can think of bigger entities than just a single
> value. I attached a function which works for me.

Wow. Aside from how elegant this is, it really makes
you appreciate how hard it was to read IDL code
before the advent of square brackets, doesn't it? :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Re: pixelwise regression for time series images David Fanning 5/13/10 7:48 AM
Bringfried Stecklum writes:

> One can do that without loops. Just write down the regression equations, keeping
> in mind that the summation has to be done for the 3rd dimension.  Actually this
> is what I like about IDL, you can think of bigger entities than just a single
> value. I attached a function which works for me.

Looks like we might also need "ima2cube".

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")

Re: pixelwise regression for time series images Craig Markwardt 5/13/10 8:51 AM
On May 13, 8:28 am, David Fanning <n...@dfanning.com> wrote:
> Bringfried Stecklum writes:
> > One can do that without loops. Just write down the regression equations, keeping
> > in mind that the summation has to be done for the 3rd dimension.  Actually this
> > is what I like about IDL, you can think of bigger entities than just a single
> > value. I attached a function which works for me.
>
> Wow. Aside from how elegant this is, it really makes
> you appreciate how hard it was to read IDL code
> before the advent of square brackets, doesn't it? :-)

Heh, I still think in round () array indices.  To me, the notation
thing is a wash.  Switching to [] indexing makes less confusion with
function calls.  On the other hand, use of [] is confused with the
array constructor, x = [a,b,c].

Craig

Re: pixelwise regression for time series images David Fanning 5/13/10 9:14 AM
Craig Markwardt writes:

> Heh, I still think in round () array indices.  To me, the notation
> thing is a wash.  Switching to [] indexing makes less confusion with
> function calls.  On the other hand, use of [] is confused with the
> array constructor, x = [a,b,c].

I'm willing to make an exception for anyone still using
IDL 4.0. :-)

By the way, I spent the evening talking to a friend
about IDL 8. I get more and more excited about this
daily. I wish I had more time to play with it.

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")