
00001 /*!@file PointCloud/VoxelImage.H Open Scene Graph Utils */ 00002 00003 // //////////////////////////////////////////////////////////////////// // 00004 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2003 // 00005 // by the University of Southern California (USC) and the iLab at USC. // 00006 // See http://iLab.usc.edu for information about this project. // 00007 // //////////////////////////////////////////////////////////////////// // 00008 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00009 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00010 // in Visual Environments, and Applications'' by Christof Koch and // 00011 // Laurent Itti, California Institute of Technology, 2001 (patent // 00012 // pending; application number 09/912,225 filed July 23, 2001; see // 00013 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00014 // //////////////////////////////////////////////////////////////////// // 00015 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00016 // // 00017 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00018 // redistribute it and/or modify it under the terms of the GNU General // 00019 // Public License as published by the Free Software Foundation; either // 00020 // version 2 of the License, or (at your option) any later version. // 00021 // // 00022 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00023 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00024 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00025 // PURPOSE. See the GNU General Public License for more details. // 00026 // // 00027 // You should have received a copy of the GNU General Public License // 00028 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00029 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00030 // Boston, MA 02111-1307 USA. // 00031 // //////////////////////////////////////////////////////////////////// // 00032 // 00033 // Primary maintainer for this file: T. Nathan Mundhenk <mundhenk@usc.edu> 00034 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/PointCloud/VoxelImage.H $ 00035 // $Id: VoxelImage.H 10794 2009-02-08 06:21:09Z itti $ 00036 // 00037 00038 #ifndef VOXELIMAGE_H_DEFINED 00039 #define VOXELIMAGE_H_DEFINED 00040 00041 #include "PointCloud/NImage.H" 00042 00043 //! Special voxel image related items such as enums that need a name space 00044 namespace imgvox 00045 { 00046 enum axis 00047 { 00048 X_AXIS, 00049 Y_AXIS, 00050 Z_AXIS, 00051 NO_AXIS 00052 }; 00053 }; 00054 00055 00056 // ###################################################################### 00057 //! Holds the range of values in a Voxel Image, is useful for point clouds 00058 /*! We use signed integer values since sometimes internal method calls 00059 will support negative coordinates. 00060 */ 00061 struct VoxRange 00062 { 00063 //! Range between minX and maxX 00064 unsigned int rangeX; 00065 int minX, maxX; 00066 //! Range between minY and maxY 00067 unsigned int rangeY; 00068 int minY, maxY; 00069 //! Range between minZ and maxZ 00070 unsigned int rangeZ; 00071 int minZ, maxZ; 00072 //! The max range of x,y and z 00073 unsigned int maxRange; 00074 }; 00075 00076 //!Pure Virtual base class for all voxel image types 00077 /*! As one example of how to create a voxel image 00078 see VirtualVoxel.H and the VirtualVoxel Class. 00079 @param T is the base type of the voxel such as float 00080 @param CLASS_IMAGE is the class of the voxel image 00081 @param BASE_IMAGE is the class of the container that holds the actual data such as an array 00082 */ 00083 template <class T, class CLASS_IMAGE, class BASE_IMAGE> 00084 class VoxelImage : public 00085 NImage<T,CLASS_IMAGE,BASE_IMAGE,3> 00086 { 00087 public: 00088 virtual ~VoxelImage() {}; 00089 00090 //! Get voxel at x,y,z return false if fails 00091 virtual bool getVal(const unsigned int x, 00092 const unsigned int y, 00093 const unsigned int z, 00094 T& vox) = 0; 00095 00096 //! store a voxel at x,y,z 00097 virtual void setVal(const unsigned int x, 00098 const unsigned int y, 00099 const unsigned int z, 00100 const T& vox) = 0; 00101 00102 //! get the range of the voxels (useful for sparse images) 00103 //virtual void range(VoxRange& range) const = 0; 00104 00105 //! get our height - Y 00106 virtual unsigned int getHeight() const = 0; 00107 00108 //! get our width - X 00109 virtual unsigned int getWidth() const = 0; 00110 00111 //! get out depth - Z 00112 virtual unsigned int getDepth() const = 0; 00113 }; 00114 00115 #endif 00116 00117 00118 00119 00120 00121 00122
1.4.4