From: Esteban Correa Date: Tue, 16 Apr 2013 13:15:22 +0000 (-0400) Subject: Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/bbtk X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=285ee5f1317074a4daec697ce27c9c53fdbf0793;hp=837b3ed9344947560cc322c78bddb74b755683b4;p=bbtk.git Merge branch 'master' of ssh://git.creatis.insa-lyon.fr/bbtk Conflicts: packages/itk/src/bbitkImageProperties.h --- diff --git a/packages/itk/src/bbitkImageProperties.cxx b/packages/itk/src/bbitkImageProperties.cxx index 2304ba8..7e5f47d 100644 --- a/packages/itk/src/bbitkImageProperties.cxx +++ b/packages/itk/src/bbitkImageProperties.cxx @@ -117,9 +117,9 @@ namespace bbitk bbSetOutputOrigin(vog); typename itkImageType::SpacingType sp = im->GetSpacing(); - std::vector vsp; + std::vector vsp; for (unsigned int i=0;i); BBTK_DECLARE_OUTPUT(Size,std::vector); BBTK_DECLARE_OUTPUT(Origin,std::vector); - BBTK_DECLARE_OUTPUT(Spacing,std::vector); + BBTK_DECLARE_OUTPUT(Spacing,std::vector); + BBTK_DECLARE_OUTPUT(MinMax,std::vector); BBTK_PROCESS(DoIt); void DoIt(); @@ -95,7 +96,7 @@ namespace bbitk BBTK_OUTPUT(ImageProperties,Index,"Index of the image",std::vector,"image index"); BBTK_OUTPUT(ImageProperties,Size,"Size in each dimension",std::vector,"image size"); BBTK_OUTPUT(ImageProperties,Origin,"Origin of the image",std::vector,"image origin"); - BBTK_OUTPUT(ImageProperties,Spacing,"Size of the voxels",std::vector,"voxel size"); + BBTK_OUTPUT(ImageProperties,Spacing,"Size of the voxels",std::vector,"voxel size"); BBTK_OUTPUT(ImageProperties,MinMax,"Minimum and the maximum intensity values of an image",std::vector,""); BBTK_END_DESCRIBE_BLACK_BOX(ImageProperties); //================================================================= diff --git a/packages/itk/src/bbitkImageStatistics.cxx b/packages/itk/src/bbitkImageStatistics.cxx new file mode 100644 index 0000000..3ed5384 --- /dev/null +++ b/packages/itk/src/bbitkImageStatistics.cxx @@ -0,0 +1,95 @@ + +/* + # --------------------------------------------------------------------- + # + # 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: bbitkImageStatistics.h,v $ + Language: C++ + Date: $Date: 2013/03/27 $ + Version: $Revision: 1.0 $ + Modified by: Ricardo A Corredor (RaC) +=========================================================================*/ + + +/** + * \file + * \brief class ITKImageStatistics : generic ITKImage statistics + */ +/** + * \class bbtk::ITKImageStatistics + * \brief Generic ITKImage statictis + */ + +#ifdef _USE_ITK_ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbitkImageStatistics.h" +#include "bbitkPackage.h" +namespace bbitk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(itk,ImageStatistics) +BBTK_BLACK_BOX_IMPLEMENTATION(ImageStatistics,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageStatistics::bbUserSetDefaultValues() +{ + bbSetOutputMin(0); + bbSetOutputMax(0); + bbSetOutputMean(0); + bbSetOutputStdDev(0); + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageStatistics::bbUserInitializeProcessing() +{ + + + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void ImageStatistics::bbUserFinalizeProcessing() +{ + +} +} +// EO namespace bbitk +#endif + diff --git a/packages/itk/src/bbitkImageStatistics.h b/packages/itk/src/bbitkImageStatistics.h new file mode 100644 index 0000000..9fa0049 --- /dev/null +++ b/packages/itk/src/bbitkImageStatistics.h @@ -0,0 +1,147 @@ +/* + # --------------------------------------------------------------------- + # + # 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: bbitkImageStatistics.h,v $ + Language: C++ + Date: $Date: 2013/03/27 $ + Version: $Revision: 1.0 $ + Modified by: Ricardo A Corredor (RaC) +=========================================================================*/ + + +/** + * \file + * \brief class ITKImageStatistics : generic ITKImage statistics + */ +/** + * \class bbtk::ITKImageStatistics + * \brief Generic ITKImage statictis + */ + +#ifdef _USE_ITK_ +//===== +// 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) +//===== +#ifndef __bbitkImageStatistics_h_INCLUDED__ +#define __bbitkImageStatistics_h_INCLUDED__ +//#include "bbitk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" + +#include "iostream" + +#include "bbitkImage.h" + +#include + + +namespace bbitk +{ + +class /*bbitk_EXPORT*/ ImageStatistics + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(ImageStatistics,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,bbitk::anyImagePointer); + BBTK_DECLARE_OUTPUT(Min,double); + BBTK_DECLARE_OUTPUT(Max,double); + BBTK_DECLARE_OUTPUT(Mean,double); + BBTK_DECLARE_OUTPUT(StdDev,double); + BBTK_PROCESS(Process); +private: + inline void Process(); + template void ProcessTemplated(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageStatistics,bbtk::AtomicBlackBox); +BBTK_NAME("ImageStatistics"); +BBTK_AUTHOR("Ricardo A Corredor"); +BBTK_DESCRIPTION("Basic Image Statistics (minimim, maximum, mean, standard deviation)"); +BBTK_CATEGORY(""); +BBTK_INPUT(ImageStatistics,In,"Input image. Can be any itk::Image*",bbitk::anyImagePointer,""); +BBTK_OUTPUT(ImageStatistics,Min,"Image minimum",double,""); +BBTK_OUTPUT(ImageStatistics,Max,"Image maximum",double,""); +BBTK_OUTPUT(ImageStatistics,Mean,"Image mean",double,""); +BBTK_OUTPUT(ImageStatistics,StdDev,"Image standard deviation",double,""); +BBTK_END_DESCRIBE_BLACK_BOX(ImageStatistics); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + + +//=================================================== +void ImageStatistics::Process() +{ + bbtk::TypeInfo t = bbGetInputIn().type(); + BBTK_TEMPLATE_ITK_IMAGE_SWITCH(t, this->ProcessTemplated); +} +//=================================================== + + +//=================================================== +template +void ImageStatistics::ProcessTemplated() +{ + bbtkDebugMessageInc("Core",9,"bbitk::ImageStatistics::Process<"<()<<">()"< StatisticsImageFilterType; + typename StatisticsImageFilterType::Pointer statisticsImageFilter = StatisticsImageFilterType::New (); + + // Input + ImageType* in = this->bbGetInputIn().get(); + + statisticsImageFilter->SetInput(in); + statisticsImageFilter->Update(); + + std::cout << "Mean: " << statisticsImageFilter->GetMean() << std::endl; + std::cout << "Std.: " << statisticsImageFilter->GetSigma() << std::endl; + std::cout << "Min: " << statisticsImageFilter->GetMinimum() << std::endl; + std::cout << "Max: " << statisticsImageFilter->GetMaximum() << std::endl; + + bbSetOutputMin((double)statisticsImageFilter->GetMinimum()); + bbSetOutputMax((double)statisticsImageFilter->GetMaximum()); + bbSetOutputMean((double)statisticsImageFilter->GetMean()); + bbSetOutputStdDev((double)statisticsImageFilter->GetSigma()); + + bbtkDebugDecTab("Core",9); +} +//=================================================== + +} +// EO namespace bbitk + +#endif // __bbitkImageStatistics_h_INCLUDED__ + +#endif // _USE_ITK_ diff --git a/packages/std/src/bbstdDoubleToInt.cxx b/packages/std/src/bbstdDoubleToInt.cxx new file mode 100644 index 0000000..6c41981 --- /dev/null +++ b/packages/std/src/bbstdDoubleToInt.cxx @@ -0,0 +1,70 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbstdDoubleToInt.h" +#include "bbstdPackage.h" +namespace bbstd +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,DoubleToInt) +BBTK_BLACK_BOX_IMPLEMENTATION(DoubleToInt,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void DoubleToInt::Process() +{ + +// THE MAIN PROCESSING METHOD BODY +// Here we simply set the input 'In' value to the output 'Out' +// And print out the output value +// INPUT/OUTPUT ACCESSORS ARE OF THE FORM : +// void bbSet{Input|Output}NAME(const TYPE&) +// const TYPE& bbGet{Input|Output}NAME() const +// Where : +// * NAME is the name of the input/output +// (the one provided in the attribute 'name' of the tag 'input') +// * TYPE is the C++ type of the input/output +// (the one provided in the attribute 'type' of the tag 'input') + bbSetOutputOut( (int)bbGetInputIn() ); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void DoubleToInt::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(0); + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void DoubleToInt::bbUserInitializeProcessing() +{ + +// THE INITIALIZATION METHOD BODY : +// Here does nothing +// but this is where you should allocate the internal/output pointers +// if any + + +} +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void DoubleToInt::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbstd + + diff --git a/packages/std/src/bbstdDoubleToInt.h b/packages/std/src/bbstdDoubleToInt.h new file mode 100644 index 0000000..83df9df --- /dev/null +++ b/packages/std/src/bbstdDoubleToInt.h @@ -0,0 +1,45 @@ +//===== +// 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) +//===== +#ifndef __bbstdDoubleToInt_h_INCLUDED__ +#define __bbstdDoubleToInt_h_INCLUDED__ +#include "bbstd_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +namespace bbstd +{ + +class bbstd_EXPORT DoubleToInt + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(DoubleToInt,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(In,double); + BBTK_DECLARE_OUTPUT(Out,int); + BBTK_PROCESS(Process); + void Process(); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(DoubleToInt,bbtk::AtomicBlackBox); +BBTK_NAME("DoubleToInt"); +BBTK_AUTHOR("Claire Mouton"); +BBTK_DESCRIPTION("Converts a double to an int"); +BBTK_CATEGORY(""); +BBTK_INPUT(DoubleToInt,In,"Double input",double,""); +BBTK_OUTPUT(DoubleToInt,Out,"Int output",int,""); +BBTK_END_DESCRIBE_BLACK_BOX(DoubleToInt); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbstd + +#endif // __bbstdDoubleToInt_h_INCLUDED__ + diff --git a/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbg b/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbg new file mode 100644 index 0000000..1bb0f12 --- /dev/null +++ b/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbg @@ -0,0 +1,51 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +vtk:SphereSource:Box00 +ISEXEC:FALSE +-100.995049:79.554760:-900.000000 +-55.420049:69.554760:-900.000000 +FIN_BOX +BOX +vtk:PlaneClipPolyData:Box01 +ISEXEC:FALSE +-100.543675:49.764041:-900.000000 +-54.968675:39.764041:-900.000000 +PORT +PlaneNormal:"0 1 0" +PORT +PlaneOrigin:"0 0 0 " +FIN_BOX +BOX +vtk:PolyDataToActor:Box02 +ISEXEC:FALSE +-97.835428:23.810006:-900.000000 +-52.260428:13.810006:-900.000000 +FIN_BOX +BOX +wxvtk:Viewer3D:Box03 +ISEXEC:TRUE +-96.029930:-5.755025:-900.000000 +-35.389930:-15.755025:-900.000000 +FIN_BOX +CONNECTIONS:3 +CONNECTION +Box00:Out:Box01:PolyData +NumberOfControlPoints:0 +CONNECTION +Box01:ClippedPolyData:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box02:Out:Box03:In1 +NumberOfControlPoints:0 +APP_END diff --git a/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbs b/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbs new file mode 100644 index 0000000..a5bba25 --- /dev/null +++ b/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbs @@ -0,0 +1,38 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/corredor/Software/CreaTools/All_Dec2012/creatools_source/bbtk/packages/vtk/bbs/appli/examplePlaneClipPolyData.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include wxvtk + +author "Author ??" +description "Description ??" +category "" + +new SphereSource Box00 + +new PlaneClipPolyData Box01 + set Box01.PlaneNormal "0 1 0" + set Box01.PlaneOrigin "0 0 0 " + +new PolyDataToActor Box02 + +new Viewer3D Box03 + + +connect Box00.Out Box01.PolyData + +connect Box01.ClippedPolyData Box02.In + +connect Box02.Out Box03.In1 + + + +# Complex input ports +exec Box03 diff --git a/packages/vtk/src/bbvtkPlaneClipPolyData.cxx b/packages/vtk/src/bbvtkPlaneClipPolyData.cxx new file mode 100644 index 0000000..e3432ee --- /dev/null +++ b/packages/vtk/src/bbvtkPlaneClipPolyData.cxx @@ -0,0 +1,65 @@ +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +#include "bbvtkPlaneClipPolyData.h" +#include "bbvtkPackage.h" +namespace bbvtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,PlaneClipPolyData) +BBTK_BLACK_BOX_IMPLEMENTATION(PlaneClipPolyData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +void PlaneClipPolyData::Process() +{ + + //std::cout << "RaC PlaneClipPolyData::Process START"<< std::endl; + + std::vector origin = bbGetInputPlaneOrigin(); + std::vector normal = bbGetInputPlaneNormal(); + + vtkPolyData* inPolyData = bbGetInputPolyData(); + + vtkPlane* plane = vtkPlane::New(); + plane->SetOrigin(origin[0],origin[1],origin[2]); + plane->SetNormal(normal[0],normal[1],normal[2]); + + vtkClipPolyData* clipper = vtkClipPolyData::New(); + clipper->SetInputConnection(inPolyData->GetProducerPort()); + clipper->SetClipFunction(plane); + clipper->Update(); + + vtkPolyData* outPolydata = clipper->GetOutput(); + bbSetOutputClippedPolyData(outPolydata); + + // std::cout << "RaC PlaneClipPolyData::Process END "< +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace bbvtk +{ + +class bbvtk_EXPORT PlaneClipPolyData + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(PlaneClipPolyData,bbtk::AtomicBlackBox); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== + BBTK_DECLARE_INPUT(PlaneOrigin,std::vector); + BBTK_DECLARE_INPUT(PlaneNormal,std::vector); + BBTK_DECLARE_INPUT(PolyData,vtkPolyData*); + BBTK_DECLARE_OUTPUT(ClippedPolyData,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + + +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +}; + +BBTK_BEGIN_DESCRIBE_BLACK_BOX(PlaneClipPolyData,bbtk::AtomicBlackBox); +BBTK_NAME("PlaneClipPolyData"); +BBTK_AUTHOR("Ricardo A Corredor"); +BBTK_DESCRIPTION("Clips a polydata with a plane determined by the origin and normal given"); +BBTK_CATEGORY(""); +BBTK_INPUT(PlaneClipPolyData,PlaneOrigin,"Cutting plane origin",std::vector,""); +BBTK_INPUT(PlaneClipPolyData,PlaneNormal,"Cutting plane normal",std::vector,""); +BBTK_INPUT(PlaneClipPolyData,PolyData,"PolyData to be clipped",vtkPolyData*,""); +BBTK_OUTPUT(PlaneClipPolyData,ClippedPolyData,"New PolyData clipped",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(PlaneClipPolyData); +//===== +// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) +//===== +} +// EO namespace bbvtk + +#endif // __bbvtkPlaneClipPolyData_h_INCLUDED__ + diff --git a/packages/wxvtk/src/bbwxvtkViewer3D.cxx b/packages/wxvtk/src/bbwxvtkViewer3D.cxx index 2072894..1d5fd58 100644 --- a/packages/wxvtk/src/bbwxvtkViewer3D.cxx +++ b/packages/wxvtk/src/bbwxvtkViewer3D.cxx @@ -184,6 +184,11 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect ) bbSetOutputRenderer( NULL ); bbSetOutputInteractor( NULL ); bbSetOutputWidget(NULL); + std::vector bckgrndColor(3); + bckgrndColor[0] = 0.1; + bckgrndColor[1] = 0.1; + bckgrndColor[2] = 0.2; + bbSetInputBackgroundColor(bckgrndColor); } //----------------------------------------------------------------- @@ -247,7 +252,7 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect ) // Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget(); // if (w) w->Update(); - + Viewer3DWidget* w = (Viewer3DWidget*)bbGetOutputWidget(); if ((firsttime==true) && (w!=NULL)){ @@ -288,6 +293,8 @@ void Viewer3DWidget::Refresh(bool eraseBackground , const wxRect* rect ) vtkRenderer *renderer = w->GetRenderer(); if (renderer!=NULL) { + std::vector bckgrndColor = bbGetInputBackgroundColor(); + renderer->SetBackground(bckgrndColor[0], bckgrndColor[1], bckgrndColor[2]); bbSetOutputRenderer( renderer ); /*if (bbGetInputIn1()!=NULL) {renderer->AddActor( bbGetInputIn1() ); } diff --git a/packages/wxvtk/src/bbwxvtkViewer3D.h b/packages/wxvtk/src/bbwxvtkViewer3D.h index b3fb40f..25dc712 100644 --- a/packages/wxvtk/src/bbwxvtkViewer3D.h +++ b/packages/wxvtk/src/bbwxvtkViewer3D.h @@ -107,6 +107,7 @@ namespace bbwxvtk BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *); BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *); BBTK_DECLARE_INPUT(Stereo, bool); + BBTK_DECLARE_INPUT(BackgroundColor,std::vector); BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*); BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*); BBTK_PROCESS(Process); @@ -130,6 +131,7 @@ namespace bbwxvtk BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr"); BBTK_DESCRIPTION("3D Viewer widget (vtk)"); BBTK_CATEGORY("viewer"); + BBTK_INPUT(Viewer3D,BackgroundColor,"Render background's color",std::vector,""); BBTK_INPUT(Viewer3D,In1,"Input actor",vtkProp3D *,""); BBTK_INPUT(Viewer3D,In2,"Input actor",vtkProp3D *,""); BBTK_INPUT(Viewer3D,In3,"Input actor",vtkProp3D *,"");