/*=========================================================================
Program: bbtk
- Module: $RCSfile: bbvtkSurface.cxx,v $
+ Module: $RCSfile: bbvtkIsoSurfaceExtractor.cxx,v $
Language: C++
- Date: $Date: 2008/03/03 13:33:50 $
+ Date: $Date: 2008/03/03 14:01:49 $
Version: $Revision: 1.1 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
#include "vtkProperty.h"
-#include "bbvtkSurface.h"
+#include "bbvtkIsoSurfaceInserter.h"
#include "bbvtkPackage.h"
namespace bbvtk
{
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Surface)
- BBTK_USER_BLACK_BOX_IMPLEMENTATION(Surface,bbtk::AtomicBlackBox);
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,IsoSurfaceInserter)
+ BBTK_USER_BLACK_BOX_IMPLEMENTATION(IsoSurfaceInserter,bbtk::AtomicBlackBox);
- void Surface::bbUserConstructor()
+ void IsoSurfaceInserter::bbUserConstructor()
{
Init();
std::vector<double> colour;
bbSetInputColour(colour);
}
- void Surface::bbUserCopyConstructor()
+ void IsoSurfaceInserter::bbUserCopyConstructor()
{
Init();
}
- void Surface::Init()
+ void IsoSurfaceInserter::Init()
{
firsttime=true;
//---------------------------------------------------------------------
- void Surface::DoProcess()
+ void IsoSurfaceInserter::DoProcess()
{
// bbGetInputIn()->Print(std::cout);
- // Visualisation - result volume
- marchingcubes->SetInput( bbGetInputIn() );
- marchingcubes->SetValue(0, bbGetInputIsovalue() );
- marchingcubes->Update();
-
- // if (_2_isoActorMC6!=NULL)
- // {
- // bbGetInputRenderer()->RemoveActor(vtkactor);
- // }
-
- vtkactor->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] );
-
-
- vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
- bbSetOutputOut( vtkactor );
-
- // Interface Update
-
- if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
- {
- firsttime=false;
- bbGetInputRenderer()->AddActor( vtkactor );
- }
+ // Visualisation - result volume
+ marchingcubes->SetInput( bbGetInputIn() );
+ marchingcubes->SetValue(0, bbGetInputIsovalue() );
+ marchingcubes->Update();
+
+ // if (_2_isoActorMC6!=NULL)
+ // {
+ // bbGetInputRenderer()->RemoveActor(vtkactor);
+ // }
+
+ vtkactor->GetProperty()->SetColor( bbGetInputColour()[0], bbGetInputColour()[1], bbGetInputColour()[2] );
+
+
+ vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
+ bbSetOutputOut( vtkactor );
+
+ // Interface Update
+
+ if ((firsttime==true) && (bbGetInputRenderer()!=NULL ))
+ {
+ firsttime=false;
+ bbGetInputRenderer()->AddActor( vtkactor );
+ }
}
} // EO namespace bbtk
--- /dev/null
+/*=========================================================================
+
+ Program: bbtk
+ Module: $RCSfile: bbvtkIsoSurfaceExtractor.h,v $
+ Language: C++
+ Date: $Date: 2008/03/03 14:01:49 $
+ 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 __vtkIsoSurfaceInserter_h__
+#define __vtkIsoSurfaceInserter_h__
+
+#include "vtkImageData.h"
+#include "vtkRenderer.h"
+#include "vtkMarchingCubes.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkProp3D.h"
+#include "vtkActor.h"
+#include <vector>
+
+#include "bbtkAtomicBlackBox.h"
+
+namespace bbvtk
+{
+
+ class /*BBTK_EXPORT*/ IsoSurfaceInserter
+ :
+ public bbtk::AtomicBlackBox
+ {
+ bool firsttime;
+ vtkMarchingCubes *marchingcubes;
+ vtkPolyDataMapper *polydatamapper;
+ vtkActor *vtkactor;
+
+
+ BBTK_USER_BLACK_BOX_INTERFACE(IsoSurfaceInserter,bbtk::AtomicBlackBox);
+
+ BBTK_DECLARE_INPUT(In,vtkImageData *);
+ BBTK_DECLARE_INPUT(InVtkObject,vtkObject *);
+ BBTK_DECLARE_INPUT(Isovalue,double);
+ BBTK_DECLARE_INPUT(Opacity,double);
+ BBTK_DECLARE_INPUT(Colour,std::vector<double>);
+ BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
+ BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
+
+ BBTK_PROCESS(DoProcess);
+ void DoProcess();
+
+ protected:
+ virtual void bbUserConstructor();
+ virtual void bbUserCopyConstructor();
+ void Init();
+ };
+
+ BBTK_BEGIN_DESCRIBE_BLACK_BOX(IsoSurfaceInserter,bbtk::AtomicBlackBox);
+ BBTK_NAME("IsoSurfaceInserter");
+ BBTK_AUTHOR("eduardo.davila / laurent.guigues at creatis.insa-lyon.fr");
+ BBTK_DESCRIPTION("Extracts an iso-surface of a 3D image and insert it into a 3D scene (vtkRenderer)");
+ typedef std::vector<double> vectorcolour;
+ BBTK_INPUT(IsoSurfaceInserter,In,"Input image",vtkImageData*);
+ BBTK_INPUT(IsoSurfaceInserter,InVtkObject,"Image vtkObject",vtkObject*);
+ BBTK_INPUT(IsoSurfaceInserter,Isovalue,"Isovalue",double);
+ BBTK_INPUT(IsoSurfaceInserter,Opacity,"Opacity",double);
+ BBTK_INPUT(IsoSurfaceInserter,Colour,"r g b",vectorcolour);
+ BBTK_INPUT(IsoSurfaceInserter,Renderer,"3D scene in which to insert the surface",vtkRenderer*);
+ BBTK_OUTPUT(IsoSurfaceInserter,Out,"Image",vtkProp3D *);
+
+ BBTK_END_DESCRIBE_BLACK_BOX(IsoSurfaceInserter);
+
+}// EO namespace bbtk
+
+
+#endif //__IsoSurfaceInserter_h__
+
+#endif //_USE_VTK_
+
+++ /dev/null
-/*=========================================================================
-
- Program: bbtk
- Module: $RCSfile: bbvtkSurface.h,v $
- Language: C++
- Date: $Date: 2008/03/03 13:33:50 $
- 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 __vtkSurface_h__
-#define __vtkSurface_h__
-
-#include "vtkImageData.h"
-#include "vtkRenderer.h"
-#include "vtkMarchingCubes.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProp3D.h"
-#include "vtkActor.h"
-#include <vector>
-
-#include "bbtkAtomicBlackBox.h"
-
-namespace bbvtk
-{
-
- class /*BBTK_EXPORT*/ Surface
- :
- public bbtk::AtomicBlackBox
- {
- bool firsttime;
- vtkMarchingCubes *marchingcubes;
- vtkPolyDataMapper *polydatamapper;
- vtkActor *vtkactor;
-
-
- BBTK_USER_BLACK_BOX_INTERFACE(Surface,bbtk::AtomicBlackBox);
-
- BBTK_DECLARE_INPUT(In,vtkImageData *);
- BBTK_DECLARE_INPUT(InVtkObject,vtkObject *);
- BBTK_DECLARE_INPUT(Isovalue,double);
- BBTK_DECLARE_INPUT(Opacity,double);
- BBTK_DECLARE_INPUT(Colour,std::vector<double>);
- BBTK_DECLARE_INPUT(Renderer,vtkRenderer *);
- BBTK_DECLARE_OUTPUT(Out,vtkProp3D *);
-
- BBTK_PROCESS(DoProcess);
- void DoProcess();
-
- protected:
- virtual void bbUserConstructor();
- virtual void bbUserCopyConstructor();
- void Init();
-};
-
- BBTK_BEGIN_DESCRIBE_BLACK_BOX(Surface,bbtk::AtomicBlackBox);
- BBTK_NAME("Surface");
- BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
- BBTK_DESCRIPTION("Construction of a vtkActor and add it to the 3D window");
- typedef std::vector<double> vectorcolour;
- BBTK_INPUT(Surface,In,"Image",vtkImageData*);
- BBTK_INPUT(Surface,InVtkObject,"Image vtkObject",vtkObject*);
- BBTK_INPUT(Surface,Isovalue,"Isovalue",double);
- BBTK_INPUT(Surface,Opacity,"Opacity",double);
- BBTK_INPUT(Surface,Colour,"r g b",vectorcolour);
- BBTK_INPUT(Surface,Renderer,"3D window to add the actor (VTK)",vtkRenderer*);
- BBTK_OUTPUT(Surface,Out,"Image",vtkProp3D *);
-
- BBTK_END_DESCRIBE_BLACK_BOX(Surface);
-
-}// EO namespace bbtk
-
-
-#endif //__Surface_h__
-
-#endif //_USE_VTK_
-
+description "Example of IsoSurfaceWithControls."
+author "laurent.guigues at creatis.insa-lyon.fr"
+category "example"
+
include wxvtk/boxes/bbIsoSurfaceWithControls
include vtk/boxes/bbLoadHola
define IsoSurfaceWithControls
author "laurent.guigues@creatis.insa-lyon.fr"
- description "Image iso-surface extractor with associated control panel (isovalue, opacity and colour)"
+ description "Image iso-surface extractor (vtk::IsoSurfaceExtractor) with associated control panel (isovalue, opacity and colour)"
category "image;mesh;widget;viewer"
new LayoutLine controls
new LayoutLine sliders
- new Surface surface
+ new IsoSurfaceExtractor surface
new Slider isovalue
new Slider opacity
-# new CommandButton colourButton
new LayoutLine colourFrame
new ColourSelectorButton colour
new MultipleInputs refresh
connect colourFrame.Widget controls.Widget2
connect colour.Widget colourFrame.Widget1
-#Button.Widget
connect isovalue.Widget sliders.Widget1
connect opacity.Widget sliders.Widget2
# connect colourButton.BoxChange colour.BoxExecute
set colourFrame.WinTitle "Colour"
- set controls.Orientation 0
+ set controls.Orientation HORIZONTAL
set isovalue.Title "Isovalue"
set opacity.Title "Opacity"
set opacity.Min 0