[vtkusers] Rotating ImageData from vti file

David E DeMarle dave.demarle at kitware.com
Thu Apr 12 09:53:48 EDT 2012


No, vtk's image data is defined to be axis aligned.
You have to apply filters to transform them (and change type to
structuredgrid in the process), so the image data file formats are not
the place to specify the transformation you want.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909



On Wed, Apr 11, 2012 at 12:54 PM, Christoffer Green
<christoffer.green at gmail.com> wrote:
> My question was if it is possible to define this within the xml file itself.
>
> Thanks.
>
> BR/ Christoffer
>
>
> On Wed, Apr 11, 2012 at 4:20 PM, Jothybasu Selvaraj <jothybasu at gmail.com>
> wrote:
>>
>> Using vtkImageReslice you could rotate the vtkImageData.
>>
>>
>> You need to create a vtkMatrix4x4 for the rotation nad pass this matrix to
>> vtkImageReslice::
>> SetReSliceAxes
>>
>> Jothy
>>
>>
>> On Wed, Apr 11, 2012 at 3:17 PM, Jothybasu Selvaraj <jothybasu at gmail.com>
>> wrote:
>>>
>>> Using vtkImageReslice you could rotate the vtkImageData?
>>>
>>> You need to create a vtkMatrix4x4 for the rotation nad pass this matrix
>>> to vtkImageReslice::SetReSliceAxes
>>>
>>> Jothy
>>>
>>> On Wed, Apr 11, 2012 at 3:10 PM, Christoffer Green
>>> <christoffer.green at gmail.com> wrote:
>>>>
>>>> Hello!
>>>>
>>>> I have been trying to figure out if it is possible to rotate data
>>>> directly from a imagedata xml file. Can anyone lend me a hand on how to do
>>>> that?
>>>>
>>>> I am currently exporting data from matlab to a .vti imagedata xml file
>>>> and importing it to paraview (that is I am writing the file without using
>>>> vtk classes) but I
>>>> do not know how to rotate the data. According to
>>>> the www.vtk.org/VTK/img/file-formats.pdf file there is a Coordinate tag
>>>> but it does not appear to have an effect when importing, but on the
>>>> other hand its barely documented and I am really just guessing on how to use
>>>> it.
>>>>
>>>> Currently I am testing with this data (but my actual data is much
>>>> larger):
>>>>
>>>> <?xml version="1.0"?>
>>>> <VTKFile type="ImageData" version="0.1" byte_order="LittleEndian">
>>>> <ImageData WholeExtent="0 1 0 1 0 0" Origin="0.0 0.0 0.0" Spacing="0.4
>>>> 0.4 0.4">
>>>> <Piece Extent="0 1 0 1 0 0">
>>>> <Coordinates>
>>>> <DataArray type="Float32" Name="x_coordinate" format="ascii">0.0 0.3
>>>> 0.0</DataArray>
>>>> <DataArray type="Float32" Name="y_coordinate" format="ascii">0.5 0.2
>>>> 0.0</DataArray>
>>>> <DataArray type="Float32" Name="z_coordinate" format="ascii">1.0 0.0
>>>> 0.0</DataArray>
>>>> </Coordinates>
>>>> <PointData>
>>>> <DataArray type="Float32" Name="MagnitudeArray" format="ascii">0.1  0.3
>>>>  0.5  0.8</DataArray>
>>>> </PointData>
>>>> </Piece>
>>>> </ImageData>
>>>> </VTKFile>
>>>>
>>>> Thanks
>>>>
>>>> BR/ Christoffer
>>>>
>>>> _______________________________________________
>>>> 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 VTK FAQ at:
>>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>>
>>>
>>>
>>>
>>> --
>>> Jothy
>>>
>>
>>
>>
>> --
>> Jothy
>>
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list