LNCC output will be out of the range [0,1] when the images have large area with zero value.
Steps to reproduce:
- Generate Data:
params = pars.ParameterDict()
params['square_example_images']['len_s'] = 10
params['square_example_images']['len_l'] = 30
I0,I1,spacing = EG.CreateSquares(dim=3, add_noise_to_bg=False).create_image_pair(np.array([64, 64, 64]),params=params)
- Register with LNCC similarity.
params['model']['registration_model']['type'] = "svf_vector_momentum_map"
params['model']['registration_model']['similarity_measure']['type'] = "lncc"
opt = MO.SimpleSingleScaleRegistration(I0,
I1,
spacing,
sz,
params,
compute_inverse_map=False)
opt.register()
The log shows as follows:
0-Tot: E=099.4140 | simE=099.4140 | regE=000.0000 | optParE=000.0000 | relF= n/a |
0-Img: E=099.4140 | simE=099.4140 | regE=000.0000 |