diff --git a/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.h b/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.h index a06d56fab..eaf228884 100644 --- a/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.h +++ b/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.h @@ -405,10 +405,6 @@ class ITK_TEMPLATE_EXPORT ParzenWindowHistogramImageToImageMetric static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ComputePDFsThreaderCallback(void * arg); - /** Helper function to launch the threads. */ - void - LaunchComputePDFsThreaderCallback() const; - /** Update the joint PDF with a pixel pair; on demand also updates the * pdf derivatives (if the Jacobian pointers are nonzero). */ @@ -450,10 +446,6 @@ class ITK_TEMPLATE_EXPORT ParzenWindowHistogramImageToImageMetric const DerivativeType & imageJacobian, const NonZeroJacobianIndicesType & nzji) const; - /** Multiply the pdf derivatives entries by the given normalization factor. */ - void - NormalizeJointPDFDerivatives(JointPDFDerivativesType * pdf, const double factor) const; - /** Compute PDFs; Loops over the fixed image samples and constructs * the m_JointPDF and m_Alpha * The JointPDF and Alpha are related as follows: diff --git a/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.hxx b/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.hxx index aa8f2bdb5..bae6f10df 100644 --- a/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.hxx +++ b/Common/CostFunctions/itkParzenWindowHistogramImageToImageMetric.hxx @@ -630,32 +630,6 @@ ParzenWindowHistogramImageToImageMetric::NormalizeJoi } // end NormalizeJointPDF() -/** - * *********************** NormalizeJointPDFDerivatives *********************** - */ - -template -void -ParzenWindowHistogramImageToImageMetric::NormalizeJointPDFDerivatives( - JointPDFDerivativesType * pdf, - const double factor) const -{ - using JointPDFDerivativesIteratorType = ImageScanlineIterator; - JointPDFDerivativesIteratorType it(pdf, pdf->GetBufferedRegion()); - const PDFValueType castfac = static_cast(factor); - while (!it.IsAtEnd()) - { - while (!it.IsAtEndOfLine()) - { - it.Value() *= castfac; - ++it; - } - it.NextLine(); - } - -} // end NormalizeJointPDFDerivatives() - - /** * ************************ ComputeMarginalPDF *********************** */ @@ -1022,8 +996,10 @@ ParzenWindowHistogramImageToImageMetric::ComputePDFs( */ this->BeforeThreadedGetValueAndDerivative(parameters); - /** Launch multi-threading JointPDF computation. */ - this->LaunchComputePDFsThreaderCallback(); + // Set up threader and launch multi-threaded JointPDF computation: + this->m_Threader->SetSingleMethodAndExecute( + this->ComputePDFsThreaderCallback, + const_cast(static_cast(&this->m_ParzenWindowHistogramThreaderParameters))); /** Gather the results from all threads. */ this->AfterThreadedComputePDFs(); @@ -1193,22 +1169,6 @@ ParzenWindowHistogramImageToImageMetric::ComputePDFsT } // end ComputePDFsThreaderCallback() -/** - * *********************** LaunchComputePDFsThreaderCallback*************** - */ - -template -void -ParzenWindowHistogramImageToImageMetric::LaunchComputePDFsThreaderCallback() const -{ - /** Setup threader and launch. */ - this->m_Threader->SetSingleMethodAndExecute( - this->ComputePDFsThreaderCallback, - const_cast(static_cast(&this->m_ParzenWindowHistogramThreaderParameters))); - -} // end LaunchComputePDFsThreaderCallback() - - /** * ************************ ComputePDFsAndPDFDerivatives ******************* */