GithubHelp home page GithubHelp logo

opencl-level-set-segmentation's Introduction

OpenCL Level Set Segmentation

Segmented brain from synthetic MR images using the level set method

This is an implementation of level set image segmentation using OpenCL. The speed function is defined as -alpha*(epsilon-|T-intensity|)+(1-alpha)*curvature.

See http://www.eriksmistad.no/level-set-segmentation-on-gpus-using-opencl/ for more information on level sets and this implementation.

See LICENSE file for license information.

Dependencies

  • OpenCL (You need an OpenCL implementation installed (AMD, NVIDIA, Intel, Apple...)
  • Submodules SIPL and OpenCLUtilities (no need to install separately, however remember to initialize them "git submodule update" if you are cloning this repo)
  • GTK2, which SIPL use for displaying the results (sudo apt-get install libgtk2.0-dev)

Compiling

Use CMake and the provided CMakeLists.txt file to compile this program. To compile on the run the example on Ubuntu, do the following:

cmake .
make
./levelSetSeg example_data/mr_brain.mhd result.mhd 100 100 100 10 2000 125 40 0.05 125 255

Usage

The arguments for the program are: ./levelSetSeg inputFile.mhd outputFile.mhd seedX seedY seedZ seedRadius iterations threshold epsilon alpha [level window]

inputFile.mhd is the metadata file of the volume you want to process and outputFile.mhd the path to where the result should be stored. seedX, seedY, seedZ defines a spherical seed point with a radius seedRadius. Iterations is the total number of iterations and threshold, epsilon, alpha are parameters for the speed function -alpha*(epsilon-|T-intensity|)+(1-alpha)*curvature. If the level and window arguments are set, the segmentation result will be displayed as an overlay to the input volume.

Run with provided example data: ./levelSetSeg example_data/mr_brain.mhd result.mhd 100 100 100 10 2000 125 40 0.05 125 255

opencl-level-set-segmentation's People

Contributors

smistad avatar

Stargazers

 avatar Elon avatar JingKai Yu avatar  avatar Wil Braithwaite avatar EinCB avatar  avatar Thomas Lang avatar 庄庭达 avatar AndreyVK_D3D avatar Sandeep Ganji avatar Andrei V. Konstantinov avatar  avatar Hüseyin Tuğrul BÜYÜKIŞIK avatar Petteri Teikari avatar Luca Antiga avatar Jake Bolewski avatar sdf0615 avatar

Watchers

 avatar James Cloos avatar sdf0615 avatar  avatar

opencl-level-set-segmentation's Issues

Error error: no matching function for call to 'read_imagef'

Hi
Compilation under UBUNTU 16.04 went fine.
Getting this when trying example !!!

racminer@mine:~/OpenCL-Level-Set-Segmentation$ ./levelSetSeg example_data/mr_brain.mhd result.mhd 100 100 100 10 2000 125 40 0.05 125 255
Using platform vendor: Mesa
Using device: AMD Radeon (TM) RX 480 Graphics (POLARIS10 / DRM 3.23.0 / 4.15.0-36-generic, LLVM 6.0.0)
Build log:
input.cl:27:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:27:69: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:28:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:28:69: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:29:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:29:69: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:32:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:32:49: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:33:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:33:49: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:34:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:34:49: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:37:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:37:63: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:38:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:38:63: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:39:13: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:39:63: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:57:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:57:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:58:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:58:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:62:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:62:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:63:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:63:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:66:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:66:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:68:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:68:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:71:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:71:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:73:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:73:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:76:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:76:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:77:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:77:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:81:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:81:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:82:19: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:82:71: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:101:50: error: no matching function for call to 'read_imagef'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:118:34: error: no matching function for call to 'read_imagef'
input.cl:7:70: note: expanded from macro 'WRITE_RESULT'
/usr/include/clc/image/image.h:26:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
/usr/include/clc/image/image.h:28:1: note: candidate function not viable: no known conversion from '__read_only image3d_t' to '__read_only image2d_t' for 1st argument
input.cl:130:18: error: passing '__write_only image3d_t' to parameter of incompatible type '__read_only image2d_t'
input.cl:7:56: note: expanded from macro 'WRITE_RESULT'
/usr/include/clc/image/image.h:19:24: note: passing argument to parameter 'image' here
input.cl:132:1: warning: null character ignored

terminate called after throwing an instance of 'cl::Error'
what(): clBuildProgram
Abandon (core dumped)

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.