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 "bbcreaVtkImageExtractComponents.h"
5 #include "bbcreaVtkPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageExtractComponents)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ImageExtractComponents,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 ImageExtractComponents::Process()
17 // THE MAIN PROCESSING METHOD BODY
18 // Here we simply set the input 'In' value to the output 'Out'
19 // And print out the output value
20 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
21 // void bbSet{Input|Output}NAME(const TYPE&)
22 // const TYPE& bbGet{Input|Output}NAME() const
24 // * NAME is the name of the input/output
25 // (the one provided in the attribute 'name' of the tag 'input')
26 // * TYPE is the C++ type of the input/output
27 // (the one provided in the attribute 'type' of the tag 'input')
29 // bbSetOutputOut( bbGetInputIn() );
30 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
32 bbSetOutputOut0( NULL );
33 bbSetOutputOut1( NULL );
34 bbSetOutputOut2( NULL );
35 bbSetOutputOut3( NULL );
37 // InputComponent 0..3
38 if (bbGetInputType()==0)
41 if (bbGetInputComponent0()!=-1)
43 //EED 2017-01-01 Migration VTK7
44 #if VTK_MAJOR_VERSION <= 5
45 IEC0->SetInput( bbGetInputIn() );
47 IEC0->SetInputData( bbGetInputIn() );
49 IEC0->SetComponents( bbGetInputComponent0() );
51 bbSetOutputOut0( IEC0->GetOutput() );
54 if (bbGetInputComponent1()!=-1)
56 //EED 2017-01-01 Migration VTK7
57 #if VTK_MAJOR_VERSION <= 5
58 IEC1->SetInput( bbGetInputIn() );
60 IEC1->SetInputData( bbGetInputIn() );
62 IEC1->SetComponents( bbGetInputComponent1() );
64 bbSetOutputOut1( IEC1->GetOutput() );
67 if (bbGetInputComponent2()!=-1)
69 //EED 2017-01-01 Migration VTK7
70 #if VTK_MAJOR_VERSION <= 5
71 IEC2->SetInput( bbGetInputIn() );
73 IEC2->SetInputData( bbGetInputIn() );
75 IEC2->SetComponents( bbGetInputComponent2() );
77 bbSetOutputOut2( IEC2->GetOutput() );
80 if (bbGetInputComponent3()!=-1)
82 //EED 2017-01-01 Migration VTK7
83 #if VTK_MAJOR_VERSION <= 5
84 IEC3->SetInput( bbGetInputIn() );
86 IEC3->SetInputData( bbGetInputIn() );
88 IEC3->SetComponents( bbGetInputComponent2() );
90 bbSetOutputOut3( IEC3->GetOutput() );
95 if (bbGetInputType()==1)
97 int i,size=lstIEC.size();
98 for (i=0; i<size; i++)
104 int nrCmp = bbGetInputIn()->GetNumberOfScalarComponents();
105 for (i=0; i<nrCmp; i++)
107 vtkImageExtractComponents* IEC;
108 IEC=vtkImageExtractComponents::New();
109 IEC->SetInputData( bbGetInputIn() );
110 IEC->SetComponents( i );
112 lstIEC.push_back( IEC);
113 lstOut.push_back( IEC->GetOutput() );
115 bbSetOutputLstOut( lstOut );
120 // 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)
122 void ImageExtractComponents::bbUserSetDefaultValues()
124 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
125 // Here we initialize the input 'In' to 0
127 bbSetInputComponent0(-1);
128 bbSetInputComponent1(-1);
129 bbSetInputComponent2(-1);
130 bbSetInputComponent3(-1);
135 // 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)
137 void ImageExtractComponents::bbUserInitializeProcessing()
140 // THE INITIALIZATION METHOD BODY :
142 // but this is where you should allocate the internal/output pointers
145 IEC0=vtkImageExtractComponents::New();
146 IEC1=vtkImageExtractComponents::New();
147 IEC2=vtkImageExtractComponents::New();
148 IEC3=vtkImageExtractComponents::New();
151 // 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)
153 void ImageExtractComponents::bbUserFinalizeProcessing()
155 // THE FINALIZATION METHOD BODY :
157 // but this is where you should desallocate the internal/output pointers
163 int i,size=lstIEC.size();
164 for (i=0; i<size; i++)
172 // EO namespace bbcreaVtk