+//=====
+// 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 "bbvtkImageProperties.h"
+#include "bbvtkPackage.h"
+namespace bbvtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImageProperties)
+BBTK_BLACK_BOX_IMPLEMENTATION(ImageProperties,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 ImageProperties::Process()
+{
+ unsigned int dim;
+ int ext[6];
+ double spc[3];
+ double range[2];
+ std::string nametype;
+ int numberoOfComponents;
+ std::vector<int> vsize;
+ std::vector<float> vspacing;
+ std::vector<float> vrange;
+
+ if ( bbGetInputIn() ){
+ bbGetInputIn()->Update();
+
+ bbGetInputIn()->GetWholeExtent(ext);
+ vsize.push_back(ext[1]-ext[0]+1);
+ vsize.push_back(ext[3]-ext[2]+1);
+ vsize.push_back(ext[5]-ext[4]+1);
+
+ dim = 0;
+ if (vsize[0]>1) dim++;
+ if (vsize[1]>1) dim++;
+ if (vsize[2]>1) dim++;
+
+ bbGetInputIn()->GetScalarRange(range);
+ numberoOfComponents=bbGetInputIn()->GetNumberOfScalarComponents();
+
+ bbGetInputIn()->GetSpacing(spc);
+ for (unsigned int i=0;i<dim;++i)
+ vspacing.push_back((float)spc[i]);
+
+ vrange.push_back((float)range[0]);
+ vrange.push_back((float)range[1]);
+
+ if (bbGetInputIn()->GetScalarType()==VTK_BIT) nametype="VTK_BIT";
+ if (bbGetInputIn()->GetScalarType()==VTK_CHAR) nametype="VTK_CHAR";
+ if (bbGetInputIn()->GetScalarType()==VTK_SIGNED_CHAR) nametype="VTK_SIGNED_CHAR";
+ if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_CHAR) nametype="VTK_UNSIGNED_CHAR";
+ if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_SHORT) nametype="VTK_UNSIGNED_SHORT";
+ if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_INT) nametype="VTK_UNSIGNED_INT";
+ if (bbGetInputIn()->GetScalarType()==VTK_LONG) nametype="VTK_LONG";
+ if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_LONG) nametype="VTK_UNSIGNED_LONG";
+ if (bbGetInputIn()->GetScalarType()==VTK_FLOAT) nametype="VTK_FLOAT";
+ if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE) nametype="VTK_DOUBLE";
+ } else {
+ dim = 0;
+ numberoOfComponents = 0;
+ vsize.push_back(0);
+ vsize.push_back(0);
+ vsize.push_back(0);
+ vspacing.push_back(0);
+ vspacing.push_back(0);
+ vspacing.push_back(0);
+ vrange.push_back(0);
+ vrange.push_back(0);
+ nametype = "VOID";
+ }
+ bbSetOutputDimension( dim );
+ bbSetOutputSize( vsize );
+ bbSetOutputSpacing( vspacing );
+ bbSetOutputMinMax( vrange );
+ bbSetOutputTypeName( nametype );
+ bbSetOutputComponents( numberoOfComponents );
+
+}
+//=====
+// 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 ImageProperties::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 ImageProperties::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 ImageProperties::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbvtk
+
+