SimpleGVXR 1.0.1
Welcome to SimpleGVXR, a simplified layer built on top of gVirtualXRay -- the open-source cross-platform library for the simulation of X-ray images from polygon meshes on the GPU. SimpleGVXR: i) is a C++ library, ii) provides a simplified, easy-to-use, and procedural interface to gVirtualXRay without templates, and iii) provides binders for other programming languages (Python 2 and 3, Ruby, R, TCL, Java, GNU Octave, Perl, and C#, and soon Matlab).
Functions
SimpleGVXR.h File Reference

SimpleGVXR is an API to the bulk functionalities and classes of gVirtualXRay. SimpleGVXR is used as the basis for the language bindings generated using SWIG. More...

#include <vector>
#include <string>

Go to the source code of this file.

Functions

int getMajorVersionOfCoreGVXR ()
 Accessor on the major version of the core gVirtualXRay library (gvxr). This number is changed when incompatible API changes have been made. More...
 
int getMinorVersionOfCoreGVXR ()
 Accessor on the minor version of the core gVirtualXRay library (gvxr). This number is changed when new functionalities have been added in a backwards-compatible manner. More...
 
int getPatchVersionOfCoreGVXR ()
 Accessor on the minor version of the core gVirtualXRay library (gvxr). This number is changed when bug fixes have been added in a backwards-compatible manner. More...
 
std::string getVersionOfCoreGVXR ()
 Accessor on the full string version of the core gVirtualXRay library (gvxr). More...
 
int getMajorVersionOfSimpleGVXR ()
 Accessor on the major version of SimpleGVXR. This number is changed when incompatible API changes have been made. More...
 
int getMinorVersionOfSimpleGVXR ()
 Accessor on the minor version of SimpleGVXR. This number is changed when new functionalities have been added in a backwards-compatible manner. More...
 
int getPatchVersionOfSimpleGVXR ()
 Accessor on the minor version of SimpleGVXR. This number is changed when bug fixes have been added in a backwards-compatible manner. More...
 
std::string getVersionOfSimpleGVXR ()
 Accessor on the full string version of SimpleGVXR. More...
 
std::string getOpenGlRenderer ()
 Accessor on the OpenGL renderer. More...
 
std::string getOpenGlVersion ()
 Accessor on the OpenGL version. More...
 
std::string getOpenGlVenror ()
 Accessor on the OpenGL vendor. More...
 
void useLogFile (const char *aFileName="gvxr.log")
 
void displayBeam (bool aState=true)
 
void displayDetector (bool aState=true)
 
void displayNormalVectors (bool aState=true)
 
void useWireframe (bool aState=true)
 
void useLighing (bool aState=true)
 
void useNegative (bool aState=true)
 
void orthographic (double left, double right, double bottom, double top, double zNear, double zFar)
 Replace the projection matrix by a orthographic projection matrix. It behaves as the old glOrtho function. More...
 
void perspective (double fovy, double aspect, double zNear, double zFar)
 Replace the projection matrix by a perspective projection matrix. It behaves as the old gluPerspective function. More...
 
void lookAt (double eyeX, double eyeY, double eyeZ, double lookAtX, double lookAtY, double lookAtZ, double upX, double upY, double upZ)
 Replace the modelling-viewing matrix by a viewing transformation matrix. It behaves as the old gluLookAt function. More...
 
void pushModelViewMatrix ()
 Add the current matrix to the model/view matrix stack. It behaves as the combination of the old glMatrixMode(GL_MODELVIEW);glPushMatrix() functions.
 
void popModelViewMatrix ()
 Restore the matrix from the model/view matrix stack, and remove the last matrix of the stack. glMatrixMode(GL_MODELVIEW);glPopMatrix() functions.
 
void rotateModelView (double anAngle, double x, double y, double z)
 Restore the matrix from the model/view matrix stack, and remove the last matrix of the stack. glMatrixMode(GL_MODELVIEW);glRotate() functions. More...
 
void autoCreateOpenGLContext (bool aFlag=true)
 Create an OpenGL context automatically. More...
 
void setSourcePosition (double x, double y, double z, const std::string &aUnitOfLength)
 Set the position of the X-ray source. More...
 
std::vector< double > getSourcePosition (const std::string &aUnitOfLength)
 Accessor on the position of the X-ray source. More...
 
void setDetectorPosition (double x, double y, double z, const std::string &aUnitOfLength)
 Set the position of the X-ray detector. More...
 
std::vector< double > getDetectorPosition (const std::string &aUnitOfLength)
 Accessor on the position of the X-ray detector. More...
 
void setDetectorUpVector (double x, double y, double z)
 Set the up-vector defining the orientation of the X-ray detector. More...
 
std::vector< double > getDetectorUpVector ()
 Accessor on the up-vector defining the orientation of the X-ray detector. More...
 
std::vector< double > getDetectorRightVector ()
 Accessor on the right-vector defining the orientation of the X-ray detector. More...
 
void setDetectorNumberOfPixels (int aWidth, int aHeight)
 Set the number of pixels of the X-ray detector. More...
 
std::vector< int > getDetectorNumberOfPixels ()
 Accessor on the number of pixels of the X-ray detector. More...
 
void setOversamplingFactor (int aFactor=1)
 Set the multiplicative factor to oversample the L-buffers. More...
 
int getOversamplingFactor ()
 Accessor on the multiplicative factor to oversample the L-buffers. More...
 
void setDetectorPixelSize (double aWidth, double aHeight, const std::string &aUnitOfLength)
 Set the pixel size. More...
 
std::vector< double > getDetectorSize (const std::string &aUnitOfLength)
 Accessor on the size of the X-ray detector. More...
 
void clearDetectorEnergyResponse ()
 Clear the energy response of the detector.
 
void loadDetectorEnergyResponse (const std::string &aFileName, const std::string &aUnitOfEnergy)
 Load the energy response of the detector from a TSV file. More...
 
void loadMeshFile (const std::string &aLabel, const std::string &aFileName, const std::string &aUnitOfLength, bool addToRendererAsInnerSurface=true)
 Load a polygon mesh from a file, set its label in the scenegraph (i.e. identifier) and add it to the X-ray renderer. More...
 
void loadSceneGraph (const std::string &aFileName, const std::string &aUnitOfLength)
 Load a scenegraph from a file and add its polygon meshes to the X-ray renderer. More...
 
unsigned int getNumberOfPrimitives (const std::string &aLabel)
 Accessor on the number of primitives of a given node. More...
 
void emptyMesh (const std::string &aLabel, const std::string &aParent="root")
 Create an empty polygon mesh and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer. More...
 
void makeCube (const std::string &aLabel, double aLength=1.0, const std::string &aUnitOfLength="cm", const std::string &aParent="root")
 Create a cube, centred on (0, 0, 0) and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer. More...
 
void makeCylinder (const std::string &aLabel, unsigned int aNumberOfSectors=10, double aHeight=1.0, double aRadius=0.5, const std::string &aUnitOfLength="cm", const std::string &aParent="root")
 Create a cylinder and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer. More...
 
void makeIsoSurface (const std::string &aLabel, short anIsoValue, const std::vector< short > &aVoxelDataSet, unsigned int aWidth, unsigned int aHeight, unsigned int aDepth, double aSpacingX, double aSpacingY, double aSpacingZ, const std::string &aUnitOfLength="cm", const std::string &aParent="root")
 Create an iso-surface from a 3D image and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer. More...
 
void makeTriangularMesh (const std::string &aLabel, const std::vector< float > &aVertexSet, const std::string &aUnitOfLength="cm", const std::string &aParent="root")
 
void makeTriangularMesh (const std::string &aLabel, const std::vector< float > &aVertexSet, const std::vector< int > &aTriangleIndexSet, const std::string &aUnitOfLength="cm", const std::string &aParent="root")
 
void addMesh (const std::string &aDestination, const std::string &aSource)
 Add a polygon mesh (aSource) to another one (aDestination). It corresponds to the operation as follows: aDestination += aSource. Both aSource and aDestination have to already exist in the scenegraph. More...
 
void subtractMesh (const std::string &aDestination, const std::string &aSource)
 Subtract a polygon mesh (aSource) from another one (aDestination). It corresponds to the operation as follows: aDestination -= aSource. Both aSource and aDestination have to already exist in the scenegraph. More...
 
unsigned int getNumberOfChildren (const std::string &aLabel)
 Get the number of children of a node in the scenegraph. More...
 
std::string getChildLabel (const std::string &aLabel, unsigned int i)
 Accessor on the i-th child's label in the list of children of a given node in the scenegraph. More...
 
std::vector< double > getLocalTransformationMatrix (const std::string &aLabel)
 Accessor on the local transformation matrix of a given node in the scenegraph. If the node does not exist, the identity matrix is returned. More...
 
void setLocalTransformationMatrix (const std::string &aLabel, const std::vector< double > &aMatrix)
 Set the local transformation matrix of a given node in the scenegraph. More...
 
void applyCurrentLocalTransformation (const std::string &aLabel)
 Apply the current local transformation to all the vertices of a given node in the scenegraph. Note the the local transformation is then reset to the identity matrix. More...
 
std::vector< double > getNodeAndChildrenBoundingBox (const std::string &aLabel, const std::string &aUnitOfLength="cm")
 Access the bounding box of a given node and all its children (if any). The bounding box is given in the world coordinate system. More...
 
std::vector< double > getNodeOnlyBoundingBox (const std::string &aLabel, const std::string &aUnitOfLength="cm")
 Access the bounding box of a given node (without its children). The bounding box is given in the world coordinate system. More...
 
void displayNode (const std::string &aLabel)
 Display the scenegraph node using OpenGL. More...
 
void invertNormalVectors (const std::string &aLabel)
 Invert the normal vectors of a given polygon mesh. More...
 
void setColor (const std::string &aLabel, float R, float G, float B, float A)
 Set the color of a given polygon mesh. More...
 
void setColour (const std::string &aLabel, float R, float G, float B, float A)
 Set the colour of a given polygon mesh. More...
 
std::vector< float > getAmbientColour (const std::string &aLabel)
 Accessor on the ambient colour of the material of a given polygon mesh. More...
 
std::vector< float > getDiffuseColour (const std::string &aLabel)
 Accessor on the diffuse colour of the material of a given polygon mesh. More...
 
std::vector< float > getSpecularColour (const std::string &aLabel)
 Accessor on the specular colour of the material of a given polygon mesh. More...
 
float getShininess (const std::string &aLabel)
 Accessor on the shininess of the material of a given polygon mesh. More...
 
void addPolygonMeshAsInnerSurface (const std::string &aLabel)
 Add a polygon mesh, given its label, to the X-ray renderer as an inner surface. More...
 
void addPolygonMeshAsOuterSurface (const std::string &aLabel)
 Add a polygon mesh, given its label, to the X-ray renderer as an outer surface. More...
 
void removePolygonMeshesFromSceneGraph ()
 Empty the scenegraph. Note that it also empties the X-ray renderer from all its meshes.
 
void removePolygonMeshesFromXRayRenderer ()
 Empty the X-ray renderer from all its meshes. Note that the meshes are kept in the scenegraph.
 
void moveToCenter ()
 Move the scenegraph to the centre.
 
void moveToCentre ()
 Move the scenegraph to the centre.
 
void moveToCenter (const std::string &aLabel)
 Move a polygon mesh to the centre. More...
 
void moveToCentre (const std::string &aLabel)
 Move a polygon mesh to the centre. More...
 
void scaleNode (const std::string &aLabel, double x, double y, double z)
 Scale a polygon mesh. More...
 
void rotateNode (const std::string &aLabel, double anAngle, double x, double y, double z)
 Rotate a polygon mesh. More...
 
void translateNode (const std::string &aLabel, double x, double y, double z, const std::string &aUnitOfLength)
 Translate a polygon mesh. More...
 
void shearNode (const std::string &aLabel, double yx, double zx, double xy, double zy, double xz, double yz)
 Use a shear matrix to transform the node. More...
 
void resetSceneTransformation ()
 Replace the 3-D transformation matrix of the overall 3-D scene by an identity matrix.
 
void scaleScene (double x, double y, double z)
 Scale the 3-D scene (all the polygon meshes will be affected but not modified). More...
 
void scaleScene (double x, double y, double z, const std::string &aUnitOfLength)
 Scale the 3-D scene (all the polygon meshes will be affected but not modified). More...
 
void rotateScene (double anAngle, double x, double y, double z)
 Rotate the 3-D scene (all the polygon meshes will be affected but not modified). More...
 
void translateScene (double x, double y, double z, const std::string &aUnitOfLength)
 Translate the 3-D scene (all the polygon meshes will be affected but not modified). More...
 
std::vector< std::vector< float > > getSceneTransformationMatrix ()
 Accessor on the 3-D scene transformation matrix. More...
 
std::vector< std::vector< float > > getRootTransformationMatrix ()
 Accessor on the transformation matrix of the scengraph's root node. More...
 
std::vector< std::vector< float > > getNodeLocalTransformationMatrix (const std::string &aLabel)
 Accessor on the transformation matrix of a given node. More...
 
std::vector< std::vector< float > > getNodeWorldTransformationMatrix (const std::string &aLabel)
 Accessor on the transformation matrix of a given node. More...
 
void setSceneTransformationMatrix (const std::vector< std::vector< float > > &aMatrix)
 Set the 3-D scene transformation matrix. More...
 
void setRootTransformationMatrix (const std::vector< std::vector< float > > &aMatrix)
 Set the transformation matrix of the scengraph's root node. More...
 
void setNodeTransformationMatrix (const std::string &aLabel, const std::vector< std::vector< float > > &aMatrix)
 Set the transformation matrix of a given node. More...
 
void setHU (const std::string &aLabel, short HU)
 Set the Hounsfield value corresponding to the material properties of a polygon mesh. More...
 
void setHounsfieldUnit (const std::string &aLabel, short HU)
 Set the Hounsfield value corresponding to the material properties of a polygon mesh. More...
 
void setHounsfieldValue (const std::string &aLabel, short HU)
 Set the Hounsfield value corresponding to the material properties of a polygon mesh. More...
 
void setElement (const std::string &aLabel, unsigned short Z)
 Set the chemical element (or element) corresponding to the material properties of a polygon mesh. More...
 
void setElement (const std::string &aLabel, const std::string &aName)
 Set the chemical element (or element) corresponding to the material properties of a polygon mesh. More...
 
void setMixture (const std::string &aLabel, const std::string &aMixture)
 Set the mixture corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material. More...
 
void setMixture (const std::string &aLabel, const std::vector< int > &aZNumberSet, const std::vector< double > &aWeightSet)
 Set the mixture corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material. More...
 
void setCompound (const std::string &aLabel, const std::string &aCompound)
 Set the compound corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material. More...
 
void setMassAttenuationCoefficient (const std::string &aLabel, double aCoefficient, const std::string &aUnit)
 Set the mass attenuation coefficient corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material. More...
 
void setLinearAttenuationCoefficient (const std::string &aLabel, double aCoefficient, const std::string &aUnit)
 Set the linear attenuation coefficient corresponding to the material properties of a polygon mesh. More...
 
void setMu (const std::string &aLabel, double aCoefficient, const std::string &aUnit)
 Set the linear attenuation coefficient corresponding to the material properties of a polygon mesh. More...
 
void setDensity (const std::string &aLabel, double aDensity, const std::string &aUnit)
 Set the density corresponding to the material properties of a polygon mesh. More...
 
double getDensity (const std::string &aLabel)
 Accessor on the density corresponding to the material properties of a polygon mesh. More...
 
double getMassAttenuationCoefficient (const std::string &aLabel, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the mass attenuation coefficient at a given energy corresponding to the material properties of a polygon mesh. More...
 
double getLinearAttenuationCoefficient (const std::string &aLabel, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the linear attenuation coefficient at a given energy corresponding to the material properties of a polygon mesh. More...
 
std::string getMaterialLabel (const std::string &aLabel)
 Accessor on the material label of a polygon mesh. More...
 
void createOpenGLContext (int aWindowID=-1, int aRendererMajorVersion=3, int aRendererMinorVersion=2)
 Create an OpenGL context (the window won't be shown). More...
 
void createWindow (int aWindowID=-1, int aVisibilityFlag=0, const std::string &aRenderer="OPENGL", int aRendererMajorVersion=3, int aRendererMinorVersion=2)
 Create an OpenGL context and display it in a window. More...
 
void setWindowSize (int aWidth, int aHeight, int aWindowID=-1)
 Create an OpenGL context and display it in a window. More...
 
void displayScene (bool aSceneRotationFlag=true, int aWindowID=-1)
 3-D visualisation of the 3-D scene (source, detector, and scanned objects). Note that there is no interactive loop running. More...
 
void renderLoop (int aWindowID=-1)
 3-D visualisation of the 3-D scene (source, detector, and scanned objects). Note that there is interactive loop running. Keys are: More...
 
void startArcBallRotation (double x, double y)
 Call this function when the user starts an arc-ball rotation (e.g. left-mouse button click in the 3-D visualisation window). More...
 
void stopArcBallRotation ()
 Call this function when the user stops an arc-ball rotation (e.g. release the left-mouse button click in the 3-D visualisation window).
 
bool usingArcBallRotation ()
 Check if arc-ball rotation is currently in use. More...
 
void cursorPositionCallback (double x, double y, int aViewportWidth, int aViewportHeight)
 Call this function when the user moves the mouse. More...
 
void scrollCallback (double xoffset, double yoffset)
 Call this function when the user scrolls. More...
 
void setZoom (float aZoomValue)
 
float getZoom ()
 
void setSceneRotationMatrix (const std::vector< double > &aRotationMatrix)
 
std::vector< double > getSceneRotationMatrix ()
 
void showWindow (int aWindowID=-1)
 Make an OpenGL context visible and display a window. More...
 
void hideWindow (int aWindowID=-1)
 Hide a window. More...
 
void setWindowBackGroundColour (float R, float G, float B, int aWindowID=-1)
 Set window background colour. More...
 
void setWindowBackGroundColor (float R, float G, float B, int aWindowID=-1)
 Set window background colour. More...
 
const std::vector< std::vector< std::vector< float > > > & takeScreenshot (int aWindowID=-1)
 Take screenshot. More...
 
const std::vector< std::vector< std::vector< float > > > & getLatestScreenshot ()
 Get the latest screenshot. More...
 
void destroyWindow (int aWindowID=-1)
 Close and destroy a given window or OpenGL context.
 
void destroyAllWindows (void)
 Close and destroy all the windows and OpenGL contexts that have been created.
 
void usePointSource ()
 Use a point source.
 
void useParallelBeam ()
 Use a parallel source (e.g. to mimic a source that is extremely far from the scanned object and detector).
 
void useParallelSource ()
 Use a parallel source (e.g. to mimic a source that is extremely far from the scanned object and detector).
 
void resetBeamSpectrum ()
 Set the size of the focal spot of the X-ray generator. More...
 
void setMonoChromatic (double anEnergy, const std::string &aUnitOfEnergy, double aNumberOfPhotons)
 Use a monochromatic beam spectrum (i.e. one single energy). More...
 
void addEnergyBinToSpectrum (double anEnergy, const std::string &aUnitOfEnergy, double aNumberOfPhotons)
 Add an energy bin to the beam spectrum (useful to generate polychromatism). More...
 
void loadSpectrumFromTSV (const std::string &aFileName, const std::string &aUnitOfEnergy, bool aNormalisationFlag)
 Load the incident beam energy spectrum from a TSV file. More...
 
std::vector< double > getEnergyBins (const std::string &aUnitOfEnergy)
 Accessor on the energy bins of the beam spectrum. More...
 
std::vector< double > getPhotonCountEnergyBins ()
 Accessor on the number of photons per energy bin of the beam spectrum. More...
 
double getTotalEnergyWithDetectorResponse ()
 Accessor on a total energy of the beam when the detector response is applied. More...
 
void saveSTLfile (const std::string &aLabel, const std::string &aFileName=std::string())
 Save the polygon mesh of a given node. More...
 
void saveLastXRayImage (const std::string &aFileName=std::string(), bool useCompression=true)
 Save the last X-ray image that has been computed. More...
 
void saveLastLBuffer (const std::string &aFileName=std::string(), bool useCompression=true)
 Save the last L-buffer that has been computed. More...
 
void saveLastCumulatedLBuffer (const std::string &aFileName=std::string(), bool useCompression=true)
 Save the last cumulated L-buffer that has been computed. More...
 
void saveLastSinogram (const std::string &aFileName=std::string(), bool useCompression=true)
 Save the last sinogram that has been computed. More...
 
void saveLastProjectionSet (const std::string &aFileName=std::string(), bool useCompression=true)
 Save the last projection set that has been computed. More...
 
void enableArtefactFilteringOnGPU (void)
 Enable artefact filtering on GPU (it is fast but can be inaccurate).
 
void enableArtifactFilteringOnGPU (void)
 Enable artefact filtering on GPU (it is fast but can be inaccurate).
 
void enableArtefactFilteringOnCPU (void)
 Enable artefact filtering on CPU (can be extremely slow as it makes use of ray-tracing).
 
void enableArtifactFilteringOnCPU (void)
 Enable artefact filtering on CPU (can be extremely slow as it makes use of ray-tracing).
 
void disableArtefactFiltering (void)
 Disable artefact filtering altogether.
 
void disableArtifactFiltering (void)
 Disable artefact filtering altogether.
 
double getUnitOfEnergy (const std::string &aUnitOfEnergy)
 Accessor on the numerical value corresponding to a unit of energy. More...
 
double getUnitOfLength (const std::string &aUnitOfLength)
 Accessor on the numerical value corresponding to a unit of length. More...
 
std::vector< std::vector< float > > computeXRayImage (bool anIntegrateEnergyFlag=true)
 Compute the X-ray projection corresponding to the environment that has previously been set, i.e. More...
 
std::vector< std::vector< float > > computeLBuffer (const std::string &aLabel)
 Compute the L-buffer of a polygon mesh corresponding to the environment that has previously been set, i.e. More...
 
std::vector< std::vector< std::vector< float > > > computeSinogram (double x, double y, double z, const std::string &aUnitOfLength, unsigned int aNumberOfAngle, double anAngleOffset)
 Compute the sinogram corresponding to the environment that has previously been set, i.e. More...
 
std::vector< std::vector< std::vector< float > > > computeProjectionSet (double x, double y, double z, const std::string &aUnitOfLength, unsigned int aNumberOfAngle, double anAngleOffset)
 Compute the projection set corresponding to the environment that has previously been set, i.e. More...
 
std::vector< std::vector< float > > getLastXRayImage ()
 Accessor on the last X-ray image that has been computed. More...
 
std::vector< std::vector< float > > getLastLBuffer ()
 Accessor on the last L-buffer that has been computed. More...
 
std::vector< std::vector< std::vector< float > > > getLastSinogram ()
 Accessor on the last sinogram that has been computed. More...
 
std::vector< std::vector< std::vector< float > > > getLastProjectionSet ()
 Accessor on the last projection set that has been computed. More...
 
int getImageWidth (const std::vector< std::vector< float > > &anImage)
 Accessor on the width of a given image. More...
 
int getImageHeght (const std::vector< std::vector< float > > &anImage)
 Accessor on the height of a given image. More...
 
std::vector< float > getImageRow (const std::vector< std::vector< float > > &anImage, int j)
 Accessor on the j-th row of pixels of a given image. More...
 
std::string getElementName (unsigned short Z)
 Accessor on the chemical element's name depending on its Z number. More...
 
std::string getElementSymbol (unsigned short Z)
 Accessor on the chemical element' symbol depending on its Z number. More...
 
unsigned short getElementAtomicNumber (const std::string &anElement)
 Accessor on the chemical element's Z number. More...
 
double getDensityFromElement (const std::string &anElement)
 Accessor on the chemical element's density. More...
 
double getDensityFromElement (unsigned short Z)
 Accessor on the chemical element's density. More...
 
double getDensityFromHU (double HU)
 Accessor on the HU's density. More...
 
double getMassAttenuationFromElement (const std::string &anElement, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the chemical element's mass attenuation. More...
 
double getMassAttenuationFromElement (unsigned short Z, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the chemical element's mass attenuation. More...
 
double getMassAttenuationFromHU (double HU, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the HU's mass attenuation. More...
 
double getMassAttenuationFromMixture (const std::string &aMixture, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the mixture's mass attenuation. More...
 
double getMassAttenuationFromCompound (const std::string &aCompound, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the compound's mass attenuation. More...
 
double getMuFromHU (double HU, double anEnergy, const std::string &aUnitOfEnergy)
 Accessor on the HU's linear attenuation coefficient. More...
 
std::vector< std::vector< std::vector< float > > > convertHU2mu (const std::vector< std::vector< std::vector< float > > > &anImage, double anEnergy, const std::string &aUnitOfEnergy)
 
std::vector< float > rayIntersect (const std::string &aLabel, double aRayOriginX, double aRayOriginY, double aRayOriginZ, double aRayDirectionX, double aRayDirectionY, double aRayDirectionZ)
 
std::vector< std::vector< float > > loadImage2D (const std::string &aFileName)
 
std::vector< std::vector< std::vector< float > > > loadImage3D (const std::string &aFileName)
 
double computeZNCC (const std::vector< std::vector< std::vector< float > > > &aReferenceImage, const std::vector< std::vector< std::vector< float > > > &aTestImage)
 
double computeRMSE (const std::vector< std::vector< std::vector< float > > > &aReferenceImage, const std::vector< std::vector< std::vector< float > > > &aTestImage)
 
double getMean (const std::vector< float > &anImage)
 
double getStddev (const std::vector< float > &anImage)
 
double computeZNCC (const std::vector< float > &aReferenceImage, const std::vector< float > &aTestImage)
 
double computeRMSE (const std::vector< float > &aReferenceImage, const std::vector< float > &aTestImage, bool normalise=false)
 
double computeRMSE (bool normalise=false)
 
double computeZNCC ()
 
void loadReference (const std::vector< float > &aReferenceImage)
 
void loadTest (const std::vector< float > &aTestImage)
 
void lineariseTest (float aThreshold, float aScalingFactor)
 
float getMinValue (const std::vector< std::vector< std::vector< float > > > &aImage)
 
float getMaxValue (const std::vector< std::vector< std::vector< float > > > &aImage)
 

Detailed Description

SimpleGVXR is an API to the bulk functionalities and classes of gVirtualXRay. SimpleGVXR is used as the basis for the language bindings generated using SWIG.

Version
1.0
Date
03/10/2018
Author
Dr Franck P. Vidal

License BSD 3-Clause License.

For details on use and redistribution please refer to http://opensource.org/licenses/BSD-3-Clause

Copyright (c) by Dr Franck P. Vidal (franc.nosp@m.k.p..nosp@m.vidal.nosp@m.@fpv.nosp@m.idal..nosp@m.net), http://www.fpvidal.net/, Oct 2018, 2018, version 1.1, BSD 3-Clause License

Function Documentation

◆ addEnergyBinToSpectrum()

void addEnergyBinToSpectrum ( double  anEnergy,
const std::string &  aUnitOfEnergy,
double  aNumberOfPhotons 
)

Add an energy bin to the beam spectrum (useful to generate polychromatism).

Parameters
anEnergythe incident photon energy
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
aNumberOfPhotonsthe number of incident photons

◆ addMesh()

void addMesh ( const std::string &  aDestination,
const std::string &  aSource 
)

Add a polygon mesh (aSource) to another one (aDestination). It corresponds to the operation as follows: aDestination += aSource. Both aSource and aDestination have to already exist in the scenegraph.

Parameters
aDestinationthe polygon mesh that is going to be modified
aSourcethe polygon mesh that is going to be added to aDestination

◆ addPolygonMeshAsInnerSurface()

void addPolygonMeshAsInnerSurface ( const std::string &  aLabel)

Add a polygon mesh, given its label, to the X-ray renderer as an inner surface.

Parameters
aLabelthe label of the polygon mesh in the scenegraph

◆ addPolygonMeshAsOuterSurface()

void addPolygonMeshAsOuterSurface ( const std::string &  aLabel)

Add a polygon mesh, given its label, to the X-ray renderer as an outer surface.

Parameters
aLabelthe label of the polygon mesh in the scenegraph

◆ applyCurrentLocalTransformation()

void applyCurrentLocalTransformation ( const std::string &  aLabel)

Apply the current local transformation to all the vertices of a given node in the scenegraph. Note the the local transformation is then reset to the identity matrix.

Parameters
aLabelthe label in the scenegraph

◆ autoCreateOpenGLContext()

void autoCreateOpenGLContext ( bool  aFlag = true)

Create an OpenGL context automatically.

Parameters
aFlagtrue to create the OpenGL context automatically, false otherwise (default value: true)

◆ computeLBuffer()

std::vector< std::vector< float > > computeLBuffer ( const std::string &  aLabel)

Compute the L-buffer of a polygon mesh corresponding to the environment that has previously been set, i.e.

  • Detector position
  • Detector orientation
  • Detector size and resolution
  • Source position
  • Source shape
  • Scanned object geometry
    Parameters
    aLabelthe label of the polygon mesh
    Returns
    the corresponding L-buffer

◆ computeProjectionSet()

std::vector< std::vector< std::vector< float > > > computeProjectionSet ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength,
unsigned int  aNumberOfAngle,
double  anAngleOffset 
)

Compute the projection set corresponding to the environment that has previously been set, i.e.

  • Detector position
  • Detector orientation
  • Detector size and resolution
  • Source position
  • Source shape
  • Beam spectrum
  • Scanned object geometries
  • Scanned object material properties Note that the rotation vector is the same as the up-vector of the detector.
    Parameters
    xthe position of the rotation centre along the X-axis
    ythe position of the rotation centre along the Y-axis
    zthe position of the rotation centre along the Z-axis
    aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
    aNumberOfAnglethe total number of projections in the projection set
    anAngleOffsetthe angle in degrees between two successive projections
    Returns
    the corresponding projection set

◆ computeSinogram()

std::vector< std::vector< std::vector< float > > > computeSinogram ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength,
unsigned int  aNumberOfAngle,
double  anAngleOffset 
)

Compute the sinogram corresponding to the environment that has previously been set, i.e.

  • Detector position
  • Detector orientation
  • Detector size and resolution
  • Source position
  • Source shape
  • Beam spectrum
  • Scanned object geometries
  • Scanned object material properties Note that the rotation vector is the same as the up-vector of the detector.
    Parameters
    xthe position of the rotation centre along the X-axis
    ythe position of the rotation centre along the Y-axis
    zthe position of the rotation centre along the Z-axis
    aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
    aNumberOfAnglethe total number of projections in the sinogram
    anAngleOffsetthe angle in degrees between two successive projections
    Returns
    the corresponding sinogram

◆ computeXRayImage()

std::vector< std::vector< float > > computeXRayImage ( bool  anIntegrateEnergyFlag = true)

Compute the X-ray projection corresponding to the environment that has previously been set, i.e.

  • Detector position
  • Detector orientation
  • Detector size and resolution
  • Source position
  • Source shape
  • Beam spectrum
  • Scanned object geometries
  • Scanned object material properties
    Parameters
    anIntegrateEnergyFlagif true the energy fluence is returned, otherwise the number of photons is returned (default value: true)
    Returns
    the corresponding X-ray image

◆ createOpenGLContext()

void createOpenGLContext ( int  aWindowID = -1,
int  aRendererMajorVersion = 3,
int  aRendererMinorVersion = 2 
)

Create an OpenGL context (the window won't be shown).

Parameters
aWindowIDthe numerical ID of the context to create (default value: -1, means that the ID will be automatically generated)
aRendererMajorVersionSelect the major version of the renderer. (default value: 3)
aRendererMajorVersionSelect the minor version of the renderer. (default value: 2)

◆ createWindow()

void createWindow ( int  aWindowID = -1,
int  aVisibilityFlag = 0,
const std::string &  aRenderer = "OPENGL",
int  aRendererMajorVersion = 3,
int  aRendererMinorVersion = 2 
)

Create an OpenGL context and display it in a window.

Parameters
aWindowIDthe numerical ID of the context to create (default value: -1, means that the ID will be automatically generated)
aRendererSelect the renderer to use, e.g. OpenGL or Vulkan. (default value: OPENGL)
aRendererMajorVersionSelect the major version of the renderer. (default value: 3)
aRendererMajorVersionSelect the minor version of the renderer. (default value: 2)
aVisibilityFlagflag controling if the window should be visible (1) or hidden (0). (default value: 0)

◆ cursorPositionCallback()

void cursorPositionCallback ( double  x,
double  y,
int  aViewportWidth,
int  aViewportHeight 
)

Call this function when the user moves the mouse.

Parameters
xthe cursor x-axis position in the viewport coordinate system
ythe cursor y-axis position in the viewport coordinate system
aViewportWidththe size of the viewport along the x-axis
aViewportHeightthe size of the viewport along the y-axis

◆ displayNode()

void displayNode ( const std::string &  aLabel)

Display the scenegraph node using OpenGL.

Parameters
aLabelthe label of the polygon mesh

◆ displayScene()

void displayScene ( bool  aSceneRotationFlag = true,
int  aWindowID = -1 
)

3-D visualisation of the 3-D scene (source, detector, and scanned objects). Note that there is no interactive loop running.

Parameters
aSceneRotationFlagtrue if the 3-D scene has to be rotated with the arc-ball method, false otherwise (default value: true)
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ emptyMesh()

void emptyMesh ( const std::string &  aLabel,
const std::string &  aParent = "root" 
)

Create an empty polygon mesh and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer.

Parameters
aLabelthe label in the scenegraph
aParentthe parent of the node in the scenegraph (default: "root")

◆ getAmbientColour()

std::vector< float > getAmbientColour ( const std::string &  aLabel)

Accessor on the ambient colour of the material of a given polygon mesh.

Returns
the ambient colour

◆ getChildLabel()

std::string getChildLabel ( const std::string &  aLabel,
unsigned int  i 
)

Accessor on the i-th child's label in the list of children of a given node in the scenegraph.

Parameters
aLabelthe label in the scenegraph
ithe ID of the child
Returns
the label corresponding to the i-th child

◆ getDensity()

double getDensity ( const std::string &  aLabel)

Accessor on the density corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
Returns
the density of the polygon mesh's material in g/cm3

◆ getDensityFromElement() [1/2]

double getDensityFromElement ( const std::string &  anElement)

Accessor on the chemical element's density.

Parameters
anElementthe name or symbol of the element
Returns
the density of the corresponding element (in g / cm3)

◆ getDensityFromElement() [2/2]

double getDensityFromElement ( unsigned short  Z)

Accessor on the chemical element's density.

Parameters
Zthe Z number of the element
Returns
the density of the corresponding element (in g / cm3)

◆ getDensityFromHU()

double getDensityFromHU ( double  HU)

Accessor on the HU's density.

Parameters
HUthe HU
Returns
the density of the corresponding HU (in g / cm3)

◆ getDetectorNumberOfPixels()

std::vector< int > getDetectorNumberOfPixels ( )

Accessor on the number of pixels of the X-ray detector.

Returns
the size of the detector in number of pixels

◆ getDetectorPosition()

std::vector< double > getDetectorPosition ( const std::string &  aUnitOfLength)

Accessor on the position of the X-ray detector.

Parameters
aUnitOfLengththe unit of length corresponding to the returned value. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
Returns
the source position in a given unit of length

◆ getDetectorRightVector()

std::vector< double > getDetectorRightVector ( )

Accessor on the right-vector defining the orientation of the X-ray detector.

Returns
the right-vector

◆ getDetectorSize()

std::vector< double > getDetectorSize ( const std::string &  aUnitOfLength)

Accessor on the size of the X-ray detector.

Parameters
aUnitOfLengththe unit of length corresponding to the returned value. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
Returns
the size in a given unit of length

◆ getDetectorUpVector()

std::vector< double > getDetectorUpVector ( )

Accessor on the up-vector defining the orientation of the X-ray detector.

Returns
the up-vector

◆ getDiffuseColour()

std::vector< float > getDiffuseColour ( const std::string &  aLabel)

Accessor on the diffuse colour of the material of a given polygon mesh.

Returns
the diffuse colour

◆ getElementAtomicNumber()

unsigned short getElementAtomicNumber ( const std::string &  anElement)

Accessor on the chemical element's Z number.

Parameters
anElementthe name or symbol of the element
Returns
the Z number of the corresponding element

◆ getElementName()

std::string getElementName ( unsigned short  Z)

Accessor on the chemical element's name depending on its Z number.

Parameters
Zthe atomic number of the element
Returns
the name of the corresponding element

◆ getElementSymbol()

std::string getElementSymbol ( unsigned short  Z)

Accessor on the chemical element' symbol depending on its Z number.

Parameters
Zthe atomic number of the element
Returns
the name of the corresponding element

◆ getEnergyBins()

std::vector< double > getEnergyBins ( const std::string &  aUnitOfEnergy)

Accessor on the energy bins of the beam spectrum.

Parameters
aUnitOfEnergythe unit of energy corresponding to the returned vector. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the list of energy bins in aUnitOfEnergy

◆ getImageHeght()

int getImageHeght ( const std::vector< std::vector< float > > &  anImage)

Accessor on the height of a given image.

Parameters
anImagethe image
Returns
the height of the image (in number of pixels)

◆ getImageRow()

std::vector< float > getImageRow ( const std::vector< std::vector< float > > &  anImage,
int  j 
)

Accessor on the j-th row of pixels of a given image.

Parameters
anImagethe image
jthe row number
Returns
the j-th row of pixels

◆ getImageWidth()

int getImageWidth ( const std::vector< std::vector< float > > &  anImage)

Accessor on the width of a given image.

Parameters
anImagethe image
Returns
the width of the image (in number of pixels)

◆ getLastLBuffer()

std::vector< std::vector< float > > getLastLBuffer ( )

Accessor on the last L-buffer that has been computed.

Returns
the last L-buffer

◆ getLastProjectionSet()

std::vector< std::vector< std::vector< float > > > getLastProjectionSet ( )

Accessor on the last projection set that has been computed.

Returns
the last projection set

◆ getLastSinogram()

std::vector< std::vector< std::vector< float > > > getLastSinogram ( )

Accessor on the last sinogram that has been computed.

Returns
the last sinogram

◆ getLastXRayImage()

std::vector< std::vector< float > > getLastXRayImage ( )

Accessor on the last X-ray image that has been computed.

Returns
the last X-ray image

◆ getLatestScreenshot()

const std::vector< std::vector< std::vector< float > > > & getLatestScreenshot ( )

Get the latest screenshot.

Returns
: the 2D image in RGB

◆ getLinearAttenuationCoefficient()

double getLinearAttenuationCoefficient ( const std::string &  aLabel,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the linear attenuation coefficient at a given energy corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the linear attenuation coefficient of the polygon mesh's material in cm-1

◆ getLocalTransformationMatrix()

std::vector< double > getLocalTransformationMatrix ( const std::string &  aLabel)

Accessor on the local transformation matrix of a given node in the scenegraph. If the node does not exist, the identity matrix is returned.

Parameters
aLabelthe label in the scenegraph
Returns
the corresponding local transformation matrix

◆ getMajorVersionOfCoreGVXR()

int getMajorVersionOfCoreGVXR ( )

Accessor on the major version of the core gVirtualXRay library (gvxr). This number is changed when incompatible API changes have been made.

Returns
the major version number

◆ getMajorVersionOfSimpleGVXR()

int getMajorVersionOfSimpleGVXR ( )

Accessor on the major version of SimpleGVXR. This number is changed when incompatible API changes have been made.

Returns
the major version number

◆ getMassAttenuationCoefficient()

double getMassAttenuationCoefficient ( const std::string &  aLabel,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the mass attenuation coefficient at a given energy corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the mass attenuation coefficient of the polygon mesh's material in cm2/g

◆ getMassAttenuationFromCompound()

double getMassAttenuationFromCompound ( const std::string &  aCompound,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the compound's mass attenuation.

Parameters
aCompoundthe details about the compound. It is given as a sequence of element symbol & number of atoms, e.g. H2O for water and SiC for silicon carbide.
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the mass attenuation of the corresponding compound (in cm2/g)

◆ getMassAttenuationFromElement() [1/2]

double getMassAttenuationFromElement ( const std::string &  anElement,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the chemical element's mass attenuation.

Parameters
anElementthe name or symbol of the element
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the mass attenuation of the corresponding element (in cm2/g)

◆ getMassAttenuationFromElement() [2/2]

double getMassAttenuationFromElement ( unsigned short  Z,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the chemical element's mass attenuation.

Parameters
Zthe Z number of the element
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the mass attenuation of the corresponding element (in cm2/g)

◆ getMassAttenuationFromHU()

double getMassAttenuationFromHU ( double  HU,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the HU's mass attenuation.

Parameters
HUthe HU
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the density of the corresponding HU (in cm2/g)

◆ getMassAttenuationFromMixture()

double getMassAttenuationFromMixture ( const std::string &  aMixture,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the mixture's mass attenuation.

Parameters
aMixturethe details about the mixture. It is given as a sequence of element symbol & relative weight, e.g. Ti90Al6V4.
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the mass attenuation of the corresponding mixture (in cm2/g)

◆ getMaterialLabel()

std::string getMaterialLabel ( const std::string &  aLabel)

Accessor on the material label of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
Returns
the label of the material

◆ getMinorVersionOfCoreGVXR()

int getMinorVersionOfCoreGVXR ( )

Accessor on the minor version of the core gVirtualXRay library (gvxr). This number is changed when new functionalities have been added in a backwards-compatible manner.

Returns
the minor version number

◆ getMinorVersionOfSimpleGVXR()

int getMinorVersionOfSimpleGVXR ( )

Accessor on the minor version of SimpleGVXR. This number is changed when new functionalities have been added in a backwards-compatible manner.

Returns
the minor version number

◆ getMuFromHU()

double getMuFromHU ( double  HU,
double  anEnergy,
const std::string &  aUnitOfEnergy 
)

Accessor on the HU's linear attenuation coefficient.

Parameters
HUthe HU
anEnergythe photon energy of interest
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the linear attenuation coefficient (in cm-1)

◆ getNodeAndChildrenBoundingBox()

std::vector< double > getNodeAndChildrenBoundingBox ( const std::string &  aLabel,
const std::string &  aUnitOfLength = "cm" 
)

Access the bounding box of a given node and all its children (if any). The bounding box is given in the world coordinate system.

Parameters
aLabelthe label in the scenegraph
aUnitOfLengththe unit of length corresponding to the bounding box. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" (default value: "cm")
Returns
the bounding box as: min_x, min_y, min_z, max_x, max_y, max_z

◆ getNodeLocalTransformationMatrix()

std::vector< std::vector< float > > getNodeLocalTransformationMatrix ( const std::string &  aLabel)

Accessor on the transformation matrix of a given node.

Parameters
aLabelthe label of the polygon mesh
Returns
the scengraph's root node transformation matrix as a 4x4 array

◆ getNodeOnlyBoundingBox()

std::vector< double > getNodeOnlyBoundingBox ( const std::string &  aLabel,
const std::string &  aUnitOfLength = "cm" 
)

Access the bounding box of a given node (without its children). The bounding box is given in the world coordinate system.

Parameters
aLabelthe label in the scenegraph
aUnitOfLengththe unit of length corresponding to the bounding box. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" (default value: "cm")
Returns
the bounding box as: min_x, min_y, min_z, max_x, max_y, max_z

◆ getNodeWorldTransformationMatrix()

std::vector< std::vector< float > > getNodeWorldTransformationMatrix ( const std::string &  aLabel)

Accessor on the transformation matrix of a given node.

Parameters
aLabelthe label of the polygon mesh
Returns
the scengraph's root node transformation matrix as a 4x4 array

◆ getNumberOfChildren()

unsigned int getNumberOfChildren ( const std::string &  aLabel)

Get the number of children of a node in the scenegraph.

Parameters
aLabelthe label in the scenegraph
Returns
the number of chidren

◆ getNumberOfPrimitives()

unsigned int getNumberOfPrimitives ( const std::string &  aLabel)

Accessor on the number of primitives of a given node.

Parameters
aLabelthe label in the scenegraph
Returns
the number of primitives

◆ getOpenGlRenderer()

std::string getOpenGlRenderer ( )

Accessor on the OpenGL renderer.

Returns
a string displaying the OpenGL renderer

◆ getOpenGlVenror()

std::string getOpenGlVenror ( )

Accessor on the OpenGL vendor.

Returns
a string displaying the OpenGL vendor

◆ getOpenGlVersion()

std::string getOpenGlVersion ( )

Accessor on the OpenGL version.

Returns
a string displaying the OpenGL version

◆ getOversamplingFactor()

int getOversamplingFactor ( )

Accessor on the multiplicative factor to oversample the L-buffers.

Returns
the multiplicative factor

◆ getPatchVersionOfCoreGVXR()

int getPatchVersionOfCoreGVXR ( )

Accessor on the minor version of the core gVirtualXRay library (gvxr). This number is changed when bug fixes have been added in a backwards-compatible manner.

Returns
the patch version number

◆ getPatchVersionOfSimpleGVXR()

int getPatchVersionOfSimpleGVXR ( )

Accessor on the minor version of SimpleGVXR. This number is changed when bug fixes have been added in a backwards-compatible manner.

Returns
the patch version number

◆ getPhotonCountEnergyBins()

std::vector< double > getPhotonCountEnergyBins ( )

Accessor on the number of photons per energy bin of the beam spectrum.

Returns
the list of number of photons

◆ getRootTransformationMatrix()

std::vector< std::vector< float > > getRootTransformationMatrix ( )

Accessor on the transformation matrix of the scengraph's root node.

Returns
the scengraph's root node transformation matrix as a 4x4 array

◆ getSceneTransformationMatrix()

std::vector< std::vector< float > > getSceneTransformationMatrix ( )

Accessor on the 3-D scene transformation matrix.

Returns
the 3-D scene transformation matrix as a 4x4 array

◆ getShininess()

float getShininess ( const std::string &  aLabel)

Accessor on the shininess of the material of a given polygon mesh.

Returns
the shininess coefficient

◆ getSourcePosition()

std::vector< double > getSourcePosition ( const std::string &  aUnitOfLength)

Accessor on the position of the X-ray source.

Parameters
aUnitOfLengththe unit of length corresponding to the returned value. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
Returns
the source position in a given unit of length

◆ getSpecularColour()

std::vector< float > getSpecularColour ( const std::string &  aLabel)

Accessor on the specular colour of the material of a given polygon mesh.

Returns
the specular colour

◆ getTotalEnergyWithDetectorResponse()

double getTotalEnergyWithDetectorResponse ( )

Accessor on a total energy of the beam when the detector response is applied.

Returns
the total energy

◆ getUnitOfEnergy()

double getUnitOfEnergy ( const std::string &  aUnitOfEnergy)

Accessor on the numerical value corresponding to a unit of energy.

Parameters
aUnitOfEnergythe unit of energy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
Returns
the corresponding numerical value

◆ getUnitOfLength()

double getUnitOfLength ( const std::string &  aUnitOfLength)

Accessor on the numerical value corresponding to a unit of length.

Parameters
aUnitOfLengththe unit of length. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
Returns
the corresponding numerical value

◆ getVersionOfCoreGVXR()

std::string getVersionOfCoreGVXR ( )

Accessor on the full string version of the core gVirtualXRay library (gvxr).

Returns
the full version number

◆ getVersionOfSimpleGVXR()

std::string getVersionOfSimpleGVXR ( )

Accessor on the full string version of SimpleGVXR.

Returns
the full version number

◆ hideWindow()

void hideWindow ( int  aWindowID = -1)

Hide a window.

Parameters
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ invertNormalVectors()

void invertNormalVectors ( const std::string &  aLabel)

Invert the normal vectors of a given polygon mesh.

Parameters
aLabelthe label of the polygon mesh

◆ loadDetectorEnergyResponse()

void loadDetectorEnergyResponse ( const std::string &  aFileName,
const std::string &  aUnitOfEnergy 
)

Load the energy response of the detector from a TSV file.

Parameters
aFileNamename of the file. Each line of the file is formatted as follows: input_energy output_energy
aUnitOfEnergythe unit of energy corresponding to the data in the file

◆ loadMeshFile()

void loadMeshFile ( const std::string &  aLabel,
const std::string &  aFileName,
const std::string &  aUnitOfLength,
bool  addToRendererAsInnerSurface = true 
)

Load a polygon mesh from a file, set its label in the scenegraph (i.e. identifier) and add it to the X-ray renderer.

Parameters
aLabelthe label in the scenegraph
aFileNamethe file where the polygon mesh data is stored
aUnitOfLengththe unit of length corresponding to the data stored in the file. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" @addToRendererAsInnerSurface: a flag to add the mesh to the X-ray renderer (as an inner surface) (default value: true)

◆ loadSceneGraph()

void loadSceneGraph ( const std::string &  aFileName,
const std::string &  aUnitOfLength 
)

Load a scenegraph from a file and add its polygon meshes to the X-ray renderer.

Parameters
aFileNamethe file where the polygon mesh data is stored
aUnitOfLengththe unit of length corresponding to the data stored in the file. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ loadSpectrumFromTSV()

void loadSpectrumFromTSV ( const std::string &  aFileName,
const std::string &  aUnitOfEnergy,
bool  aNormalisationFlag 
)

Load the incident beam energy spectrum from a TSV file.

Parameters
aFileNamename of the file to load
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
aNormalisationFlagtrue to normalise the total energy to 1, false otherwise

◆ lookAt()

void lookAt ( double  eyeX,
double  eyeY,
double  eyeZ,
double  lookAtX,
double  lookAtY,
double  lookAtZ,
double  upX,
double  upY,
double  upZ 
)

Replace the modelling-viewing matrix by a viewing transformation matrix. It behaves as the old gluLookAt function.

Parameters
eyeXSpecifies the position of the eye point along the X-axis
eyeYSpecifies the position of the eye point along the Y-axis
eyeZSpecifies the position of the eye point along the Z-axis
lookAtXSpecifies the position of the reference point along the X-axis
lookAtYSpecifies the position of the reference point along the Y-axis
lookAtZSpecifies the position of the reference point along the Z-axis
upXSpecifies the direction of the up vector along the X-axis
upYSpecifies the direction of the up vector along the Y-axis
upZSpecifies the direction of the up vector along the Z-axis

◆ makeCube()

void makeCube ( const std::string &  aLabel,
double  aLength = 1.0,
const std::string &  aUnitOfLength = "cm",
const std::string &  aParent = "root" 
)

Create a cube, centred on (0, 0, 0) and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer.

Parameters
aLabelthe label in the scenegraph
aLengththe size of an edge of the cube
aUnitOfLengththe unit of length corresponding to aLength. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" (default value: "cm")
aParentthe parent of the node in the scenegraph (default: "root")

◆ makeCylinder()

void makeCylinder ( const std::string &  aLabel,
unsigned int  aNumberOfSectors = 10,
double  aHeight = 1.0,
double  aRadius = 0.5,
const std::string &  aUnitOfLength = "cm",
const std::string &  aParent = "root" 
)

Create a cylinder and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer.

Parameters
aLabelthe label in the scenegraph
aNumberOfSectorsthe number of sector defining the mesh
aHeightthe height of the cylinder
aRadiusthe radius of the cylinder
aUnitOfLengththe unit of length corresponding to aHeight and aRadius. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" (default value: "cm")
aParentthe parent of the node in the scenegraph (default: "root")

◆ makeIsoSurface()

void makeIsoSurface ( const std::string &  aLabel,
short  anIsoValue,
const std::vector< short > &  aVoxelDataSet,
unsigned int  aWidth,
unsigned int  aHeight,
unsigned int  aDepth,
double  aSpacingX,
double  aSpacingY,
double  aSpacingZ,
const std::string &  aUnitOfLength = "cm",
const std::string &  aParent = "root" 
)

Create an iso-surface from a 3D image and set its label in the scenegraph (i.e. identifier). Note that it is not added to the X-ray renderer.

Parameters
aLabelthe label in the scenegraph
anIsoValuethe iso-value
aVoxelDataSetthe voxel dataset
aWidththe number of voxel along the X-axis
aHeightthe number of voxel along the Y-axis
aDepththe number of voxel along the Z-axis
aSpacingXthe space between the centre of two successive voxels along the X-axis
aSpacingYthe space between the centre of two successive voxels along the Y-axis
aSpacingZthe space between the centre of two successive voxels along the Z-axis
aUnitOfLengththe unit of length corresponding to aSpacingX, aSpacingY and aSpacingZ. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer" (default value: "cm")
aParentthe parent of the node in the scenegraph (default: "root")

◆ moveToCenter()

void moveToCenter ( const std::string &  aLabel)

Move a polygon mesh to the centre.

Parameters
aLabelthe label of the polygon mesh in the scenegraph

◆ moveToCentre()

void moveToCentre ( const std::string &  aLabel)

Move a polygon mesh to the centre.

Parameters
aLabelthe label of the polygon mesh in the scenegraph

◆ orthographic()

void orthographic ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)

Replace the projection matrix by a orthographic projection matrix. It behaves as the old glOrtho function.

Parameters
leftSpecify the coordinates for the left vertical clipping plane
rightSpecify the coordinates for the right vertical clipping plane
bottomSpecify the coordinates for the bottom horizontal clipping plane
topSpecify the coordinates for the top horizontal clipping plane
zNearSpecify the distances to the near clipping plane. The value must be positive
zFarSpecify the distances to the far clipping plane. The value must be positive

◆ perspective()

void perspective ( double  fovy,
double  aspect,
double  zNear,
double  zFar 
)

Replace the projection matrix by a perspective projection matrix. It behaves as the old gluPerspective function.

Parameters
fovyspecifies the field of view angle, in degrees, in the y-direction.
aspectSpecifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).
zNearSpecifies the distance from the viewer to the near clipping plane (always positive)
zFarSpecifies the distance from the viewer to the far clipping plane (always positive).

◆ rayIntersect()

std::vector< float > rayIntersect ( const std::string &  aLabel,
double  aRayOriginX,
double  aRayOriginY,
double  aRayOriginZ,
double  aRayDirectionX,
double  aRayDirectionY,
double  aRayDirectionZ 
)

void setShiftFilter(double aValue); void setScaleFilter(double aValue); double getShiftFilter(); double getScaleFilter();

◆ renderLoop()

void renderLoop ( int  aWindowID = -1)

3-D visualisation of the 3-D scene (source, detector, and scanned objects). Note that there is interactive loop running. Keys are:

  • Q/Escape: to quit the event loop (does not close the window)
  • B: display/hide the X-ray beam
  • W: display the polygon meshes in solid or wireframe
  • N: display the X-ray image in negative or positive
  • L: switch lighting on/off
  • D: display/hide the X-ray detector
  • V: display/hide normal vectors
    Parameters
    aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ resetBeamSpectrum()

void resetBeamSpectrum ( )

Set the size of the focal spot of the X-ray generator.

Parameters
xsize along the x-axis
ysize along the y-axis
zsize along the z-axis
aUnitOfLengththe unit of length. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"
Returns
the corresponding numerical value Empty the beam spectrum.

◆ rotateModelView()

void rotateModelView ( double  anAngle,
double  x,
double  y,
double  z 
)

Restore the matrix from the model/view matrix stack, and remove the last matrix of the stack. glMatrixMode(GL_MODELVIEW);glRotate() functions.

Parameters
anAnglethe angle of rotation in degrees
xthe coordinate of the rotation axis along the X-axis
ythe coordinate of the rotation axis along the Y-axis
zthe coordinate of the rotation axis along the Z-axis

◆ rotateNode()

void rotateNode ( const std::string &  aLabel,
double  anAngle,
double  x,
double  y,
double  z 
)

Rotate a polygon mesh.

Parameters
aLabelthe label of the polygon mesh to transform
anAnglethe rotation angle in degrees
xthe component of the rotation vector along the X-axis
ythe component of the rotation vector along the Y-axis
zthe component of the rotation vector along the Z-axis

◆ rotateScene()

void rotateScene ( double  anAngle,
double  x,
double  y,
double  z 
)

Rotate the 3-D scene (all the polygon meshes will be affected but not modified).

Parameters
anAnglethe rotation angle in degrees
xthe component of the rotation vector along the X-axis
ythe component of the rotation vector along the Y-axis
zthe component of the rotation vector along the Z-axis

◆ saveLastCumulatedLBuffer()

void saveLastCumulatedLBuffer ( const std::string &  aFileName = std::string(),
bool  useCompression = true 
)

Save the last cumulated L-buffer that has been computed.

Parameters
aFileNamethe name of the output file (default: means that the filename will be automatically generated and the file saved in the current path)
useCompressionuse data compression is possible (default: true)

◆ saveLastLBuffer()

void saveLastLBuffer ( const std::string &  aFileName = std::string(),
bool  useCompression = true 
)

Save the last L-buffer that has been computed.

Parameters
aFileNamethe name of the output file (default: means that the filename will be automatically generated and the file saved in the current path)
useCompressionuse data compression is possible (default: true)

◆ saveLastProjectionSet()

void saveLastProjectionSet ( const std::string &  aFileName = std::string(),
bool  useCompression = true 
)

Save the last projection set that has been computed.

Parameters
aFileNamethe name of the output file (default: 0 means that the filename will be automatically generated and the file saved in the current path)
useCompressionuse data compression is possible (default: true)

◆ saveLastSinogram()

void saveLastSinogram ( const std::string &  aFileName = std::string(),
bool  useCompression = true 
)

Save the last sinogram that has been computed.

Parameters
aFileNamethe name of the output file (default: 0 means that the filename will be automatically generated and the file saved in the current path)
useCompressionuse data compression is possible (default: true)

◆ saveLastXRayImage()

void saveLastXRayImage ( const std::string &  aFileName = std::string(),
bool  useCompression = true 
)

Save the last X-ray image that has been computed.

Parameters
aFileNamethe name of the output file (default: means that the filename will be automatically generated and the file saved in the current path)
useCompressionuse data compression is possible (default: true)

◆ saveSTLfile()

void saveSTLfile ( const std::string &  aLabel,
const std::string &  aFileName = std::string() 
)

Save the polygon mesh of a given node.

Parameters
aLabelthe label of the polygon mesh
aFileNamethe name of the output file (default: means that the filename will be automatically generated and the file saved in the current path)

◆ scaleNode()

void scaleNode ( const std::string &  aLabel,
double  x,
double  y,
double  z 
)

Scale a polygon mesh.

Parameters
aLabelthe label of the polygon mesh to transform
xthe scaling factor along the X-axis
ythe scaling factor along the Y-axis
zthe scaling factor along the Z-axis

◆ scaleScene() [1/2]

void scaleScene ( double  x,
double  y,
double  z 
)

Scale the 3-D scene (all the polygon meshes will be affected but not modified).

Parameters
xthe scaling factor along the X-axis
ythe scaling factor along the Y-axis
zthe scaling factor along the Z-axis

◆ scaleScene() [2/2]

void scaleScene ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength 
)

Scale the 3-D scene (all the polygon meshes will be affected but not modified).

Parameters
xthe scaling factor along the X-axis
ythe scaling factor along the Y-axis
zthe scaling factor along the Z-axis
aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ scrollCallback()

void scrollCallback ( double  xoffset,
double  yoffset 
)

Call this function when the user scrolls.

Parameters
xoffsetthe scroll offset along the x-axis (not used)
yoffsetthe scroll offset along the y-axis (used for zooming in and out)

◆ setColor()

void setColor ( const std::string &  aLabel,
float  R,
float  G,
float  B,
float  A 
)

Set the color of a given polygon mesh.

Parameters
aLabelthe label of the polygon mesh
Rthe red channel
Gthe green channel
Bthe blue channel
Athe alpha channel

◆ setColour()

void setColour ( const std::string &  aLabel,
float  R,
float  G,
float  B,
float  A 
)

Set the colour of a given polygon mesh.

Parameters
aLabelthe label of the polygon mesh
Rthe red channel
Gthe green channel
Bthe blue channel
Athe alpha channel

◆ setCompound()

void setCompound ( const std::string &  aLabel,
const std::string &  aCompound 
)

Set the compound corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material.

Parameters
aLabelthe label of the polygon mesh
aCompoundthe details about the compound. It is given as a sequence of element symbol & number of atoms, e.g. H2O for water and SiC for silicon carbide.

◆ setDensity()

void setDensity ( const std::string &  aLabel,
double  aDensity,
const std::string &  aUnit 
)

Set the density corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
aDensitythe density
aUnitthe unit corresponding to aDensity. Acceptable values are: "g/cm3" and "g.cm-3"

◆ setDetectorNumberOfPixels()

void setDetectorNumberOfPixels ( int  aWidth,
int  aHeight 
)

Set the number of pixels of the X-ray detector.

Parameters
aWidththe number of pixels along the X-axis
aHeightthe number of pixels along the Y-axis

◆ setDetectorPixelSize()

void setDetectorPixelSize ( double  aWidth,
double  aHeight,
const std::string &  aUnitOfLength 
)

Set the pixel size.

Parameters
aWidththe pixel size along the X-axis
aHeightthe pixel size along the Y-axis
aUnitOfLengththe unit of length corresponding to the aWidth and aHeight parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ setDetectorPosition()

void setDetectorPosition ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength 
)

Set the position of the X-ray detector.

Parameters
xthe position along the X-axis
ythe position along the Y-axis
zthe position along the Z-axis
aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ setDetectorUpVector()

void setDetectorUpVector ( double  x,
double  y,
double  z 
)

Set the up-vector defining the orientation of the X-ray detector.

Parameters
xthe component of the vector along the X-axis
ythe component of the vector along the Y-axis
zthe component of the vector along the Z-axis

◆ setElement() [1/2]

void setElement ( const std::string &  aLabel,
const std::string &  aName 
)

Set the chemical element (or element) corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
aNamethe symbol or name corresponding to the element

◆ setElement() [2/2]

void setElement ( const std::string &  aLabel,
unsigned short  Z 
)

Set the chemical element (or element) corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
Zthe atomic number (or Z number) corresponding to the element

◆ setHounsfieldUnit()

void setHounsfieldUnit ( const std::string &  aLabel,
short  HU 
)

Set the Hounsfield value corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
HUthe Hounsfield value

◆ setHounsfieldValue()

void setHounsfieldValue ( const std::string &  aLabel,
short  HU 
)

Set the Hounsfield value corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
HUthe Hounsfield value

◆ setHU()

void setHU ( const std::string &  aLabel,
short  HU 
)

Set the Hounsfield value corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
HUthe Hounsfield value

◆ setLinearAttenuationCoefficient()

void setLinearAttenuationCoefficient ( const std::string &  aLabel,
double  aCoefficient,
const std::string &  aUnit 
)

Set the linear attenuation coefficient corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
aCoefficientthe liner attenuation coefficient
aUnitthe unit corresponding to aCoefficient. Acceptable values are: "cm-1"

◆ setLocalTransformationMatrix()

void setLocalTransformationMatrix ( const std::string &  aLabel,
const std::vector< double > &  aMatrix 
)

Set the local transformation matrix of a given node in the scenegraph.

Parameters
aLabelthe label in the scenegraph
aMatrixthe local transformation matrix

◆ setMassAttenuationCoefficient()

void setMassAttenuationCoefficient ( const std::string &  aLabel,
double  aCoefficient,
const std::string &  aUnit 
)

Set the mass attenuation coefficient corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material.

Parameters
aLabelthe label of the polygon mesh
aCoefficientthe mass attenuation coefficient
aUnitthe unit corresponding to aCoefficient. Acceptable values are: "cm2/g" and "cm2.g-1"

◆ setMixture() [1/2]

void setMixture ( const std::string &  aLabel,
const std::string &  aMixture 
)

Set the mixture corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material.

Parameters
aLabelthe label of the polygon mesh
aMixturethe details about the mixture. It is given as a sequence of element symbol & relative weight, e.g. Ti90Al6V4.

◆ setMixture() [2/2]

void setMixture ( const std::string &  aLabel,
const std::vector< int > &  aZNumberSet,
const std::vector< double > &  aWeightSet 
)

Set the mixture corresponding to the material properties of a polygon mesh. Don't forget to set the density of the material.

Parameters
aLabelthe label of the polygon mesh
aZNumberSetthe array of Z numbers
aWeightSetthe corresponding weights

◆ setMonoChromatic()

void setMonoChromatic ( double  anEnergy,
const std::string &  aUnitOfEnergy,
double  aNumberOfPhotons 
)

Use a monochromatic beam spectrum (i.e. one single energy).

Parameters
anEnergythe incident photon energy
aUnitOfEnergythe unit of energy corresponding to anEnergy. Acceptable values are: "electronvolt", "eV", "kiloelectronvolt", "keV", "megaelectronvolt", "MeV"
aNumberOfPhotonsthe number of incident photons

◆ setMu()

void setMu ( const std::string &  aLabel,
double  aCoefficient,
const std::string &  aUnit 
)

Set the linear attenuation coefficient corresponding to the material properties of a polygon mesh.

Parameters
aLabelthe label of the polygon mesh
aCoefficientthe liner attenuation coefficient
aUnitthe unit corresponding to aCoefficient. Acceptable values are: "cm-1"

◆ setNodeTransformationMatrix()

void setNodeTransformationMatrix ( const std::string &  aLabel,
const std::vector< std::vector< float > > &  aMatrix 
)

Set the transformation matrix of a given node.

Parameters
aLabelthe label of the polygon mesh
aMatrixthe transformation matrix as a 4x4 array

◆ setOversamplingFactor()

void setOversamplingFactor ( int  aFactor = 1)

Set the multiplicative factor to oversample the L-buffers.

Parameters
aFactorthe multiplicative factor (default value: 1, for no oversampling)

◆ setRootTransformationMatrix()

void setRootTransformationMatrix ( const std::vector< std::vector< float > > &  aMatrix)

Set the transformation matrix of the scengraph's root node.

Parameters
aMatrixthe transformation matrix as a 4x4 array

◆ setSceneTransformationMatrix()

void setSceneTransformationMatrix ( const std::vector< std::vector< float > > &  aMatrix)

Set the 3-D scene transformation matrix.

Parameters
aMatrixthe transformation matrix as a 4x4 array

◆ setSourcePosition()

void setSourcePosition ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength 
)

Set the position of the X-ray source.

Parameters
xthe position along the X-axis
ythe position along the Y-axis
zthe position along the Z-axis
aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ setWindowBackGroundColor()

void setWindowBackGroundColor ( float  R,
float  G,
float  B,
int  aWindowID = -1 
)

Set window background colour.

Parameters
Rthe red colour [0, 1]
Gthe green colour [0, 1]
Bthe blue colour [0, 1]
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ setWindowBackGroundColour()

void setWindowBackGroundColour ( float  R,
float  G,
float  B,
int  aWindowID = -1 
)

Set window background colour.

Parameters
Rthe red colour [0, 1]
Gthe green colour [0, 1]
Bthe blue colour [0, 1]
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ setWindowSize()

void setWindowSize ( int  aWidth,
int  aHeight,
int  aWindowID = -1 
)

Create an OpenGL context and display it in a window.

Parameters
aWidththe number of pixels along the X-axis
aHeightthe number of pixels along the Y-axis
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ shearNode()

void shearNode ( const std::string &  aLabel,
double  yx,
double  zx,
double  xy,
double  zy,
double  xz,
double  yz 
)

Use a shear matrix to transform the node.

Parameters
aLabelthe label of the polygon mesh to transform
yxthe yx component of the shear matrix
zxthe zx component of the shear matrix
xythe xy component of the shear matrix
zythe zy component of the shear matrix
xzthe xz component of the shear matrix
yzthe yz component of the shear matrix

◆ showWindow()

void showWindow ( int  aWindowID = -1)

Make an OpenGL context visible and display a window.

Parameters
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)

◆ startArcBallRotation()

void startArcBallRotation ( double  x,
double  y 
)

Call this function when the user starts an arc-ball rotation (e.g. left-mouse button click in the 3-D visualisation window).

Parameters
xthe cursor x-axis position in the viewport coordinate system
ythe cursor y-axis position in the viewport coordinate system

◆ subtractMesh()

void subtractMesh ( const std::string &  aDestination,
const std::string &  aSource 
)

Subtract a polygon mesh (aSource) from another one (aDestination). It corresponds to the operation as follows: aDestination -= aSource. Both aSource and aDestination have to already exist in the scenegraph.

Parameters
aDestinationthe polygon mesh that is going to be modified
aSourcethe polygon mesh that is going to be subtracted from aDestination

◆ takeScreenshot()

const std::vector< std::vector< std::vector< float > > > & takeScreenshot ( int  aWindowID = -1)

Take screenshot.

Parameters
aWindowIDthe numerical ID of the corresponding context (default value: -1, means that the active context will be used)
Returns
: the 2D image in RGB

◆ translateNode()

void translateNode ( const std::string &  aLabel,
double  x,
double  y,
double  z,
const std::string &  aUnitOfLength 
)

Translate a polygon mesh.

Parameters
aLabelthe label of the polygon mesh to transform
xthe component of the translation vector along the X-axis
ythe component of the translation vector along the Y-axis
zthe component of the translation vector along the Z-axis
aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ translateScene()

void translateScene ( double  x,
double  y,
double  z,
const std::string &  aUnitOfLength 
)

Translate the 3-D scene (all the polygon meshes will be affected but not modified).

Parameters
xthe component of the translation vector along the X-axis
ythe component of the translation vector along the Y-axis
zthe component of the translation vector along the Z-axis
aUnitOfLengththe unit of length corresponding to the x, y and z parameters. Acceptable values are: "um", "micrometre", "micrometer", "mm", "millimetre", "millimeter", "cm", "centimetre", "centimeter", "dm", "decimetre", "decimeter", "m", "metre", "meter", "dam", "decametre", "decameter", "hm", "hectometre", "hectometer", "km", "kilometre", "kilometer"

◆ usingArcBallRotation()

bool usingArcBallRotation ( )

Check if arc-ball rotation is currently in use.

Returns
true if arc-ball rotation is currently in use, false otherwise