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());
28 void ResampleBox::bbUserSetDefaultValues()
35 void ResampleBox::bbUserInitializeProcessing()
37 resample = vtkImageResample::New();
40 void ResampleBox::bbUserFinalizeProcessing()
46 // EO namespace bbPackRecalage