Skip to content

ParzenWindowHistogramImageToImageMetric: replace m_JointPDFWindow with m_JointPDFWindowSize#1450

Merged
N-Dekker merged 3 commits into
mainfrom
ParzenWindowHistogram-metric-replace-JointPDFWindow
Jun 5, 2026
Merged

ParzenWindowHistogramImageToImageMetric: replace m_JointPDFWindow with m_JointPDFWindowSize#1450
N-Dekker merged 3 commits into
mainfrom
ParzenWindowHistogram-metric-replace-JointPDFWindow

Conversation

@N-Dekker

@N-Dekker N-Dekker commented Jun 4, 2026

Copy link
Copy Markdown
Member

No description provided.

N-Dekker added 3 commits June 4, 2026 17:32
Replaced the protected mutable data member m_JointPDFWindow with the private non-mutable data member m_JointPDFWindowSize, in ParzenWindowHistogramImageToImageMetric. Added GetJointPDFWindowSize().

It appears unnecessary for the ParzenWindowHistogram metric to store the Index of the JointPDFWindow. Only its Size matters.

It also appear unnecessary to declare the data member mutable, as was already observed by Marius Staring, commit 2fc2c49, 14-11-2013, "ENH: HUGE merge of the performance branch", by adding the comment, "no need for mutable anymore?".
Simplified use of `ParzenWindowHistogramImageToImageMetric::m_JointPDFWindowSize`.
Used aggregate initialization for local JointPDFIndexType variables in ParzenWindowHistogramImageToImageMetric member functions.
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFRight{ nullptr };
IncrementalMarginalPDFPointer m_FixedIncrementalMarginalPDFLeft{ nullptr };
IncrementalMarginalPDFPointer m_MovingIncrementalMarginalPDFLeft{ nullptr };
mutable JointPDFRegionType m_JointPDFWindow{}; // no need for mutable anymore?

@N-Dekker N-Dekker Jun 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mstaring FYI, I think this pull request is just a logical follow-up to your commit 2fc2c49 from 2013 ("ENH: HUGE merge of the performance branch"). Your 2013 commit made the Index component of m_JointPDFWindow unused, so from then, it was only its Size that mattered. (And indeed, no need for mutable anymore.)

I also noticed that its Size is always equal to { m_MovingKernelBSplineOrder + 1, m_FixedKernelBSplineOrder + 1 }, so it is still a bit redundant, having a data member whose value is based on two other data members 🤷

@N-Dekker N-Dekker merged commit 2aafd7b into main Jun 5, 2026
8 checks passed
@N-Dekker N-Dekker deleted the ParzenWindowHistogram-metric-replace-JointPDFWindow branch June 5, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant