Implementation of the Radon and Inverse Radon Transforms in Rust

Overview

Radon Transform

A rust and python implementation of the discretized version of the radon transform that I did out of boredom. The main mathematical transformation is written in Rust. The Rust functions are then wrapped up as Python functions using PyO3, which is later used along with other libs like numpy and PIL.

Building the project

To the run the script, you will first have to build the project. You can build this rust project using cargo:

cargo build --release

After building this, navigate to target/release, where you will find the extension randon_lib.dll (if you are on windows) or radon_lib.so (on OSX). Copy this file into the python folder and rename the extension to radon_lib.pyd

Running the project

To call the underlying rust functions, import the radon_lib.pyd that you created earlier in your python file, radon_trial.py for example.

import radon_lib

You must make sure that radon_lib.pyd is present in the same directory as randon_trial.py.

Once this step is done, you can load the image of choice and visualize the Radon and Inverse Radon Transform.

python3 radon_trial.py

Why is there a struct named "Tissue" in the Rust implementation?

Radon Transform is the heart of the Computed Tomography (CT Scan), which is used for non-invasive diagnosis. The CT Scan is capable of reconstructing the 3-D tissue (along with their attenuation coefficient, meaning how dense is the tissue) by taking multiple 2-D X-Ray slices and stiching them up. The 3-D reconstruction of the original tissue is done by a process called "backprojection" aka the Inverse Radon Transform. I found this interesting and thought I would try it, therefore calling the image struct as "Tissue". Feel free to change that name if you want to use this code for some reason.

You might also like...
Automatically generates Rust FFI bindings to C (and some C++) libraries.

bindgen bindgen automatically generates Rust FFI bindings to C (and some C++) libraries. For example, given the C header doggo.h: typedef struct Doggo

Safe interop between Rust and C++

CXX — safe FFI between Rust and C++ This library provides a safe mechanism for calling C++ code from Rust and Rust code from C++, not subject to the m

Bridge the gap between Haskell and Rust

Curryrs Curryrs (a play on the name of Haskell Curry, rs for Rust libraries, and it's pronunciation couriers) is a library for providing easy to use b

Rust bindings for writing safe and fast native Node.js modules.
Rust bindings for writing safe and fast native Node.js modules.

Rust bindings for writing safe and fast native Node.js modules. Getting started Once you have the platform dependencies installed, getting started is

Objective-C Runtime bindings and wrapper for Rust.

Objective-C Runtime bindings and wrapper for Rust. Documentation: http://ssheldon.github.io/rust-objc/objc/ Crate: https://crates.io/crates/objc Messa

“The Tie Between Ruby and Rust.”

Rutie Rutie — /ro͞oˈˌtī/rOOˈˌtI/rüˈˌtaI/ Integrate Ruby with your Rust application. Or integrate Rust with your Ruby application. This project allows

A minimalist and safe ECS library for rust!
A minimalist and safe ECS library for rust!

The full ECS (Entity-Component-System) library. Support an Open Source Developer! ♥️ Composed of two smaller libraries: world_dispatcher: the System p

A notebook app integrated with todo lists utility. Developed with Rust, WebAssembly, Yew and Trunk.

Flow.er A notebook app integrated with todo-list utility. Project flow.er is a Rust WASM app running in browser. Taking advantage of Yew and Trunk, it

A JavaScript Runtime built with Mozilla's SpiderMonkey Engine and Rust

Spiderfire Spiderfire is a javascript runtime built with Mozilla's SpiderMonkey engine and Rust. Spiderfire aims to disrupt the server-side javascript

Owner
Atman Kar
Electronics and Communications undergrad student
Atman Kar
Rust implementation of the Mina protocol, targeting Wasm and ARM architectures.

Mina-rs An implementation of Mina protocol in Rust, with focus on web and Wasm compatibility ** As you can probably tell this is a WIP! Don't use for

ChainSafe 157 Dec 12, 2022
WebAssembly implementation from scratch in Safe Rust with zero dependencies

wain wain is a WebAssembly INterpreter written in Rust from scratch with zero dependencies. An implementation of WebAssembly. Features: No unsafe code

Linda_pp 328 Jan 2, 2023
Pure Rust Lua implementation

purua Pure Rust Lua implementation Usage $ bat lua_examples/defun.lua ───────┬────────────────────────────────────────── │ File: lua_examples/d

Kondo Uchio 35 Dec 28, 2021
Implementation of Monte Carlo PI approximation algorithm in Rust Python bindings

rusty_pi Implementation of Monte Carlo PI approximation algorithm in Rust Python bindings. Time of 100M iterations approximation on Core i7 10th gen:

Aleksey Popov 1 Jul 6, 2022
Arrowdantic is a small Python library backed by a mature Rust implementation of Apache Arrow

Welcome to arrowdantic Arrowdantic is a small Python library backed by a mature Rust implementation of Apache Arrow that can interoperate with Parquet

Jorge Leitao 52 Dec 21, 2022
A faster experimental wasm-based tar implementation for browsers.

@bytedance/tar-wasm A faster* experimental wasm-based tar implementation for browsers. *50-160x faster, see benchmarks below. Usage Install npm instal

Bytedance Inc. 65 Dec 16, 2022
A timer toolkit that is generic over the underlying timer implementation.

timer-kit A timer toolkit that is generic over the underlying timer implementation. This crate does not implement any platform-specific timer but uses

null 4 Mar 4, 2023
Robust and Fast tokenizations alignment library for Rust and Python

Robust and Fast tokenizations alignment library for Rust and Python Demo: demo Rust document: docs.rs Blog post: How to calculate the alignment betwee

Explosion 157 Dec 28, 2022
Rust Attribute-Based Encryption library rabe's C FFI binding , support CP-ABE and KP-ABE encrypt and decrypt, submodule of Rabe.Core c# library.

Rabe-ffi Rust Attribute-Based Encryption library rabe's C FFI binding , support CP-ABE and KP-ABE encrypt and decrypt, submodule of Rabe.Core c# libra

Aya0wind 2 Oct 10, 2022
Slitter is a C- and Rust-callable slab allocator implemented primarily in Rust, with some C for performance or to avoid unstable Rust features.

Slitter is a less footgunny slab allocator Slitter is a classically structured thread-caching slab allocator that's meant to help write reliable long-

Backtrace Labs 133 Dec 5, 2022