ANTsPy icon indicating copy to clipboard operation
ANTsPy copied to clipboard

Low Spect 3D registration

Open Dauriel opened this issue 3 years ago • 5 comments

Dear devs,

I am trying to align two 3D images using ANTsPy in a low spec machine. By just running the default code:

fi = ants.image_read(file1) mi = ants.image_read(file2) mytx = ants.registration(fixed=fi, moving=mi, type_of_transform = 'SyN' )

my RAM is not sufficient and it crashes. I have tried downsampling both 3D images but the quality of the registration seems to decreased substantially. Both images have different shapes.

Is there an alternative? Time is not a constraint for me, I don't mind if it takes quite some time to run.

Thank!

Dauriel avatar Mar 04 '22 12:03 Dauriel

Running "SyN" is going to be difficult for low RAM due to the memory requirements to run it. Are you able to do something simpler like "FastAffine"?

ntustison avatar Mar 04 '22 15:03 ntustison

No luck with a FastAffine either, it also crashes (tried running it on Colab with 25gb RAM and it also crashes)

Dauriel avatar Mar 07 '22 09:03 Dauriel

Can you post the images?

ntustison avatar Mar 07 '22 15:03 ntustison

I cannot post the images, but these are their shapes and info:

ANTsImage (RAI)
 	 Pixel Type : float (float32)
 	 Components : 1
 	 Dimensions : (766, 1156, 352)
 	 Spacing    : (0.8303, 0.8303, 1.0)
 	 Origin     : (0.0, 0.0, 0.0)
 	 Direction  : [1. 0. 0. 0. 1. 0. 0. 0. 1.]
ANTsImage (RAI)
 	 Pixel Type : float (float32)
 	 Components : 1
 	 Dimensions : (1024, 1946, 363)
 	 Spacing    : (0.4151, 0.4151, 1.0)
 	 Origin     : (0.0, 0.0, 0.0)
 	 Direction  : [1. 0. 0. 0. 1. 0. 0. 0. 1.]

Dauriel avatar Mar 08 '22 12:03 Dauriel

Yeah, those are pretty big images. Outside of downsampling, there's not much you can do with low memory constraints.

ntustison avatar Mar 08 '22 14:03 ntustison