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

Method ComputeDataIncrements

IO/Image/vtkImageReader2.cxx:446–470  ·  view source on GitHub ↗

------------------------------------------------------------------------------ This function opens a file to determine the file size, and to automatically determine the header size.

Source from the content-addressed store, hash-verified

444// This function opens a file to determine the file size, and to
445// automatically determine the header size.
446void vtkImageReader2::ComputeDataIncrements()
447{
448 int idx;
449 unsigned long fileDataLength;
450
451 // Determine the expected length of the data ...
452 switch (this->DataScalarType)
453 {
454 vtkTemplateMacro(fileDataLength = vtkImageReader2GetSize(static_cast<VTK_TT*>(nullptr)));
455 default:
456 vtkErrorMacro(<< "Unknown DataScalarType");
457 return;
458 }
459
460 fileDataLength *= this->NumberOfScalarComponents;
461
462 // compute the fileDataLength (in units of bytes)
463 for (idx = 0; idx < 3; ++idx)
464 {
465 this->DataIncrements[idx] = fileDataLength;
466 fileDataLength =
467 fileDataLength * (this->DataExtent[idx * 2 + 1] - this->DataExtent[idx * 2] + 1);
468 }
469 this->DataIncrements[3] = fileDataLength;
470}
471
472//------------------------------------------------------------------------------
473void vtkImageReader2::CloseFile()

Callers 2

GetHeaderSizeMethod · 0.95

Calls 1

vtkImageReader2GetSizeFunction · 0.85

Tested by

no test coverage detected