CVBpy 14.1
Cube Class Reference

Spectral Cube object. More...

Inherits object.

Inherited by WrappedCube.

Public Member Functions

cvb.Image buffer_view (self)
 Retrieves the buffer view of the cube. More...
 
cvb.spectral.Cube clone (self)
 Copies the memory to a new instance of a cube. More...
 
cvb.spectral.Cube convert (self, int target_view_perspective)
 Converts cube to given cube encoding target view. More...
 
cvb.spectral.Cube from_images (List[cvb.Image] images, int cube_encoding)
 Create an image, that is the result of concatenating a series of input planes. More...
 
cvb.spectral.Cube map (self, cvb.spectral.CubeRange spectral_cubeoid)
 Creates a cropped cube. More...
 
cvb.spectral.MetaData meta_data (self)
 Retrieves the metadata object of the cube. More...
 
None save (self, str envi_header_filename, str envi_binary_filename)
 Writes this cube object to ENVI-format. More...
 
List[float] spectral_density (self, int line_index, int sample_index)
 Retrieves spectral density at given pixel. More...
 

Properties

 data_type = property
 cvb.DataType: Gets the data type of this cube object.
 
 type = property
 int: Gets the type of this cube object.
 

Detailed Description

Spectral Cube object.

Creates a cube.

To create an empty continuous cube you can provide the parameters (lines, samples, bands, data_type, view_perspective).Alternatively you can provide the file names of an ENVI-formatted cube (envi_header_filename, envi_binary_filename)

Parameters

lines : int Number of lines.

samples : int Number of samples.

bands : int Number of bands.

data_type : cvb.DataType Pixel data type.

cube_encoding : int View perspective on the buffer (see cvb.spectral.CubeEncoding).

Parameters

envi_header_filename : str Header file of the ENVI-format data (.hdr).

envi_binary_filename : str Binary file of the ENVI-format data (.bin).

Member Function Documentation

◆ buffer_view()

cvb.Image buffer_view (   self)

Retrieves the buffer view of the cube.

The buffer view is the shared pointer to object containing the image. This image encapsulates the buffer of the cube. This image is of size width * height * dimensions. These dimensions can be mapped to samples, lines and bands depending on the cvb.spectral.CubeEncoding of this cube.

Returns

cvb.Image The view on the buffer through an image.

◆ clone()

cvb.spectral.Cube clone (   self)

Copies the memory to a new instance of a cube.

Returns

cvb.spectral.Cube New cube of type CubeType.ContinuousCube.

◆ convert()

cvb.spectral.Cube convert (   self,
int  target_view_perspective 
)

Converts cube to given cube encoding target view.

Creates a continous image cube and copies data. The number of samples, lines and bands are equal, but the order in the buffer is different.

Parameters

target_view_perspective : int View perspective of the returned cube (see cvb.spectral.CubeEncoding).

Returns

cvb.spectral.Cube The converted cube.

◆ from_images()

cvb.spectral.Cube from_images ( List[cvb.Image images,
int  cube_encoding 
)

Create an image, that is the result of concatenating a series of input planes.

Parameters

images : List[cvb.Image] Selects the relationship between the result image and the input images.

cube_encoding : int View perspective on the buffer (see cvb.spectral.CubeEncoding).

Returns

cvb.spectral.Cube A stacked cube object.

◆ map()

cvb.spectral.Cube map (   self,
cvb.spectral.CubeRange  spectral_cubeoid 
)

Creates a cropped cube.

The returned cube type depends on the source cube type.

Parameters

spectral_cubeoid : cvb.spectral.CubeRange Crop the source cube by this cuboid.

Returns

cvb.spectral.Cube The cropped cube.

◆ meta_data()

cvb.spectral.MetaData meta_data (   self)

Retrieves the metadata object of the cube.

This method returns a shared pointer to the metadata object.

Returns

cvb.spectral.MetaData The metadata of this cube.

◆ save()

None save (   self,
str  envi_header_filename,
str  envi_binary_filename 
)

Writes this cube object to ENVI-format.

Parameters

envi_header_filename : str Header file of the ENVI-format data (.hdr).

envi_binary_filename : str Binary file of the ENVI-format data (.bin).

◆ spectral_density()

List[float] spectral_density (   self,
int  line_index,
int  sample_index 
)

Retrieves spectral density at given pixel.

Parameters

line_index : int Index of the line to inspect.

sample_index : int Index of the sample to inspect.

Returns

List[float] The spectral density at given pixel.