TomographicImaging / CCPi-Regularisation-Toolkit

The set of CPU/GPU optimised regularisation modules for iterative image reconstruction and other image processing tasks
Apache License 2.0
49 stars 25 forks source link

make the Python wrapper accept pre-allocated output array #164

Closed paskino closed 5 months ago

paskino commented 3 years ago

It'd be nice if the Python wrapper would allow the user to pass a pre allocated array for output instead of allocating the output by default.

dkazanc commented 3 years ago

so it's an initialisation of a sort? Could be useful indeed.

paskino commented 2 years ago

not really an initialisation, but the Python wrapper allocates by itself the output of the regularisation, like here in TV_ROF.

https://github.com/vais-ral/CCPi-Regularisation-Toolkit/blob/413c6001003c6f1272aeb43152654baaf0c8a423/src/Python/src/cpu_regularisers.pyx#L55-L56

The wrapper should allow to pass an already allocated array. In case none is passed it should allocate it.