question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

left handed image data direction matrix

See original GitHub issue

The ImageData code says the direction matrix needs to be orthonormal, but does it also need to be right handed?

I ran into this because the VolumeMapper rendering is not right when a left handed direction matrix.

This can be reproduced by running the example like this

npm run example -- VolumeMapper

And then pasting this in the browser developer console:

source.getOutputData().getDirection()[8] *= -1

And when you rotate around you get images like this:

image

I get the same kind of issue when loading my own data with left handed direction matrices.

This is an issue because sometimes medical image acquisitions are naturally left handed. For example a person could be put in a CT scanner either foot-first of head-first. While the patient space (e.g. LPS or RAS) is right handed, the direction matrix may not be if you leave the slices in the order they were acquired. As I recall, ITK reshuffles the slices in memory in this case so that the direction matrix is right handed, but I would prefer to avoid that if possible.

It’s not clear if this is a bug in the VolumeMapper or if vtkjs is meant to require right handed direction matrices (in which case it should be documented).

Related to: https://github.com/Kitware/vtk-js/issues/499

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
martinkencommented, Sep 11, 2018

Looks to be fixed. Thanks!

1reaction
martinkencommented, Sep 10, 2018

I think I am looking into this issue right now 😃 At least it seems similar and involves an inverted axis. I’ll let you know what I find.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle images defined in left-handed coordinate ...
VTKjs supports direction vectors on image data and it was recently fixed to allow left handed matrices recently came up in vtkjs,
Read more >
Left-Handed vs. Right-Handed Viewing
By using this mirror matrix at the end, you've made your left-handed coordinate system into a right-handed one. Each time you move the...
Read more >
Changing a matrix from right-handed to left- ...
Let me try to explain it a little better. I need to export a model from Blender, in which the z axis faces...
Read more >
3-D Coordinate Systems
Microsoft Direct3D uses a left-handed coordinate system. ... Use the view matrix to scale world space by -1 in the z direction.
Read more >
Coordinate Systems
In the following it is assumed that a transformation matrix for raw image data is provided to map voxel coordinates into scanner world...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found