Giter Club home page Giter Club logo

bayesian-image-label-correction's Introduction

Bayesian-Image-Label-Correction

Refining labeled images using Bayesian classifier, i.e., adjacent pixels are likely to be of the same class.

The method would be particularly useful in adjusting manual segmented labels and fine tuning machine learning segmented labels.

This repository is inspired ITK Bayesian segmentation and Markov Random Field method. A membership image with pixel values indicates the Gaussian density functions centered around 'n' pixel intensity values of the input image is generated via K-means and predefined number of classes. The behavior is known as Gaussian mixture model of input image. The membership image is then weighted by user defined label image undergoing Gaussian blur.

The new membership image is a vector image with same number of components as the number of labels in the user defined label. Through varying the variance of Gaussian blurring and label weight. The pixel value of the vector image represents membership of the n-th class in the user defined label. Note that the corresponding initialization membership class is automatically chosen to k-mean segmented class with nearest mean value as the label region. The classification is then done by applying maximum decision rule to the weighted membership image.

The output of the filter will give a smoothed label map with pixel values indicating the classes that they belongs to. Currently the method will rearrange the label value if the user defined label values are not consecutive.

Example Usage

2D image

The filter supports PNG, NIFTI and DICOM format. By running the following script in command prompt:

.\BayesianFilter.exe -i <2D-data-folder>/BrainT1Slice.nii.gz -l <2D-data-folder>/BrainT1Slice.nii.gz -o <2D-data-folder>/BrainT1Slice_output.nii.gz -c 3 -v 1 -w 0.5

Note: Currently the output labels range are not rescaled for PNG output. Pixel value in output image will be same as value of label class. You may have diffuclty in visualizing the image with typical image viewers.

3D image

The filter only supports NIFTI image and label input. By running the following script in command prompt:

.\BayesianFilter.exe -i <3D-data-folder>/image.nii.gz -l <3D-data-folder>/label.nii.gz -o <3D-data-folder>output.nii.gz -c 2 -v 0.3 -w 0.5

You can view the output result with itk-SNAP

Compile

Tested with MSVC 2015, the dependencies are also available on Linux and MacOS.

Dependency

  • CMake
  • ITK
  • Boost

Author

Jacky Ko [email protected]

bayesian-image-label-correction's People

Contributors

jackyko1991 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

skn123

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.