set colourSmooth.In "1 1 0"
connect colourSmooth.Widget buttonLayout.Widget2
-
/*
new CommandButton refresh
set refresh.Label "Refresh (to be used once at start time)"
description " ? ? ? "
-author "???creatis.insa-lyon.fr"
+author "davila at creatis.insa-lyon.fr"
category "demo"
+// See also examplePlane3Pts.bbs
+
include vtk/boxes/bbLoadHola
load vtk
load wxvtk
load std
load wx
-//new LoadHola image
+new LoadHola image
+/*
new FileSelector openFileDialog
set openFileDialog.Wildcard "(*.mhd)|*.mhd"
new MetaImageReader image
connect openFileDialog.Out image.In
-
+*/
+
new ImagePlanes planes
connect image.Out planes.In
new LayoutSplit mainSplit
set mainSplit.Orientation H
-set mainSplit.Proportion 10
+set mainSplit.Proportion 30
connect layoutline0.Widget mainSplit.Widget1
connect layoutline1.Widget mainSplit.Widget2
connect upleft.Widget main.Widget2
connect downleft.Widget main.Widget3
-# Here loads hola.mhd
-# -------------------
+# Here loads 'hola.mhd'
+# ---------------------
+
# Don't forget to comment out the following 2 lines
# If you want to check someting else.
Program: bbtk
Module: $RCSfile: bbitkImageProperties.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2010/04/08 14:37:58 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
template<class ImageType> void DoIt();
};
//=================================================================
-
//=================================================================
// BlackBox description
BBTK_OUTPUT(ImageProperties,Spacing,"Size of the voxels",std::vector<float>,"voxel size");
BBTK_END_DESCRIBE_BLACK_BOX(ImageProperties);
//=================================================================
-
}
//namespace bbitk
Program: bbtk
Module: $RCSfile: bbitkImageReader.cxx,v $
Language: C++
- Date: $Date: 2009/06/24 08:08:57 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2010/04/08 14:37:58 $
+ Version: $Revision: 1.8 $
=========================================================================*/
/* ---------------------------------------------------------------------
}
-
/**
Template Processing
*/
bbtkDebugDecTab("Core",9);
}
-
-
-
-
-
}
// eo namespace bbtk
Program: bbtk
Module: $RCSfile: bbitkImageReader.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:21 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2010/04/08 14:37:58 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
bbtk::AtomicBlackBox);
BBTK_DECLARE_INPUT(In,std::string);
- BBTK_DECLARE_OUTPUT(Out,anyImagePointer);
+ BBTK_DECLARE_OUTPUT(Out, anyImagePointer);
BBTK_PROCESS(Read);
void Read();
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageReader,bbtk::AtomicBlackBox);
BBTK_NAME("ImageReader");
BBTK_AUTHOR("laurent.guigues at creatis.insa-lyon.fr");
- BBTK_CATEGORY("image;read/write");
+ BBTK_CATEGORY("image; read/write");
BBTK_DESCRIPTION("Generic itk image reader");
- BBTK_INPUT(ImageReader,In,
- "filename with complete path",std::string,"file name");
- BBTK_OUTPUT(ImageReader,Out,"Output image",anyImagePointer,"");
+ BBTK_INPUT(ImageReader, In,
+ "filename with complete path", std::string,"file name");
+ BBTK_OUTPUT(ImageReader, Out, "Output image" ,anyImagePointer,"");
BBTK_END_DESCRIBE_BLACK_BOX(ImageReader);
//=================================================================
Program: bbtk
Module: $RCSfile: bbvtkMIPCreator.cxx,v $
Language: C++
- Date: $Date: 2009/05/15 14:58:01 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2010/04/08 14:37:59 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
* \brief
*/
-
-
#ifdef _USE_VTK_
-
#include "bbvtkMIPCreator.h"
#include "bbvtkPackage.h"
namespace bbvtk
{
-
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,MIPCreator)
BBTK_BLACK_BOX_IMPLEMENTATION(MIPCreator,bbtk::AtomicBlackBox);
-
-
-
-
-
+
//---------------------------------------------------------------------
void MIPCreator::bbUserSetDefaultValues()
{
mMapper = NULL;
mVolume = NULL;
}
-
//---------------------------------------------------------------------
void MIPCreator::bbUserInitializeProcessing()
- {
-
+ {
// Create the pipeline
mCast = vtkImageShiftScale::New();
mCast->SetOutputScalarTypeToUnsignedChar();
mVolume->SetMapper(mMapper);
// mMapper->ScalarVisibilityOff();
- // mMapper->ImmediateModeRenderingOn();
+ // mMapper->ImmediateModeRenderingOn();
bbSetOutputOut(mVolume);
}
- //---------------------------------------------------------------------
+//---------------------------------------------------------------------
void MIPCreator::bbUserFinalizeProcessing()
{
if (mCast!=NULL)
mVolume->Delete();
mVolume=NULL;
}
-
-
}
//---------------------------------------------------------------------
Program: bbtk
Module: $RCSfile: bbvtkMIPCreator.h,v $
Language: C++
- Date: $Date: 2009/05/15 14:58:01 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2010/04/08 14:37:59 $
+ Version: $Revision: 1.9 $
=========================================================================*/
/* ---------------------------------------------------------------------
* knowledge of the CeCILL-B license and that you accept its terms.
* ------------------------------------------------------------------------ */
-
/**
* \brief Short description in one line
*
* \brief Pattern for the definition of a new type of Node
*/
-
#ifdef _USE_VTK_
-
#ifndef __bbvtkMIPCreator_h_INCLUDED__
#define __bbvtkMIPCreator_h_INCLUDED__
-
#include "bbtkAtomicBlackBox.h"
#include "vtkImageData.h"
namespace bbvtk
{
-
-
-
class bbvtk_EXPORT MIPCreator : public bbtk::AtomicBlackBox
{
public:
protected:
private:
- vtkImageShiftScale *mCast;
+ vtkImageShiftScale *mCast;
vtkVolumeRayCastMIPFunction *mMIP;
- vtkVolumeRayCastMapper *mMapper;
- vtkVolume *mVolume;
+ vtkVolumeRayCastMapper *mMapper;
+ vtkVolume *mVolume;
};
//=================================================================
BBTK_END_DESCRIBE_BLACK_BOX(MIPCreator);
//=================================================================
-
}//namespace bbvtk
#endif //__bbtvtkMIPCreator_h__
Program: bbtk
Module: $RCSfile: bbvtkSegmentationConnectivity.cxx,v $
Language: C++
- Date: $Date: 2009/05/15 14:58:01 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2010/04/08 14:37:59 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
* \brief
*/
-
#ifdef _USE_VTK_
-
#include "bbvtkSegmentationConnectivity.h"
#include "bbvtkPackage.h"
namespace bbvtk
{
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,SegmentationConnectivity);
BBTK_BLACK_BOX_IMPLEMENTATION(SegmentationConnectivity,
bbtk::AtomicBlackBox);
-
-
- // --------------------------------------------------------------
+
+// --------------------------------------------------------------
+
void SegmentationConnectivity::bbUserSetDefaultValues()
{
thresh2 = NULL;
bbSetOutputOut(NULL);
}
- // --------------------------------------------------------------
+// --------------------------------------------------------------
+
void SegmentationConnectivity::bbUserInitializeProcessing()
{
thresh2 = vtkImageThreshold::New();
cast4->SetInput(connect2->GetOutput());
cast4->SetOutputScalarTypeToUnsignedShort();
}
-
- // --------------------------------------------------------------
+
+// --------------------------------------------------------------
+
void SegmentationConnectivity::bbUserFinalizeProcessing()
{
if (thresh2!=NULL)
{
cast4->Delete();
cast4=NULL;
- }
-
+ }
}
- // --------------------------------------------------------------
+// --------------------------------------------------------------
+
void SegmentationConnectivity::DoProcess()
{
vtkImageData *imagedata = bbGetInputIn();
bbSetOutputOut(cast4->GetOutput() );
}
-
}// EO namespace bbvtk
-
#endif //_USE_VTK_
Program: bbtk
Module: $RCSfile: bbvtkSegmentationConnectivity.h,v $
Language: C++
- Date: $Date: 2009/05/15 14:58:01 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2010/04/08 14:37:59 $
+ Version: $Revision: 1.6 $
=========================================================================*/
/* ---------------------------------------------------------------------
protected:
private:
- vtkImageCast *cast2;
- vtkImageCast *cast4; // binary segmentation result
- vtkImageThreshold *thresh2;
- vtkImageSeedConnectivity *connect2;
-
-
+ vtkImageCast *cast2;
+ vtkImageCast *cast4; // binary segmentation result
+ vtkImageThreshold *thresh2;
+ vtkImageSeedConnectivity *connect2;
};
#endif // __bbvtkSegmentationConnectivity_h_INCLUDED__
-
#endif //_USE_VTK_
#include "bbvtkTransform.h"
#include "bbvtkPackage.h"
-
-
namespace bbvtk
{
-
BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,Transform);
BBTK_BLACK_BOX_IMPLEMENTATION(Transform,bbtk::AtomicBlackBox);
-
// --------------------------------------------------------------
-
+
void Transform::bbUserSetDefaultValues()
{
bbSetInputIn(NULL);
-
+
vecScale.push_back(1); // scale x
vecScale.push_back(1); // scale y
vecScale.push_back(1); // scale z
bbSetInputScale(vecScale);
-
+
vecRotateWXYZ.push_back(0); //angle
vecRotateWXYZ.push_back(1); //vx
vecRotateWXYZ.push_back(0); //vy
vecRotateWXYZ.push_back(0); //vz
bbSetInputRotateWXYZ(vecRotateWXYZ);
-
+
vecTranslate.push_back(0); //tx
vecTranslate.push_back(0); //ty
vecTranslate.push_back(0); //tz
bbSetInputTranslate(vecTranslate);
-
+
vecSpacing.push_back(1); //spacing x
vecSpacing.push_back(1); //spacing y
vecSpacing.push_back(1); //spacing z
bbSetInputTranslate(vecSpacing);
-
+
result = NULL;
}
bbUserFinalizeProcessing();
result = vtkTransform::New();
}
-
-
+
// --------------------------------------------------------------
void Transform::bbUserFinalizeProcessing()
{
result->Delete();
result=NULL;
}
-
}
-
-
+
// --------------------------------------------------------------
void Transform::Process()
{
result->Scale(bbGetInputScale()[0], bbGetInputScale()[1], bbGetInputScale()[2]);
printf("EED %p Transform::Process() 3\n", this);
}
-
+
if ((bbGetInputTranslate().size()>=3) && (bbGetInputSpacing().size()>=3))
{
double tx = bbGetInputTranslate()[0] * bbGetInputSpacing()[0];
result->Translate(tx,ty,tz);
printf("EED %p Transform::Process() 4\n", this);
}
-
+
if (bbGetInputRotateWXYZ().size()>=4)
{
result->RotateWXYZ(bbGetInputRotateWXYZ()[0],bbGetInputRotateWXYZ()[1], bbGetInputRotateWXYZ()[2], bbGetInputRotateWXYZ()[3]);
printf("EED %p Transform::Process() 5\n", this);
}
-
+
result->Update();
printf("EED %p Transform::Process() 6\n", this);
-
+
bbSetOutputOut(result);
}
-
}
// EO namespace bbvtk
-
-
std::vector<double> vecRotateWXYZ;
std::vector<double> vecTranslate;
std::vector<double> vecSpacing;
- vtkTransform *result;
+ vtkTransform *result;
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(Transform,bbtk::AtomicBlackBox);
//-----------------------------------------------------------
void VecIsoSurfaceExtractor::bbUserSetDefaultValues()
{
+
+std::cout <<
+"================================VecIsoSurfaceExtractor::bbUserSetDefaultValues()"
+<< std::endl;
std::vector<double> colour;
// 1- red
colour.push_back(1.0);
//-----------------------------------------------------------
void VecIsoSurfaceExtractor::bbUserInitializeProcessing()
+
{
// bbSetInputIn(NULL);
- // bbSetInputInVtkObject(NULL);
-
+ // bbSetInputInVtkObject(NULL);
+std::cout <<
+"================================VecIsoSurfaceExtractor::bbUserInitializeProcessing()"
+<< std::endl;
}
//-----------------------------------------------------------
void VecIsoSurfaceExtractor::bbUserFinalizeProcessing()
{
+std::cout <<
+"================================VecIsoSurfaceExtractor::bbUserFinalizeProcessing()"
+<< std::endl;
int i,size = VecMarchingcubes.size();
for (i=0;i<size;i++)
{
//-----------------------------------------------------------
void VecIsoSurfaceExtractor::Process()
{
+std::cout <<
+"================================VecIsoSurfaceExtractor::Process()"
+<< std::endl;
double r,g,b;
- vtkMarchingCubes *marchingcubes;
- vtkPolyDataMapper *polydatamapper;
- vtkActor *vtkactor;
+ vtkMarchingCubes *marchingcubes;
+ vtkPolyDataMapper *polydatamapper;
+ vtkActor *vtkactor;
int i,size;
VecPolydatamapper.clear();
VecVtkactor.clear();
-
- size = bbGetInputIn().size();
+ size = bbGetInputIn().size();
for( i=0 ; i<size ; i++){
- marchingcubes = vtkMarchingCubes::New();
- polydatamapper = vtkPolyDataMapper::New();
- vtkactor = vtkActor::New();
+ marchingcubes = vtkMarchingCubes::New();
+ polydatamapper = vtkPolyDataMapper::New();
+ vtkactor = vtkActor::New();
polydatamapper->SetInput(marchingcubes->GetOutput());
vtkactor->SetMapper(polydatamapper);
VecVtkactor.push_back(vtkactor);
} // for i
-
for( i=0 ; i<size ; i++){
// Visualisation - result volume
marchingcubes=VecMarchingcubes[i];
vtkactor=(vtkActor*)VecVtkactor[i];
marchingcubes->SetInput( bbGetInputIn()[i] );
- marchingcubes->SetValue(0, bbGetInputIsovalue() );
+ marchingcubes->SetValue(0, bbGetInputIsovalue() );
marchingcubes->Update();
if ( (i*3+1)<(int)(bbGetInputColour().size()) ){
b = bbGetInputColour()[2];
}
vtkactor->GetProperty()->SetColor( r,g,b );
-
+
vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
if ( bbGetInputTransform()!=NULL )
bbSetOutputOut( VecVtkactor );
}
-
-
}
// EO namespace bbvtk
-
-
#include "vtkActor.h"
#include <vector>
-
namespace bbvtk
{
// virtual void bbUserDestructor();
void Init();
- std::vector<vtkMarchingCubes*> VecMarchingcubes;
- std::vector<vtkPolyDataMapper*> VecPolydatamapper;
- std::vector<vtkProp3D*> VecVtkactor;
+ std::vector<vtkMarchingCubes*> VecMarchingcubes;
+ std::vector<vtkPolyDataMapper*> VecPolydatamapper;
+ std::vector<vtkProp3D*> VecVtkactor;
};
Program: bbtk
Module: $RCSfile: bbwxLayoutSplit.cxx,v $
Language: C++
- Date: $Date: 2009/05/28 08:12:17 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2010/04/08 14:38:00 $
+ Version: $Revision: 1.13 $
=========================================================================*/
/* ---------------------------------------------------------------------
int orientation=0;
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|HORIZONTAL")==true) { orientation=0; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; }
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|VERTICAL")==true) { orientation=1; }
- if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
+ if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
else { w->SplitVertically( w1, w2, 100); }
bbSetOutputWidget( w );
# set colourButton.Label "Colour"
-
input Title controls.WinTitle "Title of the control panel"
input In surface.In "Input image"