]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkExtractVtkImageFilter.cxx
aed1148e992eaea919aa4719b12147645e25a969
[bbtk.git] / packages / vtk / src / bbvtkExtractVtkImageFilter.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 "bbvtkExtractVtkImageFilter.h"
5 #include "bbvtkPackage.h"
6 namespace bbvtk
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ExtractVtkImageFilter)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ExtractVtkImageFilter,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 ExtractVtkImageFilter::Process()
15 {
16         int voi[6];
17
18         voi[0] = bbGetInputIndex()[0];
19         voi[1] = bbGetInputIndex()[0]+bbGetInputSize()[0]-1;
20         voi[2] = bbGetInputIndex()[1];
21         voi[3] = bbGetInputIndex()[1]+bbGetInputSize()[1]-1;
22         voi[4] = bbGetInputIndex()[2];
23         voi[5] = bbGetInputIndex()[2]+bbGetInputSize()[2]-1;
24         
25         _extract->SetInput( bbGetInputIn() );
26         _extract->SetVOI(voi);  
27         _extract->UpdateWholeExtent();
28         _extract->Update();
29         bbSetOutputOut(_extract->GetOutput());
30 }
31         
32 //===== 
33 // 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)
34 //===== 
35 void ExtractVtkImageFilter::bbUserSetDefaultValues()
36 {
37
38 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
39 //    Here we initialize the input 'In' to 0
40         
41         _extract =NULL;
42
43    bbSetInputIn(0);
44         
45         std::vector<int> tmpIndex;
46         tmpIndex.push_back(0);
47         tmpIndex.push_back(0);
48         tmpIndex.push_back(0);
49         std::vector<int> tmpSize;
50         tmpSize.push_back(1);
51         tmpSize.push_back(1);
52         tmpSize.push_back(1);
53         bbSetInputIndex(tmpIndex);
54         bbSetInputSize(tmpSize);
55         
56         bbSetOutputOut(0);
57   
58 }
59 //===== 
60 // 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)
61 //===== 
62 void ExtractVtkImageFilter::bbUserInitializeProcessing()
63 {
64
65 //  THE INITIALIZATION METHOD BODY :
66 //    Here does nothing 
67 //    but this is where you should allocate the internal/output pointers 
68 //    if any 
69         _extract = vtkExtractVOI::New();
70
71   
72 }
73 //===== 
74 // 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)
75 //===== 
76 void ExtractVtkImageFilter::bbUserFinalizeProcessing()
77 {
78
79 //  THE FINALIZATION METHOD BODY :
80 //    Here does nothing 
81 //    but this is where you should desallocate the internal/output pointers 
82 //    if any
83
84         _extract->Delete();
85 }
86 }
87 // EO namespace bbvtk
88
89