[Insight-users] orientation of vectors of the coefficient image of a bsplineDeformableTransform

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 30 19:38:31 EDT 2004


Hi Kristina,

This is a misleading lateral effect of the interpretation
that ParaView makes regarding where is Up and Down in an
image. To be more precise, the interpretation of (-Y,+Y)
in ParaView is different from the ITK assumption.

As a consequence, when you load a vector field such as yours
where the +Y side has vector of one sign and the -Y side has
vectors of opposite sign, the result is that the vectors end
up pointing to the wrong direction.

You can easily solve this by using the "Calculator". It allows
you to take the components of a vector image and compose a new
image by using an algebraic expression.



Please do the follwing:

1) Load your Meta image in ParaView.

2) Select "Calculator"

3) In the lower right button "scalars"
    select "Image_0"

4) click on the "*" button

5) click on the "iHat" button

6) click on the "+" button

7) In the lower right button "scalars"
    select "Image_1"

8) click on the "*" button

9) click on the "jHat" button

10) click on the "+" button

11) In the lower right button "scalars"
    select "Image_2"

12) click on the "*" button

13) click on the "kHat" button

14) click on "Accept"


At this point you have constructed an image
where the vector components are


          ( +Vx, -Vy, +Vz )


If you Glyph this new image, you will se
what you expect from the vector field.


For your convenience, we are attaching to
this email a ParaView session that already
does this setup. For using it you will have
to edit it (it is a text file) and replace
the data filenames for the location of your
files.



Please let us know if you have further
questions


   Thanks



      Luis



-------------------------
Kristina Grunewald wrote:

> Hello everybody,
> 
> I am registering a circle (fixed image) and a square (moving image).
> The square is smaller than the circle and their centers are superimposed.
> The transform is BSPlineDeformableTransform and the metric MeanSquares.
> This works well and results exactly in what I expect.
> 
> Except for:
> I am writing the coefficient images of the bspline transform to a vector
> image and then view it with paraview.
> To do so I use 3d vectors having the z-component being set to zero and
> a 3d image consisting of one slice.
> Having a 2d image consisting of 2d vectors it isn't possible in
> paraview to set the orient mode to vector when applying a glyph filter.
> However, this seems to work well, too.
> The only thing I am wondering about is the direction of the vectors:
> I would have expected them to direct from the center of the image to its
> borders.
> This is only the case in y-direction.
> In x-direction the vectors point from the the border to the center of
> the image.
> 
> I attached my resulting coefficient image.
> 
> When I view the displacement field, the vectors are oriented in the same
> way.
> 
> Could anybody explain to me what I am not getting?
> 
> Thanks,
> Kristina
> 
> 
> ------------------------------------------------------------------------
> 
> ObjectType = Image
> NDims = 3
> BinaryData = True
> BinaryDataByteOrderMSB = False
> DimSize = 13 13 1
> ElementNumberOfChannels = 3
> ElementType = MET_FLOAT
> ElementDataFile = coeffs2.raw
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users

--------------------------------------------------------------------------------














-------------- next part --------------
# ParaView State Version 1.2

set kw(vtkTemp5) [$Application GetMainWindow]
set kw(vtkTemp19) [$kw(vtkTemp5) GetMainView]
set kw(vtkTemp164) [$kw(vtkTemp5) GetAnimationInterface]
[$kw(vtkTemp5) GetRotateCameraButton] SetState 1
$kw(vtkTemp5) ChangeInteractorStyle 1
set kw(vtkTemp781) [$kw(vtkTemp5) InitializeReadCustom "Meta Image Reader" "E:/cygwin/home/ibanez/src/UsersITK/KristinaGrunewald/coeffs2.mhd"]
$kw(vtkTemp5) ReadFileInformation $kw(vtkTemp781) "E:/cygwin/home/ibanez/src/UsersITK/KristinaGrunewald/coeffs2.mhd"
$kw(vtkTemp5) FinalizeRead $kw(vtkTemp781) "E:/cygwin/home/ibanez/src/UsersITK/KristinaGrunewald/coeffs2.mhd"
set kw(vtkTemp786) [$kw(vtkTemp781) GetPVWidget {Filename}]
$kw(vtkTemp786) SetValue "E:/cygwin/home/ibanez/src/UsersITK/KristinaGrunewald/coeffs2.mhd"
$kw(vtkTemp781) AcceptCallback
set kw(vtkTemp793) [$kw(vtkTemp781) GetPVOutput]
$kw(vtkTemp793) ColorByPointField {ImageFile} 3
$kw(vtkTemp793) DrawSurface
$kw(vtkTemp793) SetVisibility 0
$kw(vtkTemp5) SetCurrentPVSourceCallback $kw(vtkTemp781)
set kw(vtkTemp1406) [$kw(vtkTemp5) CreatePVSource Calculator]
set kw(vtkTemp1427) [$kw(vtkTemp1406) GetPVWidget {Input}]
$kw(vtkTemp1427) SetCurrentValue $kw(vtkTemp781)
set kw(vtkTemp1413) [$kw(vtkTemp1406) GetPVWidget {ResultArray}]
$kw(vtkTemp1413) SetValue {Result}
set kw(vtkTemp1418) [$kw(vtkTemp1406) GetPVWidget {Equation}]
$kw(vtkTemp1418) AddScalarVariable {ImageFile_0} {ImageFile} 0
$kw(vtkTemp1418) AddScalarVariable {ImageFile_1} {ImageFile} 1
$kw(vtkTemp1418) AddScalarVariable {ImageFile_2} {ImageFile} 2
$kw(vtkTemp1418) SetFunctionLabel {ImageFile_0*iHat-ImageFile_1*jHat+ImageFile_2*kHat}
$kw(vtkTemp1406) AcceptCallback
set kw(vtkTemp1431) [$kw(vtkTemp1406) GetPVOutput]
$kw(vtkTemp1431) ColorByPointField {ImageFile} 3
$kw(vtkTemp1431) DrawSurface
$kw(vtkTemp1431) SetVisibility 0
set kw(vtkTemp230) [$kw(vtkTemp5) GetPVSource GlyphSources Arrow0]
$kw(vtkTemp5) SetCurrentPVSourceCallback $kw(vtkTemp1406)
set kw(vtkTemp1535) [$kw(vtkTemp5) CreatePVSource Glyph]
set kw(vtkTemp1560) [$kw(vtkTemp1535) GetPVWidget {Input}]
$kw(vtkTemp1560) SetCurrentValue $kw(vtkTemp1406)
set kw(vtkTemp1561) [$kw(vtkTemp1535) GetPVWidget {Glyph}]
set kw(vtkTemp230) [$kw(vtkTemp5) GetPVSource GlyphSources Arrow0]
$kw(vtkTemp1561) SetCurrentValue $kw(vtkTemp230)
set kw(vtkTemp1549) [$kw(vtkTemp1535) GetPVWidget {OrientScale}]
$kw(vtkTemp1549) SetOrientMode {Vector}
$kw(vtkTemp1549) SetScaleMode {Vector Magnitude}
$kw(vtkTemp1549) SetScalars {ImageFile}
$kw(vtkTemp1549) SetVectors {Result}
$kw(vtkTemp1549) SetScaleFactor 0.035735
set kw(vtkTemp1551) [$kw(vtkTemp1535) GetPVWidget {Max Glyphs}]
$kw(vtkTemp1551) SetValue 5000
set kw(vtkTemp1554) [$kw(vtkTemp1535) GetPVWidget {MaskPoints}]
$kw(vtkTemp1554) SetState 1
set kw(vtkTemp1557) [$kw(vtkTemp1535) GetPVWidget {RandomMask}]
$kw(vtkTemp1557) SetState 1
$kw(vtkTemp1535) AcceptCallback
set kw(vtkTemp1565) [$kw(vtkTemp1535) GetPVOutput]
$kw(vtkTemp1565) ColorByPointField {ImageFile} 3
$kw(vtkTemp1565) DrawSurface
$kw(vtkTemp1565) SetCubeAxesVisibility 1
$kw(vtkTemp1565) SetVisibility 1
set kw(vtkTemp900) [$kw(vtkTemp5) GetPVColorMap {ImageFile} 3]
$kw(vtkTemp900) SetScalarRange -33.5288 32.4289
$kw(vtkTemp900) SetStartHSV 0.6667 1 1
$kw(vtkTemp900) SetEndHSV 0 1 1
$kw(vtkTemp900) VectorModeComponentCallback
$kw(vtkTemp900) SetScalarBarVisibility 0
set kw(vtkTemp1224) [$kw(vtkTemp5) GetPVColorMap {Result} 1]
$kw(vtkTemp1224) SetScalarRange -33.5288 32.4289
$kw(vtkTemp1224) SetStartHSV 0.6667 1 1
$kw(vtkTemp1224) SetEndHSV 0 1 1
$kw(vtkTemp1224) SetScalarBarVisibility 1
$kw(vtkTemp1224) SetScalarBarPosition1 0.858411 0.259728
$kw(vtkTemp1224) SetScalarBarPosition2 0.13 0.5
$kw(vtkTemp19) SetBackgroundColor 0.752941 0.752941 0.752941
$kw(vtkTemp19) ParallelProjectionOff
$kw(vtkTemp19) SetCameraState 5.94437 6.05563 34.8663 5.94437 6.05563 -1.51797 0 1 0
$kw(vtkTemp19) SetUseTriangleStrips 0
$kw(vtkTemp19) SetUseImmediateMode 1
set kw(vtkTemp92) [$kw(vtkTemp19) GetRenderModuleUI]
catch {$kw(vtkTemp92) SetLODThreshold 1e+038}
catch {$kw(vtkTemp92) SetLODResolution 50}
catch {$kw(vtkTemp92) SetRenderInterruptsEnabled 1}
set kw(vtkTemp45) [$kw(vtkTemp19) GetCornerAnnotation]
$kw(vtkTemp45) SetVisibility 0
$kw(vtkTemp45) SetCornerText {} 0
$kw(vtkTemp45) SetCornerText {} 1
$kw(vtkTemp45) SetCornerText {} 2
$kw(vtkTemp45) SetCornerText {} 3
$kw(vtkTemp45) SetMaximumLineHeight 0.07
set kw(vtkTemp61) [$kw(vtkTemp45) GetTextPropertyWidget]
$kw(vtkTemp61) SetColor 1 1 1
$kw(vtkTemp61) SetFontFamily 0
$kw(vtkTemp61) SetBold 0
$kw(vtkTemp61) SetItalic 0
$kw(vtkTemp61) SetShadow 0
$kw(vtkTemp61) SetOpacity 1
$kw(vtkTemp19) SetOrientationAxesVisibility 0
$kw(vtkTemp19) SetOrientationAxesInteractivity 1
$kw(vtkTemp19) SetOrientationAxesOutlineColor 1 1 1
set kw(vtkTemp229) [$kw(vtkTemp19) GetManipulatorControl2D]
$kw(vtkTemp229) SetCurrentManipulator 0 1 {Roll}
$kw(vtkTemp229) SetCurrentManipulator 0 0 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 1 0 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 1 1 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 2 1 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 0 2 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 1 2 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 2 2 {Pan}
$kw(vtkTemp229) SetCurrentManipulator 2 0 {Zoom}
set kw(vtkTemp218) [$kw(vtkTemp19) GetManipulatorControl3D]
$kw(vtkTemp218) SetCurrentManipulator 0 2 {FlyIn}
$kw(vtkTemp218) SetCurrentManipulator 2 2 {FlyOut}
$kw(vtkTemp218) SetCurrentManipulator 0 0 {Rotate}
$kw(vtkTemp218) SetCurrentManipulator 1 1 {Rotate}
$kw(vtkTemp218) SetCurrentManipulator 1 2 {Rotate}
$kw(vtkTemp218) SetCurrentManipulator 0 1 {Roll}
$kw(vtkTemp218) SetCurrentManipulator 1 0 {Pan}
$kw(vtkTemp218) SetCurrentManipulator 2 1 {Pan}
$kw(vtkTemp218) SetCurrentManipulator 2 0 {Zoom}
set kw(vtkTemp218) [$kw(vtkTemp19) GetManipulatorControl3D]
set kw(vtkTemp225) [$kw(vtkTemp218) GetWidget {FlySpeed}]
$kw(vtkTemp225) SetValue 1
$kw(vtkTemp164) SetNumberOfFrames 100
$kw(vtkTemp164) SetCurrentTime 0
$kw(vtkTemp164) SetCacheGeometry 0
$kw(vtkTemp5) SetCenterOfRotation 6 6 0


More information about the Insight-users mailing list