ANTsX / ANTsR

R interface to the ANTs biomedical image processing library
https://antsx.github.io/ANTsR
Apache License 2.0
127 stars 35 forks source link

Add Pad to abpBrainExtraction #257

Closed muschellij2 closed 5 years ago

muschellij2 commented 5 years ago

I've added the pad argument to abpBrainExtraction to allow for zero-padding (and inverting that). I think this is a good idea as I've found the "brain" goes to the edge of the image if the data doesn't have a lot of empty space but is right against the edge of the image.

This allows the user to specify the level of padding, but it will cause problems if used with the warps without additional workups.

Example data: http://johnmuschelli.com/open_ms_data/cross_sectional/raw/patient01/T1W.nii.gz

Thoughts?

cookpa commented 5 years ago

In ANTs, the padding is done after registration, so it doesn't affect the warps. Do you find padding the moving image helps with alignment? It might, but I've usually found it sufficient to pad the template.

dorianps commented 5 years ago

I am thinking that if a brain is clipped and part of it is outside the FOV, if you add padding it may need to be properly masked during the registration. A padded image without a mask of the original FOV may force the deformation of the clipped brain to match the contour of the template.

Don't remember how registration is done in this script, but just adding a thought before merging.