CCPi and iDVC file compatibility¶
This page specifies which CCPi DVC and iDVC files zvDVC reads and writes: the
dvc_in parameter file, .roi point clouds, .disp displacement tables and
.stat run summaries, and the behaviour and limits of zvdvc-dvc, the
drop-in for CCPi’s dvc executable. It is for iDVC users and for anyone
checking zvDVC against CCPi. For setting iDVC up to use zvDVC, see
Using zvDVC from iDVC. Source:
io/ccpi.py,
ccpi_dropin.py.
iDVC
(documentation) is the graphical
DVC application of the Tomographic Imaging / CCPi team at UKRI-STFC (Laura
Murgatroyd, Edoardo Pasca; Apache-2.0). It does its correlation by running
the dvc executable of CCPi DVC
(GPL-3.0), code initially developed by Prof. Brian K. Bay and collaborators
(Bay et al. 1999, doi:10.1007/BF02323555).
The formats below are those files, as CCPi 22.0.0 writes them.
Terms¶
dvc_inCCPi’s parameter file: one
key valuepair per line. iDVC writes one per run (for exampledvc_config.txt) and runsdvc <dvc_in>..roiCCPi’s point-cloud file: one
n x y zline per search point..dispCCPi’s per-point result table,
<output_filename>.disp..statCCPi’s run summary,
<output_filename>.stat. iDVC parses it by line position.- Drop-in
zvdvc-dvc(alsozvdvc ccpi): a program with CCPidvc’s command line and output files that runs zvDVC’s solver.
Introduction¶
zvDVC can meet CCPi and iDVC at three levels:
Import settings.
RunConfig.from_ccpi(dvc_in)turns a CCPi input file into a zvDVC run configuration, and.roifiles are imported into the zarr-vectors point store byzvdvc plan(Run configuration, Search-point store).Export results.
zvdvc finalize --dispandzvdvc solve --dispwrite a.dispthat iDVC and CCPi’sstrainprogram read (Results store).Replace
dvc.zvdvc-dvc dvc_inreads the same input and writes the same.disp,.statand progress lines as CCPi’sdvc, so iDVC runs on zvDVC without changes (Using zvDVC from iDVC).
The reverse also exists for testing: write_dvc_input and write_roi write
CCPi inputs for a zvDVC configuration, so the CCPi baseline runs on the same
case.
Technical reference¶
dvc_in¶
Syntax (read_dvc_input). Each non-empty line is key<whitespace>value;
values keep inner spaces (for example rigid_trans 34.0 4.0 0.0). A line
starting with # is a comment, and a comment starts at ### or at a #
after whitespace, so a # inside a path is kept. Lists may be separated by
spaces or commas. An integer key accepts a whole float (500.0), as CCPi
reads it.
Keys read. The keys below are mapped onto the run configuration; the full
mapping, with the fields each sets, is in Run configuration (“Importing a CCPi
dvc_in file”).
group |
keys |
required |
|---|---|---|
files |
|
all |
image layout |
|
all |
|
no |
|
subvolume |
|
all |
|
no |
|
search |
|
all |
|
no |
|
run control |
|
no |
Not supported or not mapped.
vol_bit_depthother than 8 or 16 is refused, as CCPi reads unsigned 8/16-bit voxels only.vol_endianmust belittleorbig(it is ignored for 8-bit data, as in CCPi);subvol_threshmust beonoroff.The converted configuration is validated as a YAML one is (
RunConfig.validate: choices, ranges, not-implemented options), and the error names thedvc_inkey, e.g.subvol_size: -16.0 is out of range.A key not in the table is ignored with a warning (CCPi ignores it silently).
fine_search, which CCPi’s manual lists butdvc22 does not read, is ignored without one.Settings that exist only in zvDVC (
prefilter_sigma,method,max_iterations, tolerances, seeding strategy, tiles) cannot be set from advc_in; the import uses their defaults, withseeding.strategy: wavefrontandsearch.report_convg_fail: falseto match CCPi.interp_type nearestis accepted by zvDVC but not by CCPi.
Behaviour of CCPi dvc 25.0.0 (conda ccpi-dvc, reports v22.0.0-19),
found by running it and followed by write_dvc_input:
the parser needs a token after each value: it appends a newline to each line and takes the value up to the next tab, so a value at the very end of a line keeps the newline, and
reference_filename<TAB>ref.rawfails with “cannot find file”.write_dvc_inputtherefore ends every value line with a tab and a### zvdvccomment;num_points_to_processandstarting_pointare required, although the manual lists them as optional;dvcexits 0 after input errors; the missing.dispis the signal. iDVC checks the process’s exit status (normal exit or crash), not its exit code, so it too can tell a failed run only by the missing.disp;the
.dispholdsn x y z status objmin u v wonly, with no rotation or strain columns, even for 6/12-DOF runs.
zvDVC’s own baselines use CCPi 22.0.0, because 25.0.0 has a broken tricubic path (MVP plan, M0).
.roi¶
aspect |
read ( |
written ( |
|---|---|---|
line |
|
|
separators |
tabs, spaces or commas |
tabs |
numbers |
any float; |
|
header |
non-numeric lines before the first point are skipped (iDVC |
none |
comments |
|
none |
Coordinates are voxels, \((x, y, z)\) with voxel \(i\) at coordinate \(i\) (Image volumes). The first point is CCPi’s default start point.
.disp¶
Tab-separated text with one header line and one row per point:
n x y z status objmin u v w
1 31.5 31.5 31.5 0 0.00343831 0.863728 -0.235165 0.231709
column |
meaning |
|---|---|
|
point label ( |
|
point position, voxels |
|
CCPi status code, 0 to −3 (Status codes) |
|
objective at the solution |
|
displacement, voxels |
zvDVC writes two variants:
|
|
|
|---|---|---|
rows |
every written point, sorted by |
the processed points ( |
number format |
|
as CCPi: |
statuses |
|
the same |
failed points |
displacement written as 0, non-finite |
the same |
read_disp reads both, and also older CCPi files that carry phi the psi
and strain columns after w.
.stat¶
Drop-in layout (stat_echo, stat_summary): CCPi 22.0.0’s .stat, line
for line, which iDVC parses by position:
### echo of the input file for this run
reference_filename ref.raw
...
subvol_aspect 1 1 1
### end of input file echo
Point Cloud contains 27 points
bounding box min = [31.5 31.5 31.5]
bounding box max = [63.5 63.5 63.5]
running under dvc code version: v22.0.0 (zvDVC 0.0.1.dev0 drop-in)
Run start: 2026-09-28 15:57:22
Run finish: 2026-09-28 15:57:22
27 points processed in 0 seconds
0.015 sec/pt
68.290 pt/sec
number successful = 27 (100.000%)
number range fail = 0 (0.000%)
number convg fail = 0 (0.000%)
The echo repeats the input settings in CCPi’s order and grouping (the
vol_endian line only for 16-bit data; the three threshold lines only with
subvol_thresh on). While the run is in progress, a temporary file next to
it (.<name>.stat.<pid>.tmp) holds the echo, a Run start: line and one
<count> points of <N> at <rate> pt/sec line per batch; at the end it is
rewritten in the final layout and renamed to <output_filename>.stat.
zvDVC summary layout (io.ccpi.write_stat, written by zvdvc finalize
and zvdvc solve) is different: point count, seconds, points per second,
one line per status with zvDVC’s names, CCPi-style number ... counts, and
the configuration as YAML
(Results store). iDVC cannot parse it; it is for people and for
read_stat_throughput, which reads the rate from either layout.
The zvdvc-dvc drop-in¶
zvdvc-dvc dvc_in # or: zvdvc ccpi dvc_in [--backend fused|cupy|cpu|numpy]
zvdvc-dvc version # dvc code version: v22.0.0 (zvDVC <version> drop-in)
zvdvc-dvc help # the module's description
zvdvc-dvc # CCPi's usage text
What it does (ccpi_dropin.run):
Reads and checks every input before touching any output: converts
dvc_inwithrun_config_from_dvc_input(validated, as above), resolving relative paths against the working directory, as CCPi does; checks that the backend exists and can run here; reads the.roidirectly and refuses an empty cloud, non-finite coordinates or repeated labels; opens both volumes (their size must match the header and dimensions exactly, Image volumes) and checks they have the same shape; builds the template; and checks that the output folder exists and is writable.Orders points by distance from
starting_point(or the first point) and keeps the firstnum_points_to_process.Writes the
.statecho and a.dispheader to temporary files next to the outputs, then prints a banner.Runs the in-memory wavefront solve (CCPi’s order and neighbour seeding,
report_convg_fail: false) with both whole volumes in host memory. The backend is--backend, else$ZVDVC_BACKEND, elsefusedwith a GPU, elsecpuwith numba, elsenumpy. If a GPU engine runs out of memory for the two volumes, the solve falls back to thecpuengine with a warning (an error if numba is missing).Prints one progress line per point in processing order, which iDVC’s progress bar reads (the count before the
/):1/27 1 31.500 31.500 31.500 Point_Good obj= 0.003438 dx= 0.863728 dy= -0.235165 dz= 0.231709
Failed points print
Range_Fail,Convg_FailorNot_Searchedafter the coordinates. If stdout is closed, it stops printing and still writes the results.Writes the final
.dispand.statto the temporary files and renames them to<output_filename>.statand then<output_filename>.disp(last: a.dispmeans the run finished), and exits 0.
If dvc_in cannot be opened it prints -> Can't open <file> and exits 1. Any
problem found in step 1 (a bad key or value, a missing, truncated or
misdescribed volume, a bad .roi, an unusable backend, an unwritable output
folder) prints one input file problem: <error> line and exits 1; a failure
during the solve prints one run failed: <error> line and exits 1. Neither
prints a traceback. A failed run removes its temporary files and never
writes a .disp or .stat, so the outputs of an earlier run with the same
output_filename are left as they were. Warnings are printed as one
warning: ... line on stderr. Unlike CCPi, which exits 0 after input errors,
a non-zero exit tells a script something went wrong; iDVC ignores the exit
code and sees the missing .disp. dvc example and dvc manual print a
note to run CCPi’s own dvc.
Limits and differences from CCPi.
Whole volumes in memory. The drop-in does not tile; both volumes must fit in host memory (and, for a GPU backend, in device memory). It writes no zarr-vectors store. Use the tiled pipeline (
zvdvc plan/seed/run/finalize) for large data.Points whose subvolume leaves the image are
Range_Fail; CCPi interpolates wrapped rows or unset memory there and reports them good (case A report).Sample points are drawn from a different random generator, so results differ from CCPi’s by the sampling spread (about 0.03 voxel per axis at 8 000 samples on the iDVC example); zvDVC with another template seed differs from itself by the same amount.
Ties in distance from the start point may be processed, and listed, in a different order: CCPi uses the unstable
std::sort, zvDVC keeps the point-cloud order. iDVC reads results by coordinates, so its views are unaffected.subvol_thresh on: CCPi’s.stathas three extra lines that shift the layout iDVC parses, so iDVC’s results view fails for such runs. zvDVC writes the same layout, so this happens with either engine.No prefilter, no IC-GN, no uncertainty. A
dvc_incannot set these.Rotation and strain parameters are solved (6/12-DOF) but, as in CCPi’s
.disp, not written.
On the iDVC example dataset (Lee, Lavallée and Bay 2022,
doi:10.5281/zenodo.7363345; 4 680
points), the drop-in’s .stat echo matches CCPi’s line for line apart from
the output name and the version line, and iDVC’s own parser reads the same
values from both (Using zvDVC from iDVC). Timings and agreement are in the
case A report.