]> Creatis software - clitk.git/commitdiff
Redo the Rigid Registration
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 11 Dec 2015 09:49:17 +0000 (10:49 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Fri, 11 Dec 2015 09:49:17 +0000 (10:49 +0100)
Without the calculation of the transformation matrix
Works without overlay only, but the crop, ROI, ... still work

vv/vvSlicer.cxx
vv/vvToolRigidReg.cxx

index c35e8cc4bcd39d974e4018df2fd4ba9317785194..8eab74a7b762e0fe8bfc273e1c4eb66eef09caa2 100644 (file)
@@ -95,7 +95,7 @@ vvSlicer::vvSlicer()
   this->UnInstallPipeline();
   mImage = NULL;
   mReducedExtent = new int[6];
-  mRegisterExtent = new int[6];
+  mRegisterExtent = NULL;
   mCurrentTSlice = 0;
   mCurrentFusionTSlice = 0;
   mCurrentOverlayTSlice = 0;
@@ -312,7 +312,6 @@ vvSlicer::~vvSlicer()
        i!=mSurfaceCutActors.end(); i++)
     delete (*i);
   delete [] mReducedExtent;
-  delete [] mRegisterExtent;
 }
 //------------------------------------------------------------------------------
 
@@ -1072,14 +1071,24 @@ int vvSlicer::GetOrientation()
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateDisplayExtent()
 { //out << __func__ << endl;
+
   vtkImageData *input = this->GetInput();
-  
   if (!input || !this->ImageActor) {
     return;
   }
-  
+
 #if VTK_MAJOR_VERSION <= 5
   input->UpdateInformation();
+#else
+  int extent[6];
+  mRegisterExtent = mImageReslice->GetOutputInformation(0)->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
+  copyExtent(mRegisterExtent, extent);
+
+  // Make sure that the required part image has been computed
+  extent[SliceOrientation*2] = Slice;
+  extent[SliceOrientation*2+1] = Slice;    
+
+  mImageReslice->SetUpdateExtent(extent);
 #endif
   this->SetSlice( this->GetSlice() ); //SR: make sure the update let the slice in extents
 
@@ -1097,16 +1106,6 @@ void vvSlicer::UpdateDisplayExtent()
   this->ImageActor->SetVisibility(mImageVisibility);
   this->ImageActor->SetDisplayExtent(w_ext);
 #if VTK_MAJOR_VERSION >= 6
-//mSlicingTransform->Print(cout);
-//GetImage()->GetTransform()[0]->Print(cout);
-//mSlicingTransform = GetImage()->GetTransform()[0];
-//mImageReslice->SetResliceTransform(mSlicingTransform);
-//mImageReslice->AutoCropOutputOff();
-//mImageReslice->Update();
-int* extentTest = mImageReslice->GetOutput()->GetExtent();
-cout<< extentTest[0] << " " << extentTest[1] << " " <<  extentTest[2] << " " <<  extentTest[3] << " " <<  extentTest[4] << " " <<  extentTest[5] << endl;
-//this->GetInput()->Print(cout);
-//GetImageActor()->GetMapper()->Print(cout);
   vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
   try {
     mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
@@ -1120,15 +1119,13 @@ cout<< extentTest[0] << " " << extentTest[1] << " " <<  extentTest[2] << " " <<
   } else {
     int w_croppingRegion[6];
     if (mUseReducedExtent) {
-        copyExtent(extentTest, w_croppingRegion);
+        copyExtent(mReducedExtent, w_croppingRegion);
     } else {
-        copyExtent(extentTest, w_croppingRegion);
+        copyExtent(mRegisterExtent, w_croppingRegion);
     }
-    cout << "w_ext : " << w_ext[0] << " " << w_ext[1] << " " << w_ext[2] << " " << w_ext[3] << " " << w_ext[4] << " " << w_ext[5] << endl;
     w_croppingRegion[ this->SliceOrientation*2   ] = this->Slice;
     w_croppingRegion[ this->SliceOrientation*2+1 ] = this->Slice;
     mapperOpenGL->SetCroppingRegion(w_croppingRegion);
-    cout << "w_croppingRegion : " << w_croppingRegion[0] << " " << w_croppingRegion[1] << " " << w_croppingRegion[2] << " " << w_croppingRegion[3] << " " << w_croppingRegion[4] << " " << w_croppingRegion[5] << endl;
   }
 #endif
   
index 0c4199325904b32d212f1dd093764ce068573cc2..49b46f1f3dc37fb9cf757e93e431a1ed2e0da394 100644 (file)
@@ -410,7 +410,7 @@ void vvToolRigidReg::SetTransform(vtkMatrix4x4 *matrix)
       rotSliders[i]->setValue(iAngle);
       rotSliders[i]->blockSignals(false);
     }
-  }cout << euler->GetParameters()[0+3] << " " << euler->GetParameters()[1+3] << " " << euler->GetParameters()[2+3] << endl;
+  }
 }
 //------------------------------------------------------------------------------