[Insight-users] generating a vector Image
David Doria
daviddoria at gmail.com
Fri May 18 11:32:32 EDT 2012
> vectorImage->SetVectorLength(vectorLength);
> vectorImage->SetSpacing(vec_spacing);
>
> It shouldn't be?:
>
>
> typedef itk::Image<unsigned short, 3> ImageType;
>
> void CreateImage(ImageType* const image)
> {
> ImageType::IndexType start;
> start.Fill(0);
>
> ImageType::SizeType size;
> size[0] =202; size[1] =419; size[2] = 157;
>
> image->SetSpacing(vec_spacing);
> image->SetRegions(region);
> image->SetVectorLength(vectorLength);
> image->Allocate();
> }
I was trying to make you an image of your input type:
typedef itk::Image < pixelType, myDimension > ImageType;
so that you could try to convert it to the itk::VectorImage that you
want. The spacing shouldn't matter for this (trying to make the
example as simple as possible), and SetVectorLength is something that
you need to do in your conversion code, not in this code to create a
dummy image.
typedef itk::Image < pixelType, myDimension > ImageType;
More information about the Insight-users
mailing list