]> Creatis software - bbtk.git/commitdiff
#3455 BBTK Feature New Normal - MathOperationVector round option
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 20 Jul 2020 13:19:23 +0000 (15:19 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Mon, 20 Jul 2020 13:19:23 +0000 (15:19 +0200)
packages/std/src/bbstdMathOperationVector.cxx

index b3633ad0ee2f11bf1af68d0547eee55b58fe81a0..cbd934fd015f4d523779927973fd25aa5b2eaa46 100644 (file)
@@ -469,6 +469,50 @@ void MathOperationVector::Process()
        } // if Type 22
 
 
+    if (bbGetInputType()==23)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  round(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 23
+
+    if (bbGetInputType()==24)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  rint(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 24
+
+    if (bbGetInputType()==25)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  floor(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 25
+
+    if (bbGetInputType()==26)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  ceil(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 26
+
+    if (bbGetInputType()==27)
+       {
+               for (i=0;i<sizeVec;i++)
+               {
+                       resultVec.push_back(  trunc(  bbGetInputIn0()[i] )  );
+               } // for i
+               bbSetOutputOut( resultVec );
+       } // Type 27
 
 }