Markov Random Field

I am trying to run the code here: https://itk.org/Doxygen/html/Examples_2Statistics_2ScalarImageMarkovRandomField1_8cxx-example.html

The executable requires two files: BrainT1Slice.png and BrainT1Slice_labelled.png

The BrainT1Slice.png file is in the Examples/Data directory from the ITK root, but the labelled image is not. Is there a place that I need to download this file? I might have missed it, but I read the README files.

It dawns on me that the filename is just an example, but I was thinking that there might be good data with a labelled image that I can start an MRF project.

Hi @melrobin,

A reference to the file used in the example test can be found in the correponding CMakeLists.txt, which points to BrainT1Slice_AfterKMeansClassification.png .

More information on how testing data is handled in ITK can be found here

1 Like

Thank you very much Matt. Can you view the image? I am having some problems with it. It does not display properly when clicking the link in Windows. Here is what I get from Linux with OpenCV:
[melrobin@scorpion ITK]$ python3
Python 3.7.5 (default, Oct 17 2019, 12:16:48)
[GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import cv2
X=cv2.imread(‘build/ExternalData/Testing/Data/Input/Statistics/BrainT1Slice_AfterKMeansClassification.png’)
libpng warning: sCAL: invalid unit

Nevermind. I was able to read this file in Octave.

This still may be a problem if external programs cannot open the file though. I’m thinking of some subsequent processing of output.

Never mind again…the problem is related to GLX rendering on my machine.