Skip to content

Registration: Fix local cross-correlation metric#3211

Open
Lestropie wants to merge 1 commit intomasterfrom
lcc_fix
Open

Registration: Fix local cross-correlation metric#3211
Lestropie wants to merge 1 commit intomasterfrom
lcc_fix

Conversation

@Lestropie
Copy link
Copy Markdown
Member

No idea if this is even accessible from the command-line, but worth fixing nevertheless in case anyone out there is trying to do anything with it.

@Lestropie Lestropie requested a review from a team October 8, 2025 12:21
@Lestropie Lestropie self-assigned this Oct 8, 2025
@Lestropie Lestropie added the bug label Oct 8, 2025
@Lestropie
Copy link
Copy Markdown
Member Author

I discovered a second potential minor issue with the LCC code.

Here:

vector<uint32_t> NoOversample;

This empty class instance is named with the intention of resulting in no oversampling during reslicing. It is passed to the Adapter::Reslice<> constructor:

else if (parameters.im1_mask.valid() and parameters.im2_mask.valid()){
  Adapter::Reslice<Interp::Nearest, Im1MaskType> mask_reslicer1 (parameters.im1_mask, cc_mask_header, parameters.transformation.get_transform_half(), NoOversample);
  Adapter::Reslice<Interp::Nearest, Im2MaskType> mask_reslicer2 (parameters.im2_mask, cc_mask_header, parameters.transformation.get_transform_half_inverse(), NoOversample);

That class however defines:

extern const vector<uint32_t> AutoOverSample;

as an equivalent empty class instance. So I believe in the LCC code the masks are being automatically oversampled despite the variable naming indicating an intent to the contrary.

The subsequent code however looks like it's entirely compatible with oversampling of mask images resulting in continuous values:

auto both = [](decltype(cc_mask)& cc_mask, decltype(mask_reslicer1)& m1, decltype(mask_reslicer2)& m2) {
  cc_mask.value() = ((m1.value() + m2.value()) / 2.0) > 0.5 ? true : false;
};

So I think just remove that NoOversample variable and leave the behaviour as the default AutoOverSample?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant