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

Home » Public Forums » archive » Fast way to collapse data cube with median
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: Fast way to collapse data cube with median [message #85136 is a reply to message #85133] Tue, 09 July 2013 09:28 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/9/13 10:08 AM, Stefan wrote:
> Hey
>
> I am doing a lot of image processing and very often I have a data
> cube like with the x/y axes corresponding to image coordinates and
> the z component corresponding to the individual images.
>
> I simply want to calculate the median at each pixel stack and so far
> I always loop through all pixels and determine the median for each
> stack. This, of course, can be quite slow for large images since it
> involves two loops and I was wondering if someone here might have a
> fancy idea of how to collapse such a cube faster.
>
> thank a lot :)
>

Yes, use the DIMENSION keyword to median (dimensions start at 1):

IDL> arr = findgen(2, 3, 4)
IDL> m = median(arr, dimension=2)
IDL> help, m
M FLOAT = Array[2, 4]

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Peak detection
Next Topic: CURVEFIT function

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

Current Time: Fri Oct 10 07:21:14 PDT 2025

Total time taken to generate the page: 0.95232 seconds