agencyenterprise / neurotechdevkit

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

Slice `SteadyStateResult3D` to `SteadyStateResult2D` #134

Closed charlesbmi closed 1 year ago

charlesbmi commented 1 year ago

Background

The benchmark paper (Aubry et al., 2022) simulates scenarios with 3-D physics but only compares results in 2-D. This seems to be a common use-case, because it is easier and faster to visualize 2-D results.

Describe the new feature or enhancement

Please provide a clear and concise description of what you want to add or change. I would like to be able to convert the SteadyStateResult3D output of a 3-D simulation to a SteadyStateResult2D that just encapsulates the slice of interest.

Please describe how you would use this new feature. To validate NDK's 3-D simulations against the publicly available Stride simulation output for the same scenarios.

Relevant issues: https://github.com/agencyenterprise/neurotechdevkit/issues/88 and https://github.com/agencyenterprise/neurotechdevkit/issues/89

Describe your proposed implementation

_Describe how you think the feature or improvement should be implemented (e.g., as a new method on an existing class? as new capability added to an existing method?) As a method in SteadyStateResult3D essentially replicating the slicing done by render_steady_state_amplitudes: https://github.com/agencyenterprise/neurotechdevkit/blob/7b0e1a002dd5d4311c4195160991305a472875dd/src/neurotechdevkit/results/_results.py#L357-L363 (but to construct a SteadyStateResult2D)

Describe possible alternatives

If you've suggested an implementation above, list here any alternative implementations you can think of, and brief comments explaining why the chosen implementation is better.

Possible alternative: Slice result.wavefield directly.

Cons: SteadyStateResult associates with the underlying wavefield data. many helper functions/methods, such as .steady_state and _metrics.py https://github.com/agencyenterprise/neurotechdevkit/blob/6e53d78a981885a06ca693bbcc1b4168367c267b/src/neurotechdevkit/results/_metrics.py#L9-L12 take a SteadyStateResult as an input, making it difficult to pass in a numpy array directly.