~ubuntu-branches/ubuntu/gutsy/vtk/gutsy

« back to all changes in this revision

Viewing changes to Widgets/vtkImagePlaneWidget.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Michele Angrisano
  • Date: 2007-06-30 22:39:48 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070630223948-6tn51upaurwfrcz8
Tags: 5.0.3-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add export SHELL=/bin/bash in debian/rules.
  - Update maintainer in field debian/control.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include "vtkTexture.h"
41
41
#include "vtkTransform.h"
42
42
 
43
 
vtkCxxRevisionMacro(vtkImagePlaneWidget, "$Revision: 1.4 $");
 
43
vtkCxxRevisionMacro(vtkImagePlaneWidget, "$Revision: 1.4.2.1 $");
44
44
vtkStandardNewMacro(vtkImagePlaneWidget);
45
45
 
46
46
vtkCxxSetObjectMacro(vtkImagePlaneWidget, PlaneProperty, vtkProperty);
1335
1335
  this->OriginalLevel = 0.5*(range[0] + range[1]);
1336
1336
 
1337
1337
  this->Reslice->SetInput(this->ImageData);
1338
 
  this->SetResliceInterpolate(this->ResliceInterpolate);
 
1338
  int interpolate = this->ResliceInterpolate;
 
1339
  this->ResliceInterpolate = -1; // Force change
 
1340
  this->SetResliceInterpolate(interpolate);
1339
1341
 
1340
1342
  this->ColorMap->SetInput(this->Reslice->GetOutput());
1341
1343
 
1440
1442
 
1441
1443
  double planeOrigin[4];
1442
1444
  this->PlaneSource->GetOrigin(planeOrigin);
 
1445
 
1443
1446
  planeOrigin[3] = 1.0;
1444
1447
  double originXYZW[4];
1445
 
  this->ResliceAxes->MultiplyPoint(planeOrigin,originXYZW);
 
1448
  this->ResliceAxes->MultiplyPoint(planeOrigin, originXYZW);
1446
1449
 
1447
1450
  this->ResliceAxes->Transpose();
1448
1451
  double neworiginXYZW[4];
1449
 
  double point[] =  {originXYZW[0],originXYZW[1],originXYZW[2],originXYZW[3]};
1450
 
  this->ResliceAxes->MultiplyPoint(point,neworiginXYZW);
 
1452
  this->ResliceAxes->MultiplyPoint(originXYZW, neworiginXYZW);
1451
1453
 
1452
1454
  this->ResliceAxes->SetElement(0,3,neworiginXYZW[0]);
1453
1455
  this->ResliceAxes->SetElement(1,3,neworiginXYZW[1]);
1507
1509
        }
1508
1510
    }
1509
1511
 
1510
 
  this->Reslice->SetOutputSpacing(planeSizeX/extentX,planeSizeY/extentY,1);
1511
 
  this->Reslice->SetOutputOrigin(0.0,0.0,0.0);
1512
 
  this->Reslice->SetOutputExtent(0,extentX-1,0,extentY-1,0,0);
 
1512
  double outputSpacingX = planeSizeX/extentX;
 
1513
  double outputSpacingY = planeSizeY/extentY;
 
1514
  this->Reslice->SetOutputSpacing(outputSpacingX, outputSpacingY, 1);
 
1515
  this->Reslice->SetOutputOrigin(0.5*outputSpacingX, 0.5*outputSpacingY, 0);
 
1516
  this->Reslice->SetOutputExtent(0, extentX-1, 0, extentY-1, 0, 0);
1513
1517
}
1514
1518
 
1515
1519
vtkImageData* vtkImagePlaneWidget::GetResliceOutput()