get_rgb_image#
- VirtualBSEImager.get_rgb_image(r: BaseInteractiveROI | tuple | list[BaseInteractiveROI] | list[tuple], g: BaseInteractiveROI | tuple | list[BaseInteractiveROI] | list[tuple], b: BaseInteractiveROI | tuple | list[BaseInteractiveROI] | list[tuple], percentiles: tuple | None = None, normalize: bool = True, alpha: ndarray | VirtualBSEImage | None = None, dtype_out: str | dtype | type = 'uint8', add_bright: int = 0, contrast: float = 1.0) VirtualBSEImage[source]#
Return an in-memory RGB virtual BSE image from three regions of interest (ROIs) on the EBSD detector, with a potential “alpha channel” in which all three arrays are multiplied by a fourth.
- Parameters:
- r
One ROI or a list of ROIs, or one tuple or a list of tuples with detector grid indices specifying one or more ROI(s). Intensities within the specified ROI(s) are summed up to form the red color channel.
- g
One ROI or a list of ROIs, or one tuple or a list of tuples with detector grid indices specifying one or more ROI(s). Intensities within the specified ROI(s) are summed up to form the green color channel.
- b
One ROI or a list of ROIs, or one tuple or a list of tuples with detector grid indices specifying one or more ROI(s). Intensities within the specified ROI(s) are summed up to form the blue color channel.
- percentiles
Whether to apply contrast stretching with a given percentile tuple with percentages, e.g. (0.5, 99.5), after creating the RGB image. If not given (default), no contrast stretching is performed.
- normalize
Whether to normalize the individual images (channels) before RGB image creation.
- alpha
“Alpha channel”. If not given (default), no “alpha channel” is added to the image.
- dtype_out
Output data type, either
"uint8"(default) or"uint16".- add_bright
Brightness offset to for each array. Default is
0.- contrast
Contrast factor for each array. Default is
1.0.
- Returns:
vbse_rgb_imageVirtual RGB image in memory.
Notes
HyperSpy only allows for RGB signal dimensions with data types unsigned 8 or 16 bit.