MCPcopy Create free account
hub / github.com/Kitware/VTK / SetScalarComponentFromDouble

Method SetScalarComponentFromDouble

Common/DataModel/vtkImageData.cxx:908–926  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

906
907//------------------------------------------------------------------------------
908void 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//------------------------------------------------------------------------------
929float vtkImageData::GetScalarComponentAsFloat(int x, int y, int z, int comp)

Callers 5

ImageHistogramStatisticsFunction · 0.80
FastSplatterFunction · 0.80
ImageAccumulateFunction · 0.80

Calls 5

GetScalarIndexMethod · 0.95
GetScalarsMethod · 0.45
GetPointDataMethod · 0.45
SetComponentMethod · 0.45

Tested by 1