| 1 | #
|
|---|
| 2 | # Example code to get interpolated volume data set values at specific points.
|
|---|
| 3 | #
|
|---|
| 4 | # Uses trilinear interpolation from 8 nearest grid points. Value is zero
|
|---|
| 5 | # if point lies outside volume. Points are specified in physical coordinates
|
|---|
| 6 | # (typically Angstroms) using the voxel size and origin.
|
|---|
| 7 | #
|
|---|
| 8 | # Results are printed to Reply Log (under Favorites menu).
|
|---|
| 9 | #
|
|---|
| 10 | from VolumeViewer import volume_list
|
|---|
| 11 | v = volume_list()[0]
|
|---|
| 12 |
|
|---|
| 13 | points = [(10.243, 12.534, 25.352),
|
|---|
| 14 | (54.2112, 32.352, 29.3525),
|
|---|
| 15 | (-15.153, 139.23, 12.44)]
|
|---|
| 16 | values = v.interpolated_values(points)
|
|---|
| 17 | print values
|
|---|