svalinn / r2s-act

Rigorous 2 Step Activation Workflow
4 stars 7 forks source link

Verify and correct uniform raytracing implementation #36

Closed erelson closed 11 years ago

erelson commented 11 years ago

The uniform sampling approach described in Damien's Master's thesis is incorrect

Sampling a square that is 4x4 (x:[0,4]; y:[0,4]), and sampling 3 points in each direction. You get points at 1, 2, 3 in each dimension (with the incorrect algorithm). Each point 'corresponds' to a 1x1 square about it Result is squares only cover the extents 0.5 to 3.5

Essentially, the edges of voxels are not being sampled.

The current implementation, via _linspace() method in mmgrid.py also uses this erroneous algorithm. (Though by default, mmgrid.py uses random point sampling)

Todo:

erelson commented 11 years ago

Unit test existed, but had an incorrect expected case, as well.

I have now fixed the code as well.