Commit b44c7e58 authored by Ken Martin's avatar Ken Martin

undo todays changes since I made a mess

parent dc87eb94
......@@ -20,7 +20,7 @@
#include "vtkPointData.h"
#include "vtkDataArray.h"
vtkCxxRevisionMacro(vtkImageContinuousDilate3D, "1.26.10.1");
vtkCxxRevisionMacro(vtkImageContinuousDilate3D, "1.26.10.2");
vtkStandardNewMacro(vtkImageContinuousDilate3D);
//----------------------------------------------------------------------------
......@@ -116,7 +116,7 @@ void vtkImageContinuousDilate3D::SetKernelSize(int size0, int size1, int size2)
template <class T>
void vtkImageContinuousDilate3DExecute(vtkImageContinuousDilate3D *self,
vtkImageData *mask,
vtkImageData *inData,
vtkImageData *inData, T *inPtr,
vtkImageData *outData,
int *outExt, T *outPtr, int id,
const char* inputScalars)
......@@ -127,7 +127,7 @@ void vtkImageContinuousDilate3DExecute(vtkImageContinuousDilate3D *self,
int outIdx0, outIdx1, outIdx2;
int inInc0, inInc1, inInc2;
int outInc0, outInc1, outInc2;
T *inPtr, *inPtr0, *inPtr1, *inPtr2;
T *inPtr0, *inPtr1, *inPtr2;
T *outPtr0, *outPtr1, *outPtr2;
int numComps, outIdxC;
// For looping through hood pixels
......@@ -152,8 +152,8 @@ void vtkImageContinuousDilate3DExecute(vtkImageContinuousDilate3D *self,
// Get information to march through data
inData->GetIncrements(inInc0, inInc1, inInc2);
inData->GetUpdateExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
self->GetInput()->GetUpdateExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
outData->GetIncrements(outInc0, outInc1, outInc2);
outMin0 = outExt[0]; outMax0 = outExt[1];
outMin1 = outExt[2]; outMax1 = outExt[3];
......@@ -280,11 +280,16 @@ void vtkImageContinuousDilate3D::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
int inExt[6];
this->ComputeInputUpdateExtent(inExt,outExt);
void *inPtr;
void *outPtr = outData->GetScalarPointerForExtent(outExt);
vtkImageData *mask;
vtkDataArray *inArray;
inArray = inData->GetPointData()->GetScalars(this->InputScalarsSelection);
// Reset later.
inPtr = inArray->GetVoidPointer(0);
// Error checking on mask
this->Ellipse->GetOutput()->Update();
......@@ -306,8 +311,8 @@ void vtkImageContinuousDilate3D::ThreadedExecute(vtkImageData *inData,
switch (inArray->GetDataType())
{
vtkTemplateMacro8(vtkImageContinuousDilate3DExecute, this,
mask, inData,
vtkTemplateMacro9(vtkImageContinuousDilate3DExecute, this,
mask, inData, (VTK_TT *)(inPtr),
outData, outExt, (VTK_TT *)(outPtr), id,
this->InputScalarsSelection);
default:
......
......@@ -20,7 +20,7 @@
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
vtkCxxRevisionMacro(vtkImageContinuousErode3D, "1.26.10.1");
vtkCxxRevisionMacro(vtkImageContinuousErode3D, "1.26.10.2");
vtkStandardNewMacro(vtkImageContinuousErode3D);
//----------------------------------------------------------------------------
......@@ -116,7 +116,7 @@ void vtkImageContinuousErode3D::SetKernelSize(int size0, int size1, int size2)
template <class T>
void vtkImageContinuousErode3DExecute(vtkImageContinuousErode3D *self,
vtkImageData *mask,
vtkImageData *inData,
vtkImageData *inData, T *inPtr,
vtkImageData *outData,
int *outExt, T *outPtr, int id,
const char* inputScalars)
......@@ -127,7 +127,7 @@ void vtkImageContinuousErode3DExecute(vtkImageContinuousErode3D *self,
int outIdx0, outIdx1, outIdx2;
int inInc0, inInc1, inInc2;
int outInc0, outInc1, outInc2;
T *inPtr, *inPtr0, *inPtr1, *inPtr2;
T *inPtr0, *inPtr1, *inPtr2;
T *outPtr0, *outPtr1, *outPtr2;
int numComps, outIdxC;
// For looping through hood pixels
......@@ -151,8 +151,8 @@ void vtkImageContinuousErode3DExecute(vtkImageContinuousErode3D *self,
// Get information to march through data
inData->GetIncrements(inInc0, inInc1, inInc2);
inData->GetWholeExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
self->GetInput()->GetWholeExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
outData->GetIncrements(outInc0, outInc1, outInc2);
outMin0 = outExt[0]; outMax0 = outExt[1];
outMin1 = outExt[2]; outMax1 = outExt[3];
......@@ -280,11 +280,16 @@ void vtkImageContinuousErode3D::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
int inExt[6];
this->ComputeInputUpdateExtent(inExt,outExt);
void *inPtr;
void *outPtr = outData->GetScalarPointerForExtent(outExt);
vtkImageData *mask;
vtkDataArray *inArray;
inArray = inData->GetPointData()->GetScalars(this->InputScalarsSelection);
// The inPtr is reset anyway, so just get the id 0 pointer.
inPtr = inArray->GetVoidPointer(0);
// Error checking on mask
this->Ellipse->GetOutput()->Update();
......@@ -306,8 +311,8 @@ void vtkImageContinuousErode3D::ThreadedExecute(vtkImageData *inData,
switch (inArray->GetDataType())
{
vtkTemplateMacro8(vtkImageContinuousErode3DExecute, this, mask,
inData, outData, outExt,
vtkTemplateMacro9(vtkImageContinuousErode3DExecute, this, mask,
inData, (VTK_TT *)(inPtr), outData, outExt,
(VTK_TT *)(outPtr),id, this->InputScalarsSelection);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
......
......@@ -17,7 +17,7 @@
#include "vtkImageEllipsoidSource.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkImageDilateErode3D, "1.40.10.1");
vtkCxxRevisionMacro(vtkImageDilateErode3D, "1.40.10.2");
vtkStandardNewMacro(vtkImageDilateErode3D);
//----------------------------------------------------------------------------
......@@ -113,7 +113,7 @@ void vtkImageDilateErode3D::SetKernelSize(int size0, int size1, int size2)
template <class T>
void vtkImageDilateErode3DExecute(vtkImageDilateErode3D *self,
vtkImageData *mask,
vtkImageData *inData,
vtkImageData *inData, T *inPtr,
vtkImageData *outData, int *outExt,
T *outPtr, int id)
{
......@@ -123,7 +123,7 @@ void vtkImageDilateErode3DExecute(vtkImageDilateErode3D *self,
int outIdx0, outIdx1, outIdx2;
int inInc0, inInc1, inInc2;
int outInc0, outInc1, outInc2;
T *inPtr, *inPtr0, *inPtr1, *inPtr2;
T *inPtr0, *inPtr1, *inPtr2;
T *outPtr0, *outPtr1, *outPtr2;
int numComps, outIdxC;
// For looping through hood pixels
......@@ -143,8 +143,8 @@ void vtkImageDilateErode3DExecute(vtkImageDilateErode3D *self,
// Get information to march through data
inData->GetIncrements(inInc0, inInc1, inInc2);
inData->GetWholeExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
self->GetInput()->GetWholeExtent(inImageMin0, inImageMax0, inImageMin1,
inImageMax1, inImageMin2, inImageMax2);
outData->GetIncrements(outInc0, outInc1, outInc2);
outMin0 = outExt[0]; outMax0 = outExt[1];
outMin1 = outExt[2]; outMax1 = outExt[3];
......@@ -272,6 +272,9 @@ void vtkImageDilateErode3D::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
int inExt[6];
this->ComputeInputUpdateExtent(inExt,outExt);
void *inPtr = inData->GetScalarPointerForExtent(inExt);
void *outPtr = outData->GetScalarPointerForExtent(outExt);
vtkImageData *mask;
......@@ -295,8 +298,8 @@ void vtkImageDilateErode3D::ThreadedExecute(vtkImageData *inData,
switch (inData->GetScalarType())
{
vtkTemplateMacro7(vtkImageDilateErode3DExecute, this, mask, inData,
outData, outExt,
vtkTemplateMacro8(vtkImageDilateErode3DExecute, this, mask, inData,
(VTK_TT *)(inPtr),outData, outExt,
(VTK_TT *)(outPtr),id);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
......
......@@ -20,7 +20,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageHSIToRGB, "1.3.10.1");
vtkCxxRevisionMacro(vtkImageHSIToRGB, "1.3.10.2");
vtkStandardNewMacro(vtkImageHSIToRGB);
//----------------------------------------------------------------------------
......@@ -135,37 +135,37 @@ void vtkImageHSIToRGBExecute(vtkImageHSIToRGB *self,
}
//----------------------------------------------------------------------------
void vtkImageHSIToRGB::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageHSIToRGB::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
vtkDebugMacro(<< "Execute: inData = " << inData
<< ", outData = " << outData);
// this filter expects that input is the same type as output.
if (inData[0][0]->GetScalarType() != outData[0]->GetScalarType())
if (inData->GetScalarType() != outData->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, " << inData[0][0]->GetScalarType()
<< ", must match out ScalarType " << outData[0]->GetScalarType());
vtkErrorMacro(<< "Execute: input ScalarType, " << inData->GetScalarType()
<< ", must match out ScalarType " << outData->GetScalarType());
return;
}
// need three components for input and output
if (inData[0][0]->GetNumberOfScalarComponents() < 3)
if (inData->GetNumberOfScalarComponents() < 3)
{
vtkErrorMacro("Input has too few components");
return;
}
if (outData[0]->GetNumberOfScalarComponents() < 3)
if (outData->GetNumberOfScalarComponents() < 3)
{
vtkErrorMacro("Output has too few components");
return;
}
switch (inData[0][0]->GetScalarType())
switch (inData->GetScalarType())
{
vtkTemplateMacro6(vtkImageHSIToRGBExecute,this, inData[0][0],
outData[0], outExt, id, static_cast<VTK_TT *>(0));
vtkTemplateMacro6(vtkImageHSIToRGBExecute,this, inData,
outData, outExt, id, static_cast<VTK_TT *>(0));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -24,13 +24,13 @@
#ifndef __vtkImageHSIToRGB_h
#define __vtkImageHSIToRGB_h
#include "vtkImageAlgorithm.h"
#include "vtkImageToImageFilter.h"
class VTK_IMAGING_EXPORT vtkImageHSIToRGB : public vtkImageAlgorithm
class VTK_IMAGING_EXPORT vtkImageHSIToRGB : public vtkImageToImageFilter
{
public:
static vtkImageHSIToRGB *New();
vtkTypeRevisionMacro(vtkImageHSIToRGB,vtkImageAlgorithm);
vtkTypeRevisionMacro(vtkImageHSIToRGB,vtkImageToImageFilter);
void PrintSelf(ostream& os, vtkIndent indent);
......@@ -48,7 +48,7 @@ protected:
double Maximum;
void ThreadedExecute (vtkImageData ***inData, vtkImageData **outData,
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
int ext[6], int id);
private:
vtkImageHSIToRGB(const vtkImageHSIToRGB&); // Not implemented.
......
......@@ -19,7 +19,7 @@
#include "vtkMath.h"
#include "vtkObjectFactory.h"
vtkCxxRevisionMacro(vtkImageHSVToRGB, "1.29.10.1");
vtkCxxRevisionMacro(vtkImageHSVToRGB, "1.29.10.2");
vtkStandardNewMacro(vtkImageHSVToRGB);
//----------------------------------------------------------------------------
......@@ -94,37 +94,37 @@ void vtkImageHSVToRGBExecute(vtkImageHSVToRGB *self,
}
//----------------------------------------------------------------------------
void vtkImageHSVToRGB::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageHSVToRGB::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
vtkDebugMacro(<< "Execute: inData = " << inData
<< ", outData = " << outData);
// this filter expects that input is the same type as output.
if (inData[0][0]->GetScalarType() != outData[0]->GetScalarType())
if (inData->GetScalarType() != outData->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, " << inData[0][0]->GetScalarType()
<< ", must match out ScalarType " << outData[0]->GetScalarType());
vtkErrorMacro(<< "Execute: input ScalarType, " << inData->GetScalarType()
<< ", must match out ScalarType " << outData->GetScalarType());
return;
}
// need three components for input and output
if (inData[0][0]->GetNumberOfScalarComponents() < 3)
if (inData->GetNumberOfScalarComponents() < 3)
{
vtkErrorMacro("Input has too few components");
return;
}
if (outData[0]->GetNumberOfScalarComponents() < 3)
if (outData->GetNumberOfScalarComponents() < 3)
{
vtkErrorMacro("Output has too few components");
return;
}
switch (inData[0][0]->GetScalarType())
switch (inData->GetScalarType())
{
vtkTemplateMacro6(vtkImageHSVToRGBExecute,this, inData[0][0],
outData[0], outExt, id, static_cast<VTK_TT *>(0));
vtkTemplateMacro6(vtkImageHSVToRGBExecute,this, inData,
outData, outExt, id, static_cast<VTK_TT *>(0));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -25,13 +25,13 @@
#define __vtkImageHSVToRGB_h
#include "vtkImageAlgorithm.h"
#include "vtkImageToImageFilter.h"
class VTK_IMAGING_EXPORT vtkImageHSVToRGB : public vtkImageAlgorithm
class VTK_IMAGING_EXPORT vtkImageHSVToRGB : public vtkImageToImageFilter
{
public:
static vtkImageHSVToRGB *New();
vtkTypeRevisionMacro(vtkImageHSVToRGB,vtkImageAlgorithm);
vtkTypeRevisionMacro(vtkImageHSVToRGB,vtkImageToImageFilter);
void PrintSelf(ostream& os, vtkIndent indent);
......@@ -49,7 +49,7 @@ protected:
double Maximum;
void ThreadedExecute (vtkImageData ***inData, vtkImageData **outData,
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
int ext[6], int id);
private:
vtkImageHSVToRGB(const vtkImageHSVToRGB&); // Not implemented.
......
......@@ -20,7 +20,7 @@
#include <vtkstd/algorithm>
#include <vtkstd/numeric>
vtkCxxRevisionMacro(vtkImageHybridMedian2D, "1.23.10.1");
vtkCxxRevisionMacro(vtkImageHybridMedian2D, "1.23.10.2");
vtkStandardNewMacro(vtkImageHybridMedian2D);
//----------------------------------------------------------------------------
......@@ -58,7 +58,7 @@ void vtkImageHybridMedian2DExecute(vtkImageHybridMedian2D *self,
inData->GetIncrements(inInc0, inInc1, inInc2);
inData->GetWholeExtent(wholeMin0, wholeMax0, wholeMin1, wholeMax1,
self->GetInput()->GetWholeExtent(wholeMin0, wholeMax0, wholeMin1, wholeMax1,
wholeMin2, wholeMax2);
numComps = inData->GetNumberOfScalarComponents();
outData->GetIncrements(outInc0, outInc1, outInc2);
......@@ -245,26 +245,26 @@ void vtkImageHybridMedian2DExecute(vtkImageHybridMedian2D *self,
// This method contains the first switch statement that calls the correct
// templated function for the input and output Data types.
// It hanldes image boundaries, so the image does not shrink.
void vtkImageHybridMedian2D::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageHybridMedian2D::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
void *inPtr = inData[0][0]->GetScalarPointerForExtent(outExt);
void *outPtr = outData[0]->GetScalarPointerForExtent(outExt);
void *inPtr = inData->GetScalarPointerForExtent(outExt);
void *outPtr = outData->GetScalarPointerForExtent(outExt);
// this filter expects the output type to be same as input
if (outData[0]->GetScalarType() != inData[0][0]->GetScalarType())
if (outData->GetScalarType() != inData->GetScalarType())
{
vtkErrorMacro(<< "Execute: output ScalarType, "
<< vtkImageScalarTypeNameMacro(outData[0]->GetScalarType())
<< vtkImageScalarTypeNameMacro(outData->GetScalarType())
<< " must match input scalar type");
return;
}
switch (inData[0][0]->GetScalarType())
switch (inData->GetScalarType())
{
vtkTemplateMacro7(vtkImageHybridMedian2DExecute, this, inData[0][0],
(VTK_TT *)(inPtr), outData[0], (VTK_TT *)(outPtr),
vtkTemplateMacro7(vtkImageHybridMedian2DExecute, this, inData,
(VTK_TT *)(inPtr), outData, (VTK_TT *)(outPtr),
outExt, id);
default:
......
......@@ -39,7 +39,7 @@ protected:
vtkImageHybridMedian2D();
~vtkImageHybridMedian2D() {};
void ThreadedExecute (vtkImageData ***inData, vtkImageData **outData,
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
int outExt[6], int id);
private:
vtkImageHybridMedian2D(const vtkImageHybridMedian2D&); // Not implemented.
......
......@@ -20,7 +20,7 @@
#include <math.h>
vtkCxxRevisionMacro(vtkImageLogic, "1.29.10.1");
vtkCxxRevisionMacro(vtkImageLogic, "1.29.10.2");
vtkStandardNewMacro(vtkImageLogic);
//----------------------------------------------------------------------------
......@@ -208,8 +208,8 @@ void vtkImageLogicExecute2(vtkImageLogic *self, vtkImageData *in1Data,
// algorithm to fill the output from the inputs.
// It just executes a switch statement to call the correct function for
// the regions data types.
void vtkImageLogic::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageLogic::ThreadedExecute(vtkImageData **inData,
vtkImageData *outData,
int outExt[6], int id)
{
vtkDebugMacro(<< "Execute: inData = " << inData
......@@ -222,19 +222,19 @@ void vtkImageLogic::ThreadedExecute (vtkImageData ***inData,
}
// this filter expects that input is the same type as output.
if (inData[0][0]->GetScalarType() != outData[0]->GetScalarType())
if (inData[0]->GetScalarType() != outData->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, " << inData[0][0]->GetScalarType()
<< ", must match out ScalarType " << outData[0]->GetScalarType());
vtkErrorMacro(<< "Execute: input ScalarType, " << inData[0]->GetScalarType()
<< ", must match out ScalarType " << outData->GetScalarType());
return;
}
if (this->Operation == VTK_NOT || this->Operation == VTK_NOP)
{
switch (inData[0][0]->GetScalarType())
switch (inData[0]->GetScalarType())
{
vtkTemplateMacro6(vtkImageLogicExecute1, this, inData[0][0],
outData[0], outExt, id, static_cast<VTK_TT *>(0));
vtkTemplateMacro6(vtkImageLogicExecute1, this, inData[0],
outData, outExt, id, static_cast<VTK_TT *>(0));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......@@ -242,27 +242,27 @@ void vtkImageLogic::ThreadedExecute (vtkImageData ***inData,
}
else
{
if (inData[1][0] == NULL)
if (inData[1] == NULL)
{
vtkErrorMacro(<< "Input " << 1 << " must be specified.");
return;
}
// this filter expects that inputs that have the same number of components
if (inData[0][0]->GetNumberOfScalarComponents() !=
inData[1][0]->GetNumberOfScalarComponents())
if (inData[0]->GetNumberOfScalarComponents() !=
inData[1]->GetNumberOfScalarComponents())
{
vtkErrorMacro(<< "Execute: input1 NumberOfScalarComponents, "
<< inData[0][0]->GetNumberOfScalarComponents()
<< inData[0]->GetNumberOfScalarComponents()
<< ", must match out input2 NumberOfScalarComponents "
<< inData[1][0]->GetNumberOfScalarComponents());
<< inData[1]->GetNumberOfScalarComponents());
return;
}
switch (inData[0][0]->GetScalarType())
switch (inData[0]->GetScalarType())
{
vtkTemplateMacro7(vtkImageLogicExecute2, this, inData[0][0],
inData[1][0], outData[0], outExt, id,
vtkTemplateMacro7(vtkImageLogicExecute2, this, inData[0],
inData[1], outData, outExt, id,
static_cast<VTK_TT *>(0));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
......
......@@ -66,7 +66,7 @@ protected:
int Operation;
double OutputTrueValue;
void ThreadedExecute (vtkImageData ***inData, vtkImageData **outData,
void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
int extent[6], int id);
private:
vtkImageLogic(const vtkImageLogic&); // Not implemented.
......
......@@ -16,26 +16,19 @@
#include "vtkImageData.h"
#include "vtkImageProgressIterator.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include <math.h>
vtkCxxRevisionMacro(vtkImageLuminance, "1.22.10.2");
vtkCxxRevisionMacro(vtkImageLuminance, "1.22.10.3");
vtkStandardNewMacro(vtkImageLuminance);
//----------------------------------------------------------------------------
// This method overrides information set by parent's ExecuteInformation.
void vtkImageLuminance::ExecuteInformation(
vtkInformation * vtkNotUsed( request ),
vtkInformationVector * vtkNotUsed( inputVector ),
vtkInformationVector * outputVector)
void vtkImageLuminance::ExecuteInformation(vtkImageData *vtkNotUsed(inData),
vtkImageData *outData)
{
// get the info objects
vtkInformation* outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),1);
outData->SetNumberOfScalarComponents(1);
}
//----------------------------------------------------------------------------
......@@ -76,31 +69,31 @@ void vtkImageLuminanceExecute(vtkImageLuminance *self, vtkImageData *inData,
// This method contains a switch statement that calls the correct
// templated function for the input data type. The output data
// must match input type. This method does handle boundary conditions.
void vtkImageLuminance::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageLuminance::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
vtkDebugMacro(<< "Execute: inData = " << inData
<< ", outData = " << outData);
// this filter expects that input is the same type as output.
if (inData[0][0]->GetNumberOfScalarComponents() != 3)
if (inData->GetNumberOfScalarComponents() != 3)
{
vtkErrorMacro(<< "Execute: input must have 3 components, but has " << inData[0][0]->GetNumberOfScalarComponents());
vtkErrorMacro(<< "Execute: input must have 3 components, but has " << inData->GetNumberOfScalarComponents());
return;
}
// this filter expects that input is the same type as output.
if (inData[0][0]->GetScalarType() != outData[0]->GetScalarType())
if (inData->GetScalarType() != outData->GetScalarType())
{
vtkErrorMacro(<< "Execute: input ScalarType, " << inData[0][0]->GetScalarType()
<< ", must match out ScalarType " << outData[0]->GetScalarType());
vtkErrorMacro(<< "Execute: input ScalarType, " << inData->GetScalarType()
<< ", must match out ScalarType " << outData->GetScalarType());
return;
}
switch (inData[0][0]->GetScalarType())
switch (inData->GetScalarType())
{
vtkTemplateMacro6(vtkImageLuminanceExecute, this, inData[0][0], outData[0],
vtkTemplateMacro6(vtkImageLuminanceExecute, this, inData, outData,
outExt, id, static_cast<VTK_TT *>(0));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
......
......@@ -20,25 +20,22 @@
#define __vtkImageLuminance_h
#include "vtkImageAlgorithm.h"
#include "vtkImageToImageFilter.h"
class VTK_IMAGING_EXPORT vtkImageLuminance : public vtkImageAlgorithm
class VTK_IMAGING_EXPORT vtkImageLuminance : public vtkImageToImageFilter
{
public:
static vtkImageLuminance *New();
vtkTypeRevisionMacro(vtkImageLuminance,vtkImageAlgorithm);
vtkTypeRevisionMacro(vtkImageLuminance,vtkImageToImageFilter);
protected:
vtkImageLuminance() {};
~vtkImageLuminance() {};
void ExecuteInformation (vtkInformation *, vtkInformationVector *,
vtkInformationVector *);
void ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
int outExt[6], int id);
void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
void ExecuteInformation(){this->vtkImageToImageFilter::ExecuteInformation();};
void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
int ext[6], int id);
private:
vtkImageLuminance(const vtkImageLuminance&); // Not implemented.
void operator=(const vtkImageLuminance&); // Not implemented.
......
......@@ -16,25 +16,20 @@
#include "vtkImageData.h"
#include "vtkImageProgressIterator.h"
#include "vtkInformation.h"
#include "vtkInformationVector.h"
#include "vtkObjectFactory.h"
#include "vtkPointData.h"
#include "vtkStreamingDemandDrivenPipeline.h"
#include <math.h>
vtkCxxRevisionMacro(vtkImageMagnitude, "1.36.10.2");
vtkCxxRevisionMacro(vtkImageMagnitude, "1.36.10.3");
vtkStandardNewMacro(vtkImageMagnitude);
void vtkImageMagnitude::ExecuteInformation(
vtkInformation * vtkNotUsed( request ),
vtkInformationVector * vtkNotUsed( inputVector ),
vtkInformationVector * outputVector)
//----------------------------------------------------------------------------
// This method tells the superclass that the first axis will collapse.
void vtkImageMagnitude::ExecuteInformation(vtkImageData *vtkNotUsed(inData),
vtkImageData *outData)
{
// get the info objects
vtkInformation* outInfo = outputVector->GetInformationObject(0);
outInfo->Set(vtkDataObject::SCALAR_NUMBER_OF_COMPONENTS(),1);
outData->SetNumberOfScalarComponents(1);
}
//----------------------------------------------------------------------------
......@@ -83,30 +78,30 @@ void vtkImageMagnitudeExecute(vtkImageMagnitude *self,
// This method contains a switch statement that calls the correct
// templated function for the input data type. The output data
// must match input type. This method does handle boundary conditions.
void vtkImageMagnitude::ThreadedExecute (vtkImageData ***inData,
vtkImageData **outData,
void vtkImageMagnitude::ThreadedExecute(vtkImageData *inData,
vtkImageData *outData,
int outExt[6], int id)
{
// This is really meta data and should be set in ExecuteInformation,