Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,32 +630,6 @@ ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>::NormalizeJoi
} // end NormalizeJointPDF()


/**
* *********************** NormalizeJointPDFDerivatives ***********************
*/

template <typename TFixedImage, typename TMovingImage>
void
ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>::NormalizeJointPDFDerivatives(
JointPDFDerivativesType * pdf,
const double factor) const
{
using JointPDFDerivativesIteratorType = ImageScanlineIterator<JointPDFDerivativesType>;
JointPDFDerivativesIteratorType it(pdf, pdf->GetBufferedRegion());
const PDFValueType castfac = static_cast<PDFValueType>(factor);
while (!it.IsAtEnd())
{
while (!it.IsAtEndOfLine())
{
it.Value() *= castfac;
++it;
}
it.NextLine();
}

} // end NormalizeJointPDFDerivatives()


/**
* ************************ ComputeMarginalPDF ***********************
*/
Expand Down Expand Up @@ -1022,8 +996,10 @@ ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>::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<void *>(static_cast<const void *>(&this->m_ParzenWindowHistogramThreaderParameters)));

/** Gather the results from all threads. */
this->AfterThreadedComputePDFs();
Expand Down Expand Up @@ -1193,22 +1169,6 @@ ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>::ComputePDFsT
} // end ComputePDFsThreaderCallback()


/**
* *********************** LaunchComputePDFsThreaderCallback***************
*/

template <typename TFixedImage, typename TMovingImage>
void
ParzenWindowHistogramImageToImageMetric<TFixedImage, TMovingImage>::LaunchComputePDFsThreaderCallback() const
{
/** Setup threader and launch. */
this->m_Threader->SetSingleMethodAndExecute(
this->ComputePDFsThreaderCallback,
const_cast<void *>(static_cast<const void *>(&this->m_ParzenWindowHistogramThreaderParameters)));

} // end LaunchComputePDFsThreaderCallback()


/**
* ************************ ComputePDFsAndPDFDerivatives *******************
*/
Expand Down
Loading