138 |
{ |
{ |
139 |
#define M(i,j) m[i].r[j] |
#define M(i,j) m[i].r[j] |
140 |
|
|
141 |
|
// compute the offset to the first space axis |
142 |
|
int base = nin->dim - nin->spaceDim; |
143 |
|
|
144 |
// Image axis Scaling and Rotation |
// Image axis Scaling and Rotation |
145 |
M(0,0) = nin->axis[0].spaceDirection[0]; |
M(0,0) = nin->axis[base+0].spaceDirection[0]; |
146 |
|
|
147 |
// Image location |
// Image location |
148 |
M(0,1) = nin->spaceOrigin[0]; |
M(0,1) = nin->spaceOrigin[0]; |
204 |
{ |
{ |
205 |
#define M(i,j) m[i].r[j] |
#define M(i,j) m[i].r[j] |
206 |
|
|
207 |
|
// compute the offset to the first space axis |
208 |
|
int base = nin->dim - nin->spaceDim; |
209 |
|
|
210 |
// Image axis Scaling and Rotation |
// Image axis Scaling and Rotation |
211 |
M(0,0) = nin->axis[0].spaceDirection[0]; |
M(0,0) = nin->axis[base+0].spaceDirection[0]; |
212 |
M(1,0) = nin->axis[0].spaceDirection[1]; |
M(1,0) = nin->axis[base+0].spaceDirection[1]; |
213 |
M(0,1) = nin->axis[1].spaceDirection[0]; |
M(0,1) = nin->axis[base+1].spaceDirection[0]; |
214 |
M(1,1) = nin->axis[1].spaceDirection[1]; |
M(1,1) = nin->axis[base+1].spaceDirection[1]; |
215 |
|
|
216 |
// Image location |
// Image location |
217 |
M(0,2) = nin->spaceOrigin[0]; |
M(0,2) = nin->spaceOrigin[0]; |
384 |
{ |
{ |
385 |
#define M(i,j) m[i].r[j] |
#define M(i,j) m[i].r[j] |
386 |
|
|
387 |
|
// compute the offset to the first space axis |
388 |
|
int base = nin->dim - nin->spaceDim; |
389 |
|
|
390 |
// Image axis Scaling and Rotation |
// Image axis Scaling and Rotation |
391 |
M(0,0) = nin->axis[0].spaceDirection[0]; |
M(0,0) = nin->axis[base+0].spaceDirection[0]; |
392 |
M(1,0) = nin->axis[0].spaceDirection[1]; |
M(1,0) = nin->axis[base+0].spaceDirection[1]; |
393 |
M(2,0) = nin->axis[0].spaceDirection[2]; |
M(2,0) = nin->axis[base+0].spaceDirection[2]; |
394 |
M(0,1) = nin->axis[1].spaceDirection[0]; |
M(0,1) = nin->axis[base+1].spaceDirection[0]; |
395 |
M(1,1) = nin->axis[1].spaceDirection[1]; |
M(1,1) = nin->axis[base+1].spaceDirection[1]; |
396 |
M(2,1) = nin->axis[1].spaceDirection[2]; |
M(2,1) = nin->axis[base+1].spaceDirection[2]; |
397 |
M(0,2) = nin->axis[2].spaceDirection[0]; |
M(0,2) = nin->axis[base+2].spaceDirection[0]; |
398 |
M(1,2) = nin->axis[2].spaceDirection[1]; |
M(1,2) = nin->axis[base+2].spaceDirection[1]; |
399 |
M(2,2) = nin->axis[2].spaceDirection[2]; |
M(2,2) = nin->axis[base+2].spaceDirection[2]; |
400 |
|
|
401 |
// Image location |
// Image location |
402 |
M(0,3) = nin->spaceOrigin[0]; |
M(0,3) = nin->spaceOrigin[0]; |