1 #include "bbTransform3DdicomFlipImage.h"
2 #include "bbTransform3DdicomPackage.h"
3 namespace bbTransform3Ddicom
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,FlipImage)
7 BBTK_BLACK_BOX_IMPLEMENTATION(FlipImage,bbtk::AtomicBlackBox);
9 void FlipImage::Process()
15 imagedata = vtkImageData::New();
16 imagedata->DeepCopy( bbGetInputIn() );
19 imagedata->GetExtent( ext );
21 for (int z=0; z<=ext[5]; z++) {
22 for (int x=0; x<ext[1]; x++) {
23 for (int y=0; y<ext[3]/2; y++) {
24 unsigned short *p1 = (unsigned short *)imagedata->GetScalarPointer( x , y , z );
25 unsigned short *p2 = (unsigned short *)imagedata->GetScalarPointer( x , ext[3]-y-1 , z );
34 bbSetOutputOut( imagedata );
38 void FlipImage::bbUserConstructor()
44 void FlipImage::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
48 void FlipImage::bbUserDestructor()
56 // 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)
58 void FlipImage::bbUserSetDefaultValues()
69 // 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)
71 void FlipImage::bbUserInitializeProcessing()
74 // THE INITIALIZATION METHOD BODY :
76 // but this is where you should allocate the internal/output pointers
82 // 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)
84 void FlipImage::bbUserFinalizeProcessing()
87 // THE FINALIZATION METHOD BODY :
89 // but this is where you should desallocate the internal/output pointers
97 // EO namespace bbTransform3Ddicom