OpenGATE / opengate

Gate 10 (beta)
http://www.opengatecollaboration.org
GNU Lesser General Public License v3.0
46 stars 40 forks source link

Switch to simpleitk #316

Open nkrah opened 10 months ago

nkrah commented 10 months ago

First steps to try the switch from itk to SimpleITK which is much faster to import.

The general idea is to implement wrapper functions in opengate.image, e.g. itk_get_image_origin(image), which internally call the library specific functions to get the return value. Anything in opengate outside of the image module should exclusively call functions implemented in the image module, and NOT itk or SimpleITK directly. In this way, we can switch from one image library to another quite easily.

The PR is a draft for now, but I am filing it as PR so everyone can have a look.

dsarrut commented 10 months ago

Update

nkrah commented 10 months ago

Thanks. Let's keep the PR simmering for now and discuss how to move on.

On Dec 11 2023, at 3:38 pm, David Sarrut @.***> wrote:

Update

yes indeed, ok for such wrapper functions

SimpleITK may not be required: it seems that it may be linked to torch + itk together

alternative idea: compile our own itk module with only the limited set of ImageType

Reply to this email directly, view it on GitHub (https://github.com/OpenGATE/opengate/pull/316#issuecomment-1850208828), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AIFQFYOJVUBXBME7T3FSCKLYI4LFDAVCNFSM6AAAAABALBHIUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJQGIYDQOBSHA).

You are receiving this because you authored the thread.

dsarrut commented 10 months ago

See

nkrah commented 10 months ago

Awesome, Thomas! So we can just keep the itk package then.

I will go through this PR here and see which of the functions I have implemented might still be useful. For example, getting the size of an ITK image requires multiple lines and it is nice to provide the GATE user with a shortcut function.

I keep the PR in Draft for now until I brush it up.