Assuming you have the 3D position vector of the photon at a given time, you can check if it crossed a boundary in tissue by comparing the tissue properties of the current location with the properties of the next location to which the photon is going.
To do this, you need to know the tissue properties of each voxel in your 3D volume, such as the absorption coefficient and the scattering coefficient. You can use these properties to calculate the probability of the photon being absorbed or scattered at each location along its trajectory.
Here's an example code snippet of how to check if a photon crossed a boundary in tissue:
main.m900 chars27 lines
Note that this is a simplified example and assumes that the photon travels in a straight line between time steps. In reality, you would need to use a Monte Carlo simulation to calculate the photon's path through tissue, taking into account scattering, absorption, and other factors.
gistlibby LogSnag