[Paraview] [Xdmf] How to write "voxel" or "image" data xdmf file.

Michael Jackson mike.jackson at bluequartz.net
Tue Feb 5 07:27:32 EST 2013


I finally got it to work, at least for Scalar values. The Dimensions in the topology section need to be 1 more than in the DataItem section because the Xdmf reader is creating a Rectilinear Grid and not "ImageData". So once I finally figured that out then I could load up some of my scalar values. 2 Step forward. 
   I then tried to load up a "Vector" data set, i.e., at set that has 3 component array at each Cell Center. This failed with various error messages also so I guess I'll try the process of elimination again for that today.

  It would be really helpful if there were more xdmc examples on their web page. Promising technology. Just needs some more documentation.


<Grid Name="Block 1" GridType="Uniform">
      <Topology TopologyType="3DCoRectMesh" Dimensions="118 202 190"></Topology>
      <Geometry Type="ORIGIN_DXDYDZ">
        <!-- Origin -->
        <DataItem Format="XML" Dimensions="3">0.0 0.0 0.0</DataItem>
        <!-- DxDyDz -->
        <DataItem Format="XML" Dimensions="3">0.25 0.25 0.25</DataItem>
      </Geometry>
      <Attribute Name="GrainIds" AttributeType="Scalar" Center="Cell">
        <DataItem Format="HDF" Dimensions="117 201 189" NumberType="Int" Precision="4">Small_IN100.dream3d:/VoxelDataContainer/CELL_DATA/GrainIds</DataItem>
      </Attribute>
      <Attribute Name="EulerAngles" AttributeType="Vector" Center="Cell">
        <DataItem Format="HDF" Dimensions="117 201 189" NumberType="Float" Precision="4">Small_IN100.dream3d:/VoxelDataContainer/CELL_DATA/EulerAngles</DataItem>
      </Attribute>
    </Grid>

--
Mike Jackson <www.bluequartz.net>

On Feb 4, 2013, at 11:29 PM, Jason Fleming <jason.fleming at seahorsecoastal.com> wrote:

> I'm looking at an XDMF xml file that I generated that works with
> Paraview (although for a 2D unstructured mesh). In the Topology element,
> I've set the NumberOfElements attribute ... I wonder if the XDMF reader
> needs that value to set up the loop to load the attribute data ... maybe
> try setting NumberOfElements in your Topology element instead of
> Dimensions?
> 
> I wouldn't think that interlacing the values into a 1D array would cause
> problems ... thats what they do in the xml examples at least.
> 
> Cheers
> Jason
> 
> On Mon, 2013-02-04 at 17:37 -0500, Michael Jackson wrote:
>> I was wondering that myself as the data inside the HDf5 file is actually encoded as a 1D array of 32 bit integers but in the xdmc file I am telling the XDMF reader that the data is 3D. Wonder if that matters? I have tried both ways and either get a read error or a ParaView crash.
>> --
>> Mike Jackson <www.bluequartz.net>
>> 
>> On Feb 4, 2013, at 5:30 PM, Jason Fleming <jason.fleming at seahorsecoastal.com> wrote:
>> 
>>> Hello Mike
>>> 
>>> I'm not sure what the issue is ... I'm assuming the hdf5 file containing
>>> the attribute data is in the same dir and the internal path is correct
>>> etc ... it all depends on how picky the XDMF reader is ... for example
>>> the number type for your Xdmf Attribute is Int but the Precision
>>> attribute is set to 4 ... I wonder if that matters to the reader.
>>> 
>>> Cheers
>>> Jason
>>> 
>>> 
>>> On Mon, 2013-02-04 at 16:54 -0500, Michael Jackson wrote:
>>>> I have this:
>>>> 
>>>> <?xml version="1.0" ?>
>>>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>>>> <Xdmf xmlns:xi="http://www.w3.org/2003/XInclude" Version="2.2">
>>>> <Information Name="DREAM3D Data File for Small IN100" Value="0"/>
>>>> <Domain>
>>>>  <Grid Name="Structured Grid" GridType="Uniform">
>>>> <Topology TopologyType="3DCoRectMesh" Dimensions="117 201 189"/>
>>>>    <Geometry GeometryType="ORIGIN_DXDYDZ">
>>>>      <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML">
>>>>         0 0 0
>>>>      </DataItem>
>>>>      <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML">
>>>>       0.25 0.25 0.25
>>>>      </DataItem>
>>>>    </Geometry>
>>>>    <Attribute Name="GrainIds" AttributeType="Scalar" Center="Cell">
>>>>      <DataItem Dimensions="117 201 189 " NumberType="Int" Precision="4" Format="HDF">
>>>>      Small_IN100.dream3d:/VoxelDataContainer/CELL_DATA/GrainIds
>>>>      </DataItem>
>>>>    </Attribute>
>>>>  </Grid>
>>>> </Domain>
>>>> </Xdmf>
>>>> 
>>>> But I get an "Can't read attribute data" error from ParaView.
>>>> --
>>>> Mike Jackson <www.bluequartz.net>
>>>> 
>>>> On Feb 4, 2013, at 11:24 AM, Jason Fleming <jason.fleming at seahorsecoastal.com> wrote:
>>>> 
>>>>> Hello Mike
>>>>> 
>>>>> I've developed some XDMF routines for ADCIRC, a finite element coastal
>>>>> ocean model. Its been a struggle, but ultimately successful. The XDMF
>>>>> technology is valuable, but somehow the community around it seems ...
>>>>> scarce. 
>>>>> 
>>>>> Anyway, I had a look at your xml, and my first guess is that you have
>>>>> placed the dimensions for your Topology element in the NumberOfElements
>>>>> attribute, instead of the Dimensions attribute ... maybe try 
>>>>> 
>>>>> <Topology TopologyType="3DCoRectMesh" Dimensions="117 201 189"/>
>>>>> 
>>>>> instead of
>>>>> 
>>>>> <Topology TopologyType="3DCORECTMesh" NumberOfElements="117 201 189 "/>
>>>>> 
>>>>> Cheers
>>>>> Jason
>>>>> 
>>>>> 
>>>>> On Mon, 2013-02-04 at 10:33 -0500, Michael Jackson wrote:
>>>>>> I have an HDF5 file that stores data on a regular voxelized grid. I have the origin, dimensions and grid deltas for each of the axis store in the file along side my data. I have tried a few different xdmf files but ParaView 3.14.1 seems to just crash or fails to read the "Attribute" data. I think it may be a "dimension" issue but there seems to be a real lack of XDMF examples on the internet to draw from.
>>>>>> 
>>>>>> This is what I have so far.
>>>>>> <?xml version="1.0" ?>
>>>>>> <!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
>>>>>> <Xdmf xmlns:xi="http://www.w3.org/2003/XInclude" Version="2.2">
>>>>>> <Information Name="DREAM3D Data File for Small IN100" Value="0"/>
>>>>>> <Domain>
>>>>>> <Grid Name="Structured Grid" GridType="Uniform">
>>>>>>   <Topology TopologyType="3DCORECTMesh" NumberOfElements="117 201 189 "/>
>>>>>>   <Geometry GeometryType="ORIGIN_DXDYDZ">
>>>>>>     <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML">
>>>>>>        0 0 0
>>>>>>     </DataItem>
>>>>>>     <DataItem Dimensions="3 " NumberType="Float" Precision="4" Format="XML">
>>>>>>      0.25 0.25 0.25
>>>>>>     </DataItem>
>>>>>>   </Geometry>
>>>>>>   <Attribute Name="GrainIds" AttributeType="Scalar" Center="Cell">
>>>>>>     <DataItem Dimensions="4444713" NumberType="Int" Precision="4" Format="HDF">
>>>>>>     Small_IN100.dream3d:/VoxelDataContainer/CELL_DATA/GrainIds
>>>>>>     </DataItem>
>>>>>>   </Attribute>
>>>>>> </Grid>
>>>>>> </Domain>
>>>>>> </Xdmf>
>>>>>> 
>>>>>> With the above the xdmf file can be read into paraview but all I get is the outline. If I attempt to display as "Surface" then I get a crash from paraview inside the vtkTupleArray() class trying to access the data. For the "DataItem" the data is actually stored in a 1D array in the HDF5 file BUT the data is really for a 3D volume of (KJI) 117 201 189. If I place those values for the "Dimensions"  in the "DataItem" then ParaView says it can not read the attribute data.
>>>>>> 
>>>>>> Does anyone have any thoughts on what might be going on?
>>>>>> ___________________________________________________________
>>>>>> Mike Jackson                    Principal Software Engineer
>>>>>> BlueQuartz Software                            Dayton, Ohio
>>>>>> mike.jackson at bluequartz.net              www.bluequartz.net
>>>>>> 
>>>>>> _______________________________________________
>>>>>> 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
>>>>> 
>>>>> -- 
>>>>> Dr. Jason G. Fleming
>>>>> Chief Engineer, Seahorse Coastal Consulting
>>>>> 3103 Mandy Ln
>>>>> Morehead City, NC 28557
>>>>> Tel: (252) 726-6323
>>>>> Mobile: (252) 269-0962
>>>>> Web: http://www.seahorsecoastal.com
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Xdmf mailing list
>>>>> Xdmf at lists.kitware.com
>>>>> http://www.kitware.com/cgi-bin/mailman/listinfo/xdmf
>>>> 
>>>> _______________________________________________
>>>> Xdmf mailing list
>>>> Xdmf at lists.kitware.com
>>>> http://www.kitware.com/cgi-bin/mailman/listinfo/xdmf
>>> 
>>> -- 
>>> Dr. Jason G. Fleming
>>> Chief Engineer, Seahorse Coastal Consulting
>>> 3103 Mandy Ln
>>> Morehead City, NC 28557
>>> Tel: (252) 726-6323
>>> Mobile: (252) 269-0962
>>> Web: http://www.seahorsecoastal.com
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xdmf mailing list
>>> Xdmf at lists.kitware.com
>>> http://www.kitware.com/cgi-bin/mailman/listinfo/xdmf
>> 
> 
> -- 
> Dr. Jason G. Fleming
> Chief Engineer, Seahorse Coastal Consulting
> 3103 Mandy Ln
> Morehead City, NC 28557
> Tel: (252) 726-6323
> Mobile: (252) 269-0962
> Web: http://www.seahorsecoastal.com
> 
> 
> 
> _______________________________________________
> Xdmf mailing list
> Xdmf at lists.kitware.com
> http://www.kitware.com/cgi-bin/mailman/listinfo/xdmf



More information about the ParaView mailing list