Improve image median
The vtkImageMedian3D filter had two problems:
-
It used a O(n^2) algorithm to compute the median, and the code was much more complex than necessary. This new code uses an O(n) algorithm provided by the stl.
-
When computing the median of an even number of elements, it did not take the average of the two middle elements (which is the usual definition of the median of an even number of elements).