X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fstd%2Fsrc%2FbbstdVectorFilterDouble.cxx;h=95dae0ad3136fcea027f57d4af94e299783ffab1;hb=bbf24c629edcb4780e121875bd4e5850f1565698;hp=9d59c393d98c5929a85685bcb023e201b3e7dde0;hpb=0d2a41be6bba99d0d60681b51d29a24d8edfcfc6;p=bbtk.git diff --git a/packages/std/src/bbstdVectorFilterDouble.cxx b/packages/std/src/bbstdVectorFilterDouble.cxx index 9d59c39..95dae0a 100644 --- a/packages/std/src/bbstdVectorFilterDouble.cxx +++ b/packages/std/src/bbstdVectorFilterDouble.cxx @@ -469,10 +469,18 @@ void VectorFilterDouble::Process() } else { printf("EED Warnning VectorFilterDouble::Process() For Type 12 the K1 vector (spacing) is not coherent.\n"); }// if size + } // Type 12 - } // Type 11 - - + if (bbGetInputType()==13) // Distance point 3D between In0 and In1 + { + if ( In0.size()==3 and In1.size()==3) + { + double x = In0[0] - In1[0]; + double y = In0[1] - In1[1]; + double z = In0[2] - In1[2]; + Out0.push_back( sqrt( x*x +y*y +z*z ) ); + } + } // Type 13 bbSetOutputOut0( Out0 ); bbSetOutputOut1( Out1 ); @@ -485,12 +493,12 @@ void VectorFilterDouble::Process() bbSetOutputOut8( Out8 ); bbSetOutputOut9( Out9 ); } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void VectorFilterDouble::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputType(0); @@ -498,32 +506,29 @@ void VectorFilterDouble::bbUserSetDefaultValues() k1.push_back(0); bbSetInputk1(k1); } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void VectorFilterDouble::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// if any } + //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void VectorFilterDouble::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - -} } -// EO namespace bbstd + +}// EO namespace bbstd