ANTsX / ANTs

Advanced Normalization Tools (ANTs)
Apache License 2.0
1.2k stars 381 forks source link

antsSliceRegularizedRegistration not working with -p 0 #1040

Closed jcohenadad closed 4 years ago

jcohenadad commented 4 years ago

Describe the problem When using antsSliceRegularizedRegistration with flag -p 0, the resulting TxTy are always 0.0.

To Reproduce

curl -o datatest.zip -L https://github.com/sct-data/sct_testing_data/releases/download/r20200707232231/sct_testing_data-r20200707232231.zip
unzip datatest.zip
cd sct-data-sct_testing_data-d3e9bad/mt/ 
antsSliceRegularizedRegistration -p 0 --output [test, mt1_reg.nii.gz] --transform Translation[0.1] --metric MI[ mt0.nii.gz , mt1.nii.gz , 1 , 16 , Regular , 0.2 ] --iterations 20 --shrinkFactors 1 --smoothingSigmas 0
cat testTxTy_poly.csv
Results ~~~ Tx,Ty 0,0 0,0 0,0 0,0 0,0 ~~~

Expected result: non-zero Tx,Ty params (which can be obtained with setting -p to non-zero)

System information (please complete the following information)

ANTs version information

Thanks!

cookpa commented 4 years ago

I can't see why this is happening in the code, but I can reproduce the error.

cookpa commented 4 years ago

@jcohenadad would you mind testing #1047 ? I think it's right but I'm not very familiar with this program.

jcohenadad commented 4 years ago

@jcohenadad would you mind testing #1047 ? I think it's right but I'm not very familiar with this program.

sorry for the delay-- testing now

cookpa commented 4 years ago

No problem, thank you. I got it to output non-zero results, I just want to confirm that:

a) The transform makes sense with -p 0 (might be suboptimal of course because there's no smoothing) b) The results with -p 1 or whatever you normally use are consistent with what they used to be

cookpa commented 4 years ago

Just realized I can test b) myself by using dense sampling. The results are identical to the master branch:

$ antsSliceRegularizedRegistration -p 2 --output [test, mt1_reg.nii.gz] --transform Translation[0.1] --metric MI[ mt0.nii.gz , mt1.nii.gz , 1 , 16 ] --iterations 20 --shrinkFactors 1 --smoothingSigmas 0

$ cat testTxTy_poly.csv 
Tx,Ty
-1.09211978608784,0.0894792994714795
-0.960138853385714,0.64427089385577
-0.874718429918505,0.911445742482711
-0.835858515686219,0.891003845352304
-0.843559110688854,0.582945202464548
jcohenadad commented 4 years ago

I've tested 79ab3a065344bf0705cbaa058ecf71d958890309 and confirm that results of p=0 make sense.

I also (re-)confirm that results are consistent with master (or with 2.3.4.dev181-g79ab3, which i am currently at).

thank you so much for the fix @cookpa 🙏