]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkImageCastToUShort.cxx
71b8123e766c1fb246f4ce2128a54f06d9803919
[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 void ImageCastToUShort::bbUserSetDefaultValues()
30 {
31  
32 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX  
33 //    Here we initialize the input 'In' to 0 
34         cast = NULL;
35    bbSetInputIn(0); 
36   
37 }
38 void ImageCastToUShort::bbUserInitializeProcessing()
39 {
40  
41 //  THE INITIALIZATION METHOD BODY : 
42 //    Here does nothing  
43 //    but this is where you should allocate the internal/output pointers  
44 //    if any  
45
46         cast = vtkImageCast::New(); 
47 }
48 void ImageCastToUShort::bbUserFinalizeProcessing()
49 {
50  
51 //  THE FINALIZATION METHOD BODY : 
52 //    Here does nothing  
53 //    but this is where you should desallocate the internal/output pointers  
54 //    if any 
55   
56 }
57
58 }
59 // EO namespace bbvtk
60
61