Commit 286c284e authored by Amy Squillacote's avatar Amy Squillacote

get values from the correct part of the new pipeline

parent 20b30705
......@@ -22,7 +22,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageButterworthHighPass, "1.24");
vtkCxxRevisionMacro(vtkImageButterworthHighPass, "1.25");
vtkStandardNewMacro(vtkImageButterworthHighPass);
//----------------------------------------------------------------------------
......@@ -68,7 +68,7 @@ void vtkImageButterworthHighPass::SetZCutOff(double cutOff)
void vtkImageButterworthHighPass::ThreadedRequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int ext[6], int id)
......@@ -89,24 +89,23 @@ void vtkImageButterworthHighPass::ThreadedRequestData(
unsigned long target;
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Error checking
if (inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()) != 2)
if (inData[0][0]->GetNumberOfScalarComponents() != 2)
{
vtkErrorMacro("Expecting 2 components not "
<< inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()));
<< inData[0][0]->GetNumberOfScalarComponents());
return;
}
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE ||
outInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE)
if (inData[0][0]->GetScalarType() != VTK_DOUBLE ||
outData[0]->GetScalarType() != VTK_DOUBLE)
{
vtkErrorMacro("Expecting input and output to be of type double");
return;
}
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
inInfo->Get(vtkDataObject::SPACING(), spacing);
inData[0][0]->GetSpacing(spacing);
inPtr = (double *)(inData[0][0]->GetScalarPointerForExtent(ext));
outPtr = (double *)(outData[0]->GetScalarPointerForExtent(ext));
......
......@@ -22,7 +22,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageButterworthLowPass, "1.25");
vtkCxxRevisionMacro(vtkImageButterworthLowPass, "1.26");
vtkStandardNewMacro(vtkImageButterworthLowPass);
//----------------------------------------------------------------------------
......@@ -68,7 +68,7 @@ void vtkImageButterworthLowPass::SetZCutOff(double cutOff)
void vtkImageButterworthLowPass::ThreadedRequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int ext[6], int id)
......@@ -89,24 +89,23 @@ void vtkImageButterworthLowPass::ThreadedRequestData(
unsigned long target;
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Error checking
if (inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()) != 2)
if (inData[0][0]->GetNumberOfScalarComponents() != 2)
{
vtkErrorMacro("Expecting 2 components not "
<< inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()));
<< inData[0][0]->GetNumberOfScalarComponents());
return;
}
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE ||
outInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE)
if (inData[0][0]->GetScalarType() != VTK_DOUBLE ||
outData[0]->GetScalarType() != VTK_DOUBLE)
{
vtkErrorMacro("Expecting input and output to be of type double");
return;
}
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
inInfo->Get(vtkDataObject::SPACING(), spacing);
inData[0][0]->GetSpacing(spacing);
inPtr = (double *)(inData[0][0]->GetScalarPointerForExtent(ext));
outPtr = (double *)(outData[0]->GetScalarPointerForExtent(ext));
......
......@@ -21,7 +21,7 @@
#include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro(vtkImageChangeInformation, "1.18");
vtkCxxRevisionMacro(vtkImageChangeInformation, "1.19");
vtkStandardNewMacro(vtkImageChangeInformation);
//----------------------------------------------------------------------------
......@@ -123,18 +123,22 @@ void vtkImageChangeInformation::ExecuteInformation (
vtkInformation *outInfo = outputVector->GetInformationObject(0);
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkImageData *inData = vtkImageData::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
int i;
int extent[6], inExtent[6];
double spacing[3], origin[3];
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),inExtent);
if (this->GetInformationInput())
vtkImageData *infoInput;
if (infoInput = this->GetInformationInput())
{
// If there is an InformationInput, it is set as a second input
vtkInformation *in2Info = inputVector[1]->GetInformationObject(0);
in2Info->Get(vtkDataObject::ORIGIN(),origin);
in2Info->Get(vtkDataObject::SPACING(),spacing);
infoInput->GetOrigin(origin);
infoInput->GetSpacing(spacing);
in2Info->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent);
for (i = 0; i < 3; i++)
{
......@@ -144,8 +148,8 @@ void vtkImageChangeInformation::ExecuteInformation (
else
{
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent);
inInfo->Get(vtkDataObject::ORIGIN(),origin);
inInfo->Get(vtkDataObject::SPACING(),spacing);
inData->GetOrigin(origin);
inData->GetSpacing(spacing);
}
for (i = 0; i < 3; i++)
......
......@@ -21,7 +21,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageIdealHighPass, "1.20");
vtkCxxRevisionMacro(vtkImageIdealHighPass, "1.21");
vtkStandardNewMacro(vtkImageIdealHighPass);
//----------------------------------------------------------------------------
......@@ -67,7 +67,7 @@ void vtkImageIdealHighPass::SetZCutOff(double cutOff)
void vtkImageIdealHighPass::ThreadedRequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int ext[6], int id)
......@@ -88,24 +88,23 @@ void vtkImageIdealHighPass::ThreadedRequestData(
unsigned long target;
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Error checking
if (inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()) != 2)
if (inData[0][0]->GetNumberOfScalarComponents() != 2)
{
vtkErrorMacro("Expecting 2 components not "
<< inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()));
<< inData[0][0]->GetNumberOfScalarComponents());
return;
}
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE ||
outInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE)
if (inData[0][0]->GetScalarType() != VTK_DOUBLE ||
outData[0]->GetScalarType() != VTK_DOUBLE)
{
vtkErrorMacro("Expecting input and output to be of type double");
return;
}
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
inInfo->Get(vtkDataObject::SPACING(), spacing);
inData[0][0]->GetSpacing(spacing);
inPtr = (double *)(inData[0][0]->GetScalarPointerForExtent(ext));
outPtr = (double *)(outData[0]->GetScalarPointerForExtent(ext));
......
......@@ -21,7 +21,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageIdealLowPass, "1.20");
vtkCxxRevisionMacro(vtkImageIdealLowPass, "1.21");
vtkStandardNewMacro(vtkImageIdealLowPass);
//----------------------------------------------------------------------------
......@@ -67,7 +67,7 @@ void vtkImageIdealLowPass::SetZCutOff(double cutOff)
void vtkImageIdealLowPass::ThreadedRequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int ext[6], int id)
......@@ -88,24 +88,23 @@ void vtkImageIdealLowPass::ThreadedRequestData(
unsigned long target;
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Error checking
if (inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()) != 2)
if (inData[0][0]->GetNumberOfScalarComponents() != 2)
{
vtkErrorMacro("Expecting 2 components not "
<< inInfo->Get(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS()));
<< inData[0][0]->GetNumberOfScalarComponents());
return;
}
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE ||
outInfo->Get(vtkDataObject::SCALAR_TYPE()) != VTK_DOUBLE)
if (inData[0][0]->GetScalarType() != VTK_DOUBLE ||
outData[0]->GetScalarType() != VTK_DOUBLE)
{
vtkErrorMacro("Expecting input and output to be of type double");
return;
}
inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
inInfo->Get(vtkDataObject::SPACING(), spacing);
inData[0][0]->GetSpacing(spacing);
inPtr = (double *)(inData[0][0]->GetScalarPointerForExtent(ext));
outPtr = (double *)(outData[0]->GetScalarPointerForExtent(ext));
......
......@@ -20,7 +20,7 @@
#include "vtkObjectFactory.h"
#include "vtkStreamingDemandDrivenPipeline.h"
vtkCxxRevisionMacro(vtkImageIslandRemoval2D, "1.44");
vtkCxxRevisionMacro(vtkImageIslandRemoval2D, "1.45");
vtkStandardNewMacro(vtkImageIslandRemoval2D);
//----------------------------------------------------------------------------
......@@ -503,15 +503,12 @@ void vtkImageIslandRemoval2D::RequestData(
outData->AllocateScalars();
// this filter expects that input is the same type as output.
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) !=
outInfo->Get(vtkDataObject::SCALAR_TYPE()))
if (inData->GetScalarType() != outData->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, "
<< vtkImageScalarTypeNameMacro(
inInfo->Get(vtkDataObject::SCALAR_TYPE()))
<< vtkImageScalarTypeNameMacro(inData->GetScalarType())
<< ", must match out ScalarType "
<< vtkImageScalarTypeNameMacro(
outInfo->Get(vtkDataObject::SCALAR_TYPE())));
<< vtkImageScalarTypeNameMacro(outData->GetScalarType()));
return;
}
......@@ -519,7 +516,7 @@ void vtkImageIslandRemoval2D::RequestData(
void *inPtr = inData->GetScalarPointerForExtent(outExt);
void *outPtr = outData->GetScalarPointerForExtent(outExt);
switch (inInfo->Get(vtkDataObject::SCALAR_TYPE()))
switch (inData->GetScalarType())
{
vtkTemplateMacro6(vtkImageIslandRemoval2DExecute, this, inData,
(VTK_TT *)(inPtr), outData, (VTK_TT *)(outPtr), outExt);
......
......@@ -22,7 +22,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageLaplacian, "1.29");
vtkCxxRevisionMacro(vtkImageLaplacian, "1.30");
vtkStandardNewMacro(vtkImageLaplacian);
//----------------------------------------------------------------------------
......@@ -193,8 +193,8 @@ void vtkImageLaplacianExecute(vtkImageLaplacian *self,
// must match input type. This method does handle boundary conditions.
void vtkImageLaplacian::ThreadedRequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector,
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int outExt[6], int id)
......@@ -202,21 +202,17 @@ void vtkImageLaplacian::ThreadedRequestData(
void *inPtr = inData[0][0]->GetScalarPointerForExtent(outExt);
void *outPtr = outData[0]->GetScalarPointerForExtent(outExt);
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// this filter expects that input is the same type as output.
if (inInfo->Get(vtkDataObject::SCALAR_TYPE()) !=
outInfo->Get(vtkDataObject::SCALAR_TYPE()))
if (inData[0][0]->GetScalarType() !=
outData[0]->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, "
<< inInfo->Get(vtkDataObject::SCALAR_TYPE())
<< ", must match out ScalarType "
<< outInfo->Get(vtkDataObject::SCALAR_TYPE()));
<< inData[0][0]->GetScalarType() << ", must match out ScalarType "
<< outData[0]->GetScalarType());
return;
}
switch (inInfo->Get(vtkDataObject::SCALAR_TYPE()))
switch (inData[0][0]->GetScalarType())
{
vtkTemplateMacro7(vtkImageLaplacianExecute, this, inData[0][0],
(VTK_TT *)(inPtr), outData[0], (VTK_TT *)(outPtr),
......
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