- Wiki Examples:
int main(int, char *[])
{
ImageType::Pointer image = ImageType::New();
ImageType::IndexType start;
ImageType::SizeType size;
size[0] = 200;
size[1] = 200;
size[2] = 200;
start[0] = 0;
start[1] = 0;
start[2] = 0;
ImageType::RegionType region;
region.SetSize( size );
region.SetIndex( start );
image->SetRegions( region );
image->Allocate();
ImageType::PixelType initialValue;
initialValue.Fill( 0.0 );
image->FillBuffer( initialValue );
ImageType::IndexType pixelIndex;
pixelIndex[0] = 27;
pixelIndex[1] = 29;
pixelIndex[2] = 37;
ImageType::PixelType pixelValue;
pixelValue[0] = 1.345;
pixelValue[1] = 6.841;
pixelValue[2] = 3.295;
image->SetPixel( pixelIndex, pixelValue );
ImageType::PixelType value = image->GetPixel( pixelIndex );
std::cout << value << std::endl;
return 0;
}