Commit 496af7eb authored by Jamie Mcclelland's avatar Jamie Mcclelland

calls to GetSimilarityMeasureGradient now only call GetSimilarityMeasureValue...

calls to GetSimilarityMeasureGradient now only call GetSimilarityMeasureValue if NMI is the similarity measure
parent 011fbd03
......@@ -1089,7 +1089,6 @@ void reg_f3d<T>::GetObjectiveFunctionGradient()
(this->measure_nmi!=NULL || this->measure_multichannel_nmi!=NULL) )
{
this->WarpFloatingImage(this->interpolation);
this->ComputeSimilarityMeasure();
this->GetSimilarityMeasureGradient();
}
else
......
......@@ -1084,7 +1084,6 @@ void reg_f3d_sym<T>::GetObjectiveFunctionGradient()
(this->measure_nmi!=NULL || this->measure_multichannel_nmi!=NULL))
{
this->WarpFloatingImage(this->interpolation);
this->ComputeSimilarityMeasure();
this->GetSimilarityMeasureGradient();
}
else
......
......@@ -766,6 +766,10 @@ void reg_nmi::GetVoxelBasedSimilarityMeasureGradient()
fprintf(stderr, "[NiftyReg ERROR] Input images are exepected to be of the same type\n");
reg_exit(1);
}
//call compute similarity measure to calculate joint histogram
this->GetSimilarityMeasureValue();
// Compute the gradient of the nmi for the forward transformation
if(this->referenceImagePointer->nz>1) // 3D input images
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment