Commit 77e62423 authored by David Gobbi's avatar David Gobbi Committed by Kitware Robot

Merge topic 'deprecate-getwholeextent'

7c202121 Deprecate vtkAbstractImageInterpolator::GetWholeExtent.
ab713222 Remove obsolete WholeExtent check.
ea7ea285 Remove redundant type check.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1303
parents 998171f2 7c202121
......@@ -66,8 +66,6 @@ vtkAbstractImageInterpolator::vtkAbstractImageInterpolator()
{
this->Extent[2*j] = 0;
this->Extent[2*j+1] = -1;
this->WholeExtent[2*j] = 0;
this->WholeExtent[2*j+1] = -1;
this->Spacing[j] = 1.0;
this->Origin[j] = 0.0;
}
......@@ -110,7 +108,6 @@ void vtkAbstractImageInterpolator::DeepCopy(vtkAbstractImageInterpolator *obj)
this->SetComponentCount(obj->ComponentCount);
this->SetBorderMode(obj->BorderMode);
obj->GetExtent(this->Extent);
obj->GetWholeExtent(this->WholeExtent);
obj->GetOrigin(this->Origin);
obj->GetSpacing(this->Spacing);
if (this->Scalars)
......@@ -139,10 +136,6 @@ void vtkAbstractImageInterpolator::PrintSelf(ostream& os, vtkIndent indent)
os << indent << "Extent: " << this->Extent[0] << " " << this->Extent[1]
<< " " << this->Extent[2] << " " << this->Extent[3]
<< " " << this->Extent[4] << " " << this->Extent[5] << "\n";
os << indent << "WholeExtent: "
<< this->WholeExtent[0] << " " << this->WholeExtent[1] << " "
<< this->WholeExtent[2] << " " << this->WholeExtent[3] << " "
<< this->WholeExtent[4] << " " << this->WholeExtent[5] << "\n";
os << indent << "Origin: " << this->Origin[0] << " " << this->Origin[1]
<< " " << this->Origin[2] << "\n";
os << indent << "Spacing: " << this->Spacing[0] << " " << this->Spacing[1]
......@@ -266,7 +259,6 @@ void vtkAbstractImageInterpolator::Initialize(vtkDataObject *o)
// get the image information
data->GetSpacing(this->Spacing);
data->GetOrigin(this->Origin);
data->GetExtent(this->WholeExtent);
data->GetExtent(this->Extent);
// call update
......@@ -317,10 +309,9 @@ void vtkAbstractImageInterpolator::Update()
extent[4] = this->Extent[4];
extent[5] = this->Extent[5];
// use the WholeExtent and Tolerance to set the bounds
// use the Extent and Tolerance to set the bounds
double *bounds = this->StructuredBoundsDouble;
float *fbounds = this->StructuredBoundsFloat;
int *wholeExtent = this->WholeExtent;
double tol = this->Tolerance;
// always restrict the bounds to the limits of int
int supportSize[3];
......@@ -335,13 +326,13 @@ void vtkAbstractImageInterpolator::Update()
for (int i = 0; i < 3; i++)
{
// use min tolerance of 0.5 if just one slice thick
double newtol = 0.5*(wholeExtent[2*i] == wholeExtent[2*i+1]);
double newtol = 0.5*(extent[2*i] == extent[2*i+1]);
newtol = ((newtol > tol) ? newtol : tol);
double bound = wholeExtent[2*i] - newtol;
double bound = extent[2*i] - newtol;
bound = ((bound > minbound) ? bound : minbound);
fbounds[2*i] = bounds[2*i] = bound;
bound = wholeExtent[2*i+1] + newtol;
bound = extent[2*i+1] + newtol;
bound = ((bound < maxbound) ? bound : maxbound);
fbounds[2*i+1] = bounds[2*i+1] = bound;
}
......@@ -509,3 +500,22 @@ void vtkAbstractImageInterpolator::FreePrecomputedWeights(
weights = NULL;
}
//----------------------------------------------------------------------------
#if !defined(VTK_LEGACY_REMOVE)
int *vtkAbstractImageInterpolator::GetWholeExtent()
{
VTK_LEGACY_REPLACED_BODY(
vtkAbstractImageInterpolator::GetWholeExtent, "VTK 7.1",
vtkAbstractImageInterpolator::GetExtent);
return this->GetExtent();
}
void vtkAbstractImageInterpolator::GetWholeExtent(int extent[6])
{
VTK_LEGACY_REPLACED_BODY(
vtkAbstractImageInterpolator::GetWholeExtent, "VTK 7.1",
vtkAbstractImageInterpolator::GetExtent);
this->GetExtent(extent);
}
#endif
......@@ -213,7 +213,8 @@ public:
// Description:
// Get the whole extent of the data being interpolated, including
// parts of the data that are not currently in memory.
vtkGetVector6Macro(WholeExtent, int);
VTK_LEGACY(int *GetWholeExtent());
VTK_LEGACY(void GetWholeExtent(int extent[6]));
protected:
vtkAbstractImageInterpolator();
......@@ -248,7 +249,6 @@ protected:
vtkDataArray *Scalars;
double StructuredBoundsDouble[6];
float StructuredBoundsFloat[6];
int WholeExtent[6];
int Extent[6];
double Spacing[3];
double Origin[3];
......
......@@ -2054,7 +2054,6 @@ void vtkImageResliceExecute(vtkImageReslice *self,
int componentOffset = interpolator->GetComponentOffset();
int borderMode = interpolator->GetBorderMode();
int *inExt = interpolator->GetExtent();
int *inWholeExt = interpolator->GetWholeExtent();
vtkIdType inInc[3];
inInc[0] = scalars->GetNumberOfComponents();
inInc[1] = inInc[0]*(inExt[1] - inExt[0] + 1);
......@@ -2084,10 +2083,7 @@ void vtkImageResliceExecute(vtkImageReslice *self,
!(newtrans || perspective || convertScalars || rescaleScalars) &&
inputScalarType == outData->GetScalarType() &&
fullSize == scalars->GetNumberOfTuples() &&
self->GetBorder() == 1 && nsamples <= 1 &&
inExt[0] >= inWholeExt[0] && inExt[1] <= inWholeExt[1] &&
inExt[2] >= inWholeExt[2] && inExt[3] <= inWholeExt[3] &&
inExt[4] >= inWholeExt[4] && inExt[5] <= inWholeExt[5])
self->GetBorder() == 1 && nsamples <= 1)
{
optimizeNearest = 1;
}
......@@ -2842,7 +2838,6 @@ void vtkReslicePermuteExecute(vtkImageReslice *self,
bool doConversion = true;
int inputScalarType = scalars->GetDataType();
if (interpolationMode == VTK_NEAREST_INTERPOLATION &&
interpolator->IsA("vtkImageInterpolator") &&
inputScalarType == scalarType && !convertScalars && !rescaleScalars &&
nsamples == 1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment