Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
CamiTK Community Edition
CamiTK Community Edition
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • CamiTK
  • CamiTK Community EditionCamiTK Community Edition
  • Issues
  • #66

Closed
Open
Opened Jun 21, 2018 by Emmanuel Promayon@promayoe
  • Report abuse
  • New issue
Report abuse New issue

Load mha rotation/translation in the proper order

About you

This was a bug submitted to the old bugzilla by Guillaume Custillon on 2016-03-17

Overview

When loading an mhd/mha image that contains some transformation, the translation (offset) is not handled correctly. Indeed, the rotation matrix should be applied and then the translation in the world frame. However, on CamiTK the rotation is applied, and then the translation in the rotated frame.

Steps to Reproduce

  • Open imp and load the attached mha test image:

test_frame_image.mha

It is a 2D image with a rotation of 45° around z axis and a translation of 10 mm on the x axis.

  • Display the world frame.

Actual VS Expected Result

  • Observe the location of the image: the translation is not made on the x axis of the world frame, but on the x axis of > the rotated image frame.

Relevant logs and/or screenshots:

Interpretation & Possible fixes:

This is the answer given by @jaffarda on 2016-03-22

Following is based on the test image provided by Guillaume.

***** The Bug, reworded ****** According to the data in file: TransformMatrix (which contains rotation matrix of frame) is 0.707 -0.707 0 0.707 0.707 0 0 0 1 and Offset (which contains translation of frame) is 10 0 0

Opening this image with camiTK: rotation is OK translation become 7.07 7.07 0

in other words, the translation is applied in rotated frame, but we expect it to be applied in world frame

***** suggested fix *****

based on tests on this image,

in ImageComponent.cpp (line 290), the line

vtkMatrix4x4::Multiply4x4(rotationMatrix, initialTranslation->GetMatrix(), initialFrameMatrix);

should become :
```cpp
vtkMatrix4x4::Multiply4x4(initialTranslation->GetMatrix(), rotationMatrix, initialFrameMatrix);

***** WARNING ***** This change in a core file should only be commit after deep tests on every thing it may impact.

CamiTK Version:

This was submitted for CamiTK 3.5.0.svn but is still present in CamiTK 4.1.develop

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
4
Labels
Bug Sandbox Track Debugging Track Prototyping Experience
Assign labels
  • View project labels
Reference: CamiTK/CamiTK#66