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)
+# 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}
+)
+
--- /dev/null
+
+rem bbc.bat ... To do it !!!
\ No newline at end of file
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")) );
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})
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}
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)
#-----------------------------------------------------------------------------
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} )
// cloning:
// class identification:
+
IMPLEMENT_DYNAMIC_CLASS(wxTreeMultiEvent, wxNotifyEvent)
// event types:
optimized for the wxTreeMultiCtrl class.
*/
-class WXDLLEXPORT wxTreeMultiEvent : public wxNotifyEvent
+class /*WXDLLEXPORT*/ wxTreeMultiEvent : public wxNotifyEvent
{
public:
///
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
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;
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
// 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);
}
}
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
ID_Menu_CreatePackage,
ID_Menu_CreateBlackBox,
ID_Menu_ShowImageGraph,
+ ID_Menu_ShowHTMLDoc,
ID_Menu_CreateIndex,
ID_Button_Run
};
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") );
#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))
//================================================================
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()
//================================================================
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
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));
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
{
const wxPoint& pt = event.m_pointDrag;
- int flags;
//wxLogMessage( wxT("OnBeginDrag at (%d, %d), item %ld."),
// pt.x, pt.y, HitTest(pt, flags) );
}
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
| wxNO_BORDER);
sizer->Add(mwxNotebook,1,wxGROW);
-
+
+
// BUTTONS
wxPanel *btnsCtrlPanel = new wxPanel(this,-1);
wxBoxSizer *btnsSizer = new wxBoxSizer(wxHORIZONTAL);
btnsSizer->Add( mwxPosition );
btnsCtrlPanel->SetSizer(btnsSizer);
+ btnsCtrlPanel->SetAutoLayout(true);
+ btnsCtrlPanel->Layout();
+
sizer->Add ( btnsCtrlPanel, 0, wxLEFT | wxRIGHT | wxBOTTOM //| wxGROW
, 10 );
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
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
#---------------------------------------------------------------------
+new OutputText dirOutput
+ connect dir.Out dirOutput.In
+
new LayoutLine layoutHor
set layoutHor.Orientation H
connect typeBlackbox.Widget layoutHor.Widget1
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 500
+ set main.WinHeight 520
#---------------------------------------------------------------------
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"
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
--- /dev/null
+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
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
bbSetInputIn(NULL);
// bbSetInputInVtkObject(NULL);
- // bbSetInputRenderer(NULL);
+ bbSetInputRenderer(NULL);
bbSetInputIsovalue(400);
bbSetInputOpacity(1);
polydatamapper->ScalarVisibilityOff();
polydatamapper->ImmediateModeRenderingOn();
-
-
}
//---------------------------------------------------------------------
marchingcubes->SetValue(0, bbGetInputIsovalue() );
marchingcubes->Update();
- // if (_2_isoActorMC6!=NULL)
- // {
- // bbGetInputRenderer()->RemoveActor(vtkactor);
- // }
-
vtkactor->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] );
bbSetOutputOut( vtkactor );
// Interface Update
- /*
if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
- {
- firsttime=false;
- bbGetInputRenderer()->AddActor( vtkactor );
- }
- */
+ {
+ firsttime=false;
+ bbGetInputRenderer()->AddActor( vtkactor );
+ }
}
} // EO namespace bbtk
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
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);
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);
--- /dev/null
+/*=========================================================================
+
+ 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_
+
+
+
+
+
--- /dev/null
+
+/*=========================================================================
+
+ 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_