Open faberno opened 1 year ago
Seems like this bug could have a higher extend than expected. All illuminations add 0.5 to their voxel positiions, like this device_position = list(self.device_position_mm / spacing + 0.5)
. But the correct configuration seems to be OriginType=1
([0, 0, 0] origin) and remove the +0.5
. Here is the output of such configuration with a pencil beam illumination at different positions:
For the position 4.5 and 5.5 the laser seems to lie exactly in the middle of the voxel, as the fluence spreads evenly to its neighbors.
For the position 5 the laser lies at the border between voxels as the peak changes voxels when slightly moved.
In contrast the current configuration in Simpa is OriginType=0
([1, 1, 1] origin) and pos+0.5
, which looks like this
Here when the laser has position 5, the peak is at 4.5.
Describe the bug In the MCX adapter, we set the origintype to 0, which corresponds to the origin [1.0, 1.0, 1.0] (MCX documentation: "1 if the origin is [0 0 0], 0 if it is [1.0,1.0,1.0]"). Maybe I overlooked something, but I would have guessed we should start at [0, 0, 0].
https://github.com/IMSY-DKFZ/simpa/blob/78d1f8bd1d9a7a22defae5de4874f2b3beec4e94/simpa/core/simulation_modules/optical_simulation_module/optical_forward_model_mcx_adapter.py#L142