It's a general programming question, not image specific, so its not
likely to be in the imageJ library. However, you can almost certainly
find open source sorting code you could borrow :)
If you're dealing with a reasonably small array, I'd use selection sort
or insertion sort (google will give you lots of info on either) because
they are both simple and easy to understand.
If you have to sort arrays frequently or the arrays are pretty large (in
the hundreds of items or more), it might be worth looking up a faster
algorithm. Quick sort is the best, in general, and doesn't require much
code, but the algorithm is a nightmare to understand at first. It's also
massively recursive.
Hope this helps!
david
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
Pedro Ramos
Sent: Wednesday, July 27, 2005 3:26 AM
To:
[hidden email]
Subject: Re: Median of an array
Ok, that is the way to calculate the median of an array, I know that. I
was
wondering if there is a command to do it automatically without
programming
the whole process you have described. But thanks anyhow for your help.
That's how I'll proceed if I can't find a "shortcut".
Pedro