0

I'm trying to display 3D images (volumes) using Javascript and XTK. I can view the volumes fine, but I am having problems trying to access the volume dimensions.

 //Create a new volume
volume = new X.volume();

//Add data. Works fine, and I can see slice views and scroll through them
volume.file = 'http://...nrrd';

Using the next line of code, I can see in Firebug that 'volume' has a property called 'dimensions' of size 3 that holds the correct dimensions of my image.

console.log(volume); 
 dimensions -> [200, 200, 396]

However, if I try to access that array, for example like below, I get an array of [10, 10, 10]

console.log("dimensions", volume.dimensions);
dimensions -> [10, 10, 10]
nrhorner
  • 328
  • 6
  • 16

1 Answers1

1

I can get the dimensions within onShowtime, as below

sliceX.onShowtime = function() {
    var dims = volume.dimensions;
}
nrhorner
  • 328
  • 6
  • 16