@@ -54,30 +54,28 @@ export function copperNrrdLoader(
5454 const rasdimensions = volume . RASDimensions ;
5555 const dimensions = volume . dimensions ;
5656
57- const ratioX = rasdimensions [ 0 ] / dimensions [ 0 ] ;
58- const ratioY = rasdimensions [ 1 ] / dimensions [ 1 ] ;
59- const ratioZ = rasdimensions [ 2 ] / dimensions [ 2 ] ;
57+ const ratio = volume . spacing ;
6058
6159 const initIndexZ = Math . floor ( dimensions [ 2 ] / 2 ) ;
6260 const initIndexY = Math . floor ( dimensions [ 1 ] / 2 ) ;
6361 const initIndexX = Math . floor ( dimensions [ 0 ] / 2 ) ;
6462
65- const sliceZ = volume . extractSlice ( "z" , initIndexZ * ratioZ ) ;
66- const sliceY = volume . extractSlice ( "y" , initIndexY * ratioY ) ;
63+ const sliceZ = volume . extractSlice ( "z" , initIndexZ * ratio [ 2 ] ) ;
64+ const sliceY = volume . extractSlice ( "y" , initIndexY * ratio [ 1 ] ) ;
6765 //x plane
68- const sliceX = volume . extractSlice ( "x" , initIndexX * ratioX ) ;
66+ const sliceX = volume . extractSlice ( "x" , initIndexX * ratio [ 0 ] ) ;
6967 sliceZ . initIndex = initIndexZ ;
7068 sliceY . initIndex = initIndexY ;
7169 sliceX . initIndex = initIndexX ;
72- sliceZ . RSARatio = ratioZ ;
73- sliceY . RSARatio = ratioY ;
74- sliceX . RSARatio = ratioX ;
75- sliceZ . MaxIndex = dimensions [ 2 ] ;
76- sliceY . MaxIndex = dimensions [ 1 ] ;
77- sliceX . MaxIndex = dimensions [ 0 ] ;
78- sliceZ . RSAMaxIndex = rasdimensions [ 2 ] ;
79- sliceY . RSAMaxIndex = rasdimensions [ 1 ] ;
80- sliceX . RSAMaxIndex = rasdimensions [ 0 ] ;
70+ sliceZ . MaxIndex = dimensions [ 2 ] - 1 ;
71+ sliceY . MaxIndex = dimensions [ 1 ] - 1 ;
72+ sliceX . MaxIndex = dimensions [ 0 ] - 1 ;
73+ sliceZ . RSARatio = ratio [ 2 ] ;
74+ sliceY . RSARatio = ratio [ 1 ] ;
75+ sliceX . RSARatio = ratio [ 0 ] ;
76+ sliceZ . RSAMaxIndex = rasdimensions [ 2 ] - 1 ;
77+ sliceY . RSAMaxIndex = rasdimensions [ 1 ] - 1 ;
78+ sliceX . RSAMaxIndex = rasdimensions [ 0 ] - 1 ;
8179
8280 nrrdMeshes = {
8381 x : sliceX . mesh ,
0 commit comments