[Paraview] Finite-size voxels and Point vs. Cell Centered Image Data
burlen
burlen.loring at gmail.com
Tue Jun 1 16:04:19 EDT 2010
Hi Eric,
> 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.
Could you use the concept of a dual grid? In other words make your vis
grid node centered with the nodes located on the cell centers of your
computational grid? Your arrays end up in PointData that way with no
interpolations required.
Burlen
Eric Nodwell wrote:
> 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);
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
More information about the ParaView
mailing list