00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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