| 401 | } |
| 402 | |
| 403 | void vtkImageReader::ComputeTransformedSpacing(double Spacing[3]) |
| 404 | { |
| 405 | if (!this->Transform) |
| 406 | { |
| 407 | memcpy(Spacing, this->DataSpacing, 3 * sizeof(double)); |
| 408 | } |
| 409 | else |
| 410 | { |
| 411 | double transformedSpacing[3]; |
| 412 | memcpy(transformedSpacing, this->DataSpacing, 3 * sizeof(double)); |
| 413 | this->Transform->TransformVector(transformedSpacing, transformedSpacing); |
| 414 | |
| 415 | for (int i = 0; i < 3; i++) |
| 416 | { |
| 417 | Spacing[i] = fabs(transformedSpacing[i]); |
| 418 | } |
| 419 | vtkDebugMacro("Transformed Spacing " << Spacing[0] << ", " << Spacing[1] << ", " << Spacing[2]); |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | // if the spacing is negative we need to translate the origin |
| 424 | // basically O' = O + spacing*(dim-1) for any axis that would |
no test coverage detected