]> Creatis software - bbtk.git/commitdiff
*** empty log message ***
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 24 Apr 2008 12:56:38 +0000 (12:56 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Thu, 24 Apr 2008 12:56:38 +0000 (12:56 +0000)
25 files changed:
CMakeLists.txt
kernel/appli/bbc/CMakeLists.txt
kernel/appli/bbc/bbc.bat.in [new file with mode: 0644]
kernel/appli/bbi/bbi.cxx
kernel/appli/bbs2cpp/CMakeLists.txt
kernel/cmake/BBTKConfigurePackage_bbs.cmake
kernel/cmake/BBTKFindLibraries.cmake
kernel/install/CMakeLists.txt
kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiEvent.cpp
kernel/src/ThirdParty/wx/treemultictrl/wxTreeMultiEvent.h
kernel/src/bbtkVirtualExec.h
kernel/src/bbtkWxGUICommand.cxx
kernel/src/bbtkWxGUIConsole.cxx
kernel/src/bbtkWxGUIConsole.h
kernel/src/bbtkWxGUIPackageBrowser2.cxx
kernel/src/bbtkWxGUITextEditor.cxx
kernel/src/bbtkXML.h
packages/std/src/bbstdASCII.h
packages/toolsbbtk/bbs/appli/CreateBlackBox.bbs
packages/toolsbbtk/bbs/appli/CreatePackage.bbs
packages/vtk/bbs/appli/ExampleGaussianSmooth.bbs [new file with mode: 0644]
packages/vtk/src/bbvtkIsoSurfaceExtractor.cxx
packages/vtk/src/bbvtkIsoSurfaceExtractor.h
packages/vtk/src/bbvtkSegmentationConnectivity.cxx [new file with mode: 0644]
packages/vtk/src/bbvtkSegmentationConnectivity.h [new file with mode: 0644]

index a20712bb70526fc4a7d12042e361f393b9276ec6..6247aaf2175d27f2e2660b68c697e258aa3a07e4 100644 (file)
@@ -49,7 +49,7 @@ ELSE(WIN32 AND NOT UNIX)
   SET(CPACK_STRIP_FILES "bin/bbi")
   SET(CPACK_SOURCE_STRIP_FILES "")
 ENDIF(WIN32 AND NOT UNIX)
-SET(CPACK_PACKAGE_EXECUTABLES "bbi" "bbs interpreter" )
+SET(CPACK_PACKAGE_EXECUTABLES "bbi" "bbs interpreter" "bbhelp" "bbtk documentation" "bbed" "bbs Editor")
   
 
 INCLUDE(CPack)
index bde14722f9a2af177659e34d5e491417b0a2be4a..c2e8202fdb072caf57664fb38290b2afad72cb64 100644 (file)
@@ -5,40 +5,48 @@ SET(bbc_DATA_REL_PATH_FROM_BIN ../${BBTK_DATA_REL_PATH}/${bbc_DATA_REL_PATH_FROM
 
 
 
+# Build tree 
+SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "-DBBTK_DIR=${PROJECT_BINARY_DIR}")
+CONFIGURE_FILE(
+  ${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in
+  ${BBTK_DATA_BUILD_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}/main.cxx.in
+  COPYONLY
+)
+CONFIGURE_FILE(
+  ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+  ${BBTK_DATA_BUILD_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}/CMakeLists.txt.in
+  COPYONLY
+)
+
+# Install tree
+SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "")
+
+
 IF(UNIX)
-  # Build tree 
-  SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "-DBBTK_DIR=${PROJECT_BINARY_DIR}")
-  CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in
-    ${BBTK_DATA_BUILD_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}/main.cxx.in
-    COPYONLY
-    )
-  CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
-    ${BBTK_DATA_BUILD_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}/CMakeLists.txt.in
-    COPYONLY
-    )
-  CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/bbc.sh.in
-    ${BBTK_BINARY_DIR}/bin/bbc
-    @ONLY IMMEDIATE
-    )
-  # Install tree
-  SET(bbc_CMAKE_OPTION_FOR_BUILD_TREE "")
-  CONFIGURE_FILE(
-    ${CMAKE_CURRENT_SOURCE_DIR}/bbc.sh.in
-    ${CMAKE_CURRENT_BINARY_DIR}/bbc
-    @ONLY IMMEDIATE
-    )
-  INSTALL(
-    FILES ${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
-    DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}
-    )
-  INSTALL(
-    PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bbc
-    DESTINATION bin
-    )
-    
+       CONFIGURE_FILE(
+               ${CMAKE_CURRENT_SOURCE_DIR}/bbc.sh.in
+               ${CMAKE_CURRENT_BINARY_DIR}/bbc
+               @ONLY IMMEDIATE
+       )    
+       INSTALL(
+               PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bbc
+               DESTINATION bin
+       )
 ELSE(UNIX)
-  # TO DO : bat for win
+       CONFIGURE_FILE(
+               ${CMAKE_CURRENT_SOURCE_DIR}/bbc.bat.in
+               ${CMAKE_CURRENT_BINARY_DIR}/bbc.bat
+               @ONLY IMMEDIATE
+       )    
+       INSTALL(
+               PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/bbc.bat
+               DESTINATION bin
+       )
 ENDIF(UNIX)
+
+
+INSTALL(
+    FILES ${CMAKE_CURRENT_SOURCE_DIR}/main.cxx.in ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+    DESTINATION ${BBTK_DATA_INSTALL_PATH}/${bbc_DATA_REL_PATH_FROM_DATA}
+)
+
diff --git a/kernel/appli/bbc/bbc.bat.in b/kernel/appli/bbc/bbc.bat.in
new file mode 100644 (file)
index 0000000..b2e3006
--- /dev/null
@@ -0,0 +1,2 @@
+
+rem bbc.bat  ... To do it !!!
\ No newline at end of file
index 42d5ec54c25d2310b3aab45f5f92d610512bfebe..03380f0a33bd12dce14a15e6321b56be0fdeb5ed 100644 (file)
@@ -67,12 +67,14 @@ void wxBBIApp::OnInitCmdLine(wxCmdLineParser& parser)
 
 bool wxBBIApp::OnCmdLineParsed(wxCmdLineParser& parser)
 {
+
   if (parser.Found(_T("M"))) 
     {
       bbtk::StaticInitTime::PrintObjectListInfo = true;
     }
   
   debug = ( parser.Found(_T("d")) );
+
   quiet = ( parser.Found(_T("q")) );
   help = ( parser.Found(_T("h")) );
   graphical_dialog = ( parser.Found(_T("g")) );
index 519826f6fef2060ccb074f004e85ef191a5f0351..ddec705363af1563eb0b4cafb9b178ec06c50189 100644 (file)
@@ -2,13 +2,14 @@
 SET(SOURCES bbs2cpp )
 SET(EXENAME bbs2cpp )
 
-IF(BBTK_USE_WXWIDGETS AND WIN32)
-  ADD_EXECUTABLE(${EXENAME} WIN32 ${SOURCES})  
-#  SET_TARGET_PROPERTIES(bbhelp PROPERTIES LINK_FLAGS /subsystem:console )
-ELSE(BBTK_USE_WXWIDGETS AND WIN32)
-  ADD_EXECUTABLE(${EXENAME} ${SOURCES})  
-ENDIF(BBTK_USE_WXWIDGETS AND WIN32)
-
+#IF(BBTK_USE_WXWIDGETS AND WIN32)
+#  ADD_EXECUTABLE(${EXENAME} WIN32 ${SOURCES})  
+#  SET_TARGET_PROPERTIES(${EXENAME} PROPERTIES LINK_FLAGS /subsystem:console )
+#ELSE(BBTK_USE_WXWIDGETS AND WIN32)
+#  ADD_EXECUTABLE(${EXENAME} ${SOURCES})  
+#ENDIF(BBTK_USE_WXWIDGETS AND WIN32)
+
+ADD_EXECUTABLE(${EXENAME} ${SOURCES})  
 
 TARGET_LINK_LIBRARIES(${EXENAME} bbtk)
 INSTALL_TARGETS(/bin/ ${EXENAME})
index 17c24d4becee9aeba26777590e2112ef556a780f..88bbdfab58263ff0be93932d35d89f435bd4f004 100644 (file)
@@ -61,7 +61,7 @@ IF (BUILD_BBTK_PACKAGE_${BBTK_PACKAGE_NAME}_BBS_APP)
     GET_FILENAME_COMPONENT(name "${bbs}" NAME_WE) 
     SET(OUTPUT bb${name})
     ADD_CUSTOM_COMMAND(
-      OUTPUT ${BBTK_BIN_PATH}/${OUTPUT}
+      OUTPUT ${BBTK_BIN_PATH}xxx/${OUTPUT}
       COMMAND 
       cd ${BBTK_BIN_PATH} && ${BBTK_BBC} ${BBTK_PACKAGE_NAME}/appli/${name}
       DEPENDS ${bbs}
index 9ed48fde924fbb2912e14575a8827c79e0303521..f140447fdb1fa5781a2a7d1aa12af60f8e065c7c 100644 (file)
@@ -110,8 +110,16 @@ IF(USE_GDCM)
     
     SET(BBTK_GDCM_LIBRARIES
 # TO DO : USE GDCM LINK LIBRARIES !!!
-      libgdcm libgdcmjpeg8 libgdcmjpeg12libgdcmjpeg16
+       gdcm  gdcmjpeg8  gdcmjpeg12  gdcmjpeg16
       )
+
+     IF(USE_VTK )
+         SET(BBTK_GDCM_LIBRARIES
+                  ${BBTK_GDCM_LIBRARIES}
+                   vtkgdcm  
+         )
+     ENDIF(USE_VTK)
+
   ENDIF(GDCM_FOUND)
 ENDIF(USE_GDCM)
 #-----------------------------------------------------------------------------
index 91f174faf371304e20953790f96060825ed8b1ec..435ddb83d4fab9921aca0a597e50c03a7074e13c 100644 (file)
@@ -9,8 +9,8 @@ ENDIF(UNIX)
 IF(WIN32)
   IF(USE_VTK)
 
-    # ????????? Why this line doesn't works ...?????
     IF(${VTK_DIR})
+    # ????????? Why this line doesn't works ...?????
       FILE(GLOB_RECURSE LST_FILE_VTKDLL RELATIVE ${VTK_DIR} *.dll )
       FOREACH( iLST  ${LST_FILE_VTKDLL} )
         message("EED kernel/install/CMakeLists.txt " ${iLST} )
index e6e8780fafe7aebb6e1526caeb98d416fb17206b..c09fab51a243eebb454ba269617f1ab0bcb3c0a7 100644 (file)
@@ -13,6 +13,7 @@ wxTreeMultiEvent::wxTreeMultiEvent(wxEventType InitEventType, wxTreeMultiItem co
 // cloning:
 
 // class identification:
+
 IMPLEMENT_DYNAMIC_CLASS(wxTreeMultiEvent, wxNotifyEvent)
 
 // event types:
index 1c452d7881695e124ffd1901511db7883704b28a..ff3e41aba13c7b43849d110f231eaf482d36b663 100644 (file)
@@ -14,7 +14,7 @@
    optimized for the wxTreeMultiCtrl class.
 */
 
-class WXDLLEXPORT wxTreeMultiEvent : public wxNotifyEvent
+class /*WXDLLEXPORT*/ wxTreeMultiEvent : public wxNotifyEvent
 {
 public:
  ///
index ea62f2385af33900f2fcc87c53b7f9af0121803a..52ceb2c1eb324de6f03115aa74a38e9594f18075 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkVirtualExec.h,v $ $
   Language:  C++
-  Date:      $Date: 2008/04/22 06:59:31 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2008/04/24 12:56:39 $
+  Version:   $Revision: 1.14 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -173,7 +173,7 @@ namespace bbtk
     virtual void Reset() = 0;
     
     /// Sets the level of message for kind
-    virtual void SetMessageLevel(const std::string &kind, int level) = 0,;
+    virtual void SetMessageLevel(const std::string &kind, int level) = 0;
     
     /// Prints help on the messages
     virtual void HelpMessages() = 0;
index d540113c55689fa60afaa314aca8867852737570..172f0260c0c36c397a5cc2b84abc2ff45af802dc 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUICommand.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/03/20 15:27:56 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2008/04/24 12:56:39 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -147,7 +147,7 @@ namespace bbtk
        // std::string command(_T("include "));
        // std::string pathfilename = (const char *)(dialog.GetFilename().mb_str());
        std::string command("include ");
-       command += wx2std(dialog.GetPath());
+       command = command + "\"" + wx2std(dialog.GetPath()) + "\"";
        SendCommand(command);
      }
   }
index 69a17d61087e0392b3cb1091f96c9cec839845ec..f1b347ee8fa172a17cd485398dd370a1f5b4f29a 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:11:28 $
-  Version:   $Revision: 1.9 $
+  Date:      $Date: 2008/04/24 12:56:39 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -52,6 +52,7 @@ namespace bbtk
       ID_Menu_CreatePackage,
       ID_Menu_CreateBlackBox,
       ID_Menu_ShowImageGraph,
+      ID_Menu_ShowHTMLDoc,
       ID_Menu_CreateIndex,
       ID_Button_Run
     };
@@ -83,6 +84,7 @@ namespace bbtk
     menuTools->Append( ID_Menu_CreatePackage, _T("Create &package") );
     menuTools->Append( ID_Menu_CreateBlackBox, _T("Create &blackbox") );
     menuTools->Append( ID_Menu_ShowImageGraph, _T("&Show last image graph") );
+    menuTools->Append( ID_Menu_ShowHTMLDoc, _T("Show &HTML documentation") );
     menuTools->Append( ID_Menu_CreateIndex, _T("&Generate index") );
     
     
@@ -314,13 +316,35 @@ namespace bbtk
 #else
     std::string strappli="gnome-open ";
 #endif
-    std::string strcommand = strappli +default_temp_dir+"/temp_dir/workspace_workspacePrototype.png";
+    std::string strcommand0 = "cd \"" + default_temp_dir+"/temp_dir/" +"\"";
+    std::string strcommand1 = strappli + "workspace_workspacePrototype.png";
+    std::string strcommand = strcommand0 + " && " + strcommand1;
        std::cout << "system: " << strcommand << std::endl;
     system ( strcommand.c_str() );
 
   }
   //================================================================
 
+  //================================================================
+  void WxGUIConsole::OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event))
+  {
+       std::string doc_path            = ConfigurationFile::GetInstance().Get_doc_path();
+
+#if defined(WIN32)
+    std::string strappli="start ";
+#else
+    std::string strappli="gnome-open ";
+#endif
+    std::string strcommand0 = "cd \"" + doc_path+"\"";
+    std::string strcommand1 = strappli + "index.html";
+    std::string strcommand = strcommand0 + " && " + strcommand1;
+       std::cout << "system: " << strcommand << std::endl;
+    system ( strcommand.c_str() );
+
+  }
+  //================================================================
+
+
 
   //================================================================
   void WxGUIConsole::OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event))
@@ -395,14 +419,15 @@ namespace bbtk
    
   //================================================================  
   BEGIN_EVENT_TABLE(WxGUIConsole, wxFrame)
-    EVT_MENU(ID_Menu_Quit, WxGUIConsole::OnMenuQuit)
-    EVT_MENU(ID_Menu_About, WxGUIConsole::OnMenuAbout)
-    EVT_MENU(ID_Menu_EditConfig, WxGUIConsole::OnMenuEditConfig)
-    EVT_MENU(ID_Menu_CreatePackage, WxGUIConsole::OnMenuCreatePackage)
-    EVT_MENU(ID_Menu_CreateBlackBox, WxGUIConsole::OnMenuCreateBlackBox)
-    EVT_MENU(ID_Menu_ShowImageGraph, WxGUIConsole::OnMenuShowImageGraph)
-    EVT_MENU(ID_Menu_CreateIndex, WxGUIConsole::OnMenuCreateIndex)
-    EVT_BUTTON(ID_Button_Run, WxGUIConsole::OnButtonRun )
+    EVT_MENU(ID_Menu_Quit                      , WxGUIConsole::OnMenuQuit)
+    EVT_MENU(ID_Menu_About                     , WxGUIConsole::OnMenuAbout)
+    EVT_MENU(ID_Menu_EditConfig                , WxGUIConsole::OnMenuEditConfig)
+    EVT_MENU(ID_Menu_CreatePackage     , WxGUIConsole::OnMenuCreatePackage)
+    EVT_MENU(ID_Menu_CreateBlackBox    , WxGUIConsole::OnMenuCreateBlackBox)
+    EVT_MENU(ID_Menu_ShowImageGraph    , WxGUIConsole::OnMenuShowImageGraph)
+    EVT_MENU(ID_Menu_ShowHTMLDoc       , WxGUIConsole::OnMenuShowHTMLDoc)
+    EVT_MENU(ID_Menu_CreateIndex       , WxGUIConsole::OnMenuCreateIndex)
+    EVT_BUTTON(ID_Button_Run           , WxGUIConsole::OnButtonRun )
     END_EVENT_TABLE()
   //================================================================
 
index 0efab2be2e81af619d6b2334a21f2dda7bd3be4d..e686d7791fa0989b1f2c3cdd73c4f857e3b59cf2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUIConsole.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:11:28 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/24 12:56:39 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -90,6 +90,7 @@ namespace bbtk
     void OnMenuCreatePackage(wxCommandEvent& WXUNUSED(event));
     void OnMenuCreateBlackBox(wxCommandEvent& WXUNUSED(event));
     void OnMenuShowImageGraph(wxCommandEvent& WXUNUSED(event));
+    void OnMenuShowHTMLDoc(wxCommandEvent& WXUNUSED(event));
     void OnMenuCreateIndex(wxCommandEvent& WXUNUSED(event));
    
 
index 16edeb4ad2ee3277d6f44a0188b9bbebb96a009c..ed28087d03cbc7fa89e8e1f8f60a8be6135caba6 100644 (file)
@@ -3,8 +3,8 @@
 Program:   bbtk
 Module:    $RCSfile: bbtkWxGUIPackageBrowser2.cxx,v $
 Language:  C++
-Date:      $Date: 2008/04/24 10:11:28 $
-Version:   $Revision: 1.7 $
+Date:      $Date: 2008/04/24 12:56:39 $
+Version:   $Revision: 1.8 $
                                                                                 
 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
 l'Image). All rights reserved. See Doc/License.txt or
@@ -231,7 +231,6 @@ namespace bbtk
   {
     const wxPoint& pt = event.m_pointDrag;
 
-    int flags;
     //wxLogMessage( wxT("OnBeginDrag at (%d, %d), item %ld."),
     //          pt.x, pt.y, HitTest(pt, flags) );
   }
index 4f3d99e83ecb167f8bf2755e1862139f31255d3a..a61de17e9a919d1610bd391a42414687c87ca537 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkWxGUITextEditor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/24 10:11:28 $
-  Version:   $Revision: 1.10 $
+  Date:      $Date: 2008/04/24 12:56:40 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -245,7 +245,8 @@ namespace bbtk
                                    | wxNO_BORDER);
     
     sizer->Add(mwxNotebook,1,wxGROW);
-    
+
+
     // BUTTONS
     wxPanel *btnsCtrlPanel = new wxPanel(this,-1);
     wxBoxSizer *btnsSizer  = new wxBoxSizer(wxHORIZONTAL);
@@ -296,6 +297,9 @@ namespace bbtk
     btnsSizer->Add( mwxPosition );
     
     btnsCtrlPanel->SetSizer(btnsSizer);
+    btnsCtrlPanel->SetAutoLayout(true);
+    btnsCtrlPanel->Layout();
+
     sizer->Add ( btnsCtrlPanel, 0, wxLEFT | wxRIGHT | wxBOTTOM  //| wxGROW
                 , 10 );
        
index a44508d23ba013120a7e607c071538db68570a20..a9846c771ec3d3b571dad28e43a3ea7db6ca337a 100644 (file)
@@ -6,17 +6,32 @@
 
 namespace bbtk
 {
+
+       void CleanString_0D(std::string& var)
+       {
+               int i,size=var.length();
+               for (i=1 ; i<size ; i++ )
+               {
+                       if ((var[i-1]==13) && (var[i]==10) )
+                       {
+                               var[i-1]=32;  // space
+                       } //if
+               } // for
+       }
+
   //====================================================================
   inline bool GetTextOrClear(const XMLNode& node, std::string& var)
   {
     if (node.nText()>0) 
       {
        var = node.getText();
+       CleanString_0D(var);
        return true;
       }
     else if (node.nClear()>0) 
       {
        var = node.getClear().lpszValue;
+       CleanString_0D(var);
        return true;
       }
     else 
index 688c104585c23c86d35139ebfed8847e69e0a98d..b246ae9e593ecf2982fd05f21cc24dc16861967b 100644 (file)
@@ -29,12 +29,14 @@ namespace bbstd
   BBTK_BEGIN_DESCRIBE_BLACK_BOX(ASCII,bbtk::AtomicBlackBox);
   BBTK_NAME("ASCII");  
   BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
+
   BBTK_DESCRIPTION("ascii codes sequence to string - string to ascii codes sequence");
   BBTK_CATEGORY("misc");
   BBTK_INPUT(ASCII,In,"Input Ascii code or Ascii character",std::string,"");
   BBTK_INPUT(ASCII,type,"type (default 0) 0=Ascii codes to string, 1=String to ascii codes",int,"");
   BBTK_OUTPUT(ASCII,Out,"Ascii codes sequence or characters sequence",std::string,"");
   BBTK_END_DESCRIBE_BLACK_BOX(ASCII);
+
 }
 // EO namespace bbstd
 
index 12547923efd52ca4830b70e22fd14b3739db02c8..0b090ee47855ec147a28aa97f3c339812ae2e5a3 100644 (file)
@@ -60,6 +60,9 @@ new StringSelect stringselectorFormat
 
 #---------------------------------------------------------------------
 
+new OutputText dirOutput
+  connect dir.Out dirOutput.In
+
 new LayoutLine layoutHor
   set  layoutHor.Orientation H
   connect typeBlackbox.Widget layoutHor.Widget1
@@ -80,16 +83,17 @@ new LayoutLine buttons
 
 new LayoutLine main
     connect windowTitle.Widget main.Widget1
-    connect nameBlackbox.Widget main.Widget2
-    connect namePackage.Widget main.Widget3
-    connect author.Widget main.Widget4
-    connect description.Widget main.Widget5
-    connect layoutHor.Widget main.Widget6
-    connect buttons.Widget main.Widget7
+    connect dirOutput.Widget main.Widget2
+    connect nameBlackbox.Widget main.Widget3
+    connect namePackage.Widget main.Widget4
+    connect author.Widget main.Widget5
+    connect description.Widget main.Widget6
+    connect layoutHor.Widget main.Widget7
+    connect buttons.Widget main.Widget8
     set main.WinTitle "Create new black box"
     set main.WinDialog true
     set main.WinWidth 350 
-    set main.WinHeight 50
+    set main.WinHeight 52
 
 #---------------------------------------------------------------------
 
index 54fecd0e0b2e106a15ce08658a2906321384fbad..51be17ca89e602ab187b05a9380e674c163ac519 100644 (file)
@@ -1,16 +1,21 @@
 description "Creates a new bbtk package file structure on disk (Graphical user interface for the script bbCreatePackage)."
 author "laurent.guigues at creatis.insa-lyon.fr"
-category "bbtk tool"
+category "toolsbbtk"
 
 load wx
 load std 
 
-new OutputText windowTitle
-  set windowTitle.In "Package informations"
 
 new DirectorySelector dir
     set dir.Message "Select the location of your new package"
 
+#-----------------------------------------------------------------------------
+new OutputText dirOutput
+  connect dir.Out dirOutput.In
+
+new OutputText windowTitle
+  set windowTitle.In "Package informations"
+
 new InputText name
     set name.Title "Name         (1 word)"
     set name.In "NEW_PACKAGE"
@@ -38,15 +43,17 @@ new LayoutLine buttons
 
 new LayoutLine main
     connect windowTitle.Widget main.Widget1
-    connect name.Widget main.Widget2
-    connect author.Widget main.Widget3
-    connect description.Widget main.Widget4
-    connect buttons.Widget main.Widget5
+    connect dirOutput.Widget main.Widget2
+    connect name.Widget main.Widget3
+    connect author.Widget main.Widget4
+    connect description.Widget main.Widget5
+    connect buttons.Widget main.Widget6
     set main.WinTitle "Create new black box package"
     set main.WinDialog true
     set main.WinWidth 400 
     set main.WinHeight 250 
 
+#-----------------------------------------------------------------------------
 
 new ASCII ascii
   set ascii.In 34
diff --git a/packages/vtk/bbs/appli/ExampleGaussianSmooth.bbs b/packages/vtk/bbs/appli/ExampleGaussianSmooth.bbs
new file mode 100644 (file)
index 0000000..a31325e
--- /dev/null
@@ -0,0 +1,104 @@
+include std
+include vtk
+include wx
+include itk
+include itkvtk
+include wxvtk
+
+new MetaImageReader reader 
+include  std/boxes/bbPrependPackageDataPath.bbs 
+new PrependPackageDataPath prependDatapath 
+  set prependDatapath.In "vtk/hola.mhd" 
+  connect prependDatapath.Out reader.In 
+
+#---------------------------------------------------------------------
+
+new Slider slider
+
+#---------------------------------------------------------------------
+
+new Viewer2D viewer2DImageOriginal
+  connect reader.Out                   viewer2DImageOriginal.In
+  connect slider.Out                   viewer2DImageOriginal.Slice
+  connect slider.BoxChange     viewer2DImageOriginal.BoxExecute
+    
+#---------------------------------------------------------------------
+
+new BinaryThresholdImageFilter threshold
+  set threshold.LowerThreshold 2000
+  set threshold.UpperThreshold 5000
+  set threshold.InsideValue 255
+  set threshold.OutsideValue 0
+  connect reader.Out threshold.In
+
+new Viewer2D viewer2DImageSegmented
+  connect threshold.Out                viewer2DImageSegmented.In
+  connect slider.Out                   viewer2DImageSegmented.Slice
+  connect slider.BoxChange     viewer2DImageSegmented.BoxExecute
+
+#---------------------------------------------------------------------
+
+new ImageGaussianSmooth smooth
+  connect threshold.Out smooth.In
+  set smooth.StdDevX  1
+  set smooth.StdDevY  1
+  set smooth.StdDevZ  1
+
+new Viewer2D viewer2DImageSmooth
+  connect smooth.Out           viewer2DImageSmooth.In
+  connect slider.Out                   viewer2DImageSmooth.Slice
+  connect slider.BoxChange     viewer2DImageSmooth.BoxExecute
+
+#---------------------------------------------------------------------
+
+new LayoutLine upLayout
+  set upLayout.Orientation H
+  connect viewer2DImageOriginal.Widget                 upLayout.Widget1
+  connect viewer2DImageSegmented.Widget                upLayout.Widget2
+  connect viewer2DImageSmooth.Widget           upLayout.Widget3
+
+
+#---------------------------------------------------------------------
+
+new Viewer3D  viewernvImagethreshold3D
+#  set viewernvImagethreshold3D.nTypeView "5" 
+
+new IsoSurfaceExtractor  isoextractorthreshold
+  connect threshold.Out isoextractorthreshold.In
+  set isoextractorthreshold.Opacity 1
+  set isoextractorthreshold.Isovalue 128
+  connect viewernvImagethreshold3D.Renderer            isoextractorthreshold.Renderer
+
+
+#---------------------------------------------------------------------
+new Viewer3D  viewernvImageSmooth3D
+#  set viewernvImageSmooth3D.nTypeView "5" 
+
+new IsoSurfaceExtractor  isoextractorsmooth
+  connect smooth.Out isoextractorsmooth.In
+  set isoextractorsmooth.Opacity 1
+  set isoextractorsmooth.Isovalue 128
+  connect viewernvImageSmooth3D.Renderer               isoextractorsmooth.Renderer
+
+
+#---------------------------------------------------------------------
+
+new LayoutLine downLayout
+ set downLayout.Orientation H
+  connect viewernvImagethreshold3D.Widget              downLayout.Widget1
+  connect viewernvImageSmooth3D.Widget         downLayout.Widget2
+
+#---------------------------------------------------------------------
+new LayoutSplit splitUp
+  connect slider.Widget                splitUp.Widget1
+  connect upLayout.Widget              splitUp.Widget2
+
+new LayoutSplit mainSplit
+  connect splitUp.Widget               mainSplit.Widget1
+  connect downLayout.Widget    mainSplit.Widget2
+
+#---------------------------------------------------------------------
+
+exec isoextractorthreshold
+exec isoextractorsmooth
+exec mainSplit
index 3e4e55f32979a9f56d9f8abbdb86cbae3de24272..7b23c9af0738fd9b22e19b9339a14a3e872d8455 100644 (file)
@@ -4,8 +4,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkIsoSurfaceExtractor.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2008/04/24 12:56:41 $
+  Version:   $Revision: 1.5 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -55,7 +55,7 @@ namespace bbvtk
 
          bbSetInputIn(NULL);
          //     bbSetInputInVtkObject(NULL);
-         //     bbSetInputRenderer(NULL);
+        bbSetInputRenderer(NULL);
      bbSetInputIsovalue(400);
      bbSetInputOpacity(1);
         
@@ -68,8 +68,6 @@ namespace bbvtk
 
      polydatamapper->ScalarVisibilityOff();
      polydatamapper->ImmediateModeRenderingOn();
-
-
 }
 
 //---------------------------------------------------------------------
@@ -82,11 +80,6 @@ namespace bbvtk
      marchingcubes->SetValue(0,  bbGetInputIsovalue() );
      marchingcubes->Update();
      
-     // if (_2_isoActorMC6!=NULL)
-     //  {
-     //   bbGetInputRenderer()->RemoveActor(vtkactor);
-     //  }
-     
      vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],  bbGetInputColour()[1], bbGetInputColour()[2] );
      
      
@@ -94,13 +87,11 @@ namespace bbvtk
      bbSetOutputOut( vtkactor );
      
      // Interface Update
-     /* 
      if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
-       {
-        firsttime=false;
-        bbGetInputRenderer()->AddActor( vtkactor );
-       }
-     */
+     {
+               firsttime=false;
+           bbGetInputRenderer()->AddActor( vtkactor );
+     }
    }
 } // EO namespace bbtk
 
index 8e34cf209f5cbc1e5ddffa778439835edd6a6a26..77d4fead25f0911a845e87aea1d10def3390a5f9 100644 (file)
@@ -3,8 +3,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbvtkIsoSurfaceExtractor.h,v $
   Language:  C++
-  Date:      $Date: 2008/04/18 12:59:52 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2008/04/24 12:56:41 $
+  Version:   $Revision: 1.6 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -66,7 +66,7 @@ namespace bbvtk
     BBTK_DECLARE_INPUT(Isovalue,double);
     BBTK_DECLARE_INPUT(Opacity,double);
     BBTK_DECLARE_INPUT(Colour,std::vector<double>);
-    //    BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
+       BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
     BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
     
     BBTK_PROCESS(DoProcess);
@@ -86,11 +86,12 @@ namespace bbvtk
   BBTK_CATEGORY("3D object creator");
   BBTK_INPUT(IsoSurfaceExtractor,In,"Input image",vtkImageData*,"");
   //  BBTK_INPUT(IsoSurfaceExtractor,InVtkObject,"Image vtkObject",vtkObject*);
-  BBTK_INPUT(IsoSurfaceExtractor,Isovalue,"Isovalue",double,"");
-  BBTK_INPUT(IsoSurfaceExtractor,Opacity,"Opacity",double,"");
-  BBTK_INPUT(IsoSurfaceExtractor,Colour,"r g b",vectorcolour,"color");
-  //  BBTK_INPUT(IsoSurfaceExtractor,Renderer,"3D scene in which to insert the surface",vtkRenderer*);
-  BBTK_OUTPUT(IsoSurfaceExtractor,Out,"Extracted iso-surface",vtkProp3D *,"");
+
+  BBTK_INPUT(IsoSurfaceExtractor,Isovalue,"Isovalue",double);
+  BBTK_INPUT(IsoSurfaceExtractor,Opacity,"Opacity",double);
+  BBTK_INPUT(IsoSurfaceExtractor,Colour,"r g b",vectorcolour);
+  BBTK_INPUT(IsoSurfaceExtractor,Renderer,"3D scene in which to insert the surface",vtkRenderer*);
+  BBTK_OUTPUT(IsoSurfaceExtractor,Out,"Extracted iso-surface",vtkProp3D *);
   
   BBTK_END_DESCRIBE_BLACK_BOX(IsoSurfaceExtractor);
   
diff --git a/packages/vtk/src/bbvtkSegmentationConnectivity.cxx b/packages/vtk/src/bbvtkSegmentationConnectivity.cxx
new file mode 100644 (file)
index 0000000..ec416f1
--- /dev/null
@@ -0,0 +1,96 @@
+/*=========================================================================
+                                                                                
+  Program:   bbtk
+  Module:    $RCSfile: bbvtkSegmentationConnectivity.cxx,v $
+  Language:  C++
+  Date:      $Date: 2008/04/24 12:56:41 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+/**
+ *  \file 
+ *  \brief 
+ */
+
+
+#ifdef _USE_VTK_
+
+
+#include "bbvtkSegmentationConnectivity.h"
+#include "bbvtkPackage.h"
+
+namespace bbvtk
+{
+
+       BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,SegmentationConnectivity)
+       BBTK_USER_BLACK_BOX_IMPLEMENTATION(SegmentationConnectivity,bbtk::AtomicBlackBox);
+
+
+       void SegmentationConnectivity::bbUserConstructor() 
+   { 
+      bbSetInputIn(NULL);
+         std::vector<int> position;
+         position.push_back(0);
+         position.push_back(0);
+         position.push_back(0);
+         bbSetInputPositionXYZ(position);
+         std::vector<int> threshold;
+         threshold.push_back(0);
+         threshold.push_back(0);
+         bbSetInputThresholdMinMax(threshold);
+         bbSetOutputOut(NULL);
+         thresh2 = vtkImageThreshold::New();
+         thresh2->SetInValue(255);
+         thresh2->SetOutputScalarTypeToUnsignedShort();
+         thresh2->SetOutValue(0);
+         cast2 = vtkImageCast::New();
+         cast2->SetInput(thresh2->GetOutput());
+         cast2->SetOutputScalarTypeToUnsignedChar();
+         connect2 = vtkImageSeedConnectivity::New();
+         connect2->SetInput(cast2->GetOutput());
+         connect2->SetInputConnectValue(255);
+         connect2->SetOutputConnectedValue(255);
+         connect2->SetOutputUnconnectedValue(0);
+         cast4 = vtkImageCast::New();
+         cast4->SetInput(connect2->GetOutput());
+         cast4->SetOutputScalarTypeToUnsignedShort();
+   }
+
+
+  void SegmentationConnectivity::DoProcess()
+  {
+       vtkImageData *imagedata = bbGetInputIn();
+       imagedata->UpdateInformation();
+       imagedata->SetUpdateExtent(imagedata->GetWholeExtent());
+       imagedata->Update();
+       thresh2->ThresholdBetween(3000, 3001);
+       thresh2->SetInput(imagedata);
+       thresh2->ThresholdBetween(bbGetInputThresholdMinMax()[0], bbGetInputThresholdMinMax()[1]);
+       thresh2->Update();
+       cast2->Update();
+       connect2->RemoveAllSeeds ();
+       connect2->AddSeed( bbGetInputPositionXYZ()[0] , bbGetInputPositionXYZ()[1] , bbGetInputPositionXYZ()[2] );
+       connect2->Update();
+       cast4->Update();
+
+    bbSetOutputOut(cast4->GetOutput() );         
+  }
+
+
+}// EO namespace bbvtk
+
+
+#endif //_USE_VTK_
+
+
+
+
+
diff --git a/packages/vtk/src/bbvtkSegmentationConnectivity.h b/packages/vtk/src/bbvtkSegmentationConnectivity.h
new file mode 100644 (file)
index 0000000..78f2356
--- /dev/null
@@ -0,0 +1,88 @@
+
+/*=========================================================================
+                                                                                
+  Program:   bbtk
+  Module:    $RCSfile: bbvtkSegmentationConnectivity.h,v $
+  Language:  C++
+  Date:      $Date: 2008/04/24 12:56:41 $
+  Version:   $Revision: 1.1 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*//**
+ * \brief Short description in one line
+ * 
+ * Long description which 
+ * can span multiple lines
+ */
+/**
+ * \file 
+ * \brief Pattern for the definition of a new type of Node (header)
+ */
+/**
+ * \class bbtk::NodePatern 
+ * \brief Pattern for the definition of a new type of Node 
+ */
+
+
+#ifdef _USE_VTK_
+
+#ifndef __bbvtkSegmentationConnectivity_h_INCLUDED__
+#define __bbvtkSegmentationConnectivity_h_INCLUDED__
+
+#include "bbtkAtomicBlackBox.h"
+#include <vtkImageData.h>
+#include <vtkImageCast.h>
+#include <vtkImageThreshold.h>
+#include <vtkImageSeedConnectivity.h>
+
+namespace bbvtk
+{
+
+  class SegmentationConnectivity
+    : 
+    public bbtk::AtomicBlackBox
+  {
+    BBTK_USER_BLACK_BOX_INTERFACE(SegmentationConnectivity,bbtk::AtomicBlackBox);
+      BBTK_DECLARE_INPUT(In,vtkImageData *);
+      BBTK_DECLARE_INPUT(PositionXYZ,std::vector<int>);
+         BBTK_DECLARE_INPUT(ThresholdMinMax,std::vector<int>);
+      BBTK_DECLARE_OUTPUT(Out,vtkImageData *);
+    BBTK_PROCESS(DoProcess);
+    void DoProcess();
+
+  protected:
+    virtual void bbUserConstructor();
+
+  private:
+       vtkImageCast                            *cast2;
+       vtkImageCast                            *cast4; // binary segmentation result
+       vtkImageThreshold                       *thresh2;
+       vtkImageSeedConnectivity        *connect2;
+
+
+
+  };
+
+  BBTK_BEGIN_DESCRIBE_BLACK_BOX(SegmentationConnectivity,bbtk::AtomicBlackBox);
+  BBTK_NAME("SegmentationConnectivity");
+  BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
+  BBTK_DESCRIPTION("Segmentation with min max threshold and connectivity");
+    BBTK_INPUT(SegmentationConnectivity,In,"Input image",vtkImageData *);
+    BBTK_INPUT(SegmentationConnectivity,PositionXYZ,"vector with the Position [x y z]" , std::vector<int> );
+    BBTK_INPUT(SegmentationConnectivity,ThresholdMinMax,"vector with the Threshold [min max]" , std::vector<int> );
+    BBTK_OUTPUT(SegmentationConnectivity,Out,"Result image",vtkImageData *);
+  BBTK_END_DESCRIBE_BLACK_BOX(SegmentationConnectivity);
+
+} // EO namespace bbvtk
+
+#endif //  __bbvtkSegmentationConnectivity_h_INCLUDED__
+
+
+#endif //_USE_VTK_