2 // 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)
4 #include "bbvtkImageVtkProperties.h"
5 #include "bbvtkPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImageVtkProperties)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ImageVtkProperties,bbtk::AtomicBlackBox);
12 // 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)
14 void ImageVtkProperties::Process()
21 int numberoOfComponents;
22 std::vector<int> vsize;
23 std::vector<float> vspacing;
24 std::vector<float> vrange;
26 if ( bbGetInputIn() ){
27 bbGetInputIn()->Update();
29 bbGetInputIn()->GetWholeExtent(ext);
30 vsize.push_back(ext[1]-ext[0]+1);
31 vsize.push_back(ext[3]-ext[2]+1);
32 vsize.push_back(ext[5]-ext[4]+1);
35 if (vsize[0]>1) dim++;
36 if (vsize[1]>1) dim++;
37 if (vsize[2]>1) dim++;
39 bbGetInputIn()->GetScalarRange(range);
40 numberoOfComponents=bbGetInputIn()->GetNumberOfScalarComponents();
42 bbGetInputIn()->GetSpacing(spc);
43 for (unsigned int i=0;i<dim;++i)
44 vspacing.push_back((float)spc[i]);
46 vrange.push_back((float)range[0]);
47 vrange.push_back((float)range[1]);
49 if (bbGetInputIn()->GetScalarType()==VTK_BIT) nametype="VTK_BIT";
50 if (bbGetInputIn()->GetScalarType()==VTK_CHAR) nametype="VTK_CHAR";
51 if (bbGetInputIn()->GetScalarType()==VTK_SIGNED_CHAR) nametype="VTK_SIGNED_CHAR";
52 if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_CHAR) nametype="VTK_UNSIGNED_CHAR";
53 if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_SHORT) nametype="VTK_UNSIGNED_SHORT";
54 if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_INT) nametype="VTK_UNSIGNED_INT";
55 if (bbGetInputIn()->GetScalarType()==VTK_LONG) nametype="VTK_LONG";
56 if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_LONG) nametype="VTK_UNSIGNED_LONG";
57 if (bbGetInputIn()->GetScalarType()==VTK_FLOAT) nametype="VTK_FLOAT";
58 if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE) nametype="VTK_DOUBLE";
61 numberoOfComponents = 0;
65 vspacing.push_back(0);
66 vspacing.push_back(0);
67 vspacing.push_back(0);
72 bbSetOutputDimension( dim );
73 bbSetOutputSize( vsize );
74 bbSetOutputSpacing( vspacing );
75 bbSetOutputMinMax( vrange );
76 bbSetOutputTypeName( nametype );
77 bbSetOutputComponents( numberoOfComponents );
81 // 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)
83 void ImageVtkProperties::bbUserSetDefaultValues()
86 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
87 // Here we initialize the input 'In' to 0
92 // 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)
94 void ImageVtkProperties::bbUserInitializeProcessing()
97 // THE INITIALIZATION METHOD BODY :
99 // but this is where you should allocate the internal/output pointers
105 // 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)
107 void ImageVtkProperties::bbUserFinalizeProcessing()
110 // THE FINALIZATION METHOD BODY :
112 // but this is where you should desallocate the internal/output pointers
117 // EO namespace bbvtk