------------------------------------------------------------------------------ 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
| 545 | // from which the gradient is to be computed. This method will treat |
| 546 | // only 3D structured point datasets (i.e., volumes). |
| 547 | void 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 |
no test coverage detected