--- /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 "bbcreaVtkGrayLevel.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,GrayLevel)
+BBTK_BLACK_BOX_IMPLEMENTATION(GrayLevel,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 GrayLevel::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')
+ vtkImageData *m_image = vtkImageData::New();
+ m_image = bbGetInputImage();
+
+ int grayLevel = 0;
+ std::vector<double> coord = bbGetInputCoordinate();
+
+ grayLevel = m_image->GetScalarComponentAsDouble(coord[0],coord[1],coord[2],0);
+
+ bbSetOutputGrayLevel(grayLevel);
+
+}
+//=====
+// 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 GrayLevel::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputImage(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 GrayLevel::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 GrayLevel::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 __bbcreaVtkGrayLevel_h_INCLUDED__
+#define __bbcreaVtkGrayLevel_h_INCLUDED__
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkImageData.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT GrayLevel
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(GrayLevel,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(Image,vtkImageData*);
+ BBTK_DECLARE_INPUT(Coordinate,std::vector<double>);
+ BBTK_DECLARE_OUTPUT(GrayLevel,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(GrayLevel,bbtk::AtomicBlackBox);
+BBTK_NAME("GrayLevel");
+BBTK_AUTHOR("Monica ESPINOSA");
+BBTK_DESCRIPTION("No Description.");
+BBTK_CATEGORY("empty");
+BBTK_INPUT(GrayLevel,Image,"Image",vtkImageData*,"");
+BBTK_INPUT(GrayLevel,Coordinate,"Coordinate Of Point ",std::vector<double>,"");
+BBTK_OUTPUT(GrayLevel,GrayLevel,"GrayLevel",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(GrayLevel);
+//=====
+// 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 // __bbcreaVtkGrayLevel_h_INCLUDED__
+
std::vector<double> coord = bbGetInputCoordinates();
- /*double *vector = static_cast<double*>(m_VectorImage->GetScalarPointer(coord[0],coord[1],coord[2]));
-
vtkDoubleArray* velocity = vtkDoubleArray::New();
- velocity = vtkDoubleArray::SafeDownCast(this->m_VectorImage->GetPointData()->GetArray("velocity"));
-
-
-
+ velocity = vtkDoubleArray::SafeDownCast(m_VectorImage->GetPointData()->GetArray("velocity"));
- std::cout << "coord: "<< coord[0] << ","<< coord[1] << ","<<coord[2] << std::endl;
- std::cout << "vector: "<< velocity[0] << ","<< velocity[1] << ","<<velocityvelocity[2] << std::endl;
+ std::cout<< "# components velocity" << velocity->GetNumberOfComponents()<<std::endl;
double ang1 = 0;
double ang2 = 0;
- ang1 = velocity[0] + velocity[1] + velocity[2];
- ang2 = velocity[0] + velocity[1] - velocity[2];
-*/
+ ang1 = 1;
+ ang2 = 2;
m_VectorImage->Print(std::cout);
-
-
-
-
- //bbSetOutputAngle1(ang1);
- //bbSetOutputAngle2(ang2);
+ bbSetOutputAngle1(ang1);
+ bbSetOutputAngle2(ang2);
}// if image != NULL
-
-
-
-
-
-
std::cout<< "MLER VectorsExtraction Process END" << std::endl;
}
#include "vtkImageData.h"
-#include "vtkPolyData.h"
+#include "vtkPointData.h"
namespace bbcreaVtk
{