]> Creatis software - bbtk.git/commitdiff
Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/bbtk
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Sat, 28 Jun 2014 07:07:22 +0000 (09:07 +0200)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Sat, 28 Jun 2014 07:07:22 +0000 (09:07 +0200)
24 files changed:
kernel/src/bbtkAtomicBlackBoxDescriptor.cxx
kernel/src/bbtkBlackBoxDescriptor.cxx
kernel/src/bbtkBlackBoxDescriptor.h
kernel/src/bbtkComplexBlackBoxDescriptor.cxx
kernel/src/bbtkComplexBlackBoxDescriptor.h
kernel/src/bbtkPackage.cxx
kernel/src/bbtkPackage.h
kernel/src/bbtkUtilities.cxx
kernel/src/bbtkUtilities.h
packages/std/src/bbstdCast.cxx
packages/std/src/bbstdCast.h
packages/std/src/bbstdCastVector.cxx [new file with mode: 0644]
packages/std/src/bbstdCastVector.h [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
packages/vtk/bbs/appli/exampleMeasureLength.bbg
packages/vtk/bbs/appli/exampleMeasureLength.bbs
packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg
packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
packages/vtk/src/bbvtkMeasureLength.cxx
packages/vtk/src/bbvtkPointsXYZtoVTKPoints.cxx
packages/vtk/src/bbvtkText2D.cxx
packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs

index b60f6bb9dda4fc82afb4635d8d4540e3ae47c037..aafb10de89ee218cb0d80db3a641ec309c4127d0 100644 (file)
@@ -86,4 +86,6 @@ namespace bbtk
   {  
     bbtkDDebugMessage("object",3,"==> ~AtomicBlackBoxDescriptor()"<<std::endl);
   }
+
+       
 }// namespace bbtk
index 9f40f1f1864fee03816b6de076a8fab0c21caa7d..24e7024ff3820166bcc1494dcadbdf263cf75515 100644 (file)
@@ -315,7 +315,7 @@ namespace bbtk
     return "::" + mTypeName;
   }
   //=========================================================================
-        void BlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, std::vector<std::string>& temp, int cont){
+        void BlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont){
                
        }
   //=========================================================================
index 25f454436c8f887cb0b4c30855337fa484bf86b7..8124b35a10689f9c97d0cb3ccf3aad4108d38996 100644 (file)
@@ -170,7 +170,7 @@ namespace bbtk
     ///
     virtual void Check(bool recursive=true) const;
 
-         virtual void GetBoxesInside (NodeTreeC& tree, std::vector<std::string>& temp, int cont);
+         virtual void GetBoxesInside (NodeTreeC& tree, int cont);
          
          /// Sets the name of the script file from which it is defined
          void SetScriptFileName(const std::string& n) { mScriptFileName = n; }
index c25819f5003eb9bb497c8f4aa6e7530defb99cbb..b79fed3e10f1a81d3f5456a91313da7bd09651d2 100644 (file)
@@ -666,47 +666,57 @@ size_t  ComplexBlackBoxDescriptor::GetObjectInternalSize() const
     return s;
   }
   //==========================================================================
-void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, std::vector<std::string>& list, int cont) 
+void ComplexBlackBoxDescriptor::GetBoxesInside (NodeTreeC& tree, int cont) 
        {
-
+               std::cout<<"getBoxesInside recursivo "<<std::endl;
+               cont++;
                std::string name = GetTypeName();
+               std::cout<<"despues de getTypeName : "<<name<<std::endl;
     std::string descr = GetDescription();
     std::string author = GetAuthor();
-       list.push_back(name);
+       
+       //list.push_back(name);
                tree.setData(name);
-   //  list.push_back(descr);
-   //  list.push_back(author);
+       //list.push_back(descr);
+       //list.push_back(author);
                int k = 0;
+               
     const ComplexBlackBox::BlackBoxMapType& B = mPrototype->bbGetBlackBoxMap();
-       
+
+               std::cout<<"----B size "<< B.size() << std::endl;
+               std::cout<<"----antes if "<<std::endl;
     if (B.size()) 
     {
           std::set<BlackBoxDescriptor::Pointer> pdeps;
           ComplexBlackBox::BlackBoxMapType::const_iterator b;
+                       std::cout<<"----antes for "<<std::endl;
           for ( b = B.begin(); b != B.end(); ++b ) 
           {
-               BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor();
-                               
+                               BlackBoxDescriptor::Pointer d = b->second->bbGetDescriptor();
+                               //std::cout<<"nombre objeto d "<< d->GetObjectName() <<std::endl;
                                
              //if (pdeps.find(d) != pdeps.end()) 
         //    continue;
              //pdeps.insert(d);
-
+                               std::cout<<"----1~ "<<std::endl;
              Package::Pointer p = d->GetPackage();
              std::string nameBox = b->second->bbGetTypeName();
                                std::string packageBox = p->GetName();
-                               
                                tree.insertChild(nameBox);
-
-                               list.push_back(nameBox);
-                               list.push_back(packageBox);
-
-                               d->GetBoxesInside (tree.childs[k],list, cont+1);
+                               std::cout<<"----2~ "<<std::endl;
+                               //list.push_back(nameBox);
+                               //list.push_back(packageBox);
+                               std::cout<<"-----cont "<<cont<<std::endl;
+                               //tree.treeTour(cont);
+                               d->GetBoxesInside (tree.childs[k], cont);
+                               std::cout<<"----3~ "<<std::endl;
+                               //std::cout<<"--despues de la recursion "<<k<<std::endl;
                                k++;
            }   // for
-
+                       std::cout<<"----despues for "<<std::endl;
      } // If B.size
-
+                       std::cout<<"----despues if "<<std::endl;
+                       std::cout<<"end getBoxesInside recursivo"<<std::endl;
        }
 
 //===================================================
index f9e7f8d8997e61525dc933c96aa4e6b280f8df58..e39b6d766e9dd1e24a5367b3f3b3b524930192d2 100644 (file)
@@ -144,7 +144,7 @@ namespace bbtk
                          const std::string& output_dir = "",
                          bool relative_link = false );
     
-               void GetBoxesInside (NodeTreeC& tree, std::vector<std::string>& list, int cont);
+               void GetBoxesInside (NodeTreeC& tree, int cont);
    ///
     virtual void Check(bool recursive=true) const;
        
index 1b0abc03a0c9fe96193faa090698101105aa6f9c..16f4ffbf692335afcb22c3d115116272ff7b0403 100644 (file)
@@ -1404,15 +1404,14 @@ namespace bbtk
     return s;
   }
   //==========================================================================
-  void  Package::GetBoxesInside(NodeTreeC& tree, std::vector<std::string>& list, int cont) 
+  void  Package::GetBoxesInside(NodeTreeC& tree, int cont) 
   {
                DescriptorMapType::const_iterator i;
-
-               std::vector<std::string>  temp;
+               std::cout<<"*********a********"<<std::endl;
                for (i=mDescriptorMap.begin(); i!=mDescriptorMap.end(); ++i) 
                {
-                       i->second->GetBoxesInside(tree, list, cont);
-                       list.insert( list.end(), temp.begin(), temp.end() );
+                       i->second->GetBoxesInside(tree, cont);
+                       std::cout<<"*****************"<<std::endl;
                }    
   }
        //==========================================================================
index f39dfc6d7dcb049c1cce7581a94c56a5a78fd398..860cbd9bff956c041d3ade1680ff1b87acf5d8f8 100644 (file)
@@ -73,7 +73,7 @@ namespace bbtk
                                            const std::string& pkgname,
                                            const std::string& path);
 
-       void  GetBoxesInside(NodeTreeC& tree, std::vector<std::string>& list, int cont);
+       void  GetBoxesInside(NodeTreeC& tree, int cont);
     /// NOTE : All the static methods below for package destruction
     /// are not member because they can cause the package death 
     /// and thus close the dynamic library from which it has been loaded.
index 0a6fd9f0cee96db2acf7821da2be679edf2720d3..747f772fdcf67fa7fa0f94c593f39c95b752df68 100644 (file)
@@ -786,68 +786,39 @@ NodeTreeC::~NodeTreeC()
 {
 
 }
+void NodeTreeC::deleteTree()
+{
+       data = "";
+       std::cout<<"NodeTreeC::deleteTree 1"<<std::endl;
+       childs.erase(childs.begin(),childs.begin()+childs.size());
+       std::cout<<"NodeTreeC::deleteTree 2"<<std::endl;
+}
 
 void NodeTreeC::insertChild(std::string _data)
 {
        NodeTreeC temp = NodeTreeC(_data);
        childs.push_back(temp);
+       //std::cout<<"NodeTreeC::insertChild"<<std::endl;
 }
 
-void NodeTreeC::treeTour()
+void NodeTreeC::treeTour(int lvl)
 {
-       std::cout <<"data "<< data << std::endl;
-       std::cout <<"size "<< childs.size() << std::endl;
+       std::string space = "";
+       for (int j=0; j<lvl ; j++){
+                               space += "   ";
+       }
+       lvl++;
+       std::cout <<space<<"data: "<< data << "  size: "<< childs.size() << std::endl;
        for(int i = 0 ; i < childs.size(); i++)
        {
-               childs[i].treeTour();           
+               childs[i].treeTour(lvl);                
        }
 }
 
 void NodeTreeC::setData(std::string _data)
 {
        data = _data;
+       //std::cout<<"NodeTreeC::setData"<<std::endl;
 }
 
-
-//---------Tree------------
-/*
-TreeC::TreeC()
-{
-
-}
-
-TreeC::TreeC(std::string _data)
-{
-       root = NodeTreeC(_data);
-}
-
-TreeC::~TreeC()
-{
-
-}
-
-void TreeC::insertRoot(std::string _data)
-{
-       NodeTreeC temp = NodeTreeC(_data);
-       root = temp;
-}
-
-void TreeC::treeTour()
-{
-       root.treeTour();
-}
-
-void TreeC::insertData(std::string _data)
-{
-       
-}
-
-TreeC* TreeC::getSubTree()
-{
-       TreeC temp;
-       temp.root = root.childs[0];
-       return ;
-}
-*/
-
 }
index 1a1a3992f4374d3581ca18bd89558c64cc3f6835..1f8f6c3552f43b1f8ab765d9d28e61234b941878 100644 (file)
@@ -211,24 +211,10 @@ public:
        NodeTreeC(std::string _data);
        ~NodeTreeC();
        void insertChild(std::string _data);
-       void treeTour();
+       void treeTour(int lvl);
        void setData(std::string _data);
+       void deleteTree();
 };
-/*
-class TreeC
-{
-public:
-       NodeTreeC root;
-
-  TreeC();
-       TreeC(std::string _data);
-       ~TreeC();
-       void insertRoot(std::string _data);
-       void treeTour();
-       void insertData(std::string _data);
-       TreeC getSubTree();
-};
- */
   
 } // namespace bbtk
  
index 7cbb6323f4bd73511317cb0ed345c613287a3afb..5d8367d5a71f03b9c888537c5b0c99923714c3a3 100644 (file)
@@ -127,6 +127,7 @@ namespace bbstd
   BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,uint8_t,int8_t);
   BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,Cast,int8_t,uint8_t);
   
+
   //====================================================================
   
 
index f14cd05153301176304d2f14851579d8dc22a06a..f42024a511a4e36acfcd8d43e458a19ed19d7188 100644 (file)
@@ -46,20 +46,20 @@ namespace bbstd
   
   //=================================================================
   // BlackBox declaration
-  template <class T, class U>
+  template < class T, class U >
   class bbstd_EXPORT Cast : public bbtk::AtomicBlackBox
   {  
-    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(Cast,bbtk::AtomicBlackBox,T,U);
-    BBTK_DECLARE_INPUT(In,T);
-    BBTK_DECLARE_OUTPUT(Out,U);
+    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(Cast,bbtk::AtomicBlackBox , T , U );
+    BBTK_DECLARE_INPUT(In , T );
+    BBTK_DECLARE_OUTPUT(Out , U );
     BBTK_PROCESS(DoIt);
     void DoIt() {  
       bbtkDebugMessage("Data",5,"bbstd::Cast In  = "
-                      <<bbGetInputIn()<<" <"<<bbtk::HumanTypeName<T>()
+                      << bbGetInputIn() <<" <"<<bbtk::HumanTypeName< T >()
                       <<">"<<std::endl);
-      bbSetOutputOut( static_cast<U>(bbGetInputIn()) );
+      bbSetOutputOut( static_cast< U >(bbGetInputIn()) );
       bbtkDebugMessage("Data",5,"bbstd::Cast Out = "
-                      <<(U)bbGetInputIn()<<" <"<<bbtk::HumanTypeName<U>()
+                      <<( U )bbGetInputIn()<<" <"<<bbtk::HumanTypeName< U >()
                       <<">"<<std::endl);
     }
   };
@@ -71,20 +71,20 @@ namespace bbstd
   //=================================================================
   // BlackBox description
   BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(Cast,bbtk::AtomicBlackBox);
-  BBTK_NAME("Cast"+bbtk::HumanTypeName<T1>()+"To"+bbtk::HumanTypeName<T2>());
+  BBTK_NAME("Cast"+bbtk::HumanTypeName< T1 >()+"To"+bbtk::HumanTypeName< T2 >());
   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
-  BBTK_DESCRIPTION("Static cast from "+bbtk::HumanTypeName<T1>()+" ("
-                  +bbtk::TypeName<T1>()+") to "+bbtk::HumanTypeName<T2>()
-                  +" ("+bbtk::TypeName<T2>()+")");
+  BBTK_DESCRIPTION("Static cast from "+bbtk::HumanTypeName< T1 >()+" ("
+                  +bbtk::TypeName< T1 >()+") to "+bbtk::HumanTypeName< T2 >()
+                  +" ("+bbtk::TypeName< T2 >()+")");
   BBTK_DEFAULT_ADAPTOR();
-  BBTK_TEMPLATE2_INPUT(Cast,In,"Input",T1);
-  BBTK_TEMPLATE2_OUTPUT(Cast,Out,"Output",T2);
+  BBTK_TEMPLATE2_INPUT(Cast,In,"Input", T1 );
+  BBTK_TEMPLATE2_OUTPUT(Cast,Out,"Output", T2 );
   BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(Cast);
   //=================================================================
 
-  template <class T, class U> void Cast<T,U>::bbUserSetDefaultValues() {}
-  template <class T, class U> void Cast<T,U>::bbUserInitializeProcessing() {}
-  template <class T, class U> void Cast<T,U>::bbUserFinalizeProcessing() {}
+  template <class T, class U> void Cast< T , U >::bbUserSetDefaultValues() {}
+  template <class T, class U> void Cast< T , U >::bbUserInitializeProcessing() {}
+  template <class T, class U> void Cast< T , U >::bbUserFinalizeProcessing() {}
 
 
 } // namespace bbstd
diff --git a/packages/std/src/bbstdCastVector.cxx b/packages/std/src/bbstdCastVector.cxx
new file mode 100644 (file)
index 0000000..51c67d7
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdCastVector.cxx,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.5 $
+=========================================================================*/
+
+#include "bbstdCastVector.h"
+#include "bbstdPackage.h"
+
+namespace bbstd 
+{
+  
+  //====================================================================
+  BBTK_BLACK_BOX_TEMPLATE2_IMPLEMENTATION(CastVector,
+                                         bbtk::AtomicBlackBox);
+  //====================================================================
+  
+  //====================================================================
+  // Add the instanciated adaptors to the package
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,double);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,double);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,double, bool); 
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float, bool);    
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t, bool);  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t, bool);  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t, bool);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,bool,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t, bool);   
+       
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,float);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,float,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,float);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int32_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int32_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint32_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint32_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,uint32_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,uint16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint16_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint16_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,int16_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int16_t,uint8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int16_t);
+  
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,uint8_t,int8_t);
+  BBTK_ADD_TEMPLATE2_BLACK_BOX_TO_PACKAGE(std,CastVector,int8_t,uint8_t);
+  
+
+  //====================================================================
+  
+
+} // namespace bbstd
diff --git a/packages/std/src/bbstdCastVector.h b/packages/std/src/bbstdCastVector.h
new file mode 100644 (file)
index 0000000..c7bb20d
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+/*=========================================================================
+  Program:   bbtk
+  Module:    $RCSfile: bbstdCastVector.h,v $
+  Language:  C++
+  Date:      $Date: 2012/11/16 08:51:32 $
+  Version:   $Revision: 1.8 $
+=========================================================================*/
+
+
+
+#ifndef __bbstdCastVector_h_INCLUDED__
+#define __bbstdCastVector_h_INCLUDED__
+
+#include "bbtkAtomicBlackBox.h"
+#include "bbstd_EXPORT.h"
+#include <vector>
+
+namespace bbstd 
+{
+  
+  //=================================================================
+  // BlackBox declaration
+  template < class T, class U >
+  class bbstd_EXPORT CastVector : public bbtk::AtomicBlackBox
+  {  
+    BBTK_TEMPLATE2_BLACK_BOX_INTERFACE(CastVector,bbtk::AtomicBlackBox , T , U );
+    BBTK_DECLARE_INPUT(In , std::vector<T> );
+    BBTK_DECLARE_OUTPUT(Out , std::vector<U> );
+    BBTK_PROCESS(DoIt);
+    void DoIt() {  
+//      bbtkDebugMessage("Data",5,"bbstd::CastVector In  = "
+//                    << bbGetInputIn() <<" <"<<bbtk::HumanTypeName< T >()
+//                    <<">"<<std::endl);
+//      bbSetOutputOut( static_cast< U >(bbGetInputIn()) );
+
+  bbmOutputOut.clear();
+
+    typename std::vector<T>::const_iterator i;
+    for (i=bbmInputIn.begin();i!=bbmInputIn.end();++i)
+    {
+      bbmOutputOut.push_back( *i );
+    }
+
+
+//      bbtkDebugMessage("Data",5,"bbstd::CastVector Out = "
+//                    <<( U )bbGetInputIn()<<" <"<<bbtk::HumanTypeName< U >()
+//                    <<">"<<std::endl);
+    }
+  };
+  //=================================================================
+  
+  
+  
+  
+  //=================================================================
+  // BlackBox description
+  BBTK_BEGIN_DESCRIBE_TEMPLATE2_BLACK_BOX(CastVector,bbtk::AtomicBlackBox);
+  BBTK_NAME("CastVector"+bbtk::HumanTypeName< T1 >()+"To"+bbtk::HumanTypeName< T2 >());
+  BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("Static CastVector from "+bbtk::HumanTypeName< T1 >()+" ("
+                  +bbtk::TypeName< T1 >()+") to "+bbtk::HumanTypeName< T2 >()
+                  +" ("+bbtk::TypeName< T2 >()+")");
+  BBTK_DEFAULT_ADAPTOR();
+  typedef std::vector<T1> T1vector;
+  BBTK_TEMPLATE2_INPUT(CastVector,In,"Input", T1vector );
+  typedef std::vector<T2> T2vector;
+  BBTK_TEMPLATE2_OUTPUT(CastVector,Out,"Output", T2vector );
+  BBTK_END_DESCRIBE_TEMPLATE2_BLACK_BOX(CastVector);
+  //=================================================================
+
+  template <class T, class U> void CastVector< T , U >::bbUserSetDefaultValues() {}
+  template <class T, class U> void CastVector< T , U >::bbUserInitializeProcessing() {}
+  template <class T, class U> void CastVector< T , U >::bbUserFinalizeProcessing() {}
+
+
+} // namespace bbstd
+
+#endif // __bbstdCastVector_h_INCLUDED__
+  
index 25707a313e2bdc21a6981645ee4c0b9c294a5c21..b9251f04f486c134e3cf07541ecb5c2eaa20cad1 100644 (file)
@@ -1,32 +1,6 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -36,100 +10,112 @@ AUTHOR:Author ??
 COMPLEXBOX:TRUE
 COMPLEXBOXNAME:ImageVtkPropertiesWidget
 PACKAGENAME:toolsbbtk
-COMPLEXINPUTS:1
-COMPLEX_PORT
-in
-34.967521:145.605564:900.000000
-FIN_COMPLEX_PORT
 COMPLEXOUTPUTS:6
 COMPLEX_PORT
 widget
-3.333144:-72.520645:900.000000
+3.333144:-72.520645:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Dimensions
-21.417324:-71.448913:900.000000
+21.417324:-71.448913:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 MinMax
-53.672901:-69.172114:900.000000
+53.672901:-69.172114:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Size
-64.566781:-70.774155:900.000000
+64.566781:-70.774155:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Spacing
-76.101477:-70.453747:900.000000
+76.101477:-70.453747:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 TypeName
-88.917806:-71.094563:900.000000
+88.917806:-71.094563:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:2
+COMPLEX_PORT
+in
+34.967521:145.605564:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+FileName
+102.519294:151.601731:-900.000000
 FIN_COMPLEX_PORT
-BOXES:8
+BOXES:9
 BOX
 wx:OutputText:Box02
 ISEXEC:FALSE
--173.282353:46.940241:900.000000
--127.707353:36.940241:900.000000
+-173.282353:46.940241:-900.000000
+-127.707353:36.940241:-900.000000
 PORT
 Title:"Dimensions"
 FIN_BOX
 BOX
 wx:OutputText:Box17
 ISEXEC:FALSE
--80.770416:34.681383:900.000000
--35.195416:24.681383:900.000000
+-80.770416:34.681383:-900.000000
+-35.195416:24.681383:-900.000000
 PORT
 Title:"Size"
 FIN_BOX
 BOX
 wx:OutputText:Box20
 ISEXEC:FALSE
--52.452230:20.761380:900.000000
--6.877230:10.761380:900.000000
+-52.452230:20.761380:-900.000000
+-6.877230:10.761380:-900.000000
 PORT
 Title:"Spacing"
 FIN_BOX
 BOX
 wx:OutputText:Box22
 ISEXEC:FALSE
--35.332320:1.230494:900.000000
-10.242680:-8.769506:900.000000
+-35.332320:1.230494:-900.000000
+10.242680:-8.769506:-900.000000
 PORT
 Title:"TypeName"
 FIN_BOX
 BOX
 wx:OutputText:Box26
 ISEXEC:FALSE
--131.615626:26.628991:900.000000
--86.040626:16.628991:900.000000
+-131.615626:26.628991:-900.000000
+-86.040626:16.628991:-900.000000
 PORT
 Title:"Min Max"
 FIN_BOX
 BOX
 vtk:ImageVtkProperties:Box09
 ISEXEC:FALSE
-33.571051:113.198814:900.000000
-79.146051:103.198814:900.000000
+33.571051:113.198814:-900.000000
+79.146051:103.198814:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box10
 ISEXEC:FALSE
--196.439793:65.504307:900.000000
--150.864793:55.504307:900.000000
+-196.439793:65.504307:-900.000000
+-150.864793:55.504307:-900.000000
 PORT
 Title:"Components"
 FIN_BOX
 BOX
 wx:LayoutLine:Box11
 ISEXEC:FALSE
--146.679789:-23.669575:900.000000
--89.119789:-33.669575:900.000000
+-69.746079:-39.358124:-900.000000
+-12.186079:-49.358124:-900.000000
 PORT
 WinTitle:"Image properties"
 FIN_BOX
-CONNECTIONS:19
+BOX
+wx:OutputText:Box13
+ISEXEC:FALSE
+-27.886899:-16.541426:-900.000000
+17.688101:-26.541426:-900.000000
+PORT
+Title:"Name"
+FIN_BOX
+CONNECTIONS:21
 CONNECTION
 Box09:Components:Box10:In
 NumberOfControlPoints:0
@@ -187,4 +173,10 @@ NumberOfControlPoints:0
 CONNECTION
 Box09:Dimension:Box02:In
 NumberOfControlPoints:0
+CONNECTION
+FileName:FileName:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box11:Widget7
+NumberOfControlPoints:0
 APP_END
index 5688245cfc550b9a14d4f727aed68e940e83aba0..5272b3b4761f58735f769c5270f9fadabb7a542e 100644 (file)
@@ -1,32 +1,6 @@
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-#                        pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-#  This software is governed by the CeCILL-B license under French law and
-#  abiding by the rules of distribution of free software. You can  use,
-#  modify and/ or redistribute the software under the terms of the CeCILL-B
-#  license as circulated by CEA, CNRS and INRIA at the following URL
-#  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-#  or in the file LICENSE.txt.
-#
-#  As a counterpart to the access to the source code and  rights to copy,
-#  modify and redistribute granted by the license, users are provided only
-#  with a limited warranty  and the software's author,  the holder of the
-#  economic rights,  and the successive licensors  have only  limited
-#  liability.
-#
-#  The fact that you are presently reading this means that you have had
-#  knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
 # ----------------------------------
-# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
 # ----------------------------------
 
 include std
@@ -64,6 +38,9 @@ new OutputText Box10
 new LayoutLine Box11
   set Box11.WinTitle "Image properties"
 
+new OutputText Box13
+  set Box13.Title "Name"
+
 
 connect Box09.Components Box10.In
 connect Box09.MinMax Box26.In
@@ -77,10 +54,11 @@ connect Box20.Widget Box11.Widget4
 connect Box22.Widget Box11.Widget5
 connect Box26.Widget Box11.Widget6
 connect Box09.Dimension Box02.In
-
+connect Box13.Widget Box11.Widget7
 
 # Complex input ports
 input in Box09.In " "
+input FileName Box13.In " "
 
 # Complex output ports
 output widget Box11.Widget " "
@@ -90,4 +68,5 @@ output Size Box09.Size " "
 output Spacing Box09.Spacing " "
 output TypeName Box09.TypeName " "
 
+
 endefine
index f1ac03bffac9d5ed599e5a584d9944ef9ae9af20..6a7e5f2d964ae12f764483d80d947adc20bdd68e 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbg
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbg
 # ----------------------------------
 
 APP_START
@@ -9,12 +9,12 @@ DESCRIPTION:Evaluates the sum of the Euclidean distances among the points in the
 AUTHOR:Ricardo A Corredor
 COMPLEXBOX:FALSE
 COMPLEXINPUTS:0
-BOXES:8
+BOXES:20
 BOX
 creaMaracasVisu:ShowNPoints:Box00
-ISEXEC:TRUE
--51.309471:11.810349:-900.000000
--2.989471:1.810349:-900.000000
+ISEXEC:FALSE
+-20.575067:-1.900823:-900.000000
+27.744933:-11.900823:-900.000000
 PORT
 WinTitle:"Points Widget"
 PORT
@@ -22,17 +22,17 @@ WinWidth:"200"
 FIN_BOX
 BOX
 creaMaracasVisu:ViewerNV:Box02
-ISEXEC:TRUE
--26.721828:47.483487:-900.000000
-33.918172:37.483487:-900.000000
+ISEXEC:FALSE
+32.451487:18.015162:-900.000000
+93.091487:8.015162:-900.000000
 PORT
 WinTitle:"Image Viewer"
 FIN_BOX
 BOX
 wx:CommandButton:Box03
-ISEXEC:TRUE
--128.980270:47.281481:-900.000000
--83.405270:37.281481:-900.000000
+ISEXEC:FALSE
+-124.217922:-25.806219:-900.000000
+-78.642922:-35.806219:-900.000000
 PORT
 Label:"Evaluate length..."
 PORT
@@ -45,38 +45,114 @@ FIN_BOX
 BOX
 vtk:MeasureLength:Box04
 ISEXEC:FALSE
--112.956474:-50.441103:-900.000000
--67.381474:-60.441103:-900.000000
+-83.249723:-44.698142:-900.000000
+-37.674723:-54.698142:-900.000000
 FIN_BOX
 BOX
 vtk:PointsXYZtoVTKPoints:Box05
 ISEXEC:FALSE
--54.277786:-36.674180:-900.000000
-16.897214:-46.674180:-900.000000
+-68.713790:-27.331519:-900.000000
+2.461210:-37.331519:-900.000000
 FIN_BOX
 BOX
 wx:OutputText:Box06
 ISEXEC:FALSE
--113.407849:-80.683196:-900.000000
--67.832849:-90.683196:-900.000000
+-106.948982:-66.573864:-900.000000
+-61.373982:-76.573864:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:DrawAxe3D:Box09
+ISEXEC:FALSE
+-6.044096:-121.459131:-900.000000
+39.530904:-131.459131:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+82.578614:-47.313269:-900.000000
+128.153614:-57.313269:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box11
+ISEXEC:FALSE
+100.248722:-68.607816:-900.000000
+145.823722:-78.607816:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box12
+ISEXEC:FALSE
+89.242836:-94.110903:-900.000000
+134.817836:-104.110903:-900.000000
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box13
+ISEXEC:FALSE
+-27.999351:-41.893546:-900.000000
+17.575649:-51.893546:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box14
+ISEXEC:FALSE
+-86.746462:92.889408:-900.000000
+-41.171462:82.889408:-900.000000
+FIN_BOX
+BOX
+vtk:Transform:Box15
+ISEXEC:FALSE
+-29.422707:-79.221243:-900.000000
+16.152293:-89.221243:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+-17.642995:-61.028922:-900.000000
+27.932005:-71.028922:-900.000000
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box17
+ISEXEC:FALSE
+-73.510553:44.615154:-900.000000
+-2.335553:34.615154:-900.000000
 FIN_BOX
 BOX
-vtk:MetaImageReader:Box07
+creaImageIO:ImagesChooserDialogBox:Box18
 ISEXEC:FALSE
--58.531222:83.907503:-900.000000
--12.956222:73.907503:-900.000000
+-34.396302:72.707317:-900.000000
+36.778698:62.707317:-900.000000
 FIN_BOX
 BOX
-wx:FileSelector:Box08
+wx:LayoutSplit:Box19
+ISEXEC:TRUE
+29.399279:-160.598681:-900.000000
+74.974279:-170.598681:-900.000000
+PORT
+Orientation:"H"
+PORT
+Proportion:"30"
+FIN_BOX
+BOX
+vtk:UpdateRender:Box20
 ISEXEC:FALSE
--57.766108:111.196570:-900.000000
--12.191108:101.196570:-900.000000
+-55.505058:-104.393331:-900.000000
+-9.930058:-114.393331:-900.000000
 PORT
-Message:"Select an image ..."
+Active:"true"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box21
+ISEXEC:FALSE
+-102.220830:-112.698357:-900.000000
+-56.645830:-122.698357:-900.000000
 PORT
-Title:"Select an image ..."
+Proportion:"25"
+FIN_BOX
+BOX
+wx:LayoutLine:Box22
+ISEXEC:FALSE
+-121.648659:-82.889246:-900.000000
+-64.088659:-92.889246:-900.000000
 FIN_BOX
-CONNECTIONS:13
+CONNECTIONS:33
 CONNECTION
 Box02:Renderer1:Box00:Renderer
 NumberOfControlPoints:0
@@ -99,21 +175,81 @@ CONNECTION
 Box05:Points:Box04:Points
 NumberOfControlPoints:0
 CONNECTION
-Box03:BoxChange:Box06:BoxExecute
+Box04:Length:Box06:In
 NumberOfControlPoints:0
 CONNECTION
-Box04:Length:Box06:In
+Box02:Renderer1:Box09:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsX:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsY:Box11:In1
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box09:lstPointY
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:lstPointX
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsZ:Box12:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box09:lstPointZ
+NumberOfControlPoints:0
+CONNECTION
+Box15:Out:Box09:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box13:Spacing:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box00:Image
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box04:ImageData
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box19:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box15:Scale
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box09:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box02:In
+Box02:Renderer1:Box20:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box20:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box22:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box22:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box21:Widget:Box19:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box03:BoxChange:Box06:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box04:ImageData
+Box22:Widget:Box21:Widget1
 NumberOfControlPoints:0
 CONNECTION
-Box07:Out:Box00:Image
+Box00:Widget:Box21:Widget2
 NumberOfControlPoints:0
 CONNECTION
-Box08:Out:Box07:In
+Box18:Out:Box17:In
 NumberOfControlPoints:0
 APP_END
index 4ffc5a7c40277b276ac073020fb5027b11f8bb3c..fe9bdc092f83bf5d6752103cb1988271aec67fac 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBS BlackBox Script
-# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbs
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/appli/exampleMeasureLength.bbs
 # ----------------------------------
 
 # BBTK GEditor Script
@@ -11,6 +11,8 @@ include itkvtk
 include creaMaracasVisu
 include wx
 include vtk
+include std
+include creaImageIO
 
 author "Ricardo A Corredor"
 description "Evaluates the sum of the Euclidean distances among the points in the list following their order. Put some points in the image using the Points Widget and the click on Evaluate Length button. "
@@ -35,11 +37,37 @@ new PointsXYZtoVTKPoints Box05
 
 new OutputText Box06
 
-new MetaImageReader Box07
+new DrawAxe3D Box09
+
+new ConcatStrings Box10
+
+new ConcatStrings Box11
+
+new ConcatStrings Box12
+
+new ImageVtkProperties Box13
+
+new LoadHola Box14
+
+new Transform Box15
+
+new ConcatStrings Box16
+
+new vtkImageDataPointerRelay Box17
+
+new ImagesChooserDialogBox Box18
 
-new FileSelector Box08
-  set Box08.Message "Select an image ..."
-  set Box08.Title "Select an image ..."
+new LayoutSplit Box19
+  set Box19.Orientation "H"
+  set Box19.Proportion "30"
+
+new UpdateRender Box20
+  set Box20.Active "true"
+
+new LayoutSplit Box21
+  set Box21.Proportion "25"
+
+new LayoutLine Box22
 
 
 connect Box02.Renderer1 Box00.Renderer
@@ -56,21 +84,59 @@ connect Box00.lstPointsZ Box05.LstPointsZ
 
 connect Box05.Points Box04.Points
 
-connect Box03.BoxChange Box06.BoxExecute
-
 connect Box04.Length Box06.In
 
-connect Box07.Out Box02.In
+connect Box02.Renderer1 Box09.Renderer
+
+connect Box00.lstPointsX Box10.In1
+
+connect Box00.lstPointsY Box11.In1
+
+connect Box11.Out Box09.lstPointY
+
+connect Box10.Out Box09.lstPointX
+
+connect Box00.lstPointsZ Box12.In1
+
+connect Box12.Out Box09.lstPointZ
+
+connect Box15.Out Box09.Transform
+
+connect Box13.Spacing Box16.In1
+
+connect Box17.Out Box02.In
+
+connect Box17.Out Box00.Image
+
+connect Box17.Out Box04.ImageData
+
+connect Box17.Out Box13.In
+
+connect Box02.Widget Box19.Widget2
+
+connect Box16.Out Box15.Scale
+
+connect Box00.BoxChange Box09.BoxExecute
+
+connect Box02.Renderer1 Box20.Renderer
+
+connect Box00.BoxChange Box20.BoxExecute
+
+connect Box03.Widget Box22.Widget1
+
+connect Box06.Widget Box22.Widget2
+
+connect Box21.Widget Box19.Widget1
+
+connect Box03.BoxChange Box06.BoxExecute
 
-connect Box07.Out Box04.ImageData
+connect Box22.Widget Box21.Widget1
 
-connect Box07.Out Box00.Image
+connect Box00.Widget Box21.Widget2
 
-connect Box08.Out Box07.In
+connect Box18.Out Box17.In
 
 
 
 # Complex input ports
-exec Box00
-exec Box02
-exec Box03
+exec Box19
index 8756b5fb0e2929ee17ff3ac79d83dffc997ef5e3..a81e328266941b0dade0b661f0f79ef38f2e4cee 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg
+# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/vtk/boxes/bbIsoSurfaceExtractor.bbg
 # ----------------------------------
 
 APP_START
@@ -50,16 +50,12 @@ vtk:MarchingCubes:mc
 ISEXEC:FALSE
 -13.834130:38.831538:-900.000000
 31.740870:28.831538:-900.000000
-PORT
-BoxProcessMode:"Reactive"
 FIN_BOX
 BOX
 vtk:PolyDataToActor:polydatatoactor
 ISEXEC:FALSE
 -99.833324:8.498185:-900.000000
 -28.658324:-1.501815:-900.000000
-PORT
-BoxProcessMode:"Reactive"
 FIN_BOX
 BOX
 std:MultipleInputs:Box03
@@ -67,7 +63,7 @@ ISEXEC:FALSE
 -27.966362:71.986554:-900.000000
 17.608638:61.986554:-900.000000
 PORT
-BoxProcessMode:"Reactive"
+BoxProcessMode:"reactive"
 FIN_BOX
 CONNECTIONS:11
 CONNECTION
@@ -98,9 +94,9 @@ CONNECTION
 BoxExecute:BoxExecute:Box03:In1
 NumberOfControlPoints:0
 CONNECTION
-Box03:BoxChange:polydatatoactor:BoxExecute
+Box03:Out:polydatatoactor:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box03:BoxChange:mc:BoxExecute
+Box03:Out:mc:BoxExecute
 NumberOfControlPoints:0
 APP_END
index 71f10b5df87b8346d6179323021dd837e93fd3c0..48d3ab6159a47decdd8de8b04b2160d6595d46b3 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
+# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/vtk/boxes/bbIsoSurfaceExtractor.bbs
 # ----------------------------------
 
 include std
@@ -16,18 +16,16 @@ description "Extracts an iso-surface of a 3D image and creates a vtkProp3D objec
 category "3D object creator"
 
 new MarchingCubes mc
-  set mc.BoxProcessMode "Reactive"
 
 new PolyDataToActor polydatatoactor
-  set polydatatoactor.BoxProcessMode "Reactive"
 
 new MultipleInputs Box03
-  set Box03.BoxProcessMode "Reactive"
+  set Box03.BoxProcessMode "reactive"
 
 
 connect mc.Out polydatatoactor.In
-connect Box03.BoxChange polydatatoactor.BoxExecute
-connect Box03.BoxChange mc.BoxExecute
+connect Box03.Out polydatatoactor.BoxExecute
+connect Box03.Out mc.BoxExecute
 
 # Complex input ports
 input In mc.In " "
index 1b2a64551cf1b2b1c8fa7aec5b2563eb1aa7256c..4dfc3d73d51b06e1b3485fe900ced5ccb4e15be1 100644 (file)
@@ -13,7 +13,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(MeasureLength,bbtk::AtomicBlackBox);
 //===== 
 void MeasureLength::Process()
 {
-       //std::cout << "RaC MeasureLength::Process START"<< std::endl;
+       std::cout << "RaC MeasureLength::Process START"<< std::endl;
 
        _points = bbGetInputPoints();
        _image = bbGetInputImageData();
@@ -61,7 +61,7 @@ void MeasureLength::Process()
 
        bbSetOutputLength(sumLength);
 
-       //std::cout << "RaC MeasureLength::Process END"<< std::endl;
+       std::cout << "RaC MeasureLength::Process END"<< std::endl;
 }
 //===== 
 // 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)
index 0a825a2ecfbb565c54b2bdb8435a57ab04744884..f2a84952f828fbed74dcb9211926abc9793604ff 100644 (file)
@@ -14,27 +14,33 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PointsXYZtoVTKPoints,bbtk::AtomicBlackBox);
 void PointsXYZtoVTKPoints::Process()
 {
 
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
+//std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
        std::vector<int> lstPointsX = bbGetInputLstPointsX();
        std::vector<int> lstPointsY = bbGetInputLstPointsY();
        std::vector<int> lstPointsZ = bbGetInputLstPointsZ();
 
+
        if(_points==NULL)
+       {
                _points=vtkPoints::New();
-       else
+       } else {
                _points->Reset();//CLEAR
+       }
+       double point[3];
+       point[0]=0;
+       point[1]=0;
+       point[2]=0;
 
        for (int i =0; i < lstPointsX.size(); ++i)
        {
-               double point[3];
                point[0]=lstPointsX[i];
-               point[1]=lstPointsY[i];
-               point[2]=lstPointsZ[i];
+               if (lstPointsY.size()>i) { point[1]=lstPointsY[i]; }
+               if (lstPointsZ.size()>i) { point[2]=lstPointsZ[i]; }
                _points->InsertPoint(i,point);
        }
        bbSetOutputPoints(_points);
 
-       //std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
+std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
   
 }
 //===== 
@@ -42,9 +48,7 @@ void PointsXYZtoVTKPoints::Process()
 //===== 
 void PointsXYZtoVTKPoints::bbUserSetDefaultValues()
 {
-
-
-  
+  _points=NULL;
 }
 //===== 
 // 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)
index c5d9d73383fbf0f5e6ba2def8138291a2378ae14..5eaa9c2342c9b877e49e7100cb298fea07f9f4c7 100644 (file)
@@ -38,6 +38,14 @@ void Text2D::Process()
    _textActor = vtkTextActor::New();
    _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld();
 
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToDisplay ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedDisplay ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToViewport ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToView ();
+//   _textActor->GetPositionCoordinate()->SetCoordinateSystemToWorld ();
+
+
    if (bbGetInputRenderer()!=NULL)
    {
       bbGetInputRenderer()->AddActor2D(_textActor);
@@ -66,7 +74,14 @@ void Text2D::Process()
     }    
 
  }
+// _textActor->SetTextScaleModeToProp();
  _textActor->SetPosition( px*spx , py*spy );
+
+printf("EED Text2D::Process px=%f  py=%f\n",px,py);
+
+// _textActor->SetPosition( 150,150 );
+// _textActor->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport();
+// _textActor->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 );
 // textActor->GetPosition2Coordinate()->SetValue(0.6, 0.1);
 
  vtkTextProperty *tprop = _textActor->GetTextProperty();
index ac1ecf98216d0fa23874c261899d779d2aa76e51..a79e53b50af6540a27443b748c34a713997ce110 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
+# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/wxvtk/boxes/bbIsoSurfaceWidget.bbg
 # ----------------------------------
 
 APP_START
@@ -78,8 +78,8 @@ FIN_BOX
 BOX
 wx:Slider:isovalue
 ISEXEC:FALSE
-97.896195:33.580835:-900.000000
-149.296195:23.580835:-900.000000
+97.623363:33.580835:-900.000000
+149.023363:23.580835:-900.000000
 PORT
 ChangeResolution:"true"
 PORT
@@ -112,16 +112,14 @@ FIN_BOX
 BOX
 std:MultipleInputs:refresh
 ISEXEC:FALSE
--92.618071:-105.393837:-900.000000
--47.043071:-115.393837:-900.000000
-PORT
-BoxProcessMode:"Reactive"
+-92.618071:-104.029679:-900.000000
+-47.043071:-114.029679:-900.000000
 FIN_BOX
 BOX
 std:Div:div
 ISEXEC:FALSE
 0.000000:-110.000000:-900.000000
-32.775000:-120.000000:-900.000000
+26.375000:-120.000000:-900.000000
 PORT
 In2:"100"
 FIN_BOX
@@ -139,7 +137,7 @@ ISEXEC:FALSE
 170.465036:-148.550905:-900.000000
 216.040036:-158.550905:-900.000000
 FIN_BOX
-CONNECTIONS:26
+CONNECTIONS:27
 CONNECTION
 isovalue:Out:surface:Isovalue
 NumberOfControlPoints:0
@@ -171,12 +169,6 @@ CONNECTION
 opacity:Widget:controls:Widget2
 NumberOfControlPoints:0
 CONNECTION
-refresh:BoxChange:surface:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
-refresh:BoxChange:Box08:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
 Box09:Out:surface:Renderer
 NumberOfControlPoints:0
 CONNECTION
@@ -216,6 +208,15 @@ CONNECTION
 controls:Widget:Widget:Widget
 NumberOfControlPoints:0
 CONNECTION
-refresh:BoxChange:BoxChange:BoxChange
+refresh:Out:BoxChange:BoxChange
+NumberOfControlPoints:0
+CONNECTION
+refresh:Out:Box08:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+refresh:Out:surface:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+opacity:BoxChange:refresh:BoxExecute
 NumberOfControlPoints:0
 APP_END
index 995a4a0501e5e2553096029caf7185ab699dc27a..6c25ef9740ff50f7d0eda1b1087a3c77b928532b 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs
+# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/wxvtk/boxes/bbIsoSurfaceWidget.bbs
 # ----------------------------------
 
 include std
@@ -36,7 +36,6 @@ new Slider opacity
 new ColourSelectorButton colour
 
 new MultipleInputs refresh
-  set refresh.BoxProcessMode "Reactive"
 
 new Div div
   set div.In2 "100"
@@ -57,10 +56,11 @@ connect colour.BoxChange refresh.In3
 connect colour.Widget controls.Widget3
 connect isovalue.Widget controls.Widget1
 connect opacity.Widget controls.Widget2
-connect refresh.BoxChange surface.BoxExecute
-connect refresh.BoxChange Box08.BoxExecute
 connect Box09.Out surface.Renderer
 connect Box09.Out Box08.Renderer
+connect refresh.Out Box08.BoxExecute
+connect refresh.Out surface.BoxExecute
+connect opacity.BoxChange refresh.BoxExecute
 
 # Complex input ports
 input Title controls.WinTitle " "
@@ -76,7 +76,7 @@ input vtkRenderer Box09.In " "
 # Complex output ports
 output Out surface.Out " "
 output Widget controls.Widget " "
-output BoxChange refresh.BoxChange " "
+output BoxChange refresh.Out " "
 
 
 endefine