CT/TEM Reconstruction (ASTRA) - User Manual
Dragonfly Prototype Apps · CT/TEM Reconstruction (ASTRA)...
Version 1.0 · 2026-07-04
English Manual
Contents
1. Overview
2. Use Cases
3. Installation & Enabling
4. Runtime Environment & First-Run Setup
5. User Interface
6. Step-by-Step Usage
7. Parameter Reference
8. Outputs
9. FAQ & Troubleshooting
10. Notes & Known Limitations
11. References
1. Overview
The CT/TEM Reconstruction (ASTRA) plugin reconstructs a 3D volume from a projection image stack directly inside Dragonfly. You select the projection Channel (with optional flat/dark correction images), enter the source-detector geometry, choose a reconstruction algorithm (FDK, SIRT3D, or CGLS3D), and the GPU-accelerated reconstruction runs in the background and returns the result as a new image Channel with correct voxel spacing.
The panel also includes a built-in beginner demo: it generates a 3D phantom, simulates X-ray projections, and reconstructs it, so you can try the whole pipeline with no data. A TEM (transmission electron microscopy) tilt-series mode is also available: it aligns and then reconstructs parallel-beam projections, on GPU or CPU.
Underlying engines and algorithms
- ASTRA Toolbox — the GPU (CUDA) reconstruction engine, providing cone-beam FDK plus the SIRT3D and CGLS3D iterative solvers (the iterative solvers are CUDA-only).
- TomoPy — the preprocessing library: flat/dark normalization, minus-log, ring/stripe artifact removal, and automatic centre-of-rotation (COR) search (find_center_vo).
- TEM parallel-beam reconstruction runs on GPU (ASTRA CUDA) or CPU (TomoPy gridrec/SIRT or scikit-image), with optional tilt-series alignment.
- All reconstruction compute runs in a dedicated WSL2 Linux conda env (named
astra) and never in Dragonfly's own Python.
Licensing highlights
The plugin ships as part of Dragonfly Prototype Apps. Its upstream engines ASTRA Toolbox (GPLv3) and TomoPy (BSD-3) are open-source and downloaded from conda channels during the one-time environment setup; please observe each upstream project's license terms.
2. Use Cases
This plugin is for anyone with raw micro-CT or industrial CT projection data who wants to reconstruct and analyze volumes in one place:
- Materials science — reconstructions better than a scanner's default (iterative, artifact correction) on lab / desktop micro-CT projections.
- Industrial inspection & metrology — internal-structure reconstruction and dimensioning of parts, castings, and additive-manufacturing samples.
- Electronics failure analysis — wide/flat objects such as PCBs and packages (pair with truncation correction and lateral-FOV widening).
- Geoscience — 3D reconstruction of rock cores and porous media.
- Lab and synchrotron CT users — experimenting with reconstruction parameters and iterative algorithms.
- Electron tomography (TEM) users — aligning and reconstructing parallel-beam tilt series (iterative solvers cope with a missing wedge).
3. Installation & Enabling
1. Download the Prototype Apps online package from ImageFly and extract it. Close Dragonfly, run install_prototype_apps.exe and select the Dragonfly version to install into.
2. Start Dragonfly, open Prototype Apps ▸ App Store and search for CT/TEM Reconstruction (ASTRA). If an Enable button is shown, click it and follow the sign-in, download or installation prompts.
3. Restart Dragonfly when prompted, then open CT/TEM Reconstruction (ASTRA) from the Prototype Apps menu. Return to App Store to enable or disable it later.
4. Runtime Environment & First-Run Setup
Reconstruction compute runs in a dedicated WSL2 Linux conda environment (named `astra`). You must build this environment once before first use.
4.1 Prerequisites
- Dragonfly 2025.1 or 2027.1, launched at least once.
- Windows 10/11 with WSL2 installed (admin:
wsl --install, then reboot). - An NVIDIA GPU with a current driver (WSL CUDA support).
- Miniconda installed inside WSL (Ubuntu) — the setup script uses it.
- Internet for the one-time build (several-GB download from conda channels).
4.2 Build the WSL astra environment
Double-click setup_astra_env.bat in the plugin folder (it calls setup_astra_env.ps1). The script:
1. Creates a conda env named astra inside WSL (default distro Ubuntu) with Python 3.11 + astra-toolbox + tomopy (several minutes).
2. Additionally installs python-docx to enable the per-reconstruction .docx report.
3. Writes environment info (WSL distro, astra interpreter path, job root) to %LOCALAPPDATA%\TomoRecon\config.json so the panel auto-fills.
REM Default arguments (Ubuntu distro, 'astra' env name, C:\TomoJobs job root):
setup_astra_env.bat
REM Custom arguments:
powershell -ExecutionPolicy Bypass -File setup_astra_env.ps1 -Distro Ubuntu -JobRoot C:\TomoJobs
4.3 Panel auto-detection
After restarting Dragonfly, open the panel; it auto-reads the astra interpreter path from config.json. If not found, click Setup / Detect env in the right-column WSL astra environment (GPU) group — the panel probes common WSL locations (e.g. ~/miniconda3/envs/astra/bin/python); you can also paste the path manually.
4.4 Environment & data locations
Content | Location |
astra conda env | inside WSL, e.g. ~/miniconda3/envs/astra |
Plugin config file | %LOCALAPPDATA%\TomoRecon\config.json |
Job root (default) | C:\TomoJobs (file-based job-directory IPC) |
If auto-setup fails (e.g. no Miniconda in WSL), install Miniconda inside WSL first and re-run the setup script; or paste an existing astra-env python path directly into the panel's “ASTRA interpreter” field.
5. User Interface
The panel has three columns: left = beginner demo (collapsible), middle = configuration, right = reconstruction / TEM / environment parameters and log. The top ◀ Hide demo button hides/shows the left column.
5.1 Beginner demo (left column)
- Phantom size (voxels): range 32–256, default 128.
- Projections (angles): simulated projection angles, range 45–1440, default 180.
- Generate phantom + Run demo (green button): builds a phantom, simulates projections, and reconstructs; yields two Channels,
Demo_ReconstructionandDemo_Phantom_GroundTruth, to overlay and compare.
5.2 Reconstruction mode
- Mode dropdown:
Cone-beam CT (X-ray, lab micro-CT)(default) orTEM tilt-series (parallel beam, electron tomography). Switching to TEM enables the TEM options group on the right.
5.3 Projection data
- Projection Channel dropdown + Refresh button: refresh and pick the projection stack (lists names and shapes).
- Angle (rotation) axis: which stack axis indexes the projection angle (
0 - Zdefault /1 - Y/2 - X). - In-plane axis order:
(X, Y) - as stored(default) or(Y, X) - swap(use if the reconstruction looks transposed). - Flat field (optional) / Dark field (optional): optional normalization Channels (default (none)).
5.4 Cone-beam geometry
- Source-origin distance [mm] (SOD): source-to-rotation-axis distance, default 100.
- Origin-detector distance [mm] (ODD): rotation-axis-to-detector distance, default 100.
- Detector pixel size [mm]: physical detector pixel, default 0.05.
- Get from x/y spacing of projection images (button): optionally fill the pixel size from the projection Channel's X/Y spacing. Warning: Dragonfly's spacing is often wrong or unset (e.g. 1.0), so it is never used automatically — confirm against your scanner's true pixel pitch.
- Angle start [deg] / Angle end [deg]: scan angular range (default 0 to 360).
- Rotation direction:
Counter-clockwise (CCW)(default) orClockwise (CW)(flip if the reconstruction is mirrored).
5.5 Preprocessing
- Invert: tick only if dense material is BRIGHT (not dark); default off.
- Normalize: normalize by flat/dark if set, else by the white level below; default on.
- Minus-log: transmission -> attenuation; default on.
- Ring / stripe removal: reduce ring artifacts; default on.
- White level I0: open-beam intensity used when no flat field is given; blank/0 = auto from a bright region.
- COR method:
Auto - Vo (recommended)(default) /Auto - phase correlation/Auto - entropy (slow)/Detector centre (no search)/Manual (value below). - Manual COR [px]: the manual centre-of-rotation column used when COR method = Manual.
5.6 Reconstruction (right column)
- Algorithm:
FDK_CUDA(default) /SIRT3D_CUDA/CGLS3D_CUDA. - Iterations (iterative): iteration count for SIRT3D/CGLS (ignored by FDK), range 1–2000, default 150.
- Binning factor: detector downsample factor, range 1–8, default 1 (smaller output, faster).
- GPU memory limit [GB] (0=auto): VRAM budget for slab reconstruction, 0 = auto-detect free VRAM (default 0).
- Truncation correction: for wide/flat objects (e.g. a PCB), default off. FDK pads projections to suppress cupping; SIRT3D/CGLS3D do not pad.
- Lateral FOV factor (1.0-2.0): in-plane reconstruction width as a multiple of detector width; use >1 (e.g. 1.5–2.0) when the object is wider than the detector FOV; default 1.0, hard cap 2.0 (cost grows with the square of the factor).
- Import reconstructed volume as a Channel: default on.
- Convert to UShort (16bit) with Min-Max to 0-65535: default on.
5.7 TEM tilt-series options (TEM mode only)
- Device:
Auto (GPU if available, else CPU)(default) /GPU (ASTRA CUDA)/CPU (TomoPy / scikit-image). - Algorithm:
FBP(default) /SIRT/SART/CGLS/gridrec. - Align tilt series before reconstruction: register projections and estimate the tilt axis before reconstructing; default on.
- Alignment:
Cross-correlation (phase)(default) orNone. - Refine with TomoPy projection matching (slower): default off.
- TEM Demo (synthetic tilt series) (green button): generate, align, and reconstruct a synthetic tilt series with no data. The tilt-angle range is taken from Angle start/end above.
5.8 Action buttons (above the log)
- Geometry Check: sanity-checks the geometry (SOD/ODD/pixel size) before reconstructing; reports magnification, cone angle, voxel size, and volume dimensions, with a PASS / SUSPICIOUS / VERY SUSPICIOUS verdict.
- Reconstruct (blue): run a full reconstruction with the current parameters.
- Reconstruct Preview: quickly reconstruct only the central slice(s) with FDK to check the geometry / COR / preprocessing are roughly right.
- Stop Recon (red): abort the running reconstruction and discard all in-progress work (active only while running).
- Save Recon Parameters to File: save the current parameters as
<projection>_ReconPara_<timestamp>.json. - Import Parameters from JSON file: load parameters from a .json (the projection/flat/dark Channel selection is NOT imported).
- Open Output Folder: open the most recent job's output directory (defaults to the job root).
- Log: a read-only log area showing progress, COR, voxel size, and errors in real time.
5.9 WSL astra environment (right column)
- WSL distro: the WSL distribution name, default
Ubuntu. - ASTRA interpreter: the astra-env python path (auto-detected or pasted).
- Job root (Windows): Windows-side job root, default
C:\TomoJobs. - Setup / Detect env (button): detect or confirm the astra interpreter.
6. Step-by-Step Usage
6.1 Beginner demo (no data)
1. Make sure the WSL astra environment is built (Chapter 4).
2. Set Phantom size and Projections in the left column.
3. Click Generate phantom + Run demo.
4. Wait for reconstruction to finish; you get Demo_Reconstruction and Demo_Phantom_GroundTruth Channels, which you can overlay to compare (FDK is fast but shows cone/edge artifacts; SIRT3D/CGLS are smoother but slower).
6.2 Reconstruct your own cone-beam CT projections
1. Load your projection stack (and optional flat/dark) into Dragonfly.
2. In the panel, click Refresh, pick the projection Channel, and set which axis is the rotation angle.
3. (Optional) pick the flat and dark Channels.
4. In the Cone-beam geometry group, enter SOD, ODD, detector pixel size, and the angle range.
5. Click Geometry Check first to confirm the geometry is reasonable (a PASS verdict is best).
6. Choose an algorithm (FDK/SIRT3D/CGLS3D) and other reconstruction parameters.
7. (Recommended) click Reconstruct Preview to check the central slice, then click Reconstruct for the full run.
8. When finished, the volume imports as a Channel; view the report and parameter files via the completion dialog or Open Output Folder.
6.3 TEM tilt-series reconstruction
1. Switch Mode to TEM tilt-series; the TEM options group on the right becomes enabled.
2. Pick the projection (tilt-series) Channel and set the tilt range in Angle start/end (e.g. -70 to 70).
3. Choose Device and Algorithm, and decide whether to align (STEM-HAADF: leave Normalize/Minus-log off; bright-field TEM: enable Minus-log).
4. Click Reconstruct; the volume imports as a Channel with a TEM_ prefix.
5. With no data, click TEM Demo first to try the whole flow.
7. Parameter Reference
The table below lists the main adjustable parameters, their panel defaults, and notes (defaults are the panel's initial state; some parameters are remembered from the last run).
Parameter | Default | Description |
Mode | Cone-beam CT | Cone-beam CT or TEM tilt-series |
Phantom size (voxels) | 128 | Demo phantom size, 32–256 |
Projections (angles) | 180 | Demo projection angles, 45–1440 |
Angle (rotation) axis | 0 - Z | Which stack axis indexes the angle |
In-plane axis order | (X, Y) - as stored | Detector in-plane axis order; swap to (Y, X) |
Source-origin distance (SOD) | 100 mm | Source-to-rotation-axis distance |
Origin-detector distance (ODD) | 100 mm | Rotation-axis-to-detector; sets magnification |
Detector pixel size | 0.05 mm | Physical detector pixel; with SOD/ODD fixes voxel size |
Angle start / end | 0 / 360 deg | Scan angular range |
Rotation direction | CCW | Rotation sense; flip to CW if mirrored |
Invert | Off | Only if dense material is bright |
Normalize | On | Normalize (flat/dark or white level) |
Minus-log | On | Transmission -> attenuation |
Ring / stripe removal | On | Reduce ring artifacts |
White level I0 | blank/0=auto | Open-beam intensity for normalization |
COR method | Auto - Vo | Centre-of-rotation search method |
Manual COR | blank | Manual column when COR = Manual |
Algorithm | FDK_CUDA | FDK / SIRT3D / CGLS3D |
Iterations | 150 | Iterations (SIRT3D/CGLS), 1–2000 |
Binning factor | 1 | Detector downsample, 1–8 |
GPU memory limit | 0 (auto) | Slab-recon VRAM budget (GB) |
Truncation correction | Off | For wide/flat objects |
Lateral FOV factor | 1.0 | In-plane width multiple, 1.0–2.0 |
Import as Channel | On | Import the volume as a Channel |
Convert to UShort (16bit) | On | 16-bit, Min-Max to 0–65535 |
TEM Device | Auto | GPU / CPU / Auto |
TEM Algorithm | FBP | FBP/SIRT/SART/CGLS/gridrec |
TEM Align tilt series | On | Align before reconstruction |
TEM Alignment | Cross-correlation | Cross-correlation (phase) or None |
TEM Refine (projection matching) | Off | TomoPy projection matching, slower |
WSL distro | Ubuntu | WSL distribution |
Job root | C:\TomoJobs | Windows-side job root |
Voxel size = detector pixel / magnification, with magnification M = (SOD+ODD)/SOD. The Channel is created with this isotropic spacing.
8. Outputs
After reconstruction the plugin creates image Channels in Dragonfly and saves related files in the job directory.
8.1 Dragonfly objects
- Full CT reconstruction: a Channel named
Reconstruction(with correct isotropic voxel spacing). - Preview: the central slice(s), named with a
Preview_prefix. - Beginner demo: two Channels,
Demo_ReconstructionandDemo_Phantom_GroundTruth. - TEM reconstruction: a Channel with a
TEM_prefix (TEM_Demo_for the demo).
8.2 Job-directory files
Each job creates a timestamped sub-directory under the job root (default C:\TomoJobs), containing:
volume.npy— the reconstructed volume (z,y,x).recon_params.json/result.json— the parameters and computed results (voxel size, volume dimensions, the actually-used COR and its offset from the detector centre, etc.).report.docx— a bilingual reconstruction report (if python-docx is installed in the astra env), with a few projection preview images.status.json— progress state during reconstruction.
8.3 How to view
On completion a “Reconstruction complete” dialog appears (showing volume size, COR, and the report path), with an Open Output Folder button. The reconstructed Channel can be viewed and rendered directly in Dragonfly's 2D/3D views and used for downstream analysis (segmentation, measurement, etc.).
9. FAQ & Troubleshooting
Symptom | Fix |
Log says “ASTRA interpreter not set” | Run setup_astra_env.bat first to build the WSL env, then click Setup / Detect env; or paste the astra-env python path into the ASTRA interpreter field. |
WSL has no GPU / CUDA error | Update the NVIDIA driver; confirm |
Reconstruction looks doubled / blurred | The centre of rotation (COR) is off. Try another COR method, or choose Manual and enter a manual COR column (adjust by a few pixels). |
Out of memory on large data | Increase the Binning factor; lower the Lateral FOV factor; or set a GPU memory limit. Iterative solvers (SIRT3D/CGLS) need more VRAM than FDK. |
Volume looks inverted / all one value | Toggle Minus-log; pick the correct flat/dark; check the Angle (rotation) axis is right. |
Reconstruction looks transposed / mirrored | Switch In-plane axis order to (Y, X); or change Rotation direction from CCW to CW. |
Geometry Check reports VERY SUSPICIOUS | The cone angle / magnification is implausible — usually a wrong detector pixel size or SOD/ODD. Re-enter your scanner's true values. |
10. Notes & Known Limitations
- WSL2 + NVIDIA GPU required: ASTRA's cone-beam and iterative solvers are CUDA-only; reconstruction cannot run without a GPU (TEM parallel-beam offers a CPU option).
- Reconstruction runs in a WSL conda env, not Dragonfly's Python: the astra env must be built first.
- Detector pixel size is not taken automatically from Dragonfly spacing: that spacing is often wrong, so enter the real value manually.
- Lateral FOV factor is capped at 2.0: cost grows with the square of the factor (memory/time).
- Large volumes are auto-reconstructed in Z-slabs to fit GPU memory.
- The one-time setup downloads several GB (astra-toolbox + tomopy) and needs internet.
- The .docx report needs python-docx: without it, reconstruction still succeeds; only the report is skipped.
11. References
- ASTRA Toolbox: https://astra-toolbox.com/
- TomoPy: https://tomopy.readthedocs.io/
- Windows WSL: https://learn.microsoft.com/windows/wsl/
- CUDA on WSL: https://docs.nvidia.com/cuda/wsl-user-guide/
- Miniconda: https://docs.conda.io/en/latest/miniconda.html