]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkImageCastToUShort.cxx
*** empty log message ***
[bbtk.git] / packages / vtk / src / bbvtkImageCastToUShort.cxx
1 #include "bbvtkImageCastToUShort.h"
2 #include "bbvtkPackage.h"
3 namespace bbvtk
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,ImageCastToUShort)
7 BBTK_BLACK_BOX_IMPLEMENTATION(ImageCastToUShort,bbtk::AtomicBlackBox);
8 void ImageCastToUShort::Process()
9 {
10  
11 // THE MAIN PROCESSING METHOD BODY 
12 //   Here we simply set the input 'In' value to the output 'Out' 
13 //   And print out the output value 
14 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM : 
15 //    void bbSet{Input|Output}NAME(const TYPE&) 
16 //    const TYPE& bbGet{Input|Output}NAME() const  
17 //    Where : 
18 //    * NAME is the name of the input/output 
19 //      (the one provided in the attribute 'name' of the tag 'input') 
20 //    * TYPE is the C++ type of the input/output 
21 //      (the one provided in the attribute 'type' of the tag 'input') 
22
23         vtkImageData* img = bbGetInputIn();     
24         cast->SetInput(img);
25         cast->SetOutputScalarTypeToUnsignedShort();
26         cast->Update();
27     bbSetOutputOut(cast->GetOutput() );   
28   
29 }
30 void ImageCastToUShort::bbUserSetDefaultValues()
31 {
32  
33 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX  
34 //    Here we initialize the input 'In' to 0 
35         cast = NULL;
36    bbSetInputIn(0); 
37   
38 }
39 void ImageCastToUShort::bbUserInitializeProcessing()
40 {
41  
42 //  THE INITIALIZATION METHOD BODY : 
43 //    Here does nothing  
44 //    but this is where you should allocate the internal/output pointers  
45 //    if any  
46
47         cast = vtkImageCast::New(); 
48   
49 }
50 void ImageCastToUShort::bbUserFinalizeProcessing()
51 {
52  
53 //  THE FINALIZATION METHOD BODY : 
54 //    Here does nothing  
55 //    but this is where you should desallocate the internal/output pointers  
56 //    if any 
57   
58 }
59 }
60 // EO namespace bbvtk
61
62