--- /dev/null
+//=====
+// 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 "bbcreaVtkImageLaplacian.h"
+#include "bbcreaVtkPackage.h"
+
+#include "vtkImageLaplacian.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageLaplacian)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageLaplacian,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 ImageLaplacian::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')
+
+ if ( bbGetInputIn()!=NULL )
+ {
+ vtkImageLaplacian *laplacian =vtkImageLaplacian::New();
+ laplacian->SetInputData( bbGetInputIn() );
+ laplacian->Update();
+ bbSetOutputOut( laplacian->GetOutput() );
+ } else {
+ bbSetOutputOut( NULL );
+ }// if In
+}
+
+//=====
+// 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 ImageLaplacian::bbUserSetDefaultValues()
+{
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(NULL);
+}
+
+//=====
+// 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 ImageLaplacian::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 ImageLaplacian::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/null
+//=====
+// 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 __bbcreaVtkImageLaplacian_h_INCLUDED__
+#define __bbcreaVtkImageLaplacian_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+#include "vtkImageData.h"
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ImageLaplacian
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageLaplacian,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,vtkImageData*);
+ BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
+ 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(ImageLaplacian,bbtk::AtomicBlackBox);
+BBTK_NAME("ImageLaplacian");
+BBTK_AUTHOR("InfoDev");
+BBTK_DESCRIPTION("No Description.");
+BBTK_CATEGORY("empty");
+BBTK_INPUT(ImageLaplacian,In,"Input image",vtkImageData*,"");
+BBTK_OUTPUT(ImageLaplacian,Out,"Output image",vtkImageData*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ImageLaplacian);
+//=====
+// 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 bbcreaVtk
+
+#endif // __bbcreaVtkImageLaplacian_h_INCLUDED__
+
--- /dev/null
+//=====
+// 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 "bbcreaVtkImageToLstPoints.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageToLstPoints)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageToLstPoints,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 ImageToLstPoints::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')
+
+ std::vector<int> lstX;
+ std::vector<int> lstY;
+ std::vector<int> lstZ;
+ std::vector<double> lstValues;
+ vtkImageData *img=bbGetInputIn();
+ if (img!=NULL)
+ {
+ int dim[3];
+ int ext[6];
+ img->GetExtent(ext);
+ dim[0] = ext[1]-ext[0]+1;
+ dim[1] = ext[3]-ext[2]+1;
+ dim[2] = ext[5]-ext[4]+1;
+ std::vector<int> lstExt = bbGetInputExtent();
+ if (lstExt.size()!=6)
+ {
+ lstExt.clear();
+ for (int i=0; i<6; i++) lstExt.push_back( ext[i] );
+ } else {
+
+ if (lstExt[0]<0) lstExt[0] = 0;
+ if (lstExt[1]>=dim[0]) lstExt[1] = dim[0]-1;
+ if (lstExt[2]<0) lstExt[2] = 0;
+ if (lstExt[3]>=dim[1]) lstExt[3] = dim[1]-1;
+ if (lstExt[4]<0) lstExt[4] = 0;
+ if (lstExt[5]>=dim[2]) lstExt[5] = dim[2]-1;
+ } // if lstExt size
+ double range[2];
+ img->GetScalarRange(range);
+ std::vector<double> lstRange = bbGetInputRange();
+ if (lstRange.size()!=2)
+ {
+ lstRange.clear();
+ for (int i=0; i<2; i++) lstRange.push_back( range[i] );
+ } // if lstRange size
+
+ double background=bbGetInputBackground();
+ int x,y,z;
+ double value;
+ for (z=lstExt[4] ; z<=lstExt[5] ; z++)
+ {
+ for (y=lstExt[2] ; y<=lstExt[3] ; y++)
+ {
+ for (x=lstExt[0] ; x<=lstExt[1] ; x++)
+ {
+ value = img->GetScalarComponentAsDouble(x,y,z,0);
+ if ((value>=lstRange[0]) && (value<=lstRange[1]))
+ {
+ lstX.push_back(x);
+ lstY.push_back(y);
+ lstZ.push_back(z);
+ lstValues.push_back(value);
+ } else {
+ if ( bbGetInputType() == 1 )
+ {
+ lstX.push_back(x);
+ lstY.push_back(y);
+ lstZ.push_back(z);
+ lstValues.push_back(background);
+ }
+ }// if value
+ }// for x
+ }// for y
+ }// for z
+
+ } // if bbGetInputIn()
+ bbSetOutputLstPointsX( lstX );
+ bbSetOutputLstPointsY( lstY );
+ bbSetOutputLstPointsZ( lstZ );
+ bbSetOutputLstValues( lstValues );
+}
+
+//=====
+// 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 ImageToLstPoints::bbUserSetDefaultValues()
+{
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(NULL);
+ bbSetInputType(0);
+ bbSetInputBackground(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 ImageToLstPoints::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 ImageToLstPoints::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+
--- /dev/null
+//=====
+// 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 __bbcreaVtkImageToLstPoints_h_INCLUDED__
+#define __bbcreaVtkImageToLstPoints_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+#include "vtkImageData.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT ImageToLstPoints
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(ImageToLstPoints,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,vtkImageData*);
+ BBTK_DECLARE_INPUT(Extent,std::vector<int>);
+ BBTK_DECLARE_INPUT(Range,std::vector<double>);
+ BBTK_DECLARE_INPUT(Background,double);
+ BBTK_DECLARE_INPUT(Type,int);
+ BBTK_DECLARE_OUTPUT(LstPointsX,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstPointsY,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstPointsZ,std::vector<int>);
+ BBTK_DECLARE_OUTPUT(LstValues,std::vector<double>);
+ 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(ImageToLstPoints,bbtk::AtomicBlackBox);
+ BBTK_NAME("ImageToLstPoints");
+ BBTK_AUTHOR("InfoDev");
+ BBTK_DESCRIPTION("No Description.");
+ BBTK_CATEGORY("empty");
+ BBTK_INPUT(ImageToLstPoints,In,"Input",vtkImageData*,"");
+ BBTK_INPUT(ImageToLstPoints,Extent,"(default extent image) [minX maxX minY maxY minZ maxZ]",std::vector<int>,"");
+ BBTK_INPUT(ImageToLstPoints,Range,"(default range image) [min max] ",std::vector<double>,"");
+ BBTK_INPUT(ImageToLstPoints,Type,"(default 0) 0:Just the Range values 1:All point, put 0 in value for the outrange points",int,"");
+ BBTK_INPUT(ImageToLstPoints,Background,"'(default 0) for Type 1",double,"");
+ BBTK_OUTPUT(ImageToLstPoints,LstPointsX,"List of X",std::vector<int>,"");
+ BBTK_OUTPUT(ImageToLstPoints,LstPointsY,"List of Y",std::vector<int>,"");
+ BBTK_OUTPUT(ImageToLstPoints,LstPointsZ,"List of Z",std::vector<int>,"");
+ BBTK_OUTPUT(ImageToLstPoints,LstValues,"List of Z",std::vector<double>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(ImageToLstPoints);
+//=====
+// 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 bbcreaVtk
+
+#endif // __bbcreaVtkImageToLstPoints_h_INCLUDED__
+