Skip to content

fix(registration): resolve UnboundLocalError in register_micro() (fixes #243) - #252

Open
Lukecele wants to merge 1 commit into
MathOnco:mainfrom
Lukecele:fix/register-micro-unboundlocalerror-issue-243
Open

Lukecele wants to merge 1 commit into
MathOnco:mainfrom
Lukecele:fix/register-micro-unboundlocalerror-issue-243

Conversation

@Lukecele

Copy link
Copy Markdown

Summary

Resolves #243 where passing non_rigid_reg_params when non_rigid_registrar_cls is a class object results in:
UnboundLocalError: local variable 'non_rigid_registrar_obj' referenced before assignment

Cause

In valis/registration.py (line 4895), when instantiating non_rigid_registrar_cls with custom parameters:

nr = non_rigid_registrar_obj(**non_rigid_reg_params)

the unassigned variable non_rigid_registrar_obj was referenced and assigned to unused nr, leaving non_rigid_registrar_obj undefined.

Fix

Instantiate non_rigid_registrar_cls and assign to non_rigid_registrar_obj:

non_rigid_registrar_obj = non_rigid_registrar_cls(**non_rigid_reg_params)

This matches the correct implementation in valis/serial_non_rigid.py (line 998).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UnboundLocalError in register_micro()

1 participant