Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to simpleitk #316

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

nkrah
Copy link
Collaborator

@nkrah nkrah commented Dec 7, 2023

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.

@nkrah nkrah marked this pull request as draft December 7, 2023 13:11
@dsarrut
Copy link
Contributor

dsarrut commented Dec 11, 2023

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

@nkrah
Copy link
Collaborator Author

nkrah commented Dec 11, 2023 via email

@nkrah
Copy link
Collaborator Author

nkrah commented Dec 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants