Commit 92fe643c authored by torsten.hopp's avatar torsten.hopp
Browse files

Update README.md until before extended debug data

parent 4be3d7a0
......@@ -22,7 +22,7 @@ e-mail: [torsten.hopp@kit.edu](mailto:torsten.hopp@kit.edu)
## How to use it
Run buildscript before usage. Please see [How to build](#howToBuild)
Run buildscript before usage. Please see [How to build](#how-to-build-it)
### nv_ray_tracing_basic
`nv_ray_tracing_basic` performs the ray tracing from the source position through the triangular mesh to the detector pixels and returns the attenuation of the ray given the material parameters. This function represents the mex-interface for the kernel call.<br>
......@@ -83,7 +83,7 @@ easyExample("easy",1)
- Output: none <br/>
## <a name="howToBuild">How to build it
## How to build it
### raytracingBuilder
MATLAB function for building raytracing functions and shader. If vulkan is installed and all files have the same relativ position as in this repository, the build works by itself and raytracingBuilderWrapper can be used, i.e.
```matlab
......@@ -149,12 +149,17 @@ printAll(nodes, faces, source, detectors, detectorId)
## Note on mesh structure
* For meshing, we recommend the iso2mesh toolbox by _Fang_ [2]. The output format of this toolbox has been used for development of this work.
* For meshing, we recommend the iso2mesh toolbox by _Fang_ [2]. The output format of this toolbox has been used for development of this work. The result of the X-ray simulation is based on the mesh structure.
Currently the result is depending on the mesh structures. Meshes can be build diffrently. In our case we used the vol2mesh method from http://iso2mesh.sourceforge.net/cgi-bin/index.cgi to create the meshes. The result has two layers between region transitions, which means two triangles on the exact same positions. That is show in the picture with the red and inner black lines, which representing each a diffrent region. Then the ray always travels in and out of an material before it reachs the next on or an detector.
![Correct mesh structure. The inner mesh structures are double layered](./Data/Images/MeshStructure.svg)<br>
In other words, the current algorithm always expects to leave a region after entering it and before entering the next one. As you can see that has effects on the number of hits. Normally we would expect 4 hit because of 2 diffrent regions. But with these double layers we get 6 hits. This is a property the mesh needs for correct calculation.<br>
Normaly this double layer exists also for the outer layer but there it has not even the same positions but the same region. With _unique(faces,'rows')_ in Matlab before calling the raytracing kernel these outer layer can be deleted.
For testing we used the vol2mesh method from the iso2mesh toolbox to create the example meshes. The result of this meshing method has two layers between region transitions, which means at interfaces between regions/materials/tissues, two triangles are located on the exact same positions. This is illustrated in the below image with the red and inner black lines, which representing a diffrent region each. By this definition a ray always travels in and out of a material, before it reachs the next material or (at the end) the detector pixel.
![Mesh structure defined for this tool. Inner surfaces are doubled](./Data/Images/MeshStructure.svg)<br>
The current algorithm always expects to leave a region after entering the next one. This is a property the mesh needs for correct calculation.
Note that this has effects on the number of intersection between rays and triangles. In the example in the above illustration with two materials, we would expect 4 intersections: (1) entering region 1, (2) entering region 2, (3) entering region 1, (4) leaving region 1. Due to the double layers expect by out algorithm, however we acutally will see 6 intersections: (1) entering region 1, (2) leaving region 1, (3) entering region 2, (4) leaving region 2, (5) entering region 1, (6) leaving region 1.<br>
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
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
......
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