[vtkusers] vtk structure

mmavila at unex.es mmavila at unex.es
Thu Jun 19 11:14:01 EDT 2008


Hi,
I have got several 512x512 images in a folder, and I load all of them by
means of vtkJPEGReader. After that, I build a three-dimensional image,
using these simple images:

  vtkJPEGReader *Image = vtkJPEGReader::New();
  Image->SetFilePrefix("../../Imagenes/MR00");
  Image->SetFilePattern("%s%i.jpg");
  Image->SetFileDimensionality(3);
  Image->SetDataExtent(0, 512, 0, 512, 40,55 );
  Image->SetDataOrigin(0,0,0);
  Image->SetDataScalarTypeToUnsignedChar();
  Image->SetDataSpacing(1, 1,2);
  Image->Update();

Totally, I have got 16 images. The gap between each pair of them (slice
thickness) is about 2 pixels. So, (1 image + 2 pixel) x 16 images = 48 – 2
(last gap) = 46 in the Z-axis. I use the following code to build the
3D-image (using interpolation):

  vtkVolumeProperty *vp = vtkVolumeProperty::New();
  vp->SetColor(colTransFunc);
  vp->SetScalarOpacity(opaTransFunc);
  vp->ShadeOn();
  vp->SetInterpolationTypeToLinear();

I suppose the result is a 512 x 512 x 46 matrix.
How can I read / write data from this final matrix?
What is the best structure to deal with this matrix?

Thanks in advance!!





More information about the vtkusers mailing list