0

I want to render volume(X.volume()) and cube(X.cube()) on one scene. For testing I use your volume files from lessons.

Case 1:

  var r = new X.renderer3D();
  r.init();
  var volume = new X.volume();
  volume.center = [0, 0, 0];
  volume.file = 'http://x.babymri.org/?avf.nrrd';

  var cube = new X.cube();
  cube.lengthX = cube.lengthY = cube.lengthZ = 20;
  cube.center = [0, 0, 0];
  cube.color = [1, 1, 1];

  r.add(volume);
  r.add(cube);
  r.render();

This case works fine, as expected:case 1.

Case 2:

  var r = new X.renderer3D();
  r.init();
  var volume = new X.volume();
  volume.center = [0, 0, 0];
  volume.file = 'http://x.babymri.org/?vol.nrrd';

  var cube = new X.cube();
  cube.lengthX = cube.lengthY = cube.lengthZ = 20;
  cube.center = [0, 0, 0];
  cube.color = [1, 1, 1];

  r.add(volume);
  r.add(cube);
  r.render();

This case works unexpected, cube center is shifted: case 2.

What is the difference of this two files?

stasovlas
  • 7,136
  • 2
  • 28
  • 29

1 Answers1

0

As far as I remember, 'center' is not actually used for the volume.

The volume is displayed in the 'ANATOMICAL COORDINATE SYSTEM'. http://www.slicer.org/slicerWiki/index.php/Coordinate_systems#Anatomical_coordinate_system

Practically, it means that avf.nrrd was actually centered on 0-0-0 when the data was acquired, whereas vol.nrrd was not.

Calling 'center' on the volume has NO effect.

As for now, the best workaround it to display the cube in the volume's center directly.

Nicolas
  • 2,191
  • 3
  • 29
  • 49