VicPy module

Classes

class RigidTransformation

Methods

def apply(...)

RigidTransformation.apply(self, point)

Applys the transformation on the supplied point, both the translation and the rotation.

Args

point(tuple/list) : A tuple or a list of size 3 representing a point.

Returns

tuple/list : A tuple or list of size 3 representing the point after the applied transformation.

def fromDisplacement(...)

RigidTransformation.fromDisplacement(self, data)

Compute a best plane fit for a data set.

Args

data(VicDataSet) : The dataset to process.

Returns

(success, residual): Returns True/False depending on the success of the fit and the residual.

def invert(...)

RigidTransformation.invert(self)

Invert the transformation.

def planeFit(...)

RigidTransformation.planeFit(self, data, bool ignoreDisp=False)

Compute a best plane fit for a data set.

Args

data(VicDataSet) : The dataset to process.

ignoreDisp(bool) : Whether to ignore the displacement or not. Defaults to false.

Returns

True if successful, False otherwise.

def rotation(...)

RigidTransformation.rotation(self)

Accessor to the rotation component of the transformation object.

Returns

A Rotation object.

def setRotation(...)

RigidTransformation.setRotation(self, Rotation rot)

Set the rotation component for the transformation.

Args

rot(Rotation) : A rotation object to be used.

def setTranslation(...)

RigidTransformation.setTranslation(self, point)

Set the translation component for the transformation.

Args

point(tuple/list) : Can be a tuple or list but must contain 3 elements.

def translation(...)

RigidTransformation.translation(self)

Accessor to the translation component of the transformation.

Returns

A tuple of the translation.

class Rotation

Methods

def angles(...)

Rotation.angles(self, bool radians=False) Get the angles of the rotation object.

    Args:
        radians(bool) : Should the angles be in radians or degrees? Defaults to false.

    Returns:
        Tuple : Returns a tuple of the Cardan/Bryant angles.
def apply(...)

Rotation.apply(self, point)

Applys a transformation around the supplied point based on the angles in the rotation object.

Args

point(tuple/list) : A tuple or list, with a size of 3, that acts as a point in a coordinate system.

Returns

Depending on whether a tuple or a list was passed in, returns either a tuple or a list of the point after the applied transformation.

def loadIdentity(...)

Rotation.loadIdentity(self)

Load an identity rotation.

def matrix(...)

Rotation.matrix(self)

Returns a 3x3 rotation matrix.

def setAngles(...)

Rotation.setAngles(self, double alpha=0, double beta=0, double gamma=0, bool radians=False) Manually set or change the angles contained in the object.

    Args:
        alpha(double) : Rotation around x

        beta(double) : Rotation around y

        gamma(double) : Rotation around z

        radians(bool) : Are the values in radians or degres? Defaults to false.
def setMatrix(...)

Rotation.setMatrix(self, mat)

Set a 3x3 rotation matrix.

Args

mat(numpy.ndarray): 3x3 matrix

class VicData

Methods

def asArray(...)

VicData.asArray(self, vars)

Return a numpy array of the specified variables

Args

vars : List of variables.

Returns

Array of data values.

def atGlobalXY(...)

VicData.atGlobalXY(self, float x, float y, vector[int] var_ids)

Return the values of a set of variables at a specific (global) position.

Args

x,y(float) : The global position to lookup.

var_ids(vector[int]) : The variables to lookup

Returns

bool, list : Success status and list of the values found.

def clear(...)

VicData.clear(self)

Clears this object of all data.

def findMaximum(...)

VicData.findMaximum(self, varIdx)

Find the maximum value for a given variable in the dataset.

Args

varIdx(int) : The variable to search over.

Returns

float : The maximum value of that variable.

def findMinimum(...)

VicData.findMinimum(self, varIdx)

Find the minimum value for a given variable in the dataset.

Args

varIdx(int) : The variable to search over.

Returns

float : The minimum value of that variable.

def matrixSize(...)

VicData.matrixSize(self)

Returns the size of the matrix itself.

def numColumns(...)

VicData.numColumns(self)

Returns the number of columns in the data matrix.

def numRows(...)

VicData.numRows(self)

Returns the number of rows in the data matrix.

def numVariables(...)

VicData.numVariables(self)

Returns the number of variables in the data matrix.

def setValue(...)

VicData.setValue(self, int n, int varIdx, float value)

Set the value of an entry in the dataset.

Args

n(int) : The row in the dataset to access.

varIdx(int) : Which variable should be changed.

value(float) : The value to set

def value(...)

VicData.value(self, int n, int varIdx)

Return the value of a variable at a specific position.

Args

n(int) : The position to look up.

varIdx(int) : The index of the variable

Returns

float : The value of the variable at position n
 
def values(...)

VicData.values(self, int n, vector[int] var_ids)

Return the values of a set of variables at a specific position.

Args

n(int) : The position to lookup.

var_ids(vector[int]) : The variables to lookup

Returns

list : A list of the values found.

def varDescription(...)

VicData.varDescription(self, int n)

Return the description of a variable.

Args

n(int) : The position of the variable to look up.

Returns

string : The descriptione of the variable.

def varIndex(...)

VicData.varIndex(self, str var)

Lookup a variable by its name and return its index.

Args
var(string) : The variable to search for.
Returns
int : Location in the array if found, else -1
def varName(...)

VicData.varName(self, int n)

Return the name of a variable.

Args

n(int) : The position of the variable to look up.

Returns

string : The name of the variable.

def varType(...)

VicData.varType(self, int n)

Return the type of a variable.

Args

n(int) : The position of the variable to look up. Returns:: int : The type of the variable.

class VicDataSet

Methods

def addVariable(...)

VicDataSet.addVariable(self, str varName, str varDesc)

Add a variable to every AOI contained in the dataset.

Args

varName(string) : Name of the variable you want to add.

varDesc(string) : Description of the variable you want to add.

Returns

actualName
The unique variable name assigned to the variable.
def asArray(...)

VicDataSet.asArray(self, vars)

Return a numpy array for the variables for all AOIs. Note that the triang() function returns indices into this array.

Args

vars
List of variable names.

Returns

A numpy array containing the requested data values.

def computeCurvature(...)

VicDataSet.computeCurvature(self, int windowSize=15, bool computePrincipalCurvature=True, bool reuseVars=True, bool weightedFilter=True)

Compute the curvature over the AOIs in the datasets.

Arguments

windowSize(int) : Defaults to 15

computePrincipalCurvature(bool) : Defaults to true

reuseVars(bool) : Defaults to True

weightedFilter(bool) : Defaults to True

Returns

bool - True if successful, False otherwise

def computeStrain(...)

VicDataSet.computeStrain(self, int windowSize=15, str tensorType='lagrange', bool computePrincipalStrain=True, bool reuseVars=True, bool weightedFilter=True, bool computeTresca=False, bool computeVonMises=False, bool outputGradient=False)

Compute the strain over the AOIs in the datasets.

Arguments

windowSize(int) : Defaults to 15

tensorType(string) : Defaults to LagrangeSTrainTensor

computePrincipalStrain(bool) : Defaults to true

reuseVars(bool) : Defaults to True

weightedFilter(bool) : Defaults to True

computeTresca(bool) : Defaults to False

computeVonMises(bool) : Defaults to False

outputGradient(bool) : Defaults to False

Returns

bool - True if successful, False otherwise

def data(...)

VicDataSet.data(self, int n)

Return a pointer to a specific VicData object.

Args

n(int) : The index of the AOI to access.

Returns

VicData : A VicData object for the AOI in the dataset.

def deformedImage(...)

VicDataSet.deformedImage(self)

Return the deformed image file name.

def exportMatV4(...)

VicDataSet.exportMatV4(self, str fileName)

Save the VicDataSet as an output file in the MatV4 format.

Args

fileName(string) : The output name of the file.

Returns

bool : True if successful, otherwise false.

def load(...)

VicDataSet.load(self, str fileName)

Load a Vic-3D output file into this object.

Args

filename(string) : The file to load.

Returns

bool - True if successful, otherwise False

def loadFromData(...)

VicDataSet.loadFromData(self, bytes buffer)

Load a Vic-3D output file into this object.

Args

buffer(string) : The memory buffer data to load from.

Returns

bool - True if successful, otherwise False

def numData(...)

VicDataSet.numData(self)

Return how many AOI's exist in the dataset.

def range(...)

VicDataSet.range(self, str var)

Return the range of values for a variable.

def referenceImage(...)

VicDataSet.referenceImage(self)

Return the reference image file name.

def save(...)

VicDataSet.save(self, str fileName)

Save the VicDataSet as an output file in the Vic-3D format.

Args

fileName(string) : The output name of the file.

Returns

bool : True if successful, otherwise false.

def setDeformedImage(...)

VicDataSet.setDeformedImage(self, str fileName)

Set the deformed image file name.

def setReferenceImage(...)

VicDataSet.setReferenceImage(self, str fileName)

Set the reference image file name.

def smooth(...)

VicDataSet.smooth(self, str variable, int windowSize=15, bool weighted=True)

def sum_range(...)

VicDataSet.sum_range(self, str var0, str var1)

Return the range of the sum of two variables (e.g., X+U).

def transform(...)

VicDataSet.transform(self, RigidTransformation trafo, bool displacementOnly=False)

Apply a transformation to the AOIs in this DataSet.

Args

trafo(RigidTransformation) :

displacementOnly(bool) : Defaults to False

def triang(...)

VicDataSet.triang(self, int sub_sample=1)

Return a triangulation for the data set.

Args

sub_sample(int): Sub-sampling value for data reduction.

Returns

A n-by-3 array of triangle indices, where n is the number of triangles.