//===== // 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 "bbvtkImageVtkProperties.h" #include "bbvtkPackage.h" namespace bbvtk { BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImageVtkProperties) BBTK_BLACK_BOX_IMPLEMENTATION(ImageVtkProperties,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 ImageVtkProperties::Process() { unsigned int dim; int ext[6]; double spc[3]; double range[2]; std::string nametype; int numberoOfComponents; std::vector vsize; std::vector vspacing; std::vector 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;iGetScalarType()==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 ImageVtkProperties::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 ImageVtkProperties::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 ImageVtkProperties::bbUserFinalizeProcessing() { // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any } } // EO namespace bbvtk