a method of filtering an image dataset and an apparatus , a data carrier , and a computer program product , the method having the following steps : providing an n - dimensional input image dataset ; applying a filtering algorithm to the input image dataset , wherein the filtering algorithm is essentially unvarying over the dataset , to thereby obtain a filtered image dataset ; providing a spatially varying weighting function between the input and the filtered image datasets ; computing a weighted sum of the input image dataset and the filtered image dataset , thereby using the spatially varying weighting function , in order to obtain an output image dataset .