Commit a9fcc8cc authored by torsten.hopp's avatar torsten.hopp
Browse files

Update README.md

parent 92fe643c
...@@ -47,8 +47,8 @@ MATLAB interface: ...@@ -47,8 +47,8 @@ MATLAB interface:
- Output: - Output:
- **attenuationValues**: the summation of attenuation values of the X-rays in format `detectorSizeUint(1)*detectorSizeUint(2)`. <br> - **attenuationValues**: the summation of attenuation values of the X-rays in format `detectorSizeUint(1)*detectorSizeUint(2)`. <br>
- **profiling**: Output of internal time profiling. It's not necessary for calculation but it does not effect the calculation time much, espacially for big problems.<br/> - **profiling**: Output of internal time profiling. It's not necessary for calculation but it does not effect the calculation time much, espacially for big problems.<br/>
- [Optional] **debug**: Please refer to the easyExample script for explanation of usage of the profiling output. - [Optional] **debug**: Please refer to the section [Extended debug data](#extended-debug-data) for explanation of usage of the debug output.
- [Optional] **debugMiss**: Please refer to the easyExample script for explanation of usage of the profiling output. - [Optional] **debugMiss**: Please refer to the section [Extended debug data](#extended-debug-data) for explanation of usage of the debug output.
### <a name="attenuationCalculationWrapper"></a>attenuationCalculationWrapper ### <a name="attenuationCalculationWrapper"></a>attenuationCalculationWrapper
...@@ -162,14 +162,22 @@ Note that this has effects on the number of intersection between rays and triang ...@@ -162,14 +162,22 @@ Note that this has effects on the number of intersection between rays and triang
After meshing with iso2mesh it may happen that the double layer exists also for the outer layer though triangles do not have the exact same positions, but the same region. by using `faces = unique(faces,'rows')` this may be corrected in the mesh structure before calling out toolbox. After meshing with iso2mesh it may happen that the double layer exists also for the outer layer though triangles do not have the exact same positions, but the same region. by using `faces = unique(faces,'rows')` this may be corrected in the mesh structure before calling out toolbox.
## Extended debug data ## Extended debug data
The implementation offers advanced debug output. Therefore the comments in the first line in nv_ray_tracing_basic.cpp and the 4th line in raygen.rgen has to be uncommented. Both lines descriping #define debug. Then the call from the kernel changes to The implementation offers advanced debug output.
**Please note**: In order to enable the extended debug data, comments in the first line in `nv_ray_tracing_basic.cpp` and the 4th line in `raygen.rgen` have to be uncommented! Both lines are describing `#define debug`.
For extended debug data the call of `nv_ray_tracing_basic` changes to
```matlab ```matlab
[attenuationValues, debugGen,debugMiss,profiling] = nv_ray_tracing_basic(detectorPositionCoordinates, faces, nodes, source, detectorSizeUint,attenuationCoefficentValues); [attenuationValues, debugGen, debugMiss, profiling] = nv_ray_tracing_basic(detectorPositionCoordinates, faces, nodes, source, detectorSizeUint,attenuationCoefficentValues);
times = reformatProfile(profiling); times = reformatProfile(profiling);
``` ```
The variable _debugGen_ contains the debug data from the raygen shader.
The variable _debugMiss_ contains the debug data from the miss shader. The variable `debugGen` contains the debug data from the raygen shader. The variable `debugMiss` contains the debug data from the miss shader.
The debug data from _debugGen_ is already implemented, comes as a linear buffer and gives data for ray generated (size of detector), to see the correct values use _debugGen = reshape(debugGen, [18 detectorSizeUint]);_. The output data is:
The debug data from `debugGen` is already implemented, comes as a linear buffer and gives data for all rays generated (size of detector). To see the values in a formated way please use `debugGen = reshape(debugGen, [18 detectorSizeUint]);`
The output data is:
* debugData.debugValues[debugId + 0 ] = gl_LaunchSizeNV.x; * debugData.debugValues[debugId + 0 ] = gl_LaunchSizeNV.x;
* debugData.debugValues[debugId + 1] = gl_LaunchSizeNV.y; * debugData.debugValues[debugId + 1] = gl_LaunchSizeNV.y;
* debugData.debugValues[debugId+ 2 ] = gl_LaunchIDNV.x; * debugData.debugValues[debugId+ 2 ] = gl_LaunchIDNV.x;
...@@ -189,9 +197,8 @@ The debug data from _debugGen_ is already implemented, comes as a linear buffer ...@@ -189,9 +197,8 @@ The debug data from _debugGen_ is already implemented, comes as a linear buffer
* debugData.debugValues[debugId + 16] = rayId; * debugData.debugValues[debugId + 16] = rayId;
* debugData.debugValues[debugId + 17] = rayPayload.outputId; * debugData.debugValues[debugId + 17] = rayPayload.outputId;
The variable _debugMiss_ can be filled by own needs. You implement some comments in the miss shader, e.g. _debug.values[rayPayload.outputId] = n;_ (in this case n shows the number of hits). <br> The variable `debugMiss` can be filled by own needs. E.g. `debug.values[rayPayload.outputId] = n;` writes the number of hits into the data buffer. It has the same size as `debugGen` for each ray, but it has a depth of 200 by default. Hence the command to reshape the data would be `debugMiss = reshape(debugMiss, [200 detectorSizeUint]);`. This data buffer may be used to see which triangles are intersected by the ray or which distances a ray traveled through regions.
It has the same size then _debugGen_ so for each ray, but it has a depth of 200 by default. so the command would be _debugMiss = reshape(debugMiss, [200 detectorSizeUint]);_ to get proper results. Overall it can be used to see which triangles got hit or with which distances.
# References # References
[1] [Beer-Lambert law](https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law) [1] [Beer-Lambert law](https://en.wikipedia.org/wiki/Beer%E2%80%93Lambert_law)
[2] [iso2mesh Toolbox](http://iso2mesh.sourceforge.net/cgi-bin/index.cgi) [2] [iso2mesh Toolbox](http://iso2mesh.sourceforge.net/cgi-bin/index.cgi)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment