[Insight-users] interpolating VariableLengthVectors?

g c gc12358 at googlemail.com
Thu Feb 4 11:47:33 EST 2010


Hi,

I use the following 'solution' for interpolating a VectorImage by
using the VectorImageToImageAdaptor and interpolating each component
separately:

=======================

unsigned int Dimension = 3;
typedef float DataType;
typedef itk::VectorImage< DataType, Dimension > VectorImageType;
typedef itk::VectorImageToImageAdaptor< DataType, Dimension >
VectorImageToImageAdaptorType;
typedef itk::LinearInterpolateImageFunction<
VectorImageToImageAdaptorType, DataType >
LinearInterpolateImageFunctionType;

VectorImageToImageAdaptorType::Pointer Adaptor =
VectorImageToImageAdaptorType::New();
LinearInterpolateImageFunctionType::Pointer Interpolator =
LinearInterpolateImageFunctionType::New();

VectorImageType::Pointer VectorImage = VectorImageType::New();

...

for( unsigned int i=0; i<NrOfComp; i++)
{
    Adaptor->SetExtractComponentIndex( i );
    Adaptor->SetImage( VectorImage );
    Adaptor->Update();
    Interpolator->SetInputImage( Adaptor );

    PointsContainerIteratorType Iter = m_PointsContainer->Begin();
    unsigned int PointId = 0;
    while( Iter != m_PointsContainer->End()  )
    {
        m_Data[PointId][i] = Interpolator->Evaluate( Iter.Value() );
        Iter++;
        PointId++;
    }
}

=======================

I would still be interested if anyone knows a more direct/better way
of interpolating an itk::VectorImage.

cheers,

George


On 1 February 2010 13:29, g c <gc12358 at googlemail.com> wrote:
> Dear all,
> I may have missed this when looking through the itk documentation, but is
> there a way to interpolate the VariableLengthVectors in a VectorImage?
> I've tried:
>     typedef float DataType;
>     typedef itk::VectorImage< DataType, 3 > VectorImageType;
>     typedef itk::VectorLinearInterpolateImageFunction< VectorImageType,
> DataType > VectorImageInterpolatorType;
> but when I instantiate the interpolator using
>     VectorImageInterpolatorType::Pointer CoefficientsInterpolator =
> VectorImageInterpolatorType::New();
> I get the error 'Dimension' is not a member of
> 'itk::VariableLengthVector<mm::DataType>'
> So I guess VectorLinearInterpolateImageFunction can only be used for
> FixedArray pixel types?
> Is there an itk interpolator that can deal with VariableLengthVectors? Any
> suggestions welcome!
> Thanks,
> George


More information about the Insight-users mailing list