# Gibbs Prior Filter for Image Classification Smoothing

**URL:** <https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147>\
**Category:** Algorithms\
**Created:** [August 12, 2019, 5:43pm UTC](https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147 "2019-08-12T17:43:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Courtney\_Ambrozic](https://discourse.itk.org/user_avatar/discourse.itk.org/courtney_ambrozic/32/651_2.png) [@Courtney\_Ambrozic](https://discourse.itk.org/u/Courtney_Ambrozic)\
**Post date:** [August 12, 2019, 5:43pm UTC](https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147/1 "2019-08-12T17:43:20Z")

</div>

Hello ITK community,

I have a question about the RGBGibbsPriorFilter. Mainly, I’m having trouble understanding the underlying algorithm for this filter. Is this filter based off of the paper “Gibbs Prior Models, Marching Cubes, and Deformable Models: A Hybrid Framework for 3D Medical Image Segmentation” by Ting Chen and Dimitris Metataxas?

I’m interested in using this filter for post-processing smoothing of my classification image, but I can’t seem to rework the configuration to use my classification image instead of one produced by a classification method within the filter. I’d appreciate any help!

Thank you,  
Courtney

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [August 13, 2019, 4:03pm UTC](https://discourse.itk.org/t/gibbs-prior-filter-for-image-classification-smoothing/2147/2 "2019-08-13T16:03:50Z")

</div>

I guess that [line 486](https://github.com/InsightSoftwareConsortium/ITK/blob/4132cb4a5cc948d32cdbd9c5ec9989a7880fef17/Modules/Segmentation/MarkovRandomFieldsClassifiers/include/itkRGBGibbsPriorFilter.hxx#L486) needs to be replaced by something like `if (!m_LabelledImage) SetLabelledImage( m_ClassifierPtr->GetClassifiedImage() );`

This filter exposes a few other parameters which it does not properly respect. If you end up improving this filter, it would be good if you [submitted a PR](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md).
