Skip to content

Commit 9582916

Browse files
thewtexkwrobot
authored andcommitted
Merge topic 'mi-valid-points-check2'
8b1fb4c PERF: Only throw exception if zero valid points
2 parents a4d9ab2 + 8b1fb4c commit 9582916

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Modules/Registration/Metricsv4/include/itkMattesMutualInformationImageToImageMetricv4.hxx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,10 @@ MattesMutualInformationImageToImageMetricv4<TFixedImage, TMovingImage, TVirtualI
226226
}
227227
}
228228

229-
const SizeValueType numberOfPoints = this->GetNumberOfDomainPoints();
230-
231-
if( this->GetNumberOfValidPoints() < numberOfPoints / 16 )
229+
if( this->GetNumberOfValidPoints() == 0 )
232230
{
233-
itkExceptionMacro("Too many samples map outside moving image buffer. There are only "
234-
<< this->m_NumberOfValidPoints << " valid points out of "
235-
<< numberOfPoints << " total points. The images do not sufficiently "
231+
itkExceptionMacro("All samples map outside moving image buffer. "
232+
"The images do not sufficiently "
236233
"overlap. They need to be initialized to have more overlap before this "
237234
"metric will work. For instance, you can align the image centers by translation."
238235
<< std::endl);

0 commit comments

Comments
 (0)