IMSY-DKFZ / simpa

The Simulation and Image Processing for Photoacoustic Imaging (SIMPA) toolkit.
https://simpa.readthedocs.io/en/main/
Other
65 stars 17 forks source link

T154 heterogeneous tissue #290

Open frisograce opened 4 weeks ago

frisograce commented 4 weeks ago

Please check the following before creating the pull request (PR):

frisograce commented 1 week ago

Thanks a lot for this @frisograce! I was very hesitant to refactor the initial pull request after the initial comments, as the simulation runtime can drastically increase because of the implemented changes. (Due to handling arrays in the volume creation part).

I discussed with @kdreher initially and we decided it might be a good idea adding a beofre and after performance test but I've never gotten around to implement that.

The changes all look sensible and I am super excited/happy for this feature to be included, but also wanted to caution that it comes at the cost of runtime - at the very least when actually defining arrays, but potentially also when using old scripts.

Hi Janek,

Apologies for the delayed response! I've been working on a way to benchmark the scripts and have some results are shown below. (For the time being, the RAM usage seems a little unpredictable, the results seem to very significantly between tests).

Before Heterogeneity: image

After: Screenshot from 2024-06-21 15-25-22

As seen from the GPU usage and time taken, there are certainly increases; but some of this has been negated by my recent commit, where I've tried to eliminate the use of tensors in tissue_properties unless necessary.

Let me know what you think :)

jgroehl commented 1 week ago

Amazing, that looks really good. Thanks for looking into this :)