]> Creatis software - clitk.git/commitdiff
Merge branch 'VTK6_Qt5_Registration' into VTK6_Qt5
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 15 Dec 2015 10:33:07 +0000 (11:33 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Tue, 15 Dec 2015 10:33:07 +0000 (11:33 +0100)
1  2 
vv/vvSlicer.cxx

diff --cc vv/vvSlicer.cxx
index 575fdacfdf38403002f01b2e1698988a3cfbc122,63d4699f1f8e48aa9241e0de347749be6db2ade3..57500bb27e6fdb3c04b89e7913864d49463352fe
@@@ -1071,9 -1070,9 +1070,8 @@@ int vvSlicer::GetOrientation(
  
  //----------------------------------------------------------------------------
  void vvSlicer::UpdateDisplayExtent()
 -{ //out << __func__ << endl;
 -
 +{ 
    vtkImageData *input = this->GetInput();
-   
    if (!input || !this->ImageActor) {
      return;
    }
  
    // Local copy of extent
    int w_ext[6];
-   int* ext = GetExtent();
+   int* ext = mImageReslice->GetOutputInformation(0)->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
    copyExtent(ext, w_ext);
+   if (mUseReducedExtent) {
+         copyExtent(mReducedExtent, w_ext);
+     }
 -    
++  cout << mUseReducedExtent<< " " << w_ext[0] << " " << w_ext[1] << " " << w_ext[2] << " " << w_ext[3] << " " << w_ext[4] << " " << w_ext[5] << endl;  
    // Set slice value
  
    w_ext[ this->SliceOrientation*2   ] = this->Slice;
  //----------------------------------------------------------------------------
  
  //----------------------------------------------------------------------------
- void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const int sourceExtent[6],
+ void vvSlicer::ConvertImageToImageDisplayExtent(vtkInformation *sourceImage, const int sourceExtent[6],
                                                  vtkImageData *targetImage, int targetExtent[6])
 -{ //out << __func__ << endl;
 +{ 
    double dExtents[6];
+   double *origin, *spacing;
+   origin = sourceImage->Get(vtkDataObject::ORIGIN());
+   spacing = sourceImage->Get(vtkDataObject::SPACING());
    for(unsigned int i=0; i<6; i++) {
      // From source voxel coordinates to world coordinates
-     dExtents[i] = sourceImage->GetOrigin()[i/2] + sourceImage->GetSpacing()[i/2] * sourceExtent[i];
+     dExtents[i] = origin[i/2] + spacing[i/2] * sourceExtent[i];
  
      // From world coordinates to floating point target voxel coordinates
      dExtents[i] = (dExtents[i]- targetImage->GetOrigin()[i/2]) / targetImage->GetSpacing()[i/2];
@@@ -1595,8 -1577,7 +1576,7 @@@ double vvSlicer::GetScalarComponentAsDo
  
  //----------------------------------------------------------------------------
  void vvSlicer::Render()
 -{ //out << __func__ << endl;
 +{ 
    if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) {
      legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
      legend->UseOpacityOn();