SyneRBI / SIRF

Main repository for the CCP SynerBI software
http://www.ccpsynerbi.ac.uk
Other
58 stars 29 forks source link

ImageData.allocate() does not support kw None for Gadgetron.and Reg #1212

Closed KrisThielemans closed 7 months ago

KrisThielemans commented 9 months ago

CIL's doc for allocate says

type value: number or string, default None allocates empty memory block

I don't know what "empty" means, but I guess it is "uninitialised"? @gfardell @paskino ?

None is supported for STIR, but not for the Gadgetron nor Reg

I suppose we could just clone()? .

KrisThielemans commented 9 months ago

By the way, this code looks a bit wasteful https://github.com/SyneRBI/SIRF/blob/d3956345ec6e56421017a6aca34c73747dbae664/src/xGadgetron/pGadgetron/Gadgetron.py#L526-L527 as out.fill(value) should work as well and is clearer. On the other hand, that will do the virtually same at the moment (!) https://github.com/SyneRBI/SIRF/blob/d3956345ec6e56421017a6aca34c73747dbae664/src/xGadgetron/pGadgetron/Gadgetron.py#L407

KrisThielemans commented 9 months ago

for reference, the STIR/STIR implementation is here

paskino commented 9 months ago

I don't know what "empty" means, but I guess it is "uninitialised"? @gfardell @paskino ?

It should read allocated but not initialised, i.e. we do not care about the values in it.

Therefore, clone is a good suggestion.