------------------------------------------------------------------------------ This function reads a data from a file. The datas extent/axes are assumed to be the same as the file extent/order.
| 677 | // This function reads a data from a file. The datas extent/axes |
| 678 | // are assumed to be the same as the file extent/order. |
| 679 | void vtkImageReader2::ExecuteDataWithInformation(vtkDataObject* output, vtkInformation* outInfo) |
| 680 | { |
| 681 | vtkImageData* data = this->AllocateOutputData(output, outInfo); |
| 682 | |
| 683 | void* ptr; |
| 684 | |
| 685 | if (!this->FileName && !this->FilePattern) |
| 686 | { |
| 687 | vtkErrorMacro("Either a valid FileName or FilePattern must be specified."); |
| 688 | return; |
| 689 | } |
| 690 | |
| 691 | data->GetPointData()->GetScalars()->SetName("ImageFile"); |
| 692 | |
| 693 | #ifndef NDEBUG |
| 694 | int* ext = data->GetExtent(); |
| 695 | #endif |
| 696 | |
| 697 | vtkDebugMacro("Reading extent: " << ext[0] << ", " << ext[1] << ", " << ext[2] << ", " << ext[3] |
| 698 | << ", " << ext[4] << ", " << ext[5]); |
| 699 | |
| 700 | this->ComputeDataIncrements(); |
| 701 | |
| 702 | // Call the correct templated function for the output |
| 703 | ptr = data->GetScalarPointer(); |
| 704 | switch (this->GetDataScalarType()) |
| 705 | { |
| 706 | vtkTemplateMacro(vtkImageReader2Update(this, data, (VTK_TT*)(ptr))); |
| 707 | default: |
| 708 | vtkErrorMacro(<< "UpdateFromFile: Unknown data type"); |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | //------------------------------------------------------------------------------ |
| 713 | // VTK_DEPRECATED_IN_9_6_0 |
nothing calls this directly
no test coverage detected