The below code is meant to accompany the 3D Gaussian Convolution post. Note that the code is not generic and only calculates a 5x5x5 Gaussian on a set of 256x256 planes. It is very easy to modify to support other sizes and could even be templated. The Z convolution is not included in the code, but remember in this step you would need to do the final division.
As blogger doesn't seem to like keeping the format of code, please find it on GitHub https://github.com/Repmov/3D-Gaussian
Showing posts with label 3D Gaussian. Show all posts
Showing posts with label 3D Gaussian. Show all posts
Saturday, 17 June 2017
Tuesday, 28 April 2009
3D Gaussian - in sections
After installing VS2008 it took me a little while to get all my projects to compile nicely again. Quite a big jump from 2003->2008 :) and a lot of my paths were a bit out. I'll post later about getting CUDA 2.2 to work in VS2008 and the problems I had making it cross compile.
Just time this evening for a quick update: I finished my 3D Gaussian convolution on my generated data set - the attached image has clearly visible joins in it, these are to make sure my segmented approach of processing big data sets works correctly. The are easily removed by overlapping the non-boundary segments. The colours are based on my transfer function and don't reflect the underlying data accurately yet. It renders the volume at around 40fps.
Just time this evening for a quick update: I finished my 3D Gaussian convolution on my generated data set - the attached image has clearly visible joins in it, these are to make sure my segmented approach of processing big data sets works correctly. The are easily removed by overlapping the non-boundary segments. The colours are based on my transfer function and don't reflect the underlying data accurately yet. It renders the volume at around 40fps.
![]() |
| 3D Gaussian convolution (segmented) output |
Friday, 17 April 2009
Large Data Sets and 3D Gaussian
Firstly a small fix:
In the post about the 2D gaussian there was a typo:
\$f(2,2) = Ae^{-(\sfrac{2^2+2^2}{1.4^2})}\$
should read
\$f(2,2) = Ae^{-(\frac{2^2+2^2}{2(1.4^2)})}\$
this has now been fixed in the original article.
Last night I successfully made my 2048*2048*2048 * 2 bytes data set. The random data was generated using the mersenne twister algorithm with a fixed seed so I can recreate it later if needed. I also created a smaller set of 512x512x512 in order to interactively test my kernels.
In the post about the 2D gaussian there was a typo:
\$f(2,2) = Ae^{-(\sfrac{2^2+2^2}{1.4^2})}\$
should read
\$f(2,2) = Ae^{-(\frac{2^2+2^2}{2(1.4^2)})}\$
this has now been fixed in the original article.
Last night I successfully made my 2048*2048*2048 * 2 bytes data set. The random data was generated using the mersenne twister algorithm with a fixed seed so I can recreate it later if needed. I also created a smaller set of 512x512x512 in order to interactively test my kernels.
Subscribe to:
Posts (Atom)
