Pores to Surface Analysis - User Manual
Dragonfly Prototype Apps · Pores to Surface Analysis...
Version 1.0 · 2026-09-01
English Manual
Contents
1. Introduction
2. What counts as solid, outside and a pore
3. The distance, and the two conventions
4. When the part is cut by the field of view
5. How to use it
6. What the table and the CSV contain
7. Requirements
1. Introduction
One workflow over one image channel: segment the solid, mark the cavities it encloses, turn them into a MultiROI, measure how far every pore is from the surface of the part, and screen the pores against a distance threshold.
The five tabs are the workflow, and each one opens only once the step before it has produced something: 1 Source → 2 Segment → 3 Distance → 4 Publish → 5 Analysis.
Nothing in the session is created or modified until you press Publish. Steps 2, 3 and 5 read the channel and compute; you can explore a threshold all day without touching the data.
Execute All Steps with Current Settings on the Source tab runs the whole workflow unattended - read the image, segment the solid and find the pores, measure the distance to the surface, publish - each step with whatever its own tab shows at the moment you press it. Publishing is the only step that writes to the session, and it is included on purpose: without it an unattended run would leave nothing behind. Every tab stays open at all times so the parameters can be read and changed BEFORE the run; a step whose input does not exist yet refuses when you press ITS button and says which step is missing.
2. What counts as solid, outside and a pore
Solid is the material — for a casting, the metal. It is a threshold on the channel, optionally cleaned, and by default reduced to its largest connected component.
Outside is every background voxel whose background component reaches the border of the volume. That is the air around the part.
A pore is any other background component: one that never reaches the border, i.e. a cavity fully enclosed by the solid. The background is labelled once and both answers come out of that same pass, so the pore segmentation and the decision about what counts as outside cannot disagree with each other.
The part is the solid plus its pores, and the boundary of the part is the part surface every distance below is measured to.
⚠ Keep only the largest solid component is ON by default, and that matters. A speck of noise elsewhere in the volume is otherwise treated as its own little part, with its own cavities and its own surface — and those cavities are not in the casting at all.
3. The distance, and the two conventions
The question is "how far is this pore from the surface of the part", and on a voxel grid that has two honest answers about one voxel apart. Both are computed and both are reported; neither is presented as "the" distance.
- Distance to surface — from the pore's surface to the part's surface: the thinnest wall of material between the cavity and the outside. Surfaces are the voxel FACES, matched with a k-d tree. This is exact when the two surfaces are flat and parallel, which is the usual near-surface case; on an oblique staircase surface, face-centre sampling can overestimate by at most half a face diagonal.
- Centre distance — from a pore voxel centre to an outside voxel centre. No surface model at all, so there is nothing in it to get wrong.
The Distance tab prints the measured median difference between the two, next to one voxel step, so you can see for your own data that they behave as expected instead of taking it on trust.
4. When the part is cut by the field of view
⚠ Where the part runs out of the scanned volume, that boundary is a CUT, not a surface of the part. A pore 1 mm from the edge of the reconstruction is not 1 mm from the surface of the casting.
The cut is kept in the surface by default, so a distance is never silently taken to a far-away real surface instead — but it is flagged everywhere it matters: the run says what percentage of the surface is a cut, and each pore's row says whether its own nearest surface point lies on the cut or on the part.
Untick Count the edge of the reconstruction as part surface on the Distance tab to measure to real surfaces only. Both answers are legitimate and which one you want depends on the scan; what is not legitimate is not knowing which you got.
5. How to use it
1. 1 Source — pick the image channel (press Refresh after publishing a new one) and the time step, then press Read this image. The panel shows the size, the voxel size and the value range. If the voxel size cannot be read, calibrate the dataset in Dragonfly first: the analysis is refused, because every distance would be meaningless.
2. 2 Segment — choose whether the material is the bright phase (usual for metal in CT), the dark phase, or a value band. Press Otsu for a starting threshold, or click on the histogram, or type the value. Adjust the clean-up if you need it, then press Segment the solid and find the pores. The report gives the pore count and the porosity; the preview shows solid / pore / outside.
3. 3 Distance — decide whether the edge of the reconstruction counts as part surface, then press Measure distance to the surface. The report gives the nearest, median and farthest pore, and states both conventions.
4. 4 Publish — set a name prefix and press Publish. The pores arrive as a MultiROI carrying the measurements; the solid and all pores can come as ROIs too.
5. 5 Analysis — set the distance threshold. Every pore closer to the surface than that is marked red across its whole row, and the summary counts them. Mark them red in the MultiROI recolours the same pores in the session, so the 3-D view and the table agree. Export CSV… writes every column plus a below-threshold flag.
6. What the table and the CSV contain
- Pore — the label number, the same one the published MultiROI uses.
- Distance to surface (µm) and Centre distance (µm) — the two conventions above.
- Equivalent diameter (µm) — the diameter of the equal-volume sphere (for a 2-D image, of the equal-area disc).
- Volume (µm³) and Voxels — the pore's size.
- Centroid Z / Y / X (µm) — where to find it.
- Nearest surface — part or field-of-view cut.
7. Requirements
No install, no internet, no GPU, no venv — in-process PyQt6 + numpy + scipy, all bundled with Dragonfly. Needs a published single-component grey image channel with a calibrated voxel size. A 2-D image (a single slice) is supported, and its own two Z faces are not mistaken for surfaces of the part.