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

Method GetPixelSpacing

IO/Image/vtkDICOMImageReader.cxx:458–480  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

456
457//------------------------------------------------------------------------------
458double* vtkDICOMImageReader::GetPixelSpacing()
459{
460 std::vector<std::pair<float, std::string>> sortedFiles;
461
462 this->AppHelper->GetImagePositionPatientFilenamePairs(sortedFiles, false);
463
464 float* spacing = this->AppHelper->GetPixelSpacing();
465 this->DataSpacing[0] = spacing[0];
466 this->DataSpacing[1] = spacing[1];
467
468 if (sortedFiles.size() > 1)
469 {
470 const std::pair<float, std::string>& p1 = sortedFiles[0];
471 const std::pair<float, std::string>& p2 = sortedFiles[1];
472 this->DataSpacing[2] = fabs(p1.first - p2.first);
473 }
474 else
475 {
476 this->DataSpacing[2] = spacing[2];
477 }
478
479 return this->DataSpacing;
480}
481
482//------------------------------------------------------------------------------
483int vtkDICOMImageReader::GetWidth()

Callers 4

TestDICOMImageReaderFunction · 0.80

Calls 2

sizeMethod · 0.45

Tested by 3

TestDICOMImageReaderFunction · 0.64