@@ -171,7 +171,7 @@ ESMDemonsRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>::Co
171
171
const FloatOffsetType & itkNotUsed (offset)) -> PixelType
172
172
{
173
173
auto * globalData = (GlobalDataStruct *)gd;
174
- PixelType update;
174
+ PixelType update{} ;
175
175
IndexType FirstIndex = this ->GetFixedImage ()->GetLargestPossibleRegion ().GetIndex ();
176
176
IndexType LastIndex = this ->GetFixedImage ()->GetLargestPossibleRegion ().GetIndex () +
177
177
this ->GetFixedImage ()->GetLargestPossibleRegion ().GetSize ();
@@ -190,7 +190,6 @@ ESMDemonsRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>::Co
190
190
191
191
if (movingPixValue == NumericTraits<MovingPixelType>::max ())
192
192
{
193
- update.Fill (0.0 );
194
193
return update;
195
194
}
196
195
@@ -324,7 +323,7 @@ ESMDemonsRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>::Co
324
323
}
325
324
else if (this ->m_UseGradientType == GradientEnum::MappedMoving)
326
325
{
327
- PointType mappedPoint;
326
+ PointType mappedPoint{} ;
328
327
this ->GetFixedImage ()->TransformIndexToPhysicalPoint (index , mappedPoint);
329
328
for (unsigned int j = 0 ; j < ImageDimension; ++j)
330
329
{
@@ -352,11 +351,7 @@ ESMDemonsRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>::Co
352
351
const double usedGradientTimes2SquaredMagnitude = usedGradientTimes2.GetSquaredNorm ();
353
352
354
353
const double speedValue = fixedValue - movingValue;
355
- if (itk::Math::abs (speedValue) < m_IntensityDifferenceThreshold)
356
- {
357
- update.Fill (0.0 );
358
- }
359
- else
354
+ if (itk::Math::abs (speedValue) >= m_IntensityDifferenceThreshold)
360
355
{
361
356
double denom;
362
357
if (m_Normalizer > 0.0 )
@@ -370,11 +365,7 @@ ESMDemonsRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>::Co
370
365
denom = usedGradientTimes2SquaredMagnitude;
371
366
}
372
367
373
- if (denom < m_DenominatorThreshold)
374
- {
375
- update.Fill (0.0 );
376
- }
377
- else
368
+ if (denom >= m_DenominatorThreshold)
378
369
{
379
370
const double factor = 2.0 * speedValue / denom;
380
371
0 commit comments