Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

GaussianBlur.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2019 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: GaussianBlur.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.9 $        $Date: 2019/01/17 21:20:59 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   Perform Gaussian blur filtering on 3-D volumes. Primarily for use in
00019  *   scale-space filtering for 3-D image segmentation of Cryo-EM density maps.
00020  ***************************************************************************/
00021 
00022 #ifndef GAUSSIAN_H
00023 #define GAUSSIAN_H
00024 
00025 template <typename IMAGE_T>
00026 class GaussianBlur {
00027   public:
00028 
00032     GaussianBlur<IMAGE_T>(IMAGE_T* image, int w, int h, int d, bool cuda=false);
00033 
00034     ~GaussianBlur<IMAGE_T>();
00035 
00037     void blur(float sigma);
00038 
00041     IMAGE_T* get_image();
00042     IMAGE_T* get_image_d();
00043 
00044   private:
00045     IMAGE_T* image;
00046     IMAGE_T* image_d;
00047     IMAGE_T* scratch;
00048     IMAGE_T* scratch_d;
00049     int height;
00050     int width;
00051     int depth;
00052     long heightWidth;
00053     long nVoxels;
00054     bool cuda;
00055 
00056     int getKernelSizeForSigma(float sigma);
00057     void fillGaussianBlurKernel3D(float sigma, int size, float* kernel);
00058     void fillGaussianBlurKernel1D(float sigma, int size, float* kernel);
00059 
00060     void blur_cpu(float sigma);
00061     void blur_cuda(float sigma);
00062     int host_image_needs_update;
00063 };
00064 
00065 #endif //GAUSSIAN

Generated on Fri Mar 29 02:45:15 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002