------------------------------------------------------------------------------
| 906 | |
| 907 | //------------------------------------------------------------------------------ |
| 908 | void vtkImageData::SetScalarComponentFromDouble(int x, int y, int z, int comp, double value) |
| 909 | { |
| 910 | // Check the component index. |
| 911 | if (comp < 0 || comp >= this->GetNumberOfScalarComponents()) |
| 912 | { |
| 913 | vtkErrorMacro("Bad component index " << comp); |
| 914 | return; |
| 915 | } |
| 916 | |
| 917 | vtkIdType index = this->GetScalarIndex(x, y, z); |
| 918 | if (index < 0) |
| 919 | { |
| 920 | // An error message was already generated by GetScalarIndex. |
| 921 | return; |
| 922 | } |
| 923 | |
| 924 | vtkDataArray* scalars = this->GetPointData()->GetScalars(); |
| 925 | scalars->SetComponent(index, comp, value); |
| 926 | } |
| 927 | |
| 928 | //------------------------------------------------------------------------------ |
| 929 | float vtkImageData::GetScalarComponentAsFloat(int x, int y, int z, int comp) |