MarkovRandomFieldsClassifiers: Replace buffered region iteration in MRFImageFilter, remove iterator from RGBGibbsPriorFilter#5977
Merged
dzenanz merged 2 commits intoInsightSoftwareConsortium:mainfrom Mar 24, 2026
Conversation
Replaced a buffered region iteration with the equivalent (but more efficient) `FillBuffer` call, in `MRFImageFilter::Allocate()`. Follow-up to pull request InsightSoftwareConsortium#5970 "Replace buffered region iteration with FillBuffer in FastMarching filters"
This particular member function never used its local `labelledImageIt` variable.
fbc8b32 to
e0ccde0
Compare
dzenanz
approved these changes
Mar 23, 2026
Contributor
Greptile SummaryThis PR makes two small, clean cleanups to the
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["MRFImageFilter::Allocate()"] --> B["m_LabelStatusImage->Allocate()"]
B --> C["m_LabelStatusImage->FillBuffer(1)\n✅ replaces manual iterator loop"]
D["RGBGibbsPriorFilter::GibbsEnergy(i, k, k1)"] --> E["Compute offsetIndex3D from i"]
E --> F["Access m_LabelledImage via GetPixel()"]
F --> G["❌ labelledImageIt was constructed here\nbut never used — now removed"]
F --> H["Return computed Gibbs energy"]
Reviews (1): Last reviewed commit: "STYLE: Remove `labelledImageIt` from `RG..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FillBuffer(1)call inMRFImageFilter::Allocate()labelledImageItfromRGBGibbsPriorFilter::GibbsEnergy