Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Interpolator3D.hxx

Go to the documentation of this file.
00001 /* ImLib3D
00002  * Copyright (c) 2001, ULP-IPB Strasbourg.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or (at
00007  * your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00020 #ifndef _Interpolator3D_hxx
00021 #define _Interpolator3D_hxx
00022 
00023 #include<ImLib3D/Image3Dlinear.hpp>
00024 #include<ImLib3D/Interpolator3D.hpp>
00025 #include<ImLib3D/SplineInterpolation.hpp>
00026 
00027 template<class Im3DValue>
00028 Interpolator3D<Im3DValue> *
00029 Interpolator3D<Im3DValue>::Create(const string &name0)
00030 {
00031     vector<string> names;
00032     Split(name0,names);
00033     string name=names[0];
00034     int arg=0;
00035     if(names.size()>1){arg=LongInt(names[1]);}
00036 
00037     if(name=="Spline")
00038     {
00039         if(arg<2 || arg>5){mprintf("WARNING: using spline interpolation default degree 5\n");arg=5;}
00040         return new SplineInterpolator3D<Im3DValue>(arg);
00041     }
00042     else
00043     if(name=="Linear" || name=="TriLinear")
00044     {
00045         return new TriLinearInterpolator<Im3DValue>();
00046     }
00047     else
00048     if(name=="NearestNeighbor" || name=="Nearest")
00049     {
00050         return new NNInterpolator<Im3DValue>();
00051     }
00052     else
00053     if(name=="TruncatedSinC")
00054     {
00055         if(arg<1){mprintf("WARNING: using sinc interpolation default radius 5\n");arg=5;}
00056         return new TruncatedSinCInterpolator<Im3DValue>(arg);
00057     }
00058     else
00059     {
00060         ThrowError("Unknown interpolator name:%s",name);
00061         return NULL;
00062     }
00063 }
00064 #endif// _Interpolator3D_hxx

Generated on Fri Jun 17 13:36:05 2005 for ImLib3D by  doxygen 1.4.2