[Paraview] Finite-size voxels and Point vs. Cell Centered Image Data
Eric Nodwell
enodwell at ucalgary.ca
Tue Jun 1 15:45:25 EDT 2010
Francois,
Thank you for the reply.
Using 2x2x2 points for one voxel is fine in principle. The difficulty is, you can't really conveniently (as far as I can tell) use a vtkImageData object for this purpose. Because now of course our scalar image data needs to be associated with cells, not to points. But vtkImageData in many cases only deals with the scalar data attached to the PointData. For example, this is from vtkImageData.cxx :
//----------------------------------------------------------------------------
// This method returns a pointer to the origin of the vtkImageData.
void *vtkImageData::GetScalarPointer()
{
if (this->PointData->GetScalars() == NULL)
{
vtkDebugMacro("Allocating scalars in ImageData");
this->AllocateScalars();
}
return this->PointData->GetScalars()->GetVoidPointer(0);
}
Notice that is method just grabs the Scalars from PointData, and other methods of vtkImageData are similar, so if you want to store the scalars in CellData, which is necessary represent voxels, it is quite difficult.
Eric
> Date: Tue, 1 Jun 2010 13:26:15 -0400
> From: Francois Bertel <francois.bertel at kitware.com>
> Subject: Re: [Paraview] Finite-size voxels and Point vs. Cell Centered
> Image Data
> To: paraview at paraview.org
> Message-ID:
> <AANLkTikZ6uW4TOfEUdMDu0XOCwc_1b4_0rs9N_z9SGtr at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello,
>
> in vtkImageData, "Dimension" is the number of points along each axis,
> not the number of cells along each axis. If you want one voxel, then
> you need 2x2x2 points.
> Note that using GetDimension() is OK but SetDimension() is only here
> for backward compatibility, use SetExtent() instead:
>
> image->SetExtent(0,1,0,1,0,1);
More information about the ParaView
mailing list