That very much depends on the goal. The sigma along z, in pixels, will be 2/7 times that of the sigma along x and y. If you want to use a small sigma, then the sigma along z will be too small for correct computation. In this case it might be better to do the filtering on the 2D slices. But in general it is better to do the operation along all 3 dimensions, because the slices are correlated and you definitely want to use that correlation if you can.

]]>would you recomment to use 2D or 3D gaussian filter to smooth a set of 2D medical image slices (slice thickness 7mm, pixel size 2mm)?

]]>Using DIPimage you can generate an image with Gaussian white noise very easily: `noise(newim)`

does the trick. You can read some more about random numbers in this post.

I am trying to use an artificially generated Gaussian white noise image to calculate the MTF of a camera. I will be using the Fourier Tranform to get my MTF value. However, I am having trouble generating such an image. Can you please provide me some guidance into how I should go about this?

]]>Sorry, I do not have any such code in C that I can distribute.

]]>Can you provide code for Gaussian Filter in ‘C’ Language for 512X512 lena image. thanks in advance.

]]>Computing the Gaussian filtered image first and then applying the finite difference derivative defeats the purpose of the Gaussian gradients. The heavier the blurring, the more accurate this approximation is, but using the Gaussian derivatives directly is always better. And it’s not such an expensive operation.

The recursive Gaussian filter is nice to use for large filters. If you’re looking to do a Gaussian derivative with a σ of 1 or 2, it’s faster to compute it with the finite impulse response filter (the “normal” way). If you want to learn more about it, you should read:

– Young, I. T. & van Vliet, L. J. “Recursive implementation of the Gaussian filter,” Signal Processing 44:139-151, 1995.

– van Vliet, L. J.; Young, I. T. & Verbeek, “Recursive Gaussian Derivative Filters,” Proceedings 14th Int. Conference on Pattern Recognition, vol. 1, 509-514, IEEE Computer Society Press, 1998.

]]>Thank you for your nice lecture. I am doing a project which requires accurate image gradient vector. It seems there are two ways. The first way is convolve the image with gaussian and then compute X and Y gradient from the blurred image. The second way is compute X and Y gradient respectively by convolving with derivative of gaussian. So which method is more widely used? Thank you!

]]>