Giter Site home page Giter Site logo

imagephantoms.jl's Introduction

ImagePhantoms.jl

https://github.com/JuliaImageRecon/ImagePhantoms.jl

action status pkgeval status codecov license docs-stable docs-dev code-style logo

This Julia language repo provides tools for working with software-defined image phantoms like the Shepp-Logan phantom (both 2D and 3D versions).

For each phantom shape, methods are available for computing samples of its image (using phantom), its Radon transform (2D) or X-ray line integrals (3D), (using radon), and its 2D or 3D Fourier transform (using spectrum).

For explanations and examples see the documentation using the blue "docs" links above.

Getting started

using Pkg
Pkg.add("ImagePhantoms")

Example

using ImagePhantoms
image = shepp_logan(256)

p = shepp_logan(SheppLoganToft())
sinogram = radon(range(-1,1,101), deg2rad.(0:180), p) # 101 × 181

Example

using ImagePhantoms
using MIRTjim: jim
using Plots # @animate, gif
function disk_phantom(title::String)
    (dx,dy) = (1, 1)
    (M,N) = (2^8,2^8)
    x = (-M÷2:M÷2-1) * dx
    y = (-N÷2:N÷2-1) * dy
    params = disk_phantom_params( ; rhead = () -> rand(100:105))
    objects = ellipse(params) # vector of Object2d{Ellipse}
    img = phantom(x, y, objects) # sampled at all (x,y) pairs
    jim(x, y, img; title, clim=(0,1300))
end
anim = @animate for i in 1:8
    disk_phantom("Realization $i")
end
gif(anim, "disk.gif", fps = 8)

animated phantom gif

Philosophy

Often "phantoms" are treated as digital images. Here, the shapes (rectangles, gaussians, ellipses, etc.) are all defined analytically as functions, as are their line integrals and Fourier transforms. Then one can sample those analytical functions to make digital images, sinograms, and spectra.

Parallel MRI (SENSE)

Most of the methods here are of general use for any imaging modality. There are a few methods (mri_smap_basis, mri_smap_fit, mri_spectra) that are specific to simulating parallel MRI (multiple receive coils) based on the 2012 paper by Guerquin-Kern et al.. See the documentation for details.

Documentation

For more examples with graphics, see the documentation.

Currently the package supports the following 2D shapes: ellipses/circles, rectangles/squares, gaussians, triangles, and the following 3D shapes: ellipsoids/spheres, cuboids/cubes, gaussians, cylinders, cones.

Dependents

Related packages

Compatibility

Tested with Julia ≥ 1.7.

imagephantoms.jl's People

Contributors

dependabot[bot] avatar jefffessler avatar tknopp 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.