Add a value to a 3D Array where a 3D Vector passes through said array.

I have a 3D Array that represents an intensity at each location inside the physical volume of a detector, initialized to all zeros.
I also have a set of 3D Vectors (defined by the Start XYZ and End XYZ of each vector) repesenting the tracks of a particle going through that detector.
I would like to add some value to each 3D Array location the 3D Vector passes through.
The 3D vectors are all inside the 3D Array and have the same coordinate system.
I am scratching my head on what would be a good approach to this problem.
For context, what I am trying to do is simulate a cosmic ray passing through a 3D detector and depositing energy along it's track.
Any

2 Comments

I would like to add some value to each 3D Array location the 3D Vector passes through.
Does the 3D Vector pass through integer grid locations only? If not you presumably need to define the contribution to each location according to some interpolation rule.
No, it is the binning of the charge into the appropriate pixel that seems to be the tricky part.

Sign in to comment.

Answers (0)

Products

Release

R2019b

Asked:

on 12 Jul 2020

Commented:

on 13 Jul 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!