How to use the pyntcloud.scalar_fields.sf_eigenvalues.ScalarField_EigenValues function in pyntcloud

To help you get started, we’ve selected a few pyntcloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
Column names of the eigen values.
        Tip:
            ev = self.add_scalar_field("eigen_values", ...)

    """

    def __init__(self, pyntcloud, ev):
        super().__init__(pyntcloud)
        self.k = ev[0].split("e1")[1]
        self.ev = ev

    def extract_info(self):
        self.ev = self.pyntcloud.points[self.ev].values


class Anisotropy(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "anisotropy{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 2]) / ev[:, 0]


class Curvature(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "curvature{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = ev[:, 2] / (ev[:, 0] + ev[:, 1] + ev[:, 2])
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
def compute(self):
        name = "anisotropy{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 2]) / ev[:, 0]


class Curvature(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "curvature{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = ev[:, 2] / (ev[:, 0] + ev[:, 1] + ev[:, 2])


class Eigenentropy(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigenentropy{}".format(self.k)
        ev = self.ev
        result = np.zeros(ev.shape[0])
        for i in range(3):
            result += ev[:, i] * np.log(ev[:, i])
        self.to_be_added[name] = -result


class EigenSum(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigen_sum{}".format(self.k)
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
self.ev = ev

    def extract_info(self):
        self.ev = self.pyntcloud.points[self.ev].values


class Anisotropy(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "anisotropy{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 2]) / ev[:, 0]


class Curvature(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "curvature{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = ev[:, 2] / (ev[:, 0] + ev[:, 1] + ev[:, 2])


class Eigenentropy(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigenentropy{}".format(self.k)
        ev = self.ev
        result = np.zeros(ev.shape[0])
        for i in range(3):
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
"""
    def compute(self):
        name = "eigen_sum{}".format(self.k)
        self.to_be_added[name] = self.ev[:, 0] + self.ev[:, 1] + self.ev[:, 2]


class Linearity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "linearity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 1]) / ev[:, 0]


class Omnivariance(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "omnivariance{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] * ev[:, 1] * ev[:, 2]) ** (1 / 3)


class Planarity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "planarity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 1] - ev[:, 2]) / ev[:, 0]
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
def compute(self):
        name = "linearity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 1]) / ev[:, 0]


class Omnivariance(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "omnivariance{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] * ev[:, 1] * ev[:, 2]) ** (1 / 3)


class Planarity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "planarity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 1] - ev[:, 2]) / ev[:, 0]


class Sphericity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "sphericity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = ev[:, 2] / ev[:, 0]
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
self.to_be_added[name] = ev[:, 2] / (ev[:, 0] + ev[:, 1] + ev[:, 2])


class Eigenentropy(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigenentropy{}".format(self.k)
        ev = self.ev
        result = np.zeros(ev.shape[0])
        for i in range(3):
            result += ev[:, i] * np.log(ev[:, i])
        self.to_be_added[name] = -result


class EigenSum(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigen_sum{}".format(self.k)
        self.to_be_added[name] = self.ev[:, 0] + self.ev[:, 1] + self.ev[:, 2]


class Linearity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "linearity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 1]) / ev[:, 0]
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
def compute(self):
        name = "omnivariance{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] * ev[:, 1] * ev[:, 2]) ** (1 / 3)


class Planarity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "planarity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 1] - ev[:, 2]) / ev[:, 0]


class Sphericity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "sphericity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = ev[:, 2] / ev[:, 0]
github daavoo / pyntcloud / pyntcloud / scalar_fields / sf_eigenvalues.py View on Github external
ev = self.ev
        result = np.zeros(ev.shape[0])
        for i in range(3):
            result += ev[:, i] * np.log(ev[:, i])
        self.to_be_added[name] = -result


class EigenSum(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "eigen_sum{}".format(self.k)
        self.to_be_added[name] = self.ev[:, 0] + self.ev[:, 1] + self.ev[:, 2]


class Linearity(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "linearity{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] - ev[:, 1]) / ev[:, 0]


class Omnivariance(ScalarField_EigenValues):
    """
    """
    def compute(self):
        name = "omnivariance{}".format(self.k)
        ev = self.ev
        self.to_be_added[name] = (ev[:, 0] * ev[:, 1] * ev[:, 2]) ** (1 / 3)