MCPcopy Create free account
hub / github.com/Kitware/VTK / ComputeTransformedSpacing

Method ComputeTransformedSpacing

IO/Image/vtkImageReader.cxx:403–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403void 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

Callers 1

RequestInformationMethod · 0.95

Calls 1

TransformVectorMethod · 0.80

Tested by

no test coverage detected