------------------------------------------------------------------------------ This function reads a data from a file. The datas extent/axes are assumed to be the same as the file extent/order.
| 366 | // This function reads a data from a file. The datas extent/axes |
| 367 | // are assumed to be the same as the file extent/order. |
| 368 | void vtkImageReader::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo) |
| 369 | { |
| 370 | vtkImageData* data = this->AllocateOutputData(output, outInfo); |
| 371 | |
| 372 | void* ptr = nullptr; |
| 373 | |
| 374 | if (!this->FileName && !this->FilePattern) |
| 375 | { |
| 376 | vtkErrorMacro("Either a valid FileName or FilePattern must be specified."); |
| 377 | return; |
| 378 | } |
| 379 | |
| 380 | if (!data->GetPointData()->GetScalars()) |
| 381 | { |
| 382 | return; |
| 383 | } |
| 384 | data->GetPointData()->GetScalars()->SetName(this->ScalarArrayName); |
| 385 | |
| 386 | #ifndef NDEBUG |
| 387 | int* ext = data->GetExtent(); |
| 388 | #endif |
| 389 | vtkDebugMacro("Reading extent: " << ext[0] << ", " << ext[1] << ", " << ext[2] << ", " << ext[3] |
| 390 | << ", " << ext[4] << ", " << ext[5]); |
| 391 | |
| 392 | this->ComputeDataIncrements(); |
| 393 | |
| 394 | // Call the correct templated function for the output |
| 395 | switch (this->GetDataScalarType()) |
| 396 | { |
| 397 | vtkTemplateMacro(vtkImageReaderUpdate1(this, data, (VTK_TT*)(ptr))); |
| 398 | default: |
| 399 | vtkErrorMacro(<< "UpdateFromFile: Unknown data type"); |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | void vtkImageReader::ComputeTransformedSpacing(double Spacing[3]) |
| 404 | { |
nothing calls this directly
no test coverage detected