# MRFImageFilter vector image input

**URL:** <https://discourse.itk.org/t/mrfimagefilter-vector-image-input/1764>\
**Category:** Algorithms\
**Created:** [April 9, 2019, 3:24pm UTC](https://discourse.itk.org/t/mrfimagefilter-vector-image-input/1764 "2019-04-09T15:24:01Z")\
**Posts on this page:** 1\
**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:** [April 9, 2019, 3:24pm UTC](https://discourse.itk.org/t/mrfimagefilter-vector-image-input/1764/1 "2019-04-09T15:24:01Z")

</div>

Hello,

I have a few questions about the inputs to the `MRFImageFilter`. I understand that the filter takes both the original image and a labeled image. I am, however, confused about how to input both of these images into the filter. Since the Markov Random Field algorithm is defined for vector type images, are we to use `composeImageFilter` to combine the original image and the labeled image and then input this resultant vector image into the MRF filter? I provided what I imagine this combination step to look like:

```
filter->SetInput( 0, image0 );
filter->SetInput( 1, image1 );
filter->Update();
itk::VectorImage<PixelType, dimension>::Pointer = filter->GetOutput();

```

I followed the example within Examples/Statistics/ScalarImageMarkovRandomField1.cxx, but could not find where this image combination step occurs. It seems to me that the only input into the `ScalarToArrayFilterType` is the unlabeled image. Any guidance is much appreciated.

Thank you!
