agencyenterprise / neurotechdevkit

Neurotech Development Kit (NDK)
https://agencyenterprise.github.io/neurotechdevkit/
Apache License 2.0
115 stars 10 forks source link

Get correct 2D sources and target when slicing a 3D scenario #148

Open kylmcgr opened 1 year ago

kylmcgr commented 1 year ago

Describe the new feature or enhancement

When slicing a scenario from 3D to 2D (as in SteadyStateResult3D get_steady_state_result_2d and as in SteadyStateResult3D render_steady_state_amplitudes), sources and targets are projected into the slice plane (the coordinate of the source/target in the slice axis is dropped). Instead, a new 2D source/target should be created with just the portion of the source/target in the slice plane.

Describe your proposed implementation

Find the places where 2D slices of 3D sources/targets are being taken (the two I know of are mentioned above). If the slice plane goes through a source, get the point sources that appear in the sliced plane and create a new source object of these point sources. If the slice plane goes through a target, calculate the center and radius of the portion of the target that appears in the sliced plane and create a new target from this. The values can just be used in cases where new source/target objects are not needed (believe this would be the case for SteadyStateResult3D render_steady_state_amplitudes).