1.3.64
 
Loading...
Searching...
No Matches
RadiationModel Class Reference

Radiation transport model plugin. More...

#include <RadiationModel.h>

Public Types

enum class  ColorCorrectionAlgorithm { DIAGONAL_ONLY , MATRIX_3X3_AUTO , MATRIX_3X3_FORCE }
 Color correction algorithm types for auto-calibration. More...
 

Public Member Functions

 RadiationModel (helios::Context *context)
 Default constructor.
 
 ~RadiationModel ()
 Destructor.
 
void disableMessages ()
 Disable/silence status messages.
 
void enableMessages ()
 Enable status messages.
 
void optionalOutputPrimitiveData (const char *label)
 Add optional output primitive data values to the Context.
 
void setDirectRayCount (const std::string &label, size_t N)
 Sets variable directRayCount, the number of rays to be used in direct radiation model.
 
void setDiffuseRayCount (const std::string &label, size_t N)
 Sets variable diffuseRayCount, the number of rays to be used in diffuse (ambient) radiation model.
 
void setDiffuseRadiationFlux (const std::string &label, float flux)
 Diffuse (ambient) radiation flux.
 
void setDiffuseRadiationExtinctionCoeff (const std::string &label, float K, const helios::vec3 &peak_dir)
 Extinction coefficient of diffuse ambient radiation.
 
void setDiffuseRadiationExtinctionCoeff (const std::string &label, float K, const helios::SphericalCoord &peak_dir)
 Extinction coefficient of diffuse ambient radiation.
 
void setDiffuseSpectrumIntegral (float spectrum_integral)
 Scale the global diffuse spectrum so its integral equals the specified value (=∫Sdλ)
 
void setDiffuseSpectrumIntegral (float spectrum_integral, float wavelength_min, float wavelength_max)
 Scale the global diffuse spectrum based on a prescribed integral between two wavelengths (=∫Sdλ)
 
void setDiffuseSpectrumIntegral (const std::string &band_label, float spectrum_integral)
 Set the integral of the diffuse spectral flux distribution across all possible wavelengths (=∫Sdλ)
 
void setDiffuseSpectrumIntegral (const std::string &band_label, float spectrum_integral, float wavelength_min, float wavelength_max)
 Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)
 
void addRadiationBand (const std::string &label)
 Add a spectral radiation band to the model.
 
void addRadiationBand (const std::string &label, float wavelength_min, float wavelength_max)
 Add a spectral radiation band to the model with explicit specification of the spectral wave band.
 
void copyRadiationBand (const std::string &old_label, const std::string &new_label)
 Copy a spectral radiation band based on a previously created band.
 
void copyRadiationBand (const std::string &old_label, const std::string &new_label, float wavelength_min, float wavelength_max)
 Copy a spectral radiation band based on a previously created band and explicitly set new band wavelength range.
 
bool doesBandExist (const std::string &label) const
 Check if a radiation band exists based on its label.
 
void disableEmission (const std::string &label)
 Disable emission calculations for all primitives in this band.
 
void enableEmission (const std::string &label)
 Enable emission calculations for all primitives in this band.
 
uint addCollimatedRadiationSource ()
 Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) assuming the default direction of (0,0,1)
 
uint addCollimatedRadiationSource (const helios::SphericalCoord &direction)
 Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)
 
uint addCollimatedRadiationSource (const helios::vec3 &direction)
 Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)
 
uint addSphereRadiationSource (const helios::vec3 &position, float radius)
 Add an external source of radiation that emits from the surface of a sphere.
 
uint addSunSphereRadiationSource ()
 Add a sphere radiation source that models the sun assuming the default direction of (0,0,1)
 
uint addSunSphereRadiationSource (const helios::SphericalCoord &sun_direction)
 Add a sphere radiation source that models the sun.
 
uint addSunSphereRadiationSource (const helios::vec3 &sun_direction)
 Add a sphere radiation source that models the sun.
 
uint addRectangleRadiationSource (const helios::vec3 &position, const helios::vec2 &size, const helios::vec3 &rotation_rad)
 Add planar rectangular radiation source.
 
uint addDiskRadiationSource (const helios::vec3 &position, float radius, const helios::vec3 &rotation_rad)
 Add planar circular radiation source.
 
void deleteRadiationSource (uint sourceID)
 Delete an existing radiation source (any type)
 
void setSourceSpectrumIntegral (uint source_ID, float source_integral)
 Set the integral of the source spectral flux distribution across all possible wavelengths (=∫Sdλ)
 
void setSourceSpectrumIntegral (uint source_ID, float source_integral, float wavelength_min, float wavelength_max)
 Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)
 
void setSourceFlux (uint source_ID, const std::string &band_label, float flux)
 Set the flux of radiation source for this band.
 
void setSourceFlux (const std::vector< uint > &source_ID, const std::string &band_label, float flux)
 Set the flux of multiple radiation sources for this band.
 
float getSourceFlux (uint source_ID, const std::string &band_label) const
 Get the flux of radiation source for this band.
 
void setSourcePosition (uint source_ID, const helios::vec3 &position)
 Set the position/direction of radiation source based on a Cartesian vector.
 
void setSourcePosition (uint source_ID, const helios::SphericalCoord &position)
 Set the position/direction of radiation source based on a spherical vector.
 
helios::vec3 getSourcePosition (uint source_ID) const
 Get the position/direction of radiation source.
 
void setSourceSpectrum (uint source_ID, const std::vector< helios::vec2 > &spectrum)
 Set the spectral distribution of a radiation source according to a vector of wavelength-intensity pairs.
 
void setSourceSpectrum (const std::vector< uint > &source_ID, const std::vector< helios::vec2 > &spectrum)
 Set the spectral distribution of multiple radiation sources according to a vector of wavelength-intensity pairs.
 
void setSourceSpectrum (uint source_ID, const std::string &spectrum_label)
 Set the spectral distribution of a radiation source based on global data of wavelength-intensity pairs.
 
void setSourceSpectrum (const std::vector< uint > &source_ID, const std::string &spectrum_label)
 Set the spectral distribution of multiple radiation sources based on global data of wavelength-intensity pairs.
 
void setDiffuseSpectrum (const std::string &spectrum_label)
 Set the spectral distribution of diffuse ambient radiation for all bands based on global data of wavelength-intensity pairs.
 
float getDiffuseFlux (const std::string &band_label) const
 Get the diffuse flux for a given band.
 
void enableLightModelVisualization ()
 Add a 3D model of the light source (rectangular, disk, and sphere) to the Context for visualization purposes.
 
void disableLightModelVisualization ()
 Remove the 3D model of the light source from the Context.
 
void enableCameraModelVisualization ()
 Add a 3D model of the camera to the Context for visualization purposes.
 
void disableCameraModelVisualization ()
 Remove the 3D model of the camera from the Context.
 
float integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum, float wavelength_min, float wavelength_max) const
 Integrate a spectral distribution between two wavelength bounds.
 
float integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum) const
 Integrate a spectral distribution across all wavelengths.
 
float integrateSpectrum (uint source_ID, const std::vector< helios::vec2 > &object_spectrum, float wavelength_min, float wavelength_max) const
 Integrate the product of a radiation source spectral distribution with specified spectral data between two wavelength bounds.
 
float integrateSpectrum (uint source_ID, const std::vector< helios::vec2 > &object_spectrum, const std::vector< helios::vec2 > &camera_spectrum) const
 Integrate the product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths.
 
float integrateSpectrum (const std::vector< helios::vec2 > &object_spectrum, const std::vector< helios::vec2 > &camera_spectrum) const
 Integrate the product of surface spectral data and camera spectral response across all wavelengths.
 
float integrateSourceSpectrum (uint source_ID, float wavelength_min, float wavelength_max) const
 Integrate a source spectral distribution between two wavelength bounds.
 
void scaleSpectrum (const std::string &existing_global_data_label, const std::string &new_global_data_label, float scale_factor) const
 Scale an entire spectrum by a constant factor. Creates new global data for scaled spectrum.
 
void scaleSpectrum (const std::string &global_data_label, float scale_factor) const
 Scale an entire spectrum by a constant factor. Performs scaling in-place.
 
void scaleSpectrumRandomly (const std::string &existing_global_data_label, const std::string &new_global_data_label, float minimum_scale_factor, float maximum_scale_factor) const
 Scale an entire spectrum by a random factor following a uniform distribution.
 
void blendSpectra (const std::string &new_spectrum_label, const std::vector< std::string > &spectrum_labels, const std::vector< float > &weights) const
 Blend one or more spectra together into a new spectrum.
 
void blendSpectraRandomly (const std::string &new_spectrum_label, const std::vector< std::string > &spectrum_labels) const
 Blend one or more spectra together into a new spectrum, with random weights assigned to each input spectrum.
 
void interpolateSpectrumFromPrimitiveData (const std::vector< uint > &primitive_UUIDs, const std::vector< std::string > &spectra, const std::vector< float > &values, const std::string &primitive_data_query_label, const std::string &primitive_data_radprop_label)
 Configure automatic spectral interpolation based on primitive data values.
 
void interpolateSpectrumFromObjectData (const std::vector< uint > &object_IDs, const std::vector< std::string > &spectra, const std::vector< float > &values, const std::string &object_data_query_label, const std::string &primitive_data_radprop_label)
 Configure automatic spectral interpolation based on object data values.
 
void setScatteringDepth (const std::string &label, uint depth)
 Set the number of scattering iterations for a certain band.
 
void setMinScatterEnergy (const std::string &label, uint energy)
 Set the energy threshold used to terminate scattering iterations. Scattering iterations are terminated when the maximum to-be-scattered energy among all primitives is less than "energy".
 
void enforcePeriodicBoundary (const std::string &boundary)
 Use a periodic boundary condition in one or more lateral directions.
 
void addRadiationCamera (const std::string &camera_label, const std::vector< std::string > &band_label, const helios::vec3 &position, const helios::vec3 &lookat, const CameraProperties &camera_properties, uint antialiasing_samples)
 Add a radiation camera sensor.
 
void addRadiationCamera (const std::string &camera_label, const std::vector< std::string > &band_label, const helios::vec3 &position, const helios::SphericalCoord &viewing_direction, const CameraProperties &camera_properties, uint antialiasing_samples)
 Add a radiation camera sensor.
 
void setCameraSpectralResponse (const std::string &camera_label, const std::string &band_label, const std::string &global_data)
 Set the spectral response of a camera band based on reference to global data. This function version uses all the global data array to calculate the spectral response.
 
void setCameraSpectralResponseFromLibrary (const std::string &camera_label, const std::string &camera_library_name)
 Set the camera spectral response based on a camera available in the standard camera spectral library (radiation/spectral_data/camera_spectral_library.xml).
 
void addRadiationCameraFromLibrary (const std::string &camera_label, const std::string &library_camera_label, const helios::vec3 &position, const helios::vec3 &lookat, uint antialiasing_samples)
 Add a radiation camera sensor loading all properties from the camera library.
 
void addRadiationCameraFromLibrary (const std::string &camera_label, const std::string &library_camera_label, const helios::vec3 &position, const helios::vec3 &lookat, uint antialiasing_samples, const std::vector< std::string > &band_labels)
 Add a radiation camera sensor loading all properties from the camera library with custom band names.
 
void setCameraPosition (const std::string &camera_label, const helios::vec3 &position)
 Set the position of the radiation camera.
 
helios::vec3 getCameraPosition (const std::string &camera_label) const
 Get the position of the radiation camera.
 
void setCameraLookat (const std::string &camera_label, const helios::vec3 &lookat)
 Set the position the radiation camera is pointed toward (used to calculate camera orientation)
 
helios::vec3 getCameraLookat (const std::string &camera_label) const
 Get the position the radiation camera is pointed toward (used to calculate camera orientation)
 
void setCameraOrientation (const std::string &camera_label, const helios::vec3 &direction)
 Set the orientation of the radiation camera based on a Cartesian vector.
 
void setCameraOrientation (const std::string &camera_label, const helios::SphericalCoord &direction)
 Set the orientation of the radiation camera based on a spherical coordinate.
 
helios::SphericalCoord getCameraOrientation (const std::string &camera_label) const
 Get the orientation of the radiation camera based on a spherical coordinate.
 
CameraProperties getCameraParameters (const std::string &camera_label) const
 Get the intrinsic parameters of an existing radiation camera.
 
void updateCameraParameters (const std::string &camera_label, const CameraProperties &camera_properties)
 Update intrinsic parameters of an existing radiation camera.
 
std::vector< std::string > getAllCameraLabels ()
 Get the labels for all radiation cameras that have been added to the radiation model.
 
void enableCameraMetadata (const std::string &camera_label)
 Enable automatic JSON metadata file writing for a camera.
 
void enableCameraMetadata (const std::vector< std::string > &camera_labels)
 Enable automatic JSON metadata file writing for multiple cameras.
 
CameraMetadata getCameraMetadata (const std::string &camera_label) const
 Get the current metadata for a camera.
 
void setCameraMetadata (const std::string &camera_label, const CameraMetadata &metadata)
 Set metadata for a camera to be automatically written with images.
 
void enableCameraLensFlare (const std::string &camera_label)
 Enable lens flare rendering for a camera.
 
void disableCameraLensFlare (const std::string &camera_label)
 Disable lens flare rendering for a camera.
 
bool isCameraLensFlareEnabled (const std::string &camera_label) const
 Check if lens flare rendering is enabled for a camera.
 
void setCameraLensFlareProperties (const std::string &camera_label, const LensFlareProperties &properties)
 Set lens flare rendering properties for a camera.
 
LensFlareProperties getCameraLensFlareProperties (const std::string &camera_label) const
 Get the current lens flare properties for a camera.
 
void updateGeometry ()
 Adds all geometric primitives from the Context to OptiX.
 
void updateGeometry (const std::vector< uint > &UUIDs)
 Adds certain geometric primitives from the Context to OptiX as specified by a list of UUIDs.
 
void runBand (const std::string &label)
 Run the simulation for a single radiative band.
 
void runBand (const std::vector< std::string > &labels)
 Run the simulation for a multiple radiative bands.
 
std::vector< float > getTotalAbsorbedFlux ()
 Get the total absorbed radiation flux summed over all bands for each primitive.
 
float getSkyEnergy ()
 Get the radiative energy lost to the sky (surroundings)
 
float calculateGtheta (helios::Context *context, helios::vec3 view_direction)
 Calculate G(theta) (i.e., projected area fraction) for a group of primitives given a certain viewing direction.
 
void setCameraCalibration (CameraCalibration *CameraCalibration)
 
void updateCameraResponse (const std::string &orginalcameralabel, const std::vector< std::string > &sourcelabels_raw, const std::vector< std::string > &cameraresponselabels, helios::vec2 &wavelengthrange, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark)
 Update the camera response for a given camera based on color board.
 
float getCameraResponseScale (const std::string &orginalcameralabel, const std::vector< std::string > &cameraresponselabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &sourcelabels, helios::vec2 &wavelengthrange, const std::vector< std::vector< float > > &truevalues)
 Get the scale factor of the camera response for a given camera.
 
void runRadiationImaging (const std::string &cameralabel, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &cameraresponselabels, helios::vec2 wavelengthrange, float fluxscale=1, float diffusefactor=0.0005, uint scatteringdepth=4)
 Run radiation imaging simulation.
 
void runRadiationImaging (const std::vector< std::string > &cameralabels, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &bandlabels, const std::vector< std::string > &cameraresponselabels, helios::vec2 wavelengthrange, float fluxscale=1, float diffusefactor=0.0005, uint scatteringdepth=4)
 Run radiation imaging simulation.
 
void applyCameraImageCorrections (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, float saturation_adjustment=1.f, float brightness_adjustment=1.f, float contrast_adjustment=1.f)
 Apply camera image corrections including brightness, contrast, saturation, and gamma compression.
 
void applyImageProcessingPipeline (const std::string &cameralabel, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, float saturation_adjustment=1.f, float brightness_adjustment=1.f, float contrast_adjustment=1.f, float gain_adjustment=1.f)
 
void applyCameraColorCorrectionMatrix (const std::string &camera_label, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, const std::string &ccm_file_path)
 Apply pre-computed color correction matrix to camera data.
 
std::string writeCameraImage (const std::string &camera, const std::vector< std::string > &bands, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float flux_to_pixel_conversion=1.f)
 Write camera data for one or more bands to a JPEG image.
 
std::string writeNormCameraImage (const std::string &camera, const std::vector< std::string > &bands, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1)
 Write normalized camera data (maximum value is 1) for one or more bands to a JPEG image.
 
void writeCameraImageData (const std::string &camera, const std::string &band, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1)
 Write camera data for one band to an ASCII text file.
 
void writePrimitiveDataLabelMap (const std::string &cameralabel, const std::string &primitive_data_label, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float padvalue=NAN)
 Write image pixel labels to text file based on primitive data. Primitive data must have type 'float', 'double', 'uint', or 'int'.
 
void writeObjectDataLabelMap (const std::string &cameralabel, const std::string &object_data_label, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1, float padvalue=NAN)
 Write image pixel labels to text file based on object data. Object data must have type 'float', 'double', 'uint', or 'int'.
 
void writeDepthImageData (const std::string &cameralabel, const std::string &imagefile_base, const std::string &image_path="./", int frame=-1)
 Write depth image data to text file.
 
void writeNormDepthImage (const std::string &cameralabel, const std::string &imagefile_base, float max_depth, const std::string &image_path="./", int frame=-1)
 Write depth image file, with grayscale normalized to the minimum and maximum depth values.
 
void writeImageBoundingBoxes (const std::string &cameralabel, const std::string &primitive_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1)
 Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
 
void writeImageBoundingBoxes_ObjectData (const std::string &cameralabel, const std::string &object_data_label, uint object_class_ID, const std::string &imagefile_base, const std::string &image_path="./", bool append_label_file=false, int frame=-1)
 Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
 
void writeImageBoundingBoxes (const std::string &cameralabel, const std::string &primitive_data_label, const uint &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./")
 Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
 
void writeImageBoundingBoxes (const std::string &cameralabel, const std::vector< std::string > &primitive_data_label, const std::vector< uint > &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./")
 Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.
 
void writeImageBoundingBoxes_ObjectData (const std::string &cameralabel, const std::string &object_data_label, const uint &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./")
 Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
 
void writeImageBoundingBoxes_ObjectData (const std::string &cameralabel, const std::vector< std::string > &object_data_label, const std::vector< uint > &object_class_ID, const std::string &image_file, const std::string &classes_txt_file="classes.txt", const std::string &image_path="./")
 Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.
 
void writeImageSegmentationMasks (const std::string &cameralabel, const std::string &primitive_data_label, const uint &object_class_ID, const std::string &json_filename, const std::string &image_file, const std::vector< std::string > &data_attribute_labels={}, bool append_file=false)
 Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.
 
void writeImageSegmentationMasks (const std::string &cameralabel, const std::vector< std::string > &primitive_data_label, const std::vector< uint > &object_class_ID, const std::string &json_filename, const std::string &image_file, const std::vector< std::string > &data_attribute_labels={}, bool append_file=false)
 Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.
 
void writeImageSegmentationMasks_ObjectData (const std::string &cameralabel, const std::string &object_data_label, const uint &object_class_ID, const std::string &json_filename, const std::string &image_file, const std::vector< std::string > &data_attribute_labels={}, bool append_file=false)
 Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.
 
void writeImageSegmentationMasks_ObjectData (const std::string &cameralabel, const std::vector< std::string > &object_data_label, const std::vector< uint > &object_class_ID, const std::string &json_filename, const std::string &image_file, const std::vector< std::string > &data_attribute_labels={}, bool append_file=false)
 Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.
 
void setPadValue (const std::string &cameralabel, const std::vector< std::string > &bandlabels, const std::vector< float > &padvalues)
 Set padding value for pixels do not have valid values.
 
void calibrateCamera (const std::string &orginalcameralabel, const std::vector< std::string > &sourcelabels, const std::vector< std::string > &cameraresponselabels, const std::vector< std::string > &bandlabels, const float scalefactor, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark)
 Calibrate camera.
 
void calibrateCamera (const std::string &originalcameralabel, const float scalefactor, const std::vector< std::vector< float > > &truevalues, const std::string &calibratedmark)
 Calibrate camera.
 
std::string autoCalibrateCameraImage (const std::string &camera_label, const std::string &red_band_label, const std::string &green_band_label, const std::string &blue_band_label, const std::string &output_file_path, bool print_quality_report=false, ColorCorrectionAlgorithm algorithm=ColorCorrectionAlgorithm::MATRIX_3X3_AUTO, const std::string &ccm_export_file_path="")
 Auto-calibrate camera image using colorboard reference values.
 
void exportColorCorrectionMatrixXML (const std::string &file_path, const std::string &camera_label, const std::vector< std::vector< float > > &matrix, const std::string &source_image_path, const std::string &colorboard_type, float average_delta_e)
 Helper function to export color correction matrix to XML file (public for testing)
 
std::vector< std::vector< float > > loadColorCorrectionMatrixXML (const std::string &file_path, std::string &camera_label_out)
 Helper function to load color correction matrix from XML file (public for testing)
 
std::vector< float > getCameraPixelData (const std::string &camera_label, const std::string &band_label)
 Get camera pixel data for a specific band.
 
void setCameraPixelData (const std::string &camera_label, const std::string &band_label, const std::vector< float > &pixel_data)
 Set camera pixel data for a specific band.
 
void queryBackendGPUMemory () const
 Query GPU memory available via backend abstraction layer.
 
size_t testBuildGeometryData ()
 Test helper: Build geometry data and return primitive count (Phase 1 testing)
 
helios::RayTracingBackendgetBackend ()
 Test helper: Get backend pointer for direct testing (Phase 1 only)
 
helios::RayTracingGeometrygetGeometryData ()
 Test helper: Get geometry data reference (Phase 1 only)
 
helios::RayTracingMaterialgetMaterialData ()
 Test helper: Get material data reference (Phase 1 only)
 
std::vector< helios::RayTracingSource > & getSourceData ()
 Test helper: Get source data reference (Phase 1 only)
 
void testBuildAllBackendData ()
 Test helper: Build all backend data (Phase 1 testing only)
 

Static Public Member Functions

static int selfTest (int argc=0, char **argv=nullptr)
 Self-test.
 

Detailed Description

Radiation transport model plugin.

Definition at line 639 of file RadiationModel.h.

Member Enumeration Documentation

◆ ColorCorrectionAlgorithm

Color correction algorithm types for auto-calibration.

Enumerator
DIAGONAL_ONLY 

Simple diagonal scaling (white balance only)

MATRIX_3X3_AUTO 

3x3 matrix with automatic fallback to diagonal if unstable

MATRIX_3X3_FORCE 

Force 3x3 matrix calculation even if potentially unstable.

Definition at line 1773 of file RadiationModel.h.

Constructor & Destructor Documentation

◆ RadiationModel()

RadiationModel::RadiationModel ( helios::Context context)
explicit

Default constructor.

Definition at line 28 of file RadiationModel.cpp.

◆ ~RadiationModel()

RadiationModel::~RadiationModel ( )

Destructor.

Definition at line 72 of file RadiationModel.cpp.

Member Function Documentation

◆ addCollimatedRadiationSource() [1/3]

uint RadiationModel::addCollimatedRadiationSource ( )

Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays) assuming the default direction of (0,0,1)

Returns
Source identifier

Definition at line 350 of file RadiationModel.cpp.

◆ addCollimatedRadiationSource() [2/3]

uint RadiationModel::addCollimatedRadiationSource ( const helios::SphericalCoord direction)

Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)

Parameters
[in]directionSpherical coordinate pointing toward the radiation source (elevation and azimuth angles in radians)
Returns
Source identifier

Definition at line 355 of file RadiationModel.cpp.

◆ addCollimatedRadiationSource() [3/3]

uint RadiationModel::addCollimatedRadiationSource ( const helios::vec3 direction)

Add an external source of collimated radiation (i.e., source at infinite distance with parallel rays)

Parameters
[in]directionunit vector pointing toward the radiation source
Returns
Source identifier

Definition at line 359 of file RadiationModel.cpp.

◆ addDiskRadiationSource()

uint RadiationModel::addDiskRadiationSource ( const helios::vec3 position,
float  radius,
const helios::vec3 rotation_rad 
)

Add planar circular radiation source.

Parameters
[in]position(x,y,z) position of the center of the disk radiation source
[in]radiusRadius of disk source
[in]rotation_radRotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule)
Returns
Source identifier

Definition at line 495 of file RadiationModel.cpp.

◆ addRadiationBand() [1/2]

void RadiationModel::addRadiationBand ( const std::string &  label)

Add a spectral radiation band to the model.

Parameters
[in]labelLabel used to reference the band

Definition at line 239 of file RadiationModel.cpp.

◆ addRadiationBand() [2/2]

void RadiationModel::addRadiationBand ( const std::string &  label,
float  wavelength_min,
float  wavelength_max 
)

Add a spectral radiation band to the model with explicit specification of the spectral wave band.

Parameters
[in]labelLabel used to reference the band
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band

Definition at line 263 of file RadiationModel.cpp.

◆ addRadiationCamera() [1/2]

void RadiationModel::addRadiationCamera ( const std::string &  camera_label,
const std::vector< std::string > &  band_label,
const helios::vec3 position,
const helios::SphericalCoord viewing_direction,
const CameraProperties camera_properties,
uint  antialiasing_samples 
)

Add a radiation camera sensor.

Parameters
[in]camera_labelA label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.).
[in]band_labelLabels for radiation bands to include in camera.
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]viewing_directionSpherical direction in which the camera is pointed (elevation and azimuth angles in radians).
[in]camera_properties'CameraProperties' struct containing intrinsic camera parameters.
[in]antialiasing_samplesNumber of ray samples per pixel. More samples will decrease noise/aliasing in the image, but will take longer to run.

Definition at line 70 of file RadiationCamera.cpp.

◆ addRadiationCamera() [2/2]

void RadiationModel::addRadiationCamera ( const std::string &  camera_label,
const std::vector< std::string > &  band_label,
const helios::vec3 position,
const helios::vec3 lookat,
const CameraProperties camera_properties,
uint  antialiasing_samples 
)

Add a radiation camera sensor.

Parameters
[in]camera_labelA label that will be used to refer to the camera (e.g., "thermal", "multispectral", "NIR", etc.).
[in]band_labelLabels for radiation bands to include in camera.
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]lookatCartesian (x,y,z) position at which the camera is pointed. The vector (lookat-position) is perpendicular to the camera face.
[in]camera_properties'CameraProperties' struct containing intrinsic camera parameters.
[in]antialiasing_samplesNumber of ray samples per pixel. More samples will decrease noise/aliasing in the image, but will take longer to run.

Definition at line 30 of file RadiationCamera.cpp.

◆ addRadiationCameraFromLibrary() [1/2]

void RadiationModel::addRadiationCameraFromLibrary ( const std::string &  camera_label,
const std::string &  library_camera_label,
const helios::vec3 position,
const helios::vec3 lookat,
uint  antialiasing_samples 
)

Add a radiation camera sensor loading all properties from the camera library.

This method loads camera intrinsic parameters (resolution, field of view, sensor size) and spectral response data from the camera library XML file. The camera is created with the specified position and viewing direction.

Available cameras can be found in plugins/radiation/camera_library/camera_library.xml. The library includes cameras such as: Canon_20D, Nikon_D700, Nikon_D50, iPhone11, iPhone12ProMAX.

Each camera in the library defines spectral bands (typically "red", "green", and "blue" for RGB cameras). If these bands do not already exist in the radiation model, they will be automatically created with emission disabled and scattering depth set to 3.

Parameters
[in]camera_labelA label that will be used to refer to the camera instance.
[in]library_camera_labelLabel of the camera in the library (e.g., "Canon_20D", "iPhone11").
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]lookatCartesian (x,y,z) position at which the camera is pointed.
[in]antialiasing_samplesNumber of ray samples per pixel (minimum 1).

Definition at line 113 of file RadiationCamera.cpp.

◆ addRadiationCameraFromLibrary() [2/2]

void RadiationModel::addRadiationCameraFromLibrary ( const std::string &  camera_label,
const std::string &  library_camera_label,
const helios::vec3 position,
const helios::vec3 lookat,
uint  antialiasing_samples,
const std::vector< std::string > &  band_labels 
)

Add a radiation camera sensor loading all properties from the camera library with custom band names.

This overload allows specifying custom band labels instead of using the default labels from the camera library XML file. This is useful when you want to use different band names than those defined in the library (e.g., using "R", "G", "B" instead of "red", "green", "blue").

The custom band labels are mapped to the spectral responses in the order they appear in the camera library XML file. For example, if the XML defines spectral responses in order "red", "green", "blue" and you provide band_labels = {"R", "G", "B"}, then "R" will use the "red" spectral response, "G" will use "green", and "B" will use "blue".

Parameters
[in]camera_labelA label that will be used to refer to the camera instance.
[in]library_camera_labelLabel of the camera in the library (e.g., "Canon_20D", "iPhone11").
[in]positionCartesian (x,y,z) location of the camera sensor.
[in]lookatCartesian (x,y,z) position at which the camera is pointed.
[in]antialiasing_samplesNumber of ray samples per pixel (minimum 1).
[in]band_labelsCustom band labels to use. Must have the same number of elements as there are spectral responses defined in the camera library entry. The order must correspond to the order of spectral_response elements in the XML.

Definition at line 118 of file RadiationCamera.cpp.

◆ addRectangleRadiationSource()

uint RadiationModel::addRectangleRadiationSource ( const helios::vec3 position,
const helios::vec2 size,
const helios::vec3 rotation_rad 
)

Add planar rectangular radiation source.

Parameters
[in]position(x,y,z) position of the center of the rectangular radiation source
[in]sizeLength (.x) and width (.y) of rectangular source
[in]rotation_radRotation of the source in radians about the x- y- and z- axes (the sign of the rotation angle follows right-hand rule)
Returns
Source identifier

Definition at line 464 of file RadiationModel.cpp.

◆ addSphereRadiationSource()

uint RadiationModel::addSphereRadiationSource ( const helios::vec3 position,
float  radius 
)

Add an external source of radiation that emits from the surface of a sphere.

Parameters
[in]position(x,y,z) position of the center of the sphere radiation source
[in]radiusRadius of the sphere radiation source
Returns
Source identifier

Definition at line 394 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [1/3]

uint RadiationModel::addSunSphereRadiationSource ( )

Add a sphere radiation source that models the sun assuming the default direction of (0,0,1)

Returns
Source identifier

Definition at line 425 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [2/3]

uint RadiationModel::addSunSphereRadiationSource ( const helios::SphericalCoord sun_direction)

Add a sphere radiation source that models the sun.

Parameters
[in]sun_directionSpherical coordinate pointing towards the sun
Returns
Source identifier

Definition at line 429 of file RadiationModel.cpp.

◆ addSunSphereRadiationSource() [3/3]

uint RadiationModel::addSunSphereRadiationSource ( const helios::vec3 sun_direction)

Add a sphere radiation source that models the sun.

Parameters
[in]sun_directionUnit vector pointing towards the sun
Returns
Source identifier

Definition at line 433 of file RadiationModel.cpp.

◆ applyCameraColorCorrectionMatrix()

void RadiationModel::applyCameraColorCorrectionMatrix ( const std::string &  camera_label,
const std::string &  red_band_label,
const std::string &  green_band_label,
const std::string &  blue_band_label,
const std::string &  ccm_file_path 
)

Apply pre-computed color correction matrix to camera data.

Parameters
[in]camera_labelLabel of the camera to apply color correction to
[in]red_band_labelLabel for red channel band data
[in]green_band_labelLabel for green channel band data
[in]blue_band_labelLabel for blue channel band data
[in]ccm_file_pathPath to XML file containing color correction matrix

Definition at line 4673 of file RadiationModel.cpp.

◆ applyCameraImageCorrections()

void RadiationModel::applyCameraImageCorrections ( const std::string &  cameralabel,
const std::string &  red_band_label,
const std::string &  green_band_label,
const std::string &  blue_band_label,
float  saturation_adjustment = 1.f,
float  brightness_adjustment = 1.f,
float  contrast_adjustment = 1.f 
)

Apply camera image corrections including brightness, contrast, saturation, and gamma compression.

This only applies to RGB cameras. This pipeline applies post-processing steps including brightness/contrast adjustment, saturation adjustment, and gamma compression. The parameters are saved to camera metadata if metadata export is enabled.

Parameters
[in]cameralabelLabel of camera to be used for processing
[in]red_band_labelLabel of the red band
[in]green_band_labelLabel of the green band
[in]blue_band_labelLabel of the blue band
[in]saturation_adjustment[optional] Adjustment factor for saturation (default is 1.0, which means no adjustment)
[in]brightness_adjustment[optional] Adjustment factor for brightness (default is 1.0, which means no adjustment)
[in]contrast_adjustment[optional] Adjustment factor for contrast (default is 1.0, which means no adjustment)

Definition at line 2869 of file RadiationCamera.cpp.

◆ applyImageProcessingPipeline()

void RadiationModel::applyImageProcessingPipeline ( const std::string &  cameralabel,
const std::string &  red_band_label,
const std::string &  green_band_label,
const std::string &  blue_band_label,
float  saturation_adjustment = 1.f,
float  brightness_adjustment = 1.f,
float  contrast_adjustment = 1.f,
float  gain_adjustment = 1.f 
)
Deprecated:
Use applyCameraImageCorrections() instead

Definition at line 2909 of file RadiationCamera.cpp.

◆ autoCalibrateCameraImage()

std::string RadiationModel::autoCalibrateCameraImage ( const std::string &  camera_label,
const std::string &  red_band_label,
const std::string &  green_band_label,
const std::string &  blue_band_label,
const std::string &  output_file_path,
bool  print_quality_report = false,
ColorCorrectionAlgorithm  algorithm = ColorCorrectionAlgorithm::MATRIX_3X3_AUTO,
const std::string &  ccm_export_file_path = "" 
)

Auto-calibrate camera image using colorboard reference values.

Parameters
[in]camera_labelLabel of the camera that generated the image
[in]red_band_labelLabel for red channel band data
[in]green_band_labelLabel for green channel band data
[in]blue_band_labelLabel for blue channel band data
[in]output_file_pathPath where corrected image will be written
[in]print_quality_reportIf true, prints calibration quality metrics to console
[in]algorithmColor correction algorithm to use (defaults to 3x3 matrix with auto-fallback)
[in]ccm_export_file_pathOptional path to export the computed color correction matrix to XML file
Returns
Path to the written corrected image file

Definition at line 3967 of file RadiationModel.cpp.

◆ blendSpectra()

void RadiationModel::blendSpectra ( const std::string &  new_spectrum_label,
const std::vector< std::string > &  spectrum_labels,
const std::vector< float > &  weights 
) const

Blend one or more spectra together into a new spectrum.

Parameters
[in]new_spectrum_labelLabel for new spectrum global data, which is created by blending the input spectra.
[in]spectrum_labelsVector of global data labels for spectra to be blended.
[in]weightsVector of weights for each spectrum to be blended. The weights must sum to 1.0.
Note
The input spectra can have different sizes, but must have matching wavelength values across all spectra. The output spectra will be the size of the overlapping portion of wavelengths.

Definition at line 1041 of file RadiationModel.cpp.

◆ blendSpectraRandomly()

void RadiationModel::blendSpectraRandomly ( const std::string &  new_spectrum_label,
const std::vector< std::string > &  spectrum_labels 
) const

Blend one or more spectra together into a new spectrum, with random weights assigned to each input spectrum.

Parameters
[in]new_spectrum_labelLabel for new spectrum global data, which is created by blending the input spectra.
[in]spectrum_labelsVector of global data labels for spectra to be blended.
Note
The input spectra can have different sizes, but must have matching wavelength values across all spectra. The output spectra will be the size of the overlapping portion of wavelengths.

Definition at line 1115 of file RadiationModel.cpp.

◆ calculateGtheta()

float RadiationModel::calculateGtheta ( helios::Context context,
helios::vec3  view_direction 
)

Calculate G(theta) (i.e., projected area fraction) for a group of primitives given a certain viewing direction.

Parameters
[in]contextPointer to Helios context
[in]view_directionViewing direction for projected area
Returns
Projected area fraction G(theta)

Definition at line 3791 of file RadiationModel.cpp.

◆ calibrateCamera() [1/2]

void RadiationModel::calibrateCamera ( const std::string &  orginalcameralabel,
const std::vector< std::string > &  sourcelabels,
const std::vector< std::string > &  cameraresponselabels,
const std::vector< std::string > &  bandlabels,
const float  scalefactor,
const std::vector< std::vector< float > > &  truevalues,
const std::string &  calibratedmark 
)

Calibrate camera.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]sourcelabelsLabels of source fluxes
[in]cameraresponselabelsLabels of camera spectral responses
[in]bandlabelsLabels of radiation bands
[in]scalefactorScale factor for calibrated camera spectral response
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera spectral response

Definition at line 2755 of file RadiationCamera.cpp.

◆ calibrateCamera() [2/2]

void RadiationModel::calibrateCamera ( const std::string &  originalcameralabel,
const float  scalefactor,
const std::vector< std::vector< float > > &  truevalues,
const std::string &  calibratedmark 
)

Calibrate camera.

Parameters
[in]originalcameralabelLabel of camera to be used for simulation
[in]scalefactorScale factor for calibrated camera spectral response
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera spectral response

Definition at line 2792 of file RadiationCamera.cpp.

◆ copyRadiationBand() [1/2]

void RadiationModel::copyRadiationBand ( const std::string &  old_label,
const std::string &  new_label 
)

Copy a spectral radiation band based on a previously created band.

Parameters
[in]old_labelLabel of old radiation band to be copied
[in]new_labelLabel of new radiation band to be created

Definition at line 293 of file RadiationModel.cpp.

◆ copyRadiationBand() [2/2]

void RadiationModel::copyRadiationBand ( const std::string &  old_label,
const std::string &  new_label,
float  wavelength_min,
float  wavelength_max 
)

Copy a spectral radiation band based on a previously created band and explicitly set new band wavelength range.

Parameters
[in]old_labelLabel of old radiation band to be copied
[in]new_labelLabel of new radiation band to be created
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band

Definition at line 304 of file RadiationModel.cpp.

◆ deleteRadiationSource()

void RadiationModel::deleteRadiationSource ( uint  sourceID)

Delete an existing radiation source (any type)

Parameters
[in]sourceIDIdentifier of radiation source

Definition at line 526 of file RadiationModel.cpp.

◆ disableCameraLensFlare()

void RadiationModel::disableCameraLensFlare ( const std::string &  camera_label)

Disable lens flare rendering for a camera.

Parameters
[in]camera_labelLabel for the camera to disable lens flare for.

Definition at line 4424 of file RadiationCamera.cpp.

◆ disableCameraModelVisualization()

void RadiationModel::disableCameraModelVisualization ( )

Remove the 3D model of the camera from the Context.

Definition at line 753 of file RadiationModel.cpp.

◆ disableEmission()

void RadiationModel::disableEmission ( const std::string &  label)

Disable emission calculations for all primitives in this band.

Parameters
[in]labelLabel used to reference the band

Definition at line 332 of file RadiationModel.cpp.

◆ disableLightModelVisualization()

void RadiationModel::disableLightModelVisualization ( )

Remove the 3D model of the light source from the Context.

Definition at line 737 of file RadiationModel.cpp.

◆ disableMessages()

void RadiationModel::disableMessages ( )

Disable/silence status messages.

Note
Error messages are still displayed.

Definition at line 76 of file RadiationModel.cpp.

◆ doesBandExist()

bool RadiationModel::doesBandExist ( const std::string &  label) const

Check if a radiation band exists based on its label.

Parameters
[in]labelLabel used to reference the band

Definition at line 324 of file RadiationModel.cpp.

◆ enableCameraLensFlare()

void RadiationModel::enableCameraLensFlare ( const std::string &  camera_label)

Enable lens flare rendering for a camera.

Enables physically-based lens flare effects including ghost reflections and starburst diffraction patterns. Lens flare is applied as a post-processing step after the main radiation calculations.

Parameters
[in]camera_labelLabel for the camera to enable lens flare for.
Note
Use setCameraLensFlareProperties() to customize lens flare appearance.

Definition at line 4417 of file RadiationCamera.cpp.

◆ enableCameraMetadata() [1/2]

void RadiationModel::enableCameraMetadata ( const std::string &  camera_label)

Enable automatic JSON metadata file writing for a camera.

Parameters
[in]camera_labelLabel for the camera to enable metadata writing for.
Note
After calling this method, writeCameraImage() will automatically create a JSON metadata file alongside the image.
Metadata is automatically populated from camera properties and simulation context. Use getCameraMetadata() and setCameraMetadata() to customize.

Definition at line 4236 of file RadiationCamera.cpp.

◆ enableCameraMetadata() [2/2]

void RadiationModel::enableCameraMetadata ( const std::vector< std::string > &  camera_labels)

Enable automatic JSON metadata file writing for multiple cameras.

Parameters
[in]camera_labelsVector of camera labels to enable metadata writing for.
Note
After calling this method, writeCameraImage() will automatically create a JSON metadata file alongside the image for each camera.
Metadata is automatically populated from camera properties and simulation context. Use getCameraMetadata() and setCameraMetadata() to customize.

Definition at line 4260 of file RadiationCamera.cpp.

◆ enableCameraModelVisualization()

void RadiationModel::enableCameraModelVisualization ( )

Add a 3D model of the camera to the Context for visualization purposes.

Definition at line 744 of file RadiationModel.cpp.

◆ enableEmission()

void RadiationModel::enableEmission ( const std::string &  label)

Enable emission calculations for all primitives in this band.

Parameters
[in]labelLabel used to reference the band

Definition at line 341 of file RadiationModel.cpp.

◆ enableLightModelVisualization()

void RadiationModel::enableLightModelVisualization ( )

Add a 3D model of the light source (rectangular, disk, and sphere) to the Context for visualization purposes.

Definition at line 728 of file RadiationModel.cpp.

◆ enableMessages()

void RadiationModel::enableMessages ( )

Enable status messages.

Definition at line 80 of file RadiationModel.cpp.

◆ enforcePeriodicBoundary()

void RadiationModel::enforcePeriodicBoundary ( const std::string &  boundary)

Use a periodic boundary condition in one or more lateral directions.

Parameters
[in]boundaryLateral direction to enforce periodic boundary - choices are "x" (periodic only in x-direction), "y" (periodic only in y-direction), or "xy" (periodic in both x- and y-directions).
Note
This method should be called prior to calling RadiationModel::updateGeometry(), otherwise the boundary condition will not be enforced.

Definition at line 1303 of file RadiationModel.cpp.

◆ exportColorCorrectionMatrixXML()

void RadiationModel::exportColorCorrectionMatrixXML ( const std::string &  file_path,
const std::string &  camera_label,
const std::vector< std::vector< float > > &  matrix,
const std::string &  source_image_path,
const std::string &  colorboard_type,
float  average_delta_e 
)

Helper function to export color correction matrix to XML file (public for testing)

Definition at line 3813 of file RadiationModel.cpp.

◆ getAllCameraLabels()

std::vector< std::string > RadiationModel::getAllCameraLabels ( )

Get the labels for all radiation cameras that have been added to the radiation model.

Returns
Vector of strings corresponding to each camera label.

Definition at line 502 of file RadiationCamera.cpp.

◆ getBackend()

helios::RayTracingBackend * RadiationModel::getBackend ( )

Test helper: Get backend pointer for direct testing (Phase 1 only)

Definition at line 5648 of file RadiationModel.cpp.

◆ getCameraLensFlareProperties()

LensFlareProperties RadiationModel::getCameraLensFlareProperties ( const std::string &  camera_label) const

Get the current lens flare properties for a camera.

Parameters
[in]camera_labelLabel for the camera to get properties for.
Returns
LensFlareProperties struct containing current settings.

Definition at line 4466 of file RadiationCamera.cpp.

◆ getCameraLookat()

helios::vec3 RadiationModel::getCameraLookat ( const std::string &  camera_label) const

Get the position the radiation camera is pointed toward (used to calculate camera orientation)

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Cartesian coordinate of location camera is pointed toward.

Definition at line 385 of file RadiationCamera.cpp.

◆ getCameraMetadata()

CameraMetadata RadiationModel::getCameraMetadata ( const std::string &  camera_label) const

Get the current metadata for a camera.

Parameters
[in]camera_labelLabel for the camera to get metadata for.
Returns
CameraMetadata struct containing current metadata for the camera.
Note
Metadata is automatically populated when cameras are added. This method allows retrieval for inspection or modification.

Definition at line 4267 of file RadiationCamera.cpp.

◆ getCameraOrientation()

helios::SphericalCoord RadiationModel::getCameraOrientation ( const std::string &  camera_label) const

Get the orientation of the radiation camera based on a spherical coordinate.

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Spherical coordinate defining the orientation of the camera (elevation and azimuth angles in radians).

Definition at line 406 of file RadiationCamera.cpp.

◆ getCameraParameters()

CameraProperties RadiationModel::getCameraParameters ( const std::string &  camera_label) const

Get the intrinsic parameters of an existing radiation camera.

This method returns the current intrinsic optical and geometric parameters of a camera including resolution, horizontal field of view, lens diameter, focal plane distance, sensor width, model name, and the auto-calculated FOV aspect ratio.

Parameters
[in]camera_labelLabel identifying the camera to query. Camera must exist.
Returns
CameraProperties struct containing the current intrinsic parameters.
Note
This method does not return camera position, lookat direction, or spectral band configuration.
The returned FOV_aspect_ratio is the auto-calculated value ensuring square pixels.
Throws helios_runtime_error if camera_label does not exist.

Definition at line 427 of file RadiationCamera.cpp.

◆ getCameraPixelData()

std::vector< float > RadiationModel::getCameraPixelData ( const std::string &  camera_label,
const std::string &  band_label 
)

Get camera pixel data for a specific band.

Definition at line 4748 of file RadiationModel.cpp.

◆ getCameraPosition()

helios::vec3 RadiationModel::getCameraPosition ( const std::string &  camera_label) const

Get the position of the radiation camera.

Parameters
[in]camera_labelLabel for the camera to be set.
Returns
Cartesian coordinate of camera position.

Definition at line 364 of file RadiationCamera.cpp.

◆ getCameraResponseScale()

float RadiationModel::getCameraResponseScale ( const std::string &  orginalcameralabel,
const std::vector< std::string > &  cameraresponselabels,
const std::vector< std::string > &  bandlabels,
const std::vector< std::string > &  sourcelabels,
helios::vec2 wavelengthrange,
const std::vector< std::vector< float > > &  truevalues 
)

Get the scale factor of the camera response for a given camera.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]wavelengthrangeWavelength range of the camera
[in]truevaluesTrue image values of the color board
Returns
scale factor

Definition at line 938 of file RadiationCamera.cpp.

◆ getDiffuseFlux()

float RadiationModel::getDiffuseFlux ( const std::string &  band_label) const

Get the diffuse flux for a given band.

Parameters
[in]band_labelLabel used to reference the band
Returns
Diffuse flux for the band

Definition at line 695 of file RadiationModel.cpp.

◆ getGeometryData()

helios::RayTracingGeometry & RadiationModel::getGeometryData ( )

Test helper: Get geometry data reference (Phase 1 only)

Definition at line 5652 of file RadiationModel.cpp.

◆ getMaterialData()

helios::RayTracingMaterial & RadiationModel::getMaterialData ( )

Test helper: Get material data reference (Phase 1 only)

Definition at line 5656 of file RadiationModel.cpp.

◆ getSkyEnergy()

float RadiationModel::getSkyEnergy ( )

Get the radiative energy lost to the sky (surroundings)

Definition at line 3754 of file RadiationModel.cpp.

◆ getSourceData()

std::vector< helios::RayTracingSource > & RadiationModel::getSourceData ( )

Test helper: Get source data reference (Phase 1 only)

Definition at line 5660 of file RadiationModel.cpp.

◆ getSourceFlux()

float RadiationModel::getSourceFlux ( uint  source_ID,
const std::string &  band_label 
) const

Get the flux of radiation source for this band.

Parameters
[in]source_IDIdentifier of radiation source
[in]band_labelLabel used to reference the band
Returns
Radiative flux normal to the direction of radiation propagation

Definition at line 591 of file RadiationModel.cpp.

◆ getSourcePosition()

helios::vec3 RadiationModel::getSourcePosition ( uint  source_ID) const

Get the position/direction of radiation source.

Parameters
[in]source_IDIdentifier of radiation source
Returns
If point source - (x,y,z) position of the radiation source. If collimated source - (nx,ny,nz) unit vector pointing toward the source.

Definition at line 1280 of file RadiationModel.cpp.

◆ getTotalAbsorbedFlux()

std::vector< float > RadiationModel::getTotalAbsorbedFlux ( )

Get the total absorbed radiation flux summed over all bands for each primitive.

Definition at line 3766 of file RadiationModel.cpp.

◆ integrateSourceSpectrum()

float RadiationModel::integrateSourceSpectrum ( uint  source_ID,
float  wavelength_min,
float  wavelength_max 
) const

Integrate a source spectral distribution between two wavelength bounds.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of spectral data from wavelength_min to wavelength_max

Definition at line 1002 of file RadiationModel.cpp.

◆ integrateSpectrum() [1/5]

float RadiationModel::integrateSpectrum ( const std::vector< helios::vec2 > &  object_spectrum) const

Integrate a spectral distribution across all wavelengths.

Parameters
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of spectral data from minimum to maximum wavelength

Definition at line 923 of file RadiationModel.cpp.

◆ integrateSpectrum() [2/5]

float RadiationModel::integrateSpectrum ( const std::vector< helios::vec2 > &  object_spectrum,
const std::vector< helios::vec2 > &  camera_spectrum 
) const

Integrate the product of surface spectral data and camera spectral response across all wavelengths.

Parameters
[in]object_spectrumVector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]camera_spectrumVector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths

Definition at line 969 of file RadiationModel.cpp.

◆ integrateSpectrum() [3/5]

float RadiationModel::integrateSpectrum ( const std::vector< helios::vec2 > &  object_spectrum,
float  wavelength_min,
float  wavelength_max 
) const

Integrate a spectral distribution between two wavelength bounds.

Parameters
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of spectral data from wavelength_min to wavelength_max

◆ integrateSpectrum() [4/5]

float RadiationModel::integrateSpectrum ( uint  source_ID,
const std::vector< helios::vec2 > &  object_spectrum,
const std::vector< helios::vec2 > &  camera_spectrum 
) const

Integrate the product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]object_spectrumVector containing surface spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]camera_spectrumVector containing camera spectral response data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
Returns
Integral of product of a radiation source spectral distribution, surface spectral data, and camera spectral response across all wavelengths

Definition at line 930 of file RadiationModel.cpp.

◆ integrateSpectrum() [5/5]

float RadiationModel::integrateSpectrum ( uint  source_ID,
const std::vector< helios::vec2 > &  object_spectrum,
float  wavelength_min,
float  wavelength_max 
) const

Integrate the product of a radiation source spectral distribution with specified spectral data between two wavelength bounds.

Parameters
[in]source_IDIdentifier of a radiation source.
[in]object_spectrumVector containing spectral data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity/reflectivity (.y).
[in]wavelength_minWavelength for lower bounds of integration
[in]wavelength_maxWavelength for upper bounds of integration
Returns
Integral of product of source energy spectrum and spectral data from minimum to maximum wavelength

◆ interpolateSpectrumFromObjectData()

void RadiationModel::interpolateSpectrumFromObjectData ( const std::vector< uint > &  object_IDs,
const std::vector< std::string > &  spectra,
const std::vector< float > &  values,
const std::string &  object_data_query_label,
const std::string &  primitive_data_radprop_label 
)

Configure automatic spectral interpolation based on object data values.

This function sets up automatic interpolation between different spectra based on the value of an object data field. When updateRadiativeProperties() is called, for each object specified, it will query the value of the object data field specified by object_data_query_label, perform nearest-neighbor interpolation to find the closest spectrum from the spectra vector, and set the primitive data field specified by primitive_data_radprop_label to the label of the selected spectrum for all primitives belonging to that object.

Parameters
[in]object_IDsVector of object IDs to apply interpolation to
[in]spectraVector of global data labels containing spectral data (type std::vector<helios::vec2>). Each label must reference valid global data.
[in]valuesVector of object data values mapping to each spectrum. Must be the same length as spectra vector.
[in]object_data_query_labelName of existing object data field to query for interpolation (e.g., "age")
[in]primitive_data_radprop_labelName of primitive data field to set with interpolated spectrum label (e.g., "reflectivity_spectrum" or "transmissivity_spectrum")
Note
This function must be called before updateRadiativeProperties(). The interpolation uses nearest-neighbor selection based on the absolute distance between the queried value and the provided mapping values.
Although this function reads object data, it sets primitive data because radiative properties are defined per-primitive. All primitives belonging to the object will have their primitive data set.

Definition at line 1194 of file RadiationModel.cpp.

◆ interpolateSpectrumFromPrimitiveData()

void RadiationModel::interpolateSpectrumFromPrimitiveData ( const std::vector< uint > &  primitive_UUIDs,
const std::vector< std::string > &  spectra,
const std::vector< float > &  values,
const std::string &  primitive_data_query_label,
const std::string &  primitive_data_radprop_label 
)

Configure automatic spectral interpolation based on primitive data values.

This function sets up automatic interpolation between different spectra based on the value of a primitive data field. When updateRadiativeProperties() is called, for each primitive specified, it will query the value of the primitive data field specified by primitive_data_query_label, perform nearest-neighbor interpolation to find the closest spectrum from the spectra vector, and set the primitive data field specified by primitive_data_radprop_label to the label of the selected spectrum.

Parameters
[in]primitive_UUIDsVector of primitive UUIDs to apply interpolation to
[in]spectraVector of global data labels containing spectral data (type std::vector<helios::vec2>). Each label must reference valid global data.
[in]valuesVector of primitive data values mapping to each spectrum. Must be the same length as spectra vector.
[in]primitive_data_query_labelName of existing primitive data field to query for interpolation (e.g., "age")
[in]primitive_data_radprop_labelName of primitive data field to set with interpolated spectrum label (e.g., "reflectivity_spectrum" or "transmissivity_spectrum")
Note
This function must be called before updateRadiativeProperties(). The interpolation uses nearest-neighbor selection based on the absolute distance between the queried value and the provided mapping values.

Definition at line 1130 of file RadiationModel.cpp.

◆ isCameraLensFlareEnabled()

bool RadiationModel::isCameraLensFlareEnabled ( const std::string &  camera_label) const

Check if lens flare rendering is enabled for a camera.

Parameters
[in]camera_labelLabel for the camera to check.
Returns
true if lens flare is enabled, false otherwise.

Definition at line 4431 of file RadiationCamera.cpp.

◆ loadColorCorrectionMatrixXML()

std::vector< std::vector< float > > RadiationModel::loadColorCorrectionMatrixXML ( const std::string &  file_path,
std::string &  camera_label_out 
)

Helper function to load color correction matrix from XML file (public for testing)

Definition at line 3868 of file RadiationModel.cpp.

◆ optionalOutputPrimitiveData()

void RadiationModel::optionalOutputPrimitiveData ( const char *  label)

Add optional output primitive data values to the Context.

Parameters
[in]labelName of primitive data (e.g., "reflectivity", "transmissivity")

Definition at line 84 of file RadiationModel.cpp.

◆ queryBackendGPUMemory()

void RadiationModel::queryBackendGPUMemory ( ) const

Query GPU memory available via backend abstraction layer.

Phase 1: Integration test method - proves backend is accessible and functional. This method uses the backend instead of direct OptiX calls.

Definition at line 4771 of file RadiationModel.cpp.

◆ runBand() [1/2]

void RadiationModel::runBand ( const std::string &  label)

Run the simulation for a single radiative band.

Parameters
[in]labelLabel used to reference the band (e.g., "PAR")
Note
Before running the band simulation, you must 1) add at least one radiative band to the simulation (see RadiationModel::addRadiationBand()), 2) update the Context geometry in the model (see RadiationModel::updateGeometry()), and 3) update radiative properties in the model (see RadiationModel::updateRadiativeProperties()).

Definition at line 2761 of file RadiationModel.cpp.

◆ runBand() [2/2]

void RadiationModel::runBand ( const std::vector< std::string > &  labels)

Run the simulation for a multiple radiative bands.

Parameters
[in]labelsLabel used to reference the band (e.g., "PAR")
Note
Before running the band simulation, you must 1) add at least one radiative band to the simulation (see RadiationModel::addRadiationBand()), 2) update the Context geometry in the model (see RadiationModel::updateGeometry()), and 3) update radiative properties in the model (see RadiationModel::updateRadiativeProperties()).

Definition at line 2766 of file RadiationModel.cpp.

◆ runRadiationImaging() [1/2]

void RadiationModel::runRadiationImaging ( const std::string &  cameralabel,
const std::vector< std::string > &  sourcelabels,
const std::vector< std::string > &  bandlabels,
const std::vector< std::string > &  cameraresponselabels,
helios::vec2  wavelengthrange,
float  fluxscale = 1,
float  diffusefactor = 0.0005,
uint  scatteringdepth = 4 
)

Run radiation imaging simulation.

Parameters
[in]cameralabelLabel of camera to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of spectra
[in]fluxscaleScale factor for source flux
[in]diffusefactorDiffuse factor for diffuse radiation
[in]scatteringdepthNumber of scattering events to simulate

Definition at line 855 of file RadiationCamera.cpp.

◆ runRadiationImaging() [2/2]

void RadiationModel::runRadiationImaging ( const std::vector< std::string > &  cameralabels,
const std::vector< std::string > &  sourcelabels,
const std::vector< std::string > &  bandlabels,
const std::vector< std::string > &  cameraresponselabels,
helios::vec2  wavelengthrange,
float  fluxscale = 1,
float  diffusefactor = 0.0005,
uint  scatteringdepth = 4 
)

Run radiation imaging simulation.

Parameters
[in]cameralabelsVector of camera labels to be used for simulation
[in]sourcelabelsVector of labels of source spectra to be used for simulation
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of spectra
[in]fluxscaleScale factor for source flux
[in]diffusefactorDiffuse factor for diffuse radiation
[in]scatteringdepthNumber of scattering events to simulate

Definition at line 895 of file RadiationCamera.cpp.

◆ scaleSpectrum() [1/2]

void RadiationModel::scaleSpectrum ( const std::string &  existing_global_data_label,
const std::string &  new_global_data_label,
float  scale_factor 
) const

Scale an entire spectrum by a constant factor. Creates new global data for scaled spectrum.

Parameters
[in]existing_global_data_labelLabel of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y).
[in]new_global_data_labelLabel of new global data to be created containing scaled spectral data (type of vec2).
[in]scale_factorScaling factor.

Definition at line 1013 of file RadiationModel.cpp.

◆ scaleSpectrum() [2/2]

void RadiationModel::scaleSpectrum ( const std::string &  global_data_label,
float  scale_factor 
) const

Scale an entire spectrum by a constant factor. Performs scaling in-place.

Parameters
[in]global_data_labelLabel of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y).
[in]scale_factorScaling factor.

Definition at line 1024 of file RadiationModel.cpp.

◆ scaleSpectrumRandomly()

void RadiationModel::scaleSpectrumRandomly ( const std::string &  existing_global_data_label,
const std::string &  new_global_data_label,
float  minimum_scale_factor,
float  maximum_scale_factor 
) const

Scale an entire spectrum by a random factor following a uniform distribution.

Parameters
[in]existing_global_data_labelLabel of global data containing spectral data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity/reflectivity/transmissivity (.y).
[in]new_global_data_labelLabel of new global data to be created containing scaled spectral data (type of vec2).
[in]minimum_scale_factorScaling factor minimum value in uniform distribution.
[in]maximum_scale_factorScaling factor maximum value in uniform distribution.

Definition at line 1035 of file RadiationModel.cpp.

◆ selfTest()

int RadiationModel::selfTest ( int  argc = 0,
char **  argv = nullptr 
)
static

Self-test.

Returns
0 if test was successful, 1 if test failed

Definition at line 11 of file selfTest.cpp.

◆ setCameraCalibration()

void RadiationModel::setCameraCalibration ( CameraCalibration CameraCalibration)

Definition at line 733 of file RadiationCamera.cpp.

◆ setCameraLensFlareProperties()

void RadiationModel::setCameraLensFlareProperties ( const std::string &  camera_label,
const LensFlareProperties properties 
)

Set lens flare rendering properties for a camera.

Parameters
[in]camera_labelLabel for the camera to configure.
[in]propertiesLensFlareProperties struct containing the desired settings.
Note
Lens flare must be enabled separately using enableCameraLensFlare().

Definition at line 4438 of file RadiationCamera.cpp.

◆ setCameraLookat()

void RadiationModel::setCameraLookat ( const std::string &  camera_label,
const helios::vec3 lookat 
)

Set the position the radiation camera is pointed toward (used to calculate camera orientation)

Parameters
[in]camera_labelLabel for the camera to be set.
[in]lookatCartesian coordinate of location camera is pointed toward.

Definition at line 373 of file RadiationCamera.cpp.

◆ setCameraMetadata()

void RadiationModel::setCameraMetadata ( const std::string &  camera_label,
const CameraMetadata metadata 
)

Set metadata for a camera to be automatically written with images.

Parameters
[in]camera_labelLabel for the camera to set metadata for.
[in]metadataCameraMetadata struct containing metadata to be written with camera images.
Note
When writeCameraImage() is called for this camera, a JSON metadata file will be automatically created alongside the image.

Definition at line 4280 of file RadiationCamera.cpp.

◆ setCameraOrientation() [1/2]

void RadiationModel::setCameraOrientation ( const std::string &  camera_label,
const helios::SphericalCoord direction 
)

Set the orientation of the radiation camera based on a spherical coordinate.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]directionSpherical coordinate defining the orientation of the camera (elevation and azimuth angles in radians).

Definition at line 415 of file RadiationCamera.cpp.

◆ setCameraOrientation() [2/2]

void RadiationModel::setCameraOrientation ( const std::string &  camera_label,
const helios::vec3 direction 
)

Set the orientation of the radiation camera based on a Cartesian vector.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]directionCartesian vector defining the orientation of the camera.

Definition at line 394 of file RadiationCamera.cpp.

◆ setCameraPixelData()

void RadiationModel::setCameraPixelData ( const std::string &  camera_label,
const std::string &  band_label,
const std::vector< float > &  pixel_data 
)

Set camera pixel data for a specific band.

Definition at line 4761 of file RadiationModel.cpp.

◆ setCameraPosition()

void RadiationModel::setCameraPosition ( const std::string &  camera_label,
const helios::vec3 position 
)

Set the position of the radiation camera.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]positionCartesian coordinate of camera position.

Definition at line 350 of file RadiationCamera.cpp.

◆ setCameraSpectralResponse()

void RadiationModel::setCameraSpectralResponse ( const std::string &  camera_label,
const std::string &  band_label,
const std::string &  global_data 
)

Set the spectral response of a camera band based on reference to global data. This function version uses all the global data array to calculate the spectral response.

Parameters
[in]camera_labelLabel for the camera to be set.
[in]band_labelLabel for the radiation band.
[in]global_dataLabel for global data containing camera spectral response data. This should be of type vec2 and contain wavelength-quantum efficiency pairs.
Note
If global data in the standard camera spectral library is referenced, the library will be automatically loaded.

Definition at line 77 of file RadiationCamera.cpp.

◆ setCameraSpectralResponseFromLibrary()

void RadiationModel::setCameraSpectralResponseFromLibrary ( const std::string &  camera_label,
const std::string &  camera_library_name 
)

Set the camera spectral response based on a camera available in the standard camera spectral library (radiation/spectral_data/camera_spectral_library.xml).

Consult the documentation for available cameras in the library, or examine the file radiation/spectral_data/camera_spectral_library.xml. The naming convention is that the response data for the band starts with the camera model (e.g., "iPhone11") followed by an underscore, then the band label. In order for the response to be applied to the camera, the bands must all exist. For example, for iPhone11, there must exist bands "red", "green", and "blue".

Parameters
[in]camera_labelLabel for the camera to be set.
[in]camera_library_nameName of the camera in the standard camera spectral library (e.g., "iPhone11", "NikonD700", etc.).

Definition at line 89 of file RadiationCamera.cpp.

◆ setDiffuseRadiationExtinctionCoeff() [1/2]

void RadiationModel::setDiffuseRadiationExtinctionCoeff ( const std::string &  label,
float  K,
const helios::SphericalCoord peak_dir 
)

Extinction coefficient of diffuse ambient radiation.

The angular distribution of diffuse ambient radiation is computed according to N = Psi^-K, where Psi is the angle between the distribution peak (usually the sun direction) and the ambient direction, and K is the extinction coefficient. When K=0 the ambient distribution is uniform, which is the default setting

Parameters
[in]labelLabel used to reference the radiative band
[in]KExtinction coefficient value
[in]peak_dirSpherical direction of the peak in diffuse radiation (elevation and azimuth angles in radians, this is usually the sun direction)

Definition at line 114 of file RadiationModel.cpp.

◆ setDiffuseRadiationExtinctionCoeff() [2/2]

void RadiationModel::setDiffuseRadiationExtinctionCoeff ( const std::string &  label,
float  K,
const helios::vec3 peak_dir 
)

Extinction coefficient of diffuse ambient radiation.

The angular distribution of diffuse ambient radiation is computed according to N = Psi^-K, where Psi is the angle between the distribution peak (usually the sun direction) and the ambient direction, and K is the extinction coefficient. When K=0 the ambient distribution is uniform, which is the default setting

Parameters
[in]labelLabel used to reference the radiative band
[in]KExtinction coefficient value
[in]peak_dirUnit vector pointing in the direction of the peak in diffuse radiation (this is usually the sun direction)

Definition at line 118 of file RadiationModel.cpp.

◆ setDiffuseRadiationFlux()

void RadiationModel::setDiffuseRadiationFlux ( const std::string &  label,
float  flux 
)

Diffuse (ambient) radiation flux.

Diffuse component of radiation incident on a horizontal surface above all geometry in the domain.

Parameters
[in]labelLabel used to reference the band
[in]fluxRadiative flux

Definition at line 107 of file RadiationModel.cpp.

◆ setDiffuseRayCount()

void RadiationModel::setDiffuseRayCount ( const std::string &  label,
size_t  N 
)

Sets variable diffuseRayCount, the number of rays to be used in diffuse (ambient) radiation model.

Parameters
[in]labelLabel used to reference the band
[in]NNumber of rays
Note
Default is 1000 rays/primitive.

Definition at line 100 of file RadiationModel.cpp.

◆ setDiffuseSpectrum()

void RadiationModel::setDiffuseSpectrum ( const std::string &  spectrum_label)

Set the spectral distribution of diffuse ambient radiation for all bands based on global data of wavelength-intensity pairs.

Parameters
[in]spectrum_labelLabel of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y).
Note
For emission-enabled bands, getDiffuseFlux() returns 0 since diffuse sky radiation is not relevant for thermal bands. Use setDiffuseRadiationFlux() to manually set flux for emission bands if needed.

Definition at line 670 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [1/4]

void RadiationModel::setDiffuseSpectrumIntegral ( const std::string &  band_label,
float  spectrum_integral 
)

Set the integral of the diffuse spectral flux distribution across all possible wavelengths (=∫Sdλ)

Parameters
[in]band_labelLabel used to reference the band
[in]spectrum_integralIntegration of source spectral flux distribution across all possible wavelengths (=∫Sdλ)
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 202 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [2/4]

void RadiationModel::setDiffuseSpectrumIntegral ( const std::string &  band_label,
float  spectrum_integral,
float  wavelength_min,
float  wavelength_max 
)

Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)

Parameters
[in]band_labelLabel used to reference the band
[in]spectrum_integralIntegration of source spectral flux distribution between two wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band
Note
This function will call setDiffuseFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 222 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [3/4]

void RadiationModel::setDiffuseSpectrumIntegral ( float  spectrum_integral)

Scale the global diffuse spectrum so its integral equals the specified value (=∫Sdλ)

Scales the global diffuse spectrum (set via setDiffuseSpectrum()) so that its integral over all wavelengths equals the specified value. The scaled spectrum is applied to all existing radiation bands and will be inherited by any bands created subsequently. This should be called after setDiffuseSpectrum().

Parameters
[in]spectrum_integralDesired integration of spectral flux distribution across all wavelengths (=∫Sdλ)

Definition at line 152 of file RadiationModel.cpp.

◆ setDiffuseSpectrumIntegral() [4/4]

void RadiationModel::setDiffuseSpectrumIntegral ( float  spectrum_integral,
float  wavelength_min,
float  wavelength_max 
)

Scale the global diffuse spectrum based on a prescribed integral between two wavelengths (=∫Sdλ)

Scales the global diffuse spectrum (set via setDiffuseSpectrum()) so that its integral between the specified wavelengths equals the given value. The entire spectrum is scaled uniformly. The scaled spectrum is applied to all existing radiation bands and will be inherited by any bands created subsequently.

Parameters
[in]spectrum_integralDesired integration of spectral flux distribution between the specified wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for integration range (nm)
[in]wavelength_maxUpper bounding wavelength for integration range (nm)

Definition at line 177 of file RadiationModel.cpp.

◆ setDirectRayCount()

void RadiationModel::setDirectRayCount ( const std::string &  label,
size_t  N 
)

Sets variable directRayCount, the number of rays to be used in direct radiation model.

Parameters
[in]labelLabel used to reference the band
[in]NNumber of rays
Note
Default is 100 rays/primitive.

Definition at line 93 of file RadiationModel.cpp.

◆ setMinScatterEnergy()

void RadiationModel::setMinScatterEnergy ( const std::string &  label,
uint  energy 
)

Set the energy threshold used to terminate scattering iterations. Scattering iterations are terminated when the maximum to-be-scattered energy among all primitives is less than "energy".

Parameters
[in]labelLabel used to reference the band
[in]energyEnergy threshold

Definition at line 1295 of file RadiationModel.cpp.

◆ setPadValue()

void RadiationModel::setPadValue ( const std::string &  cameralabel,
const std::vector< std::string > &  bandlabels,
const std::vector< float > &  padvalues 
)

Set padding value for pixels do not have valid values.

Parameters
[in]cameralabelLabel of target camera
[in]bandlabelsVector of labels of radiation bands to be used for simulation
[in]padvaluesVector of padding values for each band

Definition at line 2733 of file RadiationCamera.cpp.

◆ setScatteringDepth()

void RadiationModel::setScatteringDepth ( const std::string &  label,
uint  depth 
)

Set the number of scattering iterations for a certain band.

Parameters
[in]labelLabel used to reference the band
[in]depthNumber of scattering iterations (depth=0 turns scattering off)

Definition at line 1287 of file RadiationModel.cpp.

◆ setSourceFlux() [1/2]

void RadiationModel::setSourceFlux ( const std::vector< uint > &  source_ID,
const std::string &  band_label,
float  flux 
)

Set the flux of multiple radiation sources for this band.

Parameters
[in]source_IDVector of radiation source identifiers
[in]band_labelLabel used to reference the band
[in]fluxRadiative flux normal to the direction of radiation propagation

Definition at line 585 of file RadiationModel.cpp.

◆ setSourceFlux() [2/2]

void RadiationModel::setSourceFlux ( uint  source_ID,
const std::string &  band_label,
float  flux 
)

Set the flux of radiation source for this band.

Parameters
[in]source_IDIdentifier of radiation source
[in]band_labelLabel used to reference the band
[in]fluxRadiative flux normal to the direction of radiation propagation

Definition at line 572 of file RadiationModel.cpp.

◆ setSourcePosition() [1/2]

void RadiationModel::setSourcePosition ( uint  source_ID,
const helios::SphericalCoord position 
)

Set the position/direction of radiation source based on a spherical vector.

Parameters
[in]source_IDIdentifier of radiation source
[in]positionIf point source - (radius,elevation,azimuth) position of the radiation source (elevation and azimuth angles in radians). If collimated source - (elevation,azimuth) vector pointing toward the source (elevation and azimuth angles in radians, radius is ignored).

Definition at line 1276 of file RadiationModel.cpp.

◆ setSourcePosition() [2/2]

void RadiationModel::setSourcePosition ( uint  source_ID,
const helios::vec3 position 
)

Set the position/direction of radiation source based on a Cartesian vector.

Parameters
[in]source_IDIdentifier of radiation source
[in]positionIf point source - (x,y,z) position of the radiation source. If collimated source - (nx,ny,nz) unit vector pointing toward the source.

Definition at line 1257 of file RadiationModel.cpp.

◆ setSourceSpectrum() [1/4]

void RadiationModel::setSourceSpectrum ( const std::vector< uint > &  source_ID,
const std::string &  spectrum_label 
)

Set the spectral distribution of multiple radiation sources based on global data of wavelength-intensity pairs.

Parameters
[in]source_IDVector of radiation source identifiers.
[in]spectrum_labelLabel of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y).

Definition at line 664 of file RadiationModel.cpp.

◆ setSourceSpectrum() [2/4]

void RadiationModel::setSourceSpectrum ( const std::vector< uint > &  source_ID,
const std::vector< helios::vec2 > &  spectrum 
)

Set the spectral distribution of multiple radiation sources according to a vector of wavelength-intensity pairs.

Parameters
[in]source_IDVector of radiation source identifiers.
[in]spectrumVector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y).

Definition at line 643 of file RadiationModel.cpp.

◆ setSourceSpectrum() [3/4]

void RadiationModel::setSourceSpectrum ( uint  source_ID,
const std::string &  spectrum_label 
)

Set the spectral distribution of a radiation source based on global data of wavelength-intensity pairs.

Parameters
[in]source_IDIdentifier of radiation source.
[in]spectrum_labelLabel of global data containing spectral intensity data (type of vec2). Each index of the global data gives the wavelength (.x) and spectral intensity (.y).

Definition at line 649 of file RadiationModel.cpp.

◆ setSourceSpectrum() [4/4]

void RadiationModel::setSourceSpectrum ( uint  source_ID,
const std::vector< helios::vec2 > &  spectrum 
)

Set the spectral distribution of a radiation source according to a vector of wavelength-intensity pairs.

Parameters
[in]source_IDIdentifier of radiation source.
[in]spectrumVector containing spectral intensity data. Each index of "spectrum" gives the wavelength (.x) and spectral intensity (.y).

Definition at line 616 of file RadiationModel.cpp.

◆ setSourceSpectrumIntegral() [1/2]

void RadiationModel::setSourceSpectrumIntegral ( uint  source_ID,
float  source_integral 
)

Set the integral of the source spectral flux distribution across all possible wavelengths (=∫Sdλ)

Parameters
[in]source_IDID of source
[in]source_integralIntegration of source spectral flux distribution across all possible wavelengths (=∫Sdλ)
Note
This function will call setSourceFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 537 of file RadiationModel.cpp.

◆ setSourceSpectrumIntegral() [2/2]

void RadiationModel::setSourceSpectrumIntegral ( uint  source_ID,
float  source_integral,
float  wavelength_min,
float  wavelength_max 
)

Scale the source spectral flux distribution based on a prescribed integral between two wavelengths (=∫Sdλ)

Parameters
[in]source_IDID of source
[in]source_integralIntegration of source spectral flux distribution between two wavelengths (=∫Sdλ)
[in]wavelength_minLower bounding wavelength for wave band
[in]wavelength_maxUpper bounding wavelength for wave band
Note
This function will call setSourceFlux() for all bands to update source fluxes based on the new spectrum integral

Definition at line 552 of file RadiationModel.cpp.

◆ testBuildAllBackendData()

void RadiationModel::testBuildAllBackendData ( )

Test helper: Build all backend data (Phase 1 testing only)

Definition at line 5665 of file RadiationModel.cpp.

◆ testBuildGeometryData()

size_t RadiationModel::testBuildGeometryData ( )

Test helper: Build geometry data and return primitive count (Phase 1 testing)

Phase 1: Testing helper to verify buildGeometryData() works correctly. Returns the number of primitives extracted from Context.

Definition at line 5328 of file RadiationModel.cpp.

◆ updateCameraParameters()

void RadiationModel::updateCameraParameters ( const std::string &  camera_label,
const CameraProperties camera_properties 
)

Update intrinsic parameters of an existing radiation camera.

This method updates the intrinsic optical and geometric parameters of an existing camera. The camera position, lookat direction, and spectral bands are preserved. All fields in CameraProperties can be updated including resolution, HFOV, lens diameter, focal plane distance, sensor width, and model name. If resolution changes, pixel buffers will be reallocated on the next call to runRadiationImaging().

Parameters
[in]camera_labelLabel identifying the camera to update. Camera must already exist.
[in]camera_propertiesCameraProperties struct containing the new intrinsic parameters.
Note
This method preserves the camera's position, lookat direction, and spectral band configuration.
The FOV_aspect_ratio field in camera_properties is ignored and recalculated from resolution.
Throws helios_runtime_error if camera_label does not exist.

Definition at line 458 of file RadiationCamera.cpp.

◆ updateCameraResponse()

void RadiationModel::updateCameraResponse ( const std::string &  orginalcameralabel,
const std::vector< std::string > &  sourcelabels_raw,
const std::vector< std::string > &  cameraresponselabels,
helios::vec2 wavelengthrange,
const std::vector< std::vector< float > > &  truevalues,
const std::string &  calibratedmark 
)

Update the camera response for a given camera based on color board.

Parameters
[in]orginalcameralabelLabel of camera to be used for simulation
[in]sourcelabels_rawVector of labels of source spectra to be used for simulation
[in]cameraresponselabelsVector of labels of camera spectral responses
[in]wavelengthrangeWavelength range of the camera
[in]truevaluesTrue image values of the color board
[in]calibratedmarkMark of the calibrated camera

Definition at line 738 of file RadiationCamera.cpp.

◆ updateGeometry() [1/2]

void RadiationModel::updateGeometry ( )

Adds all geometric primitives from the Context to OptiX.

This function should be called anytime Context geometry is created or modified

Note
RadiationModel::updateGeometry() must be called before simulation can be run

Definition at line 1324 of file RadiationModel.cpp.

◆ updateGeometry() [2/2]

void RadiationModel::updateGeometry ( const std::vector< uint > &  UUIDs)

Adds certain geometric primitives from the Context to OptiX as specified by a list of UUIDs.

This function should be called anytime Context geometry is created or modified

Parameters
[in]UUIDsVector of universal unique identifiers of Context primitives to be updated
Note
RadiationModel::updateGeometry() must be called before simulation can be run

Definition at line 1329 of file RadiationModel.cpp.

◆ writeCameraImage()

std::string RadiationModel::writeCameraImage ( const std::string &  camera,
const std::vector< std::string > &  bands,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1,
float  flux_to_pixel_conversion = 1.f 
)

Write camera data for one or more bands to a JPEG image.

Parameters
[in]cameraLabel for camera to be queried
[in]bandsVector of labels for radiative bands to be written
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.
[in]flux_to_pixel_conversion[optional] A factor to convert radiative flux to 8-bit pixel values (0-255). By default, this value is 1.0, which means that the pixel values will be equal to the radiative flux. If the radiative flux is very large or very small, it may be necessary to scale the flux to a more appropriate range for the image.
Returns
Name of the output image file that was written

Definition at line 512 of file RadiationCamera.cpp.

◆ writeCameraImageData()

void RadiationModel::writeCameraImageData ( const std::string &  camera,
const std::string &  band,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1 
)

Write camera data for one band to an ASCII text file.

Parameters
[in]cameraLabel for camera to be queried
[in]bandLabel for radiative band to be written
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.

Definition at line 668 of file RadiationCamera.cpp.

◆ writeDepthImageData()

void RadiationModel::writeDepthImageData ( const std::string &  cameralabel,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1 
)

Write depth image data to text file.

Parameters
[in]cameralabelLabel of target camera
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output image file (e.g., camera_depth_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.

Definition at line 1144 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes() [1/3]

void RadiationModel::writeImageBoundingBoxes ( const std::string &  cameralabel,
const std::string &  primitive_data_label,
const uint object_class_ID,
const std::string &  image_file,
const std::string &  classes_txt_file = "classes.txt",
const std::string &  image_path = "./" 
)

Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName for base of output files (will also include the camera label and a frame number in the file name)
[in]classes_txt_file[optional] Name of text file to write class names. By default, it is "classes.txt".
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1485 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes() [2/3]

void RadiationModel::writeImageBoundingBoxes ( const std::string &  cameralabel,
const std::string &  primitive_data_label,
uint  object_class_ID,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
bool  append_label_file = false,
int  frame = -1 
)

Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]imagefile_baseName for base of output files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]append_label_file[optional] If true, the label file will be appended to the existing file. If false, the label file will be overwritten. By default, it is false.
[in]frame[optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.

Definition at line 1269 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes() [3/3]

void RadiationModel::writeImageBoundingBoxes ( const std::string &  cameralabel,
const std::vector< std::string > &  primitive_data_label,
const std::vector< uint > &  object_class_ID,
const std::string &  image_file,
const std::string &  classes_txt_file = "classes.txt",
const std::string &  image_path = "./" 
)

Write bounding boxes based on primitive data labels (Ultralytic's YOLO format). Primitive data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Primitive data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName for base of output files (will also include the camera label and a frame number in the file name)
[in]classes_txt_file[optional] Name of text file to write class names. By default, it is "classes.txt".
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 1489 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes_ObjectData() [1/3]

void RadiationModel::writeImageBoundingBoxes_ObjectData ( const std::string &  cameralabel,
const std::string &  object_data_label,
const uint object_class_ID,
const std::string &  image_file,
const std::string &  classes_txt_file = "classes.txt",
const std::string &  image_path = "./" 
)

Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName for base of output files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]classes_txt_file[optional] Name of text file to write class names. By default, it is "classes.txt".
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1605 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes_ObjectData() [2/3]

void RadiationModel::writeImageBoundingBoxes_ObjectData ( const std::string &  cameralabel,
const std::string &  object_data_label,
uint  object_class_ID,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
bool  append_label_file = false,
int  frame = -1 
)

Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]imagefile_baseName for base of output files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]append_label_file[optional] If true, the label file will be appended to the existing file. If false, the label file will be overwritten. By default, it is false.
[in]frame[optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.

Definition at line 1373 of file RadiationCamera.cpp.

◆ writeImageBoundingBoxes_ObjectData() [3/3]

void RadiationModel::writeImageBoundingBoxes_ObjectData ( const std::string &  cameralabel,
const std::vector< std::string > &  object_data_label,
const std::vector< uint > &  object_class_ID,
const std::string &  image_file,
const std::string &  classes_txt_file = "classes.txt",
const std::string &  image_path = "./" 
)

Write bounding boxes based on object data labels (Ultralytic's YOLO format). Object data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]image_fileName for base of output files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]classes_txt_file[optional] Name of text file to write class names. By default, it is "classes.txt".
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 1610 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks() [1/2]

void RadiationModel::writeImageSegmentationMasks ( const std::string &  cameralabel,
const std::string &  primitive_data_label,
const uint object_class_ID,
const std::string &  json_filename,
const std::string &  image_file,
const std::vector< std::string > &  data_attribute_labels = {},
bool  append_file = false 
)

Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName of the image file corresponding to these labels
[in]data_attribute_labels[optional] Vector of primitive or object data labels to calculate mean values within each mask and write as attributes. If empty or data doesn't exist, no attributes are added. By default, it is an empty vector.
[in]append_file[optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 2144 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks() [2/2]

void RadiationModel::writeImageSegmentationMasks ( const std::string &  cameralabel,
const std::vector< std::string > &  primitive_data_label,
const std::vector< uint > &  object_class_ID,
const std::string &  json_filename,
const std::string &  image_file,
const std::vector< std::string > &  data_attribute_labels = {},
bool  append_file = false 
)

Write segmentation masks for primitive data in COCO JSON format. Primitive data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName of the image file corresponding to these labels
[in]data_attribute_labels[optional] Vector of primitive or object data labels to calculate mean values within each mask and write as attributes. If empty or data doesn't exist, no attributes are added. By default, it is an empty vector.
[in]append_file[optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false.
Note
The lengths of primitive_data_label and object_class_ID vectors must be the same.

Definition at line 2149 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks_ObjectData() [1/2]

void RadiationModel::writeImageSegmentationMasks_ObjectData ( const std::string &  cameralabel,
const std::string &  object_data_label,
const uint object_class_ID,
const std::string &  json_filename,
const std::string &  image_file,
const std::vector< std::string > &  data_attribute_labels = {},
bool  append_file = false 
)

Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName of the image file corresponding to these labels
[in]data_attribute_labels[optional] Vector of primitive or object data labels to calculate mean values within each mask and write as attributes. If empty or data doesn't exist, no attributes are added. By default, it is an empty vector.
[in]append_file[optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false.
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 2405 of file RadiationCamera.cpp.

◆ writeImageSegmentationMasks_ObjectData() [2/2]

void RadiationModel::writeImageSegmentationMasks_ObjectData ( const std::string &  cameralabel,
const std::vector< std::string > &  object_data_label,
const std::vector< uint > &  object_class_ID,
const std::string &  json_filename,
const std::string &  image_file,
const std::vector< std::string > &  data_attribute_labels = {},
bool  append_file = false 
)

Write segmentation masks for object data in COCO JSON format. Object data must have type of 'uint' or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label. Object data must have type of 'uint' or 'int'.
[in]object_class_IDObject class ID to write for the labels in this group.
[in]json_filenameName of the output JSON file. Can include a relative path. If no extension is provided, ".json" will be added.
[in]image_fileName of the image file corresponding to these labels
[in]data_attribute_labels[optional] Vector of primitive or object data labels to calculate mean values within each mask and write as attributes. If empty or data doesn't exist, no attributes are added. By default, it is an empty vector.
[in]append_file[optional] If true, the data will be appended to the existing COCO JSON file. If false, a new file will be created. By default, it is false.
Note
The lengths of object_data_label and object_class_ID vectors must be the same.

Definition at line 2410 of file RadiationCamera.cpp.

◆ writeNormCameraImage()

std::string RadiationModel::writeNormCameraImage ( const std::string &  camera,
const std::vector< std::string > &  bands,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1 
)

Write normalized camera data (maximum value is 1) for one or more bands to a JPEG image.

Parameters
[in]cameraLabel for camera to be queried
[in]bandsVector of labels for radiative bands to be written
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_pathPath to directory where images should be saved
[in]frame[optional] A frame count number to be appended to the output image file (e.g., camera_thermal_00001.jpeg). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.
Returns
Name of the output image file that was written

Definition at line 634 of file RadiationCamera.cpp.

◆ writeNormDepthImage()

void RadiationModel::writeNormDepthImage ( const std::string &  cameralabel,
const std::string &  imagefile_base,
float  max_depth,
const std::string &  image_path = "./",
int  frame = -1 
)

Write depth image file, with grayscale normalized to the minimum and maximum depth values.

Parameters
[in]cameralabelLabel of target camera
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]max_depthMaximum depth value for normalization (e.g., the depth of the sky)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output image file (e.g., camera_depth_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.

Definition at line 1199 of file RadiationCamera.cpp.

◆ writeObjectDataLabelMap()

void RadiationModel::writeObjectDataLabelMap ( const std::string &  cameralabel,
const std::string &  object_data_label,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1,
float  padvalue = NAN 
)

Write image pixel labels to text file based on object data. Object data must have type 'float', 'double', 'uint', or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]object_data_labelName of the object data label
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.
[in]padvaluePad value for the empty pixels

Definition at line 1051 of file RadiationCamera.cpp.

◆ writePrimitiveDataLabelMap()

void RadiationModel::writePrimitiveDataLabelMap ( const std::string &  cameralabel,
const std::string &  primitive_data_label,
const std::string &  imagefile_base,
const std::string &  image_path = "./",
int  frame = -1,
float  padvalue = NAN 
)

Write image pixel labels to text file based on primitive data. Primitive data must have type 'float', 'double', 'uint', or 'int'.

Parameters
[in]cameralabelLabel of target camera
[in]primitive_data_labelName of the primitive data label
[in]imagefile_baseName for base of output image JPEG files (will also include the camera label and a frame number in the file name)
[in]image_path[optional] Path to directory where images should be saved. By default, it will be placed in the current working directory.
[in]frame[optional] A frame count number to be appended to the output file (e.g., camera_thermal_00001.txt). By default, the frame count will be omitted from the file name. This value must be less than or equal to 99,999.
[in]padvaluePad value for the empty pixels

Definition at line 963 of file RadiationCamera.cpp.


The documentation for this class was generated from the following files: