]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdVectorFilterDouble.cxx
#3280 BBTK Feature New Normal - MathOperation
[bbtk.git] / packages / std / src / bbstdVectorFilterDouble.cxx
index 85dee1f9d0d11e21a6c1b8291c6d108fd90b549c..63d22719334da7b6bb2062b1bef187f4811664d7 100644 (file)
@@ -113,7 +113,7 @@ void VectorFilterDouble::Process()
                int             ipLstvec2;
                double  iLine;
                int     sizeLines       = (*pLstVec[0]).size();
-               double  step            = (double)sizeLines/(double)bbGetInputk1();
+               double  step            = (double)sizeLines/((double)bbGetInputk1()-1);
                for (iLine=0 ; iLine<sizeLines ; iLine=iLine+step)
                {
                        for (ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
@@ -121,6 +121,13 @@ void VectorFilterDouble::Process()
                                (*pLstVecOut[ipLstvec2]).push_back( (*pLstVec[ipLstvec2])[(int)iLine] );
                        } // for                        
                } // for ipLstVec
+
+               // adding the lastone
+               for (ipLstvec2=0 ; ipLstvec2<pLstVec.size() ; ipLstvec2++)
+               {
+                       (*pLstVecOut[ipLstvec2]).push_back( (*pLstVec[ipLstvec2])[(int)(sizeLines-1)] );
+               } // for                        
+
        } // Type==1
 
        if (bbGetInputType()==2) // Insert intermediate points