[vtkusers] alignment between nifti and vtk files

Hila Hiler hilahiler at gmail.com
Sun Mar 4 18:12:38 EST 2012


Hi,

I fliped my matrix by fliplr with Matlab and afterwards set the origin by
translation with Paraview.
The vtk's direction remains the same (the origin is fixed).
note that my poly in 3D.

attached a snapshot of the direction which I'd like to convert my poly (but
it's the reflection,  not the flipping).

Thanks,
Hila.

On Fri, Mar 2, 2012 at 2:30 PM, Martijn Steenwijk <
martijnsteenwijk at gmail.com> wrote:

> Okay, what you should do is left-right flip the vtkImageData (use
> vtkImageFlip) and set the origin of the vtkImageData to (0,0,0). Probably
> this will fix the problem.
>
>
> On Fri, Mar 2, 2012 at 1:29 PM, Hila Hiler <hilahiler at gmail.com> wrote:
>
>> The poly data is a segmentation from the nifti file and was written by
>> vtkPolyDataWriter.
>> I read the nifti file by itk.
>> To visualize them I use Mitk.
>>
>> please ask more if I missed any detail ...
>>
>> On Fri, Mar 2, 2012 at 2:18 PM, Martijn Steenwijk <
>> martijnsteenwijk at gmail.com> wrote:
>>
>>> Hi Hila,
>>>
>>> How was the polydata obtained and how do you read the nifti file in VTK?
>>>
>>> Best,
>>> Martijn
>>>
>>> On Fri, Mar 2, 2012 at 12:29 PM, Hila Hiler <hilahiler at gmail.com> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have one vtk file consists of polyData and another nifti file
>>>> consists gray values.
>>>> I'd like to align them.
>>>>
>>>> *data of vtk file:
>>>> ===============*
>>>>        GetGeometry3D(0):       Geometry3D (0314A390)
>>>>          IndexToWorldTransform:
>>>>         Matrix:
>>>>           1 0 0
>>>>           0 1 0
>>>>           0 0 1
>>>>         Offset: [0, 0, 0]
>>>>         Center: [0, 0, 0]
>>>>         Translation: [0, 0, 0]
>>>>         Inverse:
>>>>           1 0 0
>>>>           0 1 0
>>>>           0 0 1
>>>>         Scale : 1 1 1
>>>>          BoundingBox:         ( -16.886,63.6804 -102.803,88.6225
>>>> -19.869,79.0607  )
>>>>          Origin: [0, 0, 0]
>>>>          ImageGeometry: 0
>>>>          Spacing: [1, 1, 1]
>>>>          TimeBounds: [-3.40282e+038, 3.40282e+038]
>>>>
>>>> *
>>>> data of nifti file:
>>>> ===============*
>>>> GetGeometry2D(0):         PlaneGeometry (0BE3CAE8)
>>>>            IndexToWorldTransform:
>>>>           Matrix:
>>>>             0.488281 0 0
>>>>             0 -0.488281 0
>>>>             0 0 -1
>>>>           Offset: [-122.375, 115.432, -122.515]
>>>>           Center: [0, 0, 0]
>>>>           Translation: [-122.375, 115.432, -122.515]
>>>>           Inverse:
>>>>             2.048 0 0
>>>>             0 -2.048 0
>>>>             0 0 -1
>>>>           Scale : 1 1 1
>>>>            BoundingBox:           ( 0,512 0,512 0,1  )
>>>>            Origin: [-122.375, 115.432, -122.515]
>>>>            ImageGeometry: 1
>>>>            Spacing: [0.488281, 0.488281, 1]
>>>>            TimeBounds: [-3.40282e+038, 3.40282e+038]
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120305/dbbcf6e4/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dir.JPG
Type: image/jpeg
Size: 27581 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120305/dbbcf6e4/attachment.jpeg>


More information about the vtkusers mailing list