Code Monkey home page Code Monkey logo

recontpcf.jl's Introduction

ReconTPCF

Build Status Build Status Coverage

Statistical Descriptor based image reconstruction of binary images. Allows for a binary image to evolve via simulated annealing into a energy minimised analogue of the original image, sharing its S2 and C2 to a major extent. Uses surface optimisation to assist the closing of shapes (limiting the range of pixels which are operated on). This library provides simple functions to compute the two-point correlation function and two point cluster correlation function in Julia.

S2 and C2 are computed using a gridded approach, not a KD tree or ball tree. While this is detrimental to how the algorithm scales with large datasets, for smaller computations (self comparisons up to 10^5 points) this approach is comparable. This is achieved with fast, multithreaded computation of distance metrics (which may be arbitrary, unlike a KD tree). This software is intended to be simple, available and quick.

Install

ReconTPCF is implemented as a full Julia package. It may be installed directly from the Julia REPL by first opening the package manager with ]. Then call Pkg add https://github.com/JAgho/ReconTPCF.jl and the files will be downloaded into your julia/dev folder. The toolbox contains some example executions in ./test, where the individual files act to load the package with using. These file may simply be run using julia --threads 12 ./julia/dev/ReconTPCF/test/file.jl to use 12 cores. Alternatively, this may be run from VSCode, Atom or the REPL itself.

Use

The test files show how the package may be called with using ReconTPCF, giving access to some of the exposed functions. If internal functions are to be called, either add them to the exports in ReconTPCF.jl, or call them as a method of the package, e.g. as ReconTPCF.foo(). Most functions in this toolbox are designed to work with arrays of CartesianIndices (for a basis of dimensionality N, a tuple of N Float64).

A test file may be run either from a shell by: path/to/.julia/dev/ReconTPCF/src/file.jl Or may be opened in an editor of your choosing and executed at will.

Intended Functionality

Several modes of operation are due to be added to ReconTPCF. These will improve performance, add new ways of calculating correlation statistics, or extend the software to 3D as well as 2D data. Some possible actions are:

  • Add KD tree functionality for larger datasets and profile to determine efficiency cutoff for this approach.
  • Extend the approach to 3D spaces (this should be relatively simple for S2, though for C2 some clustering algorithms must be re-written).
  • Add a framework for ungridded calculations of S2.
  • Add k-means clustering for ungridded calculation of C2.
  • Add work-order scheduling via MPI. This would send proposed pixel swaps to multiple nodes for calculation, then return the cost function of the swap.

Testing and Compatibility

ReconTPCF is tested for VSCode (with the Julia plugin), direct REPL use, and for Juno (within Atom). It has been tested in Jupyter, but it is not determined if it is fully stable.

This package moves a lot of data, and hence task scheduling is central to its activity. This is dominated by Threads.@threads which parallelises instructions. The long nature of calculations can mean a @sync lock by another Julia program can cause the activity to be registered as a hang. Consequently, if real-time elements are included, an @async / @sync block should be provided to prevent execution while an update occurs. This is critical if e.g. ImageView.jl is to be used.

recontpcf.jl's People

Contributors

jagho avatar github-actions[bot] avatar

Watchers

 avatar

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.