[Paraview] wrong scalar type

Dominik Szczerba dominik at itis.ethz.ch
Sat May 28 16:04:30 EDT 2011


I have been digging deep into this issue for the recent days.
It has destructive consequences in scenarios like:

* read an xdmf file using vtkXdmfReader
* use a (old designed?) filter relying on image scalars, not point/cell data
* <bang> update the pipeline </bang>

I have seen things from crashes to highly inconsistent and
irreproducible behaviors, including segfaults on program exit and
invalid values in the output. <highlight> All these issues go away
when I use the XML VTI image reader </highlight>. I think this needs
treatment. I am glad to involve in any discussion.

Dominik

On Wed, May 25, 2011 at 10:10 AM, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
> Hi,
>
> I am reading in my data this way:
>
> reader = vtkXdmfReader()
> reader.SetFileName(infile)
> reader.Update()
> dataset = reader.GetOutputDataObject(0)
> print dataset.GetScalarType()
>
> The problem, very likely a bug, is, that the scalar type after loading
> is reported as 11 (VTK_DOUBLE) and not as expected 10 (VTK_FLOAT).
> This fools some filters later on, so I need to fix it. The input data
> is cited below, and is consistent with the actual content in the hdf5
> file.
> I am willing to fix this bug and submit a patch, but I can not find my
> way through the vtkXdfm reader. There are only two instances of
> VTK_DOUBLE, and none seems related to reading (one in reading points,
> one in converting to xdmf array). Chances are, "11" is hardcoded
> somewhere. I will be glad to receive some starting pointers.
>
> Best regards,
> Dominik
>
>
> <!DOCTYPE Xdmf>
> <Xdmf>
>  <Domain Name="domain">
>  <Grid Type="Uniform">
>   <Geometry Type="ORIGIN_DXDYDZ">
>    <DataItem NumberType="Float" Dimensions="3" Format="XML"
> Precision="4" Name="Origin">976 0 0</DataItem>
>    <DataItem NumberType="Float" Dimensions="3" Format="XML"
> Precision="4" Name="Spacing">2 0.868056 0.868056</DataItem>
>   </Geometry>
>   <Topology Dimensions="35 448 576" Type="3DCORECTMesh"/>
>   <Attribute Center="Node" Name="Source" AttributeType="Scalar">
>    <DataItem NumberType="Float" Dimensions="35 448 576" Format="HDF"
> Precision="4">boy3_knee_05_08_09a.h5:/Source</DataItem>
>   </Attribute>
>   <Attribute Center="Node" Name="Target" AttributeType="Scalar">
>    <DataItem NumberType="Float" Dimensions="35 448 576" Format="HDF"
> Precision="4">boy3_knee_05_08_09a.h5:/Target</DataItem>
>   </Attribute>
>   <Attribute Center="Node" Name="Tissue" AttributeType="Scalar">
>    <DataItem NumberType="UChar" Dimensions="35 448 576" Format="HDF"
> Precision="1">boy3_knee_05_08_09a.h5:/Tissue</DataItem>
>   </Attribute>
>  </Grid>
>  </Domain>
> </Xdmf>
>


More information about the ParaView mailing list