9.11. pointCloud

class itom.pointCloud(type = point.PointInvalid | pointCloud, indices = None | width, height, point = None | point) → creates new point cloud.
Parameters

type : point-type (e.g. point.PointXYZ, see Notes)

pointCloud : {pointCloud}

another pointCloud instance which is appended at this point cloud

indices : {sequence}, optional

only the indices of the given pointCloud will be appended to this point cloud

width : {int}

width of the new point cloud

height : {int}

height of the new point cloud (the point cloud is dense if height > 1)

point : {point}

single point instance. This point cloud is filled up with elements of this point. If width and height are given, every element is set to this point, else the point cloud only consists of this single point.

Notes

Possible types:

  • point.PointXYZ

  • point.PointXYZI

  • point.PointXYZRGBA

  • point.PointXYZNormal

  • point.PointXYZINormal

  • point.PointXYZRGBNormal

append(point) → appends point or all points from a given point cloud to the end of the point cloud.
Parameters

point : {point or pointCloud}

point or points from pointCloud that should be appended at the list of points of this pointCloud.

Notes

The type of point must fit to the type of the point cloud. If the point cloud is invalid, its type is set to the type of the point.

clear() → clears the whole point cloud
copy() → returns a deep copy of this point cloud.
Returns

cloud : {pointCloud}

An exact copy if this point cloud.

dense

specifies if all the data in points is finite (true), or whether it might contain Inf/NaN values (false)

empty

returns whether this point cloud is empty (size == 0)

Notes

This attribute is readonly

erase(indices) -> erases the points in point clouds indicated by indices (single number of slice)
Parameters

indices : {int or slice}

Single index or slice of indices whose corresponding points should be deleted.

Notes

This method is the same than command ‘del pointCloudVariable[indices]’

fields

get available field names of point cloud

This property returns a list of field names that are contained in this cloud, e.g. [‘x’, ‘y’, ‘z’].

Notes

This attribute is readonly

static fromDisparity(disparity, intensity=None, deleteNaN=False, color=None) → creates a point cloud from a given topography dataObject.

Creates a point cloud from the 2.5D data set given by the topography dataObject. The x and y-components of each point are taken from the regular grid values of ‘topography’ (considering the scaling and offset of the object). The corresponding z-value is the topography’s value itself.

This method is deprecated and has been renamed to ‘fromTopography’ due to the wrong usage of the name topography in this case.

Parameters

disparity : {MxN data object, float32}

The values of this dataObject represent the z-components.

intensity : {MxN data object, float32}, optional

If given, an XYZI-point cloud is created whose intensity values are determined by this dataObject (cannot be used together with ‘color’)

deleteNaN : {bool}, optional

If true (default: false), NaN or Inf-values (z) in the topography map will not be copied into the point cloud (the point cloud is not organized any more).

color : {MxN data object, rgba32}, optional

If given, a XYZRGBA-point cloud is created whose color values are determined by this dataObject (cannot be used together with ‘intensity’)

Returns

pointCloud. :

static fromTopography(topography, intensity=None, deleteNaN=False, color=None) → creates a point cloud from a given topography dataObject.

Creates a point cloud from the 2.5D data set given by the topography dataObject. The x and y-components of each point are taken from the regular grid values of ‘topography’ (considering the scaling and offset of the object). The corresponding z-value is the topography’s value itself.

Parameters

topography : {MxN data object, float32}

The values of this dataObject represent the topography values.

intensity : {MxN data object, float32}, optional

If given, an XYZI-point cloud is created whose intensity values are determined by this dataObject (cannot be used together with ‘color’)

deleteNaN : {bool}, optional

If true (default: false), NaN or Inf-values (z) in the disparity map will not be copied into the point cloud (the point cloud is not organized any more).

color : {MxN data object, rgba32}, optional

If given, a XYZRGBA-point cloud is created whose color values are determined by this dataObject (cannot be used together with ‘intensity’)

Returns

PointCloud. :

pointCloud.fromXYZ(X, Y, Z, deleteNaN = False | XYZ, deleteNaN = False) -> creates a point cloud from three X,Y,Z data objects or from one 3xMxN data object

The created point cloud is not organized (height=1) and dense, if no NaN or Inf values are within the point cloud (deleteNaN:true results in a dense point cloud)

Parameters

X,Y,Z : {MxN data objects}

Three 2D data objects with the same size.

XYZ : {3xMxN or Mx3 data object}

either 3xMxN data object, such that the first plane is X, the second is Y and the third is Z, or: Mx3 data object, such that the point cloud consists of M points where every coordinate is given by the three values in each row.

deleteNaN : {bool}

default = false if True all NaN values are skipped, hence, the resulting point cloud is not dense any more

Returns

pointCloud. :

static fromXYZI(X, Y, Z, I, deleteNaN = False | XYZ, I, deleteNaN = False) → creates a point cloud from four X,Y,Z,I data objects or from one 3xMxN data object and one intensity data object

The created point cloud is not organized (height=1) and dense, if no NaN or Inf values are within the point cloud (deleteNaN:true results in a dense point cloud)

Parameters

X,Y,Z,I : {MxN data objects}

Four 2D data objects with the same size.

OR :

XYZ : {3xMxN data object}

3xMxN data object, such that the first plane is X, the second is Y and the third is Z

I : {MxN data object}

MxN data object with the same size than the single X,Y or Z planes

deleteNaN : {bool}

default = false if True all NaN values in X, Y or Z data objects are skipped, hence, the resulting point cloud is not dense any more

Returns

pointCloud. :

static fromXYZRGBA(X, Y, Z, color, deleteNaN = False | XYZ, color, deleteNaN = False) → creates a point cloud from four X,Y,Z,color data objects or from one 3xMxN data object and one coloured data object

The created point cloud is not organized (height=1) and dense, if no NaN or Inf values are within the point cloud (deleteNaN:true results in a dense point cloud)

Parameters

X,Y,Z,color : {MxN data objects}

Four 2D data objects with the same size. X,Y,Z must have the same type, color must be rgba32.

OR :

XYZ : {3xMxN data object}

3xMxN data object, such that the first plane is X, the second is Y and the third is Z

color : {MxN data object}

MxN data object with the same size than the single X,Y or Z planes, type: rgba32

deleteNaN : {bool}

default = false if True all NaN or Inf values are skipped, hence, the resulting point cloud does not contain this values

Returns

pointCloud. :

height

returns height of point cloud if organized as regular grid (organized == true), else 1.

The height of a point cloud is equal to 1, if the points in the point cloud are not organized. If it is organized, all points are assumed to lie on a regular grid, such that neighbouring points in the grid are adjacent in space, too. In this case, height is the number of rows in this grid. The total number of points is then height * width.

Notes

This attribute is readonly

insert(index, values) → inserts a single point or a sequence of points before position given by index

By this method, an itom.point or a sequence of points is inserted into the existing point cloud. The new points are inserted before the existing value at the index-th position.

The type of the inserted points must fit to the type of the point cloud.

Parameters

index : {int}

the new point(s) is / are inserted before the existing value at the index-th position. index must be in range [0, size of point cloud - 1]. Negative values signify a count from the end of the existing cloud.

values : {point, seq. of point}

itom.point or sequence of itom.point that should be inserted.

moveXYZ(x=0.0, y=0.0, z=0.0) → move the x, y and z components of every point by the given values.
Parameters

x : {float}, optional

offset value for x-component (default: 0.0)

y : {float}, optional

offset value for y-component (default: 0.0)

z : {float}, optional

offset value for z-component (default: 0.0)

name()
organized

returns True if this point cloud is organized, else False

Points in an organized point cloud are assumed to lie on a regular grid, defined by height and width. Neighbouring points in this grid are the neighbours in space, too. An unorganized point cloud has always a height equal to 1 and width equal to the total number of points.

Notes

This attribute is readonly

scaleXYZ(x=1.0, y=1.0, z=1.0) → scale the x, y and z components of every point by the given values .
Parameters

x : {float}, optional

scaling factor for x-component (default: 1.0)

y : {float}, optional

scaling factor for y-component (default: 1.0)

z : {float}, optional

scaling factor for z-component (default: 1.0)

size

returns total number of points in point cloud

Notes

This attribute is readonly

toDataObject() → returns a PxN data object, where P is determined by the point type in the point cloud. N is the number of points.

The output has at least 3 elements per column. Onr got each coordinate (xyz). These will always be the first 3 elements. If the pointcloud type has normals defined, these will be added in the next 4 columns as [nx, ny, nz, curvature]. If the pointcloud type has an intensity, these will be added in the next 1 column as [intensity]. If the pointcloud type has an RGB(A)-intensity, these will be added in the next 4 column as [r, g, b, a]. Hence following combinations are possible [x,y,z], [x,y,z,i], [x,y,z,r,g,b,a], [x,y,z,nx,ny,nz, curvature], [x,y,z,nx,ny,nz, curvature, i], …

Returns

dObj : {dataObject}

A dataObject with P (cols) by N elements (Points), where the elements per column depend on the point cloud type

type

returns point type of point cloud [read-only]

Point types can be:

  • pointCloud.PointInvalid

  • pointCloud.PointXYZ

  • pointCloud.PointXYZI

  • pointCloud.PointXYZRGBA

  • pointCloud.PointXYZNormal

  • pointCloud.PointXYZINormal

  • pointCloud.PointXYZRGBNormal

Notes

This attribute is readonly

width

returns width of point cloud if organized as regular grid (organized == true), else equal to size

The width of a point cloud is equal to the number of total points, if the points in the point cloud are not organized. If it is organized, all points are assumed to lie on a regular grid, such that neighbouring points in the grid are adjacent in space, too. In this case, width is the number of columns in this grid. The total number of points is then height * width.

Notes

This attribute is readonly