8a8e2bac67ece22ca327e62764c5e7d5e379c1c3,pyntcloud/structures/voxelgrid.py,VoxelGrid,build,#VoxelGrid#,70

Before Change


        self.get_feature_vector()

    def build(self):
        structure = np.zeros((len(self.points), 4), dtype=int)
        structure[:,0] = np.searchsorted(self.segments[0], self.points[:,0]) - 1
        structure[:,1] = np.searchsorted(self.segments[1], self.points[:,1]) - 1
        structure[:,2] = np.searchsorted(self.segments[2], self.points[:,2]) - 1
        // i = ((y * n_x) + x) + (z * (n_x * n_y))
        structure[:,3] = ((structure[:,1] * self.n_x) + structure[:,0]) + (structure[:,2] * (self.n_x * self.n_y)) 
        self.structure = structure

    def get_feature_vector(self):
        vector = np.zeros(self.n_voxels)
        count = np.bincount(self.structure[:,3])

After Change


        self.voxel_n = np.ravel_multi_index([x,y,z], [self.n_x, self.n_y, self.n_z])

        // compute center of each voxel
        midsegments = [(segments[i][1:] + segments[i][:-1]) / 2 for i in range(3)]
        self.voxel_centers = cartesian(midsegments)

    def get_feature_vector(self, mode="binary"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: daavoo/pyntcloud
Commit Name: 8a8e2bac67ece22ca327e62764c5e7d5e379c1c3
Time: 2017-02-15
Author: daviddelaiglesiacastro@gmail.com
File Name: pyntcloud/structures/voxelgrid.py
Class Name: VoxelGrid
Method Name: build


Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 1a89404a84393211c7b370077fafe536a8f44762
Time: 2018-03-02
Author: max.lapan@gmail.com
File Name: ch17/lib/common.py
Class Name:
Method Name: iterate_batches


Project Name: rflamary/POT
Commit Name: 6aa0f1f4e275098948d4b312530119e5d95b8884
Time: 2020-03-31
Author: ievgen.redko@univ-st-etienne.fr
File Name: ot/da.py
Class Name:
Method Name: jcpot_barycenter