Skip to content

Commit c641f61

Browse files
committed
Correct wegith computation from correlation metric
1 parent d52bea8 commit c641f61

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Anima/registration/algorithms/animaAnatomicalBlockMatcher.hxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ AnatomicalBlockMatcher<TInputImageType>
9191
return 1;
9292

9393
case Correlation:
94-
return (val > 0) ? val : 0;
94+
{
95+
double weight = (val > 0) ? val : 0;
96+
return (weight + 1) / 2.0;
97+
}
9598

9699
case SquaredCorrelation:
97100
default:

Anima/registration/algorithms/animaDistortionCorrectionBlockMatcher.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ DistortionCorrectionBlockMatcher<TInputImageType>
166166
similarityWeight = 1;
167167

168168
case Correlation:
169-
similarityWeight = (val + 1) / 2.0;
169+
similarityWeight = (val > 0) ? val : 0;
170+
similarityWeight = (similarityWeight + 1) / 2.0;
170171

171172
case SquaredCorrelation:
172173
default:

0 commit comments

Comments
 (0)