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

Method GetVoxelGradient

Common/DataModel/vtkImageData.cxx:547–563  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Given structured coordinates (i,j,k) for a voxel cell, compute the eight gradient values for the voxel corners. The order in which the gradient vectors are arranged corresponds to the ordering of the voxel points. Gradient vector is computed by central differences (except on edges of volume where forward difference is u

Source from the content-addressed store, hash-verified

545// from which the gradient is to be computed. This method will treat
546// only 3D structured point datasets (i.e., volumes).
547void vtkImageData::GetVoxelGradient(int i, int j, int k, vtkDataArray* s, vtkDataArray* g)
548{
549 double gv[3];
550 int ii, jj, kk, idx = 0;
551
552 for (kk = 0; kk < 2; kk++)
553 {
554 for (jj = 0; jj < 2; jj++)
555 {
556 for (ii = 0; ii < 2; ii++)
557 {
558 this->GetPointGradient(i + ii, j + jj, k + kk, s, gv);
559 g->SetTuple(idx++, gv);
560 }
561 }
562 }
563}
564
565//------------------------------------------------------------------------------
566// Given structured coordinates (i,j,k) for a point in a structured point

Callers 3

EvaluateGradientMethod · 0.80
ComputeVolumeOpacityMethod · 0.80

Calls 2

GetPointGradientMethod · 0.95
SetTupleMethod · 0.45

Tested by

no test coverage detected