------------------------------------------------------------------------------
| 885 | |
| 886 | //------------------------------------------------------------------------------ |
| 887 | double vtkImageData::GetScalarComponentAsDouble(int x, int y, int z, int comp) |
| 888 | { |
| 889 | // Check the component index. |
| 890 | if (comp < 0 || comp >= this->GetNumberOfScalarComponents()) |
| 891 | { |
| 892 | vtkErrorMacro("Bad component index " << comp); |
| 893 | return 0.0; |
| 894 | } |
| 895 | |
| 896 | vtkIdType index = this->GetScalarIndex(x, y, z); |
| 897 | if (index < 0) |
| 898 | { |
| 899 | // An error message was already generated by GetScalarIndex. |
| 900 | return 0.0; |
| 901 | } |
| 902 | |
| 903 | vtkDataArray* scalars = this->GetPointData()->GetScalars(); |
| 904 | return scalars->GetComponent(index, comp); |
| 905 | } |
| 906 | |
| 907 | //------------------------------------------------------------------------------ |
| 908 | void vtkImageData::SetScalarComponentFromDouble(int x, int y, int z, int comp, double value) |