Giter Club home page Giter Club logo

drr.jl's Introduction

DRR.jl

Summary

Digitally reconstructed radiographs (DRR) are simulated projectional radiographs generated from volumetric CT imaging data. This package provides parallelized, GPU-accelerated, and differentiable DRR generators in Julia.

Examples

Read the CT volume data and define the camera/detector geometry:

# Read the DICOM file
volume, ΔX, ΔY, ΔZ = read_dicom("../data/cxr"; pad=true)
grid = volume2grid(volume, ΔX, ΔY, ΔZ)  # The bottom-left corner of the CT is placed at (0,0,0)

# Define the camera
center = Vec3(180., 180., -100)
camera = Camera(center)

# Define the detector plane
center = Vec3(180., 180., 500.)
normal = Vec3(0., 0., -1.)
height, width = 601, 601
Δx, Δy = 2., 2.
detector = Detector(center, normal, height, width, Δx, Δy)

To generate a DRR using this setup, run

julia> spacing = 0.5

julia> drr = make_drr(grid, volume, camera, detector, spacing)

julia> heatmap(drr, c=:grays)

which generates the following projection:

Screen Shot 2022-05-09 at 3 04 09 PM

drr.jl's People

Contributors

eigenvivek avatar rliu34 avatar

Watchers

 avatar

drr.jl's Issues

Potential method for GPU acceleration

For each ray, turn the individual trilinear matrices into a big block diagonal and do it in one go on the GPU

A single trilinear matrix is only 8x8 so it's inefficient to do individually on the GPU

Replace GridInterpolations dependency

Just need a dictionary of spacings

volume, ΔX, ΔY, ΔZ = read_dicom("data/cxr"; pad=true)
nx, ny, nz = size(volume)
spacing = Dict(
    "xs" => 0:ΔX:(nx-1)*ΔX,
    "ys" => 0:ΔY:(ny-1)*ΔY,
    "zs" => 0:ΔZ:(nz-1)*ΔZ,
)

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.