#include "bbTransform3DdicomFlipImage.h" #include "bbTransform3DdicomPackage.h" namespace bbTransform3Ddicom { BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,FlipImage) BBTK_BLACK_BOX_IMPLEMENTATION(FlipImage,bbtk::AtomicBlackBox); void FlipImage::Process() { if (imagedata!=NULL) { imagedata->Delete(); } imagedata = vtkImageData::New(); imagedata->DeepCopy( bbGetInputIn() ); int ext[6]; imagedata->GetExtent( ext ); for (int z=0; z<=ext[5]; z++) { for (int x=0; xGetScalarPointer( x , y , z ); unsigned short *p2 = (unsigned short *)imagedata->GetScalarPointer( x , ext[3]-y-1 , z ); unsigned short tt; tt =*p1; *p1=*p2; *p2=tt; } } } bbSetOutputOut( imagedata ); } /* EED 13/11/2015 void FlipImage::bbUserConstructor() { imagedata=NULL; // bbSetInputIn(0); } void FlipImage::bbUserCopyConstructor(bbtk::BlackBox::Pointer) { } void FlipImage::bbUserDestructor() { } */ //===== // 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) //===== void FlipImage::bbUserSetDefaultValues() { imagedata=NULL; // bbSetInputIn(0); } //===== // 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) //===== void FlipImage::bbUserInitializeProcessing() { // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers // if any } //===== // 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) //===== void FlipImage::bbUserFinalizeProcessing() { // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any } } // EO namespace bbTransform3Ddicom