Interactive Radio Tomographic Imaging tutorial built with PyQt5.
Project description
Radio Tomographic Imaging Tutorial
Interactive PyQt5 tutorial for Radio Tomographic Imaging (RTI). The app lets you draw an attenuation layout, define TX/RX movement paths, collect line-integral measurements, inspect the projection matrix, reconstruct the attenuation image, and experiment with segmentation methods.
This is an academic initiative from the Sensing and Networked Systems Engineering (SeNSE) Group at IIT Madras.
Features
- Grid-based attenuation layout editor.
- TX and RX waypoint drawing with Bresenham ray tracing between current positions.
- Step-by-step or continuous measurement acquisition.
- Live projection matrix visualization.
- Reconstruction with least squares, Tikhonov regularization, and total variation IRLS.
- Noise controls for measurement mean and standard deviation.
- Segmentation playground for reconstructed layouts.
- JSON configuration loading and saving.
Screenshots
The screenshots below were captured from the Python window at 1920x1080 after loading configs/rti_config1.json and advancing to 420 measurements.
Projection Matrix
Least Squares Reconstruction
Tikhonov Reconstruction
Total Variation Reconstruction
Layout Thresholding
Project Layout
RTI_Tutorial/
├── configs/ # Saved and sample RTI configuration JSON files
│ └── rti_config1.json
├── docs/
│ └── screenshots/ # README and documentation screenshots
├── src/
│ └── rti_tutorial/
│ ├── assets/ # Package screenshots used for PyPI/package assets
│ ├── config/ # Config load/save code
│ ├── core/ # RTI model, solvers, waypoint logic, segmentation
│ └── gui/ # PyQt windows, controls, widgets, workers
├── main.py # Local launcher
├── pyproject.toml # Installable package metadata
└── requirements.txt # Minimal runtime requirements
Setup
Use Python 3.10 or newer.
After the package is published on PyPI:
pip install rti-tutorial
rti-tutorial
For optional segmentation acceleration and OpenCV-based skeletonization:
pip install "rti-tutorial[segmentation]"
For local development from this repository:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
For editable package installation:
pip install -e .
Optional segmentation acceleration and OpenCV-based skeletonization:
pip install -e ".[segmentation]"
Run
From the project root:
python main.py
If installed with pip install -e ., you can also run:
rti-tutorial
If installed from PyPI, the same command launches the GUI:
rti-tutorial
Configuration Files
Configuration JSON files are stored in configs/. The included sample is:
configs/rti_config1.json
In the app, use Load to open this file. The Save As dialog defaults to the configs/ folder so new scenarios stay grouped with the sample configurations.
Each configuration stores:
- Grid dimensions.
- Open-cell and obstacle attenuation values.
- TX power and measurement noise settings.
- Obstacle mask and per-cell attenuation matrix.
- TX/RX waypoint paths.
- Solver method, regularization operator, and solver parameters.
The included sample has a 30 x 30 grid and 446 possible TX/RX trajectory positions. Load it, then use Run, Step, or the Measurements slider to move past 400 measurements and compare the reconstruction and thresholding algorithms on the same data.
Reconstruction Options
The Solver Configuration panel controls how the attenuation image X is reconstructed from the projection matrix A and measurement vector M.
- Least squares solves the direct inverse problem by minimizing
||A X - M||2^2. It is useful as a baseline and shows what the measurement geometry alone can recover. - Tikhonov adds a regularization term,
lambda ||L X||2^2, to stabilize the reconstruction. The operator selector can use identity, first-difference gradient, or Laplacian regularization. - Total variation IRLS uses an iterative total-variation style penalty. It is useful when the expected layout has sharper boundaries and piecewise-smooth regions.
- Lambda controls regularization strength. Lower values follow the measurements more closely; higher values smooth or constrain the result more strongly.
- TV iterations and TV epsilon control the total-variation IRLS approximation.
- Noise mean and Noise std add deterministic simulated Gaussian measurement noise. The mean shifts the measurement loss, and the standard deviation controls spread. Changing either value regenerates the measurement vector for the current measurement count.
Layout Thresholding Options
The Layout tab turns the reconstructed attenuation image into an estimated obstacle layout. It includes several thresholding and segmentation choices:
- Global Otsu computes one threshold for the full reconstruction.
- Local Otsu computes thresholds over local windows so different parts of the grid can adapt independently.
- Manual Threshold lets you choose the threshold ratio directly.
- Adaptive Mean thresholds against a local mean plus an offset.
- RAG Regions quantizes the reconstruction into regions and reports region adjacency information.
- Morphology Cleanup applies thresholding followed by cleanup operations such as filling small gaps.
- Skeletonization extracts a thin structural representation of the thresholded layout.
- Gradient Edges emphasizes strong spatial changes in attenuation rather than filled obstacle regions.
The layout controls also include threshold offset, local window size, minimum region size, RAG levels, invert, fill holes, morphology cleanup, and skeleton overlay toggles.
Basic Workflow
- Start the app with
python main.py. - Load
configs/rti_config1.json, or initialize a new grid. - Edit cells to mark obstacles and adjust attenuation values.
- Switch to Draw TX and Draw RX modes to add movement waypoints.
- Click Step or Run to collect measurements, or use the Measurements slider to jump to a specific count.
- For the sample config, move to 400+ measurements and try least squares, Tikhonov, and total variation reconstruction.
- Open the Layout tab and compare Otsu, local Otsu, adaptive mean, manual thresholding, morphology cleanup, skeletonization, and edge-based methods.
- Save the scenario as a JSON file in
configs/.
License
Copyright (C) 2026 Ayon Chakraborty, Sensing and Networked Systems Engineering (SeNSE) Group at IIT Madras.
This project is licensed under the GNU General Public License v3.0 or later. See LICENSE.
Development Checks
Syntax check all Python files:
python -m compileall main.py src
Quick config load smoke test:
python - <<'PY'
from pathlib import Path
import sys
sys.path.insert(0, "src")
from rti_tutorial.config.io import load_model_config
model = load_model_config(Path("configs/rti_config1.json"))
print(model.rows, model.cols, len(model.tx_waypoints), len(model.rx_waypoints))
PY
Expected output for the included sample:
30 30 64 94
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rti_tutorial-0.1.1.tar.gz.
File metadata
- Download URL: rti_tutorial-0.1.1.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ace94b66376fcdd74698e4e5144e64acd0fa1df6ff937c956b70c2f4bb5674
|
|
| MD5 |
1b82592185aae9788fd124aa182f968d
|
|
| BLAKE2b-256 |
6b6c873e22b02b3c51603e03916f1c622f9ce3bbbfae12ff1fc4047246234bab
|
File details
Details for the file rti_tutorial-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rti_tutorial-0.1.1-py3-none-any.whl
- Upload date:
- Size: 906.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8ba23d355c17982d57b58ba6641e91fdaa167d1888c0ab25a0066020c3eb916
|
|
| MD5 |
d2869b950e921db808d3b6a7dabfdefa
|
|
| BLAKE2b-256 |
c3040e6e96cd3e64d6edb11d7c5d56409cdc8146c96a751090fc6c4d3881c87f
|