[Paraview] wrong scalar type

Dominik Szczerba dominik at itis.ethz.ch
Wed May 25 04:10:35 EDT 2011


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