almarklein / pyelastix

Thin wrapper around elastix - a toolbox for rigid and nonrigid registration of images
MIT License
103 stars 31 forks source link

applying transform to other images #13

Open cabaker7 opened 6 years ago

cabaker7 commented 6 years ago

Sorry if this is not the appropriate forum, but does this wrapper provide methods for calling transformix from within Python? The pyelastix.register function outputs an image and a deformation field but deletes the temporary files used to determine the transformation, so I can't use the same transformation on a separate image set

alfonmedela commented 4 years ago

Did you find a solution to this @cabaker7 ? I am having the same problem and I can't find a straightforward way to solve it

soupault commented 4 years ago

@alfonmedela This is currently not implemented, but I will consider it high-priority in my next iteration with the code. Or... You are always welcome to submit a PR. 🙂

Iamlearn commented 4 years ago

Hello, I have the same problem. Have you solved it?

philippe2toulouse commented 4 years ago

I also have the same problem. Have you been able to implement it? thks :-)

FakerAmine commented 3 years ago

Any solution ? I used pyelastix to register two medical images, i wanna reproduce the same transformation on their respective masks(for segmentation purposes) , i cant find a way to exploit the resulting field to do so.

manuel-lincbiotech commented 3 years ago

Hello, @FakerAmine I think it might be possible to use the field and pass it somehow to another library like SimpleITK to generate a deformation field. However, I'm not sure how to do it, for the time being when I apply the deformation in this way the result is far from the expected, could be related to how the axes are defined. Not sure. Could also be other libraries to work with the numpy array directly, maybe scipy has something to work with this? I was working based on this with SimpleITK in case it is useful: https://github.com/SimpleITK/SimpleITK/issues/1285 If anyone can figure it out please share. I'll do the same.

Thanks

FakerAmine commented 3 years ago

@manuel-lincbiotech Thank you ! I will try doing that !

fabiopk commented 3 years ago

Hello,

@FakerAmine, got any positive results using the SimpleITK route? I am facing the same issue right now.

Thanks

basicskywards commented 3 years ago

Any solution ? I used pyelastix to register two medical images, i wanna reproduce the same transformation on their respective masks(for segmentation purposes) , i cant find a way to exploit the resulting field to do so.

pyelastix is really great for registration. But I solved the same problem as you mentioned using ANTsPy. You can follow this example for more information https://github.com/ANTsX/ANTsPy/blob/master/tutorials/concatenateRegistrations.ipynb