------------------------------------------------------------------------------ This function opens a file to determine the file size, and to automatically determine the header size.
| 444 | // This function opens a file to determine the file size, and to |
| 445 | // automatically determine the header size. |
| 446 | void 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 | //------------------------------------------------------------------------------ |
| 473 | void vtkImageReader2::CloseFile() |
no test coverage detected