Closed mathiser closed 1 year ago
Hi again @Sikerdebaard Just checking in if this has any interest. Mathis
I am a bit squeezed for time at the moment so I haven't had a chance to do the work / refactoring necessary to start testing this (and other) PR. I'll update once my agenda clears up a bit which should be in the next two weeks or so. Sorry for the delay.
Thanks for getting back. No problem at all. Just wanted to be sure you received the PR. Take care!
Hi again. I've found a bug this code, causing irregularities when run multiple times. Specifically, it is caused by np.empty. Running the code with np.zeroes instead fixes this. Closing this and opening a new PR soon.
Mathis
Hi @Sikerdebaard I have been fiddling around with vectorizing the coordinate transform to increase the conversion performance. It is quite a drastic refactoring of the conversion, but it works quite well.
In my tests the current codebase converts a given patient in 2 minutes and 2 seconds, while this PR converts the same in 1 min 31 secs. The biggest consumer of time is still the generation of the mask from coordinates, which takes up around half of the execution time (and saving niftis about 15 %).
Feel free to have a look, and decide if this (or an edited version should be merged)
Mathis