From: Eduardo Davila Date: Wed, 11 Apr 2012 15:40:17 +0000 (+0000) Subject: no message X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=13d97955e2c838ced909d9cfad124dc65dd388cd;p=bbtk.git no message --- diff --git a/packages/std/src/bbstdVectorRescaleSlope.cxx b/packages/std/src/bbstdVectorRescaleSlope.cxx new file mode 100644 index 0000000..81909c3 --- /dev/null +++ b/packages/std/src/bbstdVectorRescaleSlope.cxx @@ -0,0 +1,147 @@ +//===== +// 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) +//===== +#include "bbstdVectorRescaleSlope.h" +#include "bbstdPackage.h" +namespace bbstd +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,VectorRescaleSlope) +BBTK_BLACK_BOX_IMPLEMENTATION(VectorRescaleSlope,bbtk::AtomicBlackBox); +//===== +// 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 VectorRescaleSlope::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + + unsigned int i; + std::vector result; + double range[2]; + + double A=bbGetInputA(); + double B=bbGetInputB(); + + + // ------------------------------------------------- + + if (bbGetInputIn().size()>=1) + { + range[0]=bbGetInputIn()[0]; + range[1]=bbGetInputIn()[0]; + } else { + range[0]=999999; + range[1]=-999999; + } + for (i=0; ibbGetInputIn()[i]) + { + range[0]=bbGetInputIn()[i]; + } + if (range[1]); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(A,double); + BBTK_DECLARE_INPUT(B,double); + BBTK_DECLARE_OUTPUT(Out,std::vector); + BBTK_PROCESS(Process); + void Process(); +//===== +// 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) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorRescaleSlope,bbtk::AtomicBlackBox); + BBTK_NAME("VectorRescaleSlope"); + BBTK_AUTHOR("Info-Dev"); + BBTK_DESCRIPTION("Rescale and slope of a vector"); + BBTK_CATEGORY(""); + + BBTK_INPUT(VectorRescaleSlope,In,"Input vector",std::vector,""); + BBTK_INPUT(VectorRescaleSlope,Type,"type of operation: 0 (default) SlopeIntercept np=p*A+B, 1 Invert, 2 Redimension A=newMin B=newMax, 3 InvertRedimension A=newMin B=newMax",int,""); + BBTK_INPUT(VectorRescaleSlope,A,"(1 default) see Type description",double,""); + BBTK_INPUT(VectorRescaleSlope,B,"(0 default) see Type description",double,""); + BBTK_OUTPUT(VectorRescaleSlope,Out,"Output vector",std::vector,""); +BBTK_END_DESCRIBE_BLACK_BOX(VectorRescaleSlope); +//===== +// 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) +//===== +} +// EO namespace bbstd + +#endif // __bbstdVectorRescaleSlope_h_INCLUDED__ +