void CreateImage(VectorImageType::Pointer image);
int main(int, char *[])
{
VectorImageType::Pointer image = VectorImageType::New();
CreateImage(image);
ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();
adaptor->SetExtractComponentIndex(0);
adaptor->SetImage(image);
index[0] = 0;
index[1] = 0;
std::cout << adaptor->GetPixel(index) << std::endl;
return EXIT_SUCCESS;
}
void CreateImage(VectorImageType::Pointer image)
{
VectorImageType::IndexType start;
VectorImageType::SizeType size;
size.Fill(2);
VectorImageType::RegionType region;
region.SetSize(size);
region.SetIndex(start);
image->SetRegions(region);
image->SetNumberOfComponentsPerPixel(2);
image->Allocate();
VariableVectorType variableLengthVector;
variableLengthVector[0] = 1;
variableLengthVector[1] = 2;
while(!imageIterator.IsAtEnd())
{
imageIterator.
Set(variableLengthVector);
++imageIterator;
}
}