Working With 3D Data

NDIToolbox supports previews and plots of three-dimensional data. Throughout this document and in NDIToolbox we refer to X, Y, and Z axes. The following figure illustrates the coordinate system used: Y is the row number, X is the column number, and Z is the third dimension into your data.

 

numpy_array_dims

 

 

 

 

 

 

 

 

 

 

For three-dimensional data, you’ll be asked how to take a two-dimensional “slice” for preview. This slice is a plane through the 3D data that’s defined by its orientation and an index. The orientation of the slice specifies which plane your slice will be parallel to: X-Y, X-Z, or Y-Z. The index of the slice specifies how far into the other dimension your slice will be. For example, specifying an orientation of Parallel To X-Y means that your slice will be somewhere in the Z axis, while Parallel to Y-Z will mean your slice will be taken somewhere in the X axis.

 

slice_3d_data

 

 

 

 

 

 

 

 

 

 

If you’re familiar with NumPy, here’s how the slicing works. For a three-dimensional data set A, a point P at position (x0, y0, z0) is given by P = A[y0, x0, z0] (notice that the Y index is first – NumPy indexes data beginning with row and then column). A planar slice in A is one of the following.

  • A slice S in Z (parallel to the X-Y plane) at index z0 is given by S = A[:, :, z0] (S is every point in A for which Z=z0)
  • A slice S in Y (parallel to the X-Z plane) at index y0 is given by S = A[y0, :, :] (S is every point in A for which Y=y0)
  • A slice S in X (parallel to the Y-Z plane) at index x0 is given by S = A[:, x0, :] (S is every point in A for which X=x0)