]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkImageExtractComponents.cxx
#3110 creaVtk Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkImageExtractComponents.cxx
1 //===== 
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)
3 //===== 
4 #include "bbcreaVtkImageExtractComponents.h"
5 #include "bbcreaVtkPackage.h"
6 namespace bbcreaVtk
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ImageExtractComponents)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ImageExtractComponents,bbtk::AtomicBlackBox);
11 //===== 
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)
13 //===== 
14 void ImageExtractComponents::Process()
15 {
16
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 
23 //    Where :
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')
28
29 //    bbSetOutputOut( bbGetInputIn() );
30 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
31   
32         bbSetOutputOut0( NULL ); 
33         bbSetOutputOut1( NULL ); 
34         bbSetOutputOut2( NULL ); 
35         bbSetOutputOut3( NULL ); 
36
37         if (bbGetInputComponent0()!=-1)
38         {
39 //EED 2017-01-01 Migration VTK7
40 #if VTK_MAJOR_VERSION <= 5
41                 IEC0->SetInput( bbGetInputIn() );
42 #else
43                 IEC0->SetInputData( bbGetInputIn() );
44 #endif
45                 IEC0->SetComponents( bbGetInputComponent0() );
46                 IEC0->Update();
47                 bbSetOutputOut0( IEC0->GetOutput() ); 
48         } 
49
50         if (bbGetInputComponent1()!=-1)
51         {
52 //EED 2017-01-01 Migration VTK7
53 #if VTK_MAJOR_VERSION <= 5
54                 IEC1->SetInput( bbGetInputIn() );
55 #else
56                 IEC1->SetInputData( bbGetInputIn() );
57 #endif
58                 IEC1->SetComponents( bbGetInputComponent1() );
59                 IEC1->Update();
60                 bbSetOutputOut1( IEC1->GetOutput() ); 
61         }
62
63         if (bbGetInputComponent2()!=-1)
64         {
65 //EED 2017-01-01 Migration VTK7
66 #if VTK_MAJOR_VERSION <= 5
67                 IEC2->SetInput( bbGetInputIn() );
68 #else
69                 IEC2->SetInputData( bbGetInputIn() );
70 #endif
71                 IEC2->SetComponents( bbGetInputComponent2() );
72                 IEC2->Update();
73                 bbSetOutputOut2( IEC2->GetOutput() ); 
74         }
75
76         if (bbGetInputComponent3()!=-1)
77         {
78
79 //EED 2017-01-01 Migration VTK7
80 #if VTK_MAJOR_VERSION <= 5
81                 IEC3->SetInput( bbGetInputIn() );
82 #else
83                 IEC3->SetInputData( bbGetInputIn() );
84 #endif
85                 IEC3->SetComponents( bbGetInputComponent2() );
86                 IEC3->Update();
87                 bbSetOutputOut3( IEC3->GetOutput() ); 
88         }
89
90
91 }
92 //===== 
93 // 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 //===== 
95 void ImageExtractComponents::bbUserSetDefaultValues()
96 {
97
98 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
99 //    Here we initialize the input 'In' to 0
100    bbSetInputIn(NULL);
101    bbSetInputComponent0(-1);
102    bbSetInputComponent1(-1);
103    bbSetInputComponent2(-1);
104    bbSetInputComponent3(-1);
105
106 }
107 //===== 
108 // 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)
109 //===== 
110 void ImageExtractComponents::bbUserInitializeProcessing()
111 {
112
113 //  THE INITIALIZATION METHOD BODY :
114 //    Here does nothing 
115 //    but this is where you should allocate the internal/output pointers 
116 //    if any 
117
118         IEC0=vtkImageExtractComponents::New();  
119         IEC1=vtkImageExtractComponents::New();  
120         IEC2=vtkImageExtractComponents::New();  
121         IEC3=vtkImageExtractComponents::New();  
122 }
123 //===== 
124 // 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)
125 //===== 
126 void ImageExtractComponents::bbUserFinalizeProcessing()
127 {
128
129 //  THE FINALIZATION METHOD BODY :
130 //    Here does nothing 
131 //    but this is where you should desallocate the internal/output pointers 
132 //    if any
133
134         IEC0->Delete();  
135         IEC1->Delete();  
136         IEC2->Delete();  
137         IEC3->Delete();  
138
139 }
140
141
142 }
143 // EO namespace bbcreaVtk
144
145