Package schrodinger :: Package analysis :: Package visanalysis :: Module volumedatautils
[hide private]
[frames] | no frames]

Module volumedatautils

Classes [hide private]
  DataPointLocator
The DataPointLocator class is a simple utility class that allows data-points that are 'close' to a given position in space to be located easily.
Functions [hide private]
VolumeData
CreateLike(volumeData, initialValue=0.0)
This function creates a new VolumeData instance that is identical in size and resolution to volumeData.
VolumeData
Resize(volumeData, N=None, resolution=None, origin=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)
This function is used to resize the specified volumeData object, returning a new VolumeData instance with the specified N, resolution and origin.
tuple< iterable< int, 3 >, iterable< float, 3 >, iterable< float, 3 > >
CalculateContainingVolume(minWorldCoordinates, maxWorldCoordinates, resolutions, resolutionMode='highest', resolutionValue=None)
This function calculates values for N, origin and resolution that span the specified world-coordinate range.
iterable< VolumeData >
MakeConsistent(volumeDatas, resolutionMode='highest', resolutionValue=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)
This function can be used to make all of the VolumeData instances in volumeDatas consistent with each other.
Variables [hide private]
  _X = 0
hash(x)
  _Y = 1
  _Z = 2
  _DOWN_COLUMNS = 0
hash(x)
  _ACROSS_ROWS = 1
  _INVALID_VOLUME_SPEC = 'min/maxWorldCoordinates and resolution...
  _BAD_RESOLUTION = 'resolution must be a 3-element array'
  _BAD_COORD = 'Coordinate must be a 3-element array'
  _INVALID_RESOLUTION_MODE = 'resolutionMode must be highest/low...
  __package__ = 'schrodinger.analysis.visanalysis'
Function Details [hide private]

CreateLike(volumeData, initialValue=0.0)

 

This function creates a new VolumeData instance that is identical in size and resolution to volumeData. All data-points within the newly constructed VolumeData instance are set to initialValue.

Parameters:
  • volumeData (volumeData) - The template VolumeData instance
  • initialValue (float) - The initial value to assign to every data-point of the new VolumeData instance
Returns: VolumeData
The newly constructed VolumeData instance

Resize(volumeData, N=None, resolution=None, origin=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)

 

This function is used to resize the specified volumeData object, returning a new VolumeData instance with the specified N, resolution and origin.

Parameters:
  • volumeData (VolumeData) - The VolumeData instance to be resized.
  • N (iterable< int, 3 >) - The number of array-coordinates along the X, Y and Z axes respectively.
  • resolution (iterable< float, 3 >) - The resolution of the X, Y and Z axes respectively. Specified in world-coordinate units
  • origin - The origin of the X, Y and Z axes respectively. Specified in world-coordinates
  • interpolationOrder (int) - The degree of interpolation to use when retrieving the values. 0-5
  • oobMethod (string) - What to do with requests that lie outside of the bounds of this VolumeData object. The options are "constant", which returns the value of oobConstant. "nearest" which returns the value of the nearest valid point or "wrap", which effectively tiles the data into an infinite repeating lattice.
  • oobConstant (float) - Of the class float. The value to return if the request is OOB and the oobMethod is "constant"
Returns: VolumeData
A new VolumeData instance covering the specified region of space, filled with data from the argument volumeData instance.

CalculateContainingVolume(minWorldCoordinates, maxWorldCoordinates, resolutions, resolutionMode='highest', resolutionValue=None)

 

This function calculates values for N, origin and resolution that span the specified world-coordinate range.

len( resolutions ) == len( minWorldCoordinates ) == len( maxWorldCoordinates )

Parameters:
  • minWorldCoordinates (iterable< iterable< float, 3 > >) - The minimum world-coordinates to consider
  • maxWorldCoordinates (iterable< iterable< float, 3 > >) - The maximum world-coordinates to consider
  • resolutions (iterable< float, 3 >) - The resolutions to consider
  • resolutionMode (string) - Either "highest", in which case the highest resolution is used for the resized VolumeDatas, "lowest", in which case the lowest resolution is used, or "fixed", in which case the resolution specified by resolutionValue will be used
  • resolutionValue (iterable< float, 3 >) - The resolution value to use when the resolutionMode is "fixed". Ignored otherwise
Returns: tuple< iterable< int, 3 >, iterable< float, 3 >, iterable< float, 3 > >
These are the values of N, resolution and origin that span the input world-coordinate range

MakeConsistent(volumeDatas, resolutionMode='highest', resolutionValue=None, interpolationOrder=0, oobMethod='constant', oobConstant=0.0)

 

This function can be used to make all of the VolumeData instances in volumeDatas consistent with each other. This is done by resizing all of the VolumeData instances so that they span the union volume of the individual VolumeData instances.

Parameters:
  • volumeDatas (iterable< VolumeData >) - The VolumeData instances to make consistent with each other.
  • resolutionMode (string) - Either "highest", in which case the highest resolution is used for the resized VolumeDatas, "lowest", in which case the lowest resolution is used, or "fixed", in which case the resolution specified by resolutionValue will be used
  • resolutionValue (iterable< float, 3 >) - The resolution value to use when the resolutionMode is "fixed". Ignored otherwise
  • interpolationOrder (int) - The degree of interpolation to use when retrieving the values. 0-5
  • oobMethod (string) - What to do with requests that lie outside of the bounds of this VolumeData object. The options are "constant", which returns the value of oobConstant. "nearest" which returns the value of the nearest valid point or "wrap", which effectively tiles the data into an infinite repeating lattice.
  • oobConstant (float) - Of the class float. The value to return if the request is OOB and the oobMethod is "constant"
Returns: iterable< VolumeData >
These are the set of consistent VolumeData instances formed from volumeDatas

Variables Details [hide private]

_INVALID_VOLUME_SPEC

Value:
'min/maxWorldCoordinates and resolutions must be same size.'

_INVALID_RESOLUTION_MODE

Value:
'resolutionMode must be highest/lowest/fixed.'