X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaRigidRegistration.git;a=blobdiff_plain;f=PackRecalage%2Fsrc%2FbbPackRecalageReSlicerBox.cxx;fp=PackRecalage%2Fsrc%2FbbPackRecalageReSlicerBox.cxx;h=29953b0481c3882fb7742b3943776ff83d6a86d5;hp=0d7fd540d2bef5153ef33be4bd38f02d49c2ae4b;hb=f6b89d782ef742d6585b461ee68ea03070a4d1b1;hpb=b67a23af7a7cbeec6d337e5d56c826ab555267d4 diff --git a/PackRecalage/src/bbPackRecalageReSlicerBox.cxx b/PackRecalage/src/bbPackRecalageReSlicerBox.cxx index 0d7fd54..29953b0 100644 --- a/PackRecalage/src/bbPackRecalageReSlicerBox.cxx +++ b/PackRecalage/src/bbPackRecalageReSlicerBox.cxx @@ -50,6 +50,8 @@ void ReSlicerBox::Process() slicer->SetInformationInput( image->GetOutput() ); slicer->SetResliceTransform(bbGetInputTransform()); slicer->SetOutputOrigin( -(bbGetInputOrigin()[0]) , -(bbGetInputOrigin()[1]) , -(bbGetInputOrigin()[2]) ); + + if(bbGetInputInterpolate()) { slicer->InterpolateOn(); @@ -64,12 +66,28 @@ void ReSlicerBox::Process() imageResult->SetOutputOrigin( 0,0,0 ); bbSetOutputOut( imageResult->GetOutput() ); + + if (bbGetInputTransform()!=NULL) + { + bbGetInputTransform()->Update(); + vtkMatrix4x4 *m = bbGetInputTransform()->GetMatrix(); + if (m!=NULL) + { + printf("EED ReSlicerBox::Process Translation %d %d %d \n",-(bbGetInputOrigin()[0]),-(bbGetInputOrigin()[1]),-(bbGetInputOrigin()[2])); + printf("EED ReSlicerBox::Process Matrix %f %f %f %f\n", m->GetElement(0,0),m->GetElement(0,1),m->GetElement(0,2),m->GetElement(0,3)); + printf("EED ReSlicerBox::Process Matrix %f %f %f %f\n", m->GetElement(1,0),m->GetElement(1,1),m->GetElement(1,2),m->GetElement(1,3)); + printf("EED ReSlicerBox::Process Matrix %f %f %f %f\n", m->GetElement(2,0),m->GetElement(2,1),m->GetElement(2,2),m->GetElement(2,3)); + printf("EED ReSlicerBox::Process Matrix %f %f %f %f\n", m->GetElement(3,0),m->GetElement(3,1),m->GetElement(3,2),m->GetElement(3,3)); + } // if m + } // if Transform } else { bbSetOutputOut( NULL ); } } + + void ReSlicerBox::bbUserSetDefaultValues() { std::vector empty; @@ -81,6 +99,8 @@ void ReSlicerBox::bbUserSetDefaultValues() bbSetInputInterpolate(false); } + + void ReSlicerBox::bbUserInitializeProcessing() { @@ -92,11 +112,13 @@ void ReSlicerBox::bbUserInitializeProcessing() slicer =vtkImageReslice::New(); imageResult = vtkImageChangeInformation::New(); } + void ReSlicerBox::bbUserFinalizeProcessing() { image->Delete(); slicer->Delete(); imageResult->Delete(); } + } // EO namespace bbPackRecalage