1 #include "bbPackRecalageResampleBox.h"
2 #include "bbPackRecalagePackage.h"
3 namespace bbPackRecalage
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(PackRecalage,ResampleBox)
7 BBTK_BLACK_BOX_IMPLEMENTATION(ResampleBox,bbtk::AtomicBlackBox);
8 void ResampleBox::Process()
10 if(bbGetInputIn() != NULL && bbGetInputFactor() != 0)
12 double factor = bbGetInputFactor();
13 resample->SetInput(bbGetInputIn());
14 resample->SetAxisMagnificationFactor(0, factor);
15 resample->SetAxisMagnificationFactor(1, factor);
16 resample->SetAxisMagnificationFactor(2, factor);
18 vtkImageData *image = resample->GetOutput();
19 std::cout << "NTU: new spacing!" << image->GetExtent()[1] << " " << image->GetExtent()[3] << " " << image->GetExtent()[5] << " " << image->GetSpacing()[0] << " " << image->GetSpacing()[1] << " " << image->GetSpacing()[2] << std::endl;
20 bbSetOutputOut(resample->GetOutput());
27 void ResampleBox::bbUserSetDefaultValues()
33 void ResampleBox::bbUserInitializeProcessing()
35 resample = vtkImageResample::New();
37 void ResampleBox::bbUserFinalizeProcessing()
42 // EO namespace bbPackRecalage