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_in

CCPi’s parameter file: one key value pair per line. iDVC writes one per run (for example dvc_config.txt) and runs dvc <dvc_in>.

.roi

CCPi’s point-cloud file: one n x y z line per search point.

.disp

CCPi’s per-point result table, <output_filename>.disp.

.stat

CCPi’s run summary, <output_filename>.stat. iDVC parses it by line position.

Drop-in

zvdvc-dvc (also zvdvc ccpi): a program with CCPi dvc’s command line and output files that runs zvDVC’s solver.


Introduction

zvDVC can meet CCPi and iDVC at three levels:

  1. Import settings. RunConfig.from_ccpi(dvc_in) turns a CCPi input file into a zvDVC run configuration, and .roi files are imported into the zarr-vectors point store by zvdvc plan (Run configuration, Search-point store).

  2. Export results. zvdvc finalize --disp and zvdvc solve --disp write a .disp that iDVC and CCPi’s strain program read (Results store).

  3. Replace dvc. zvdvc-dvc dvc_in reads the same input and writes the same .disp, .stat and progress lines as CCPi’s dvc, 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

reference_filename, correlate_filename, point_cloud_filename, output_filename

all

image layout

vol_bit_depth (8 or 16), vol_wide, vol_high, vol_tall

all

vol_endian (little/big), vol_hdr_lngth

no

subvolume

subvol_geom, subvol_size, subvol_npts

all

subvol_aspect, subvol_thresh, gray_thresh_min, gray_thresh_max, min_vol_fract

no

search

disp_max, num_srch_dof, obj_function, interp_type

all

rigid_trans, basin_radius

no

run control

num_points_to_process (0 = all), starting_point

no

Not supported or not mapped.

  • vol_bit_depth other than 8 or 16 is refused, as CCPi reads unsigned 8/16-bit voxels only. vol_endian must be little or big (it is ignored for 8-bit data, as in CCPi); subvol_thresh must be on or off.

  • The converted configuration is validated as a YAML one is (RunConfig.validate: choices, ranges, not-implemented options), and the error names the dvc_in key, 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 but dvc 22 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 a dvc_in; the import uses their defaults, with seeding.strategy: wavefront and search.report_convg_fail: false to match CCPi.

  • interp_type nearest is 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.raw fails with “cannot find file”. write_dvc_input therefore ends every value line with a tab and a ### zvdvc comment;

  • num_points_to_process and starting_point are required, although the manual lists them as optional;

  • dvc exits 0 after input errors; the missing .disp is 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 .disp holds n x y z status objmin u v w only, 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 (read_roi)

written (write_roi)

line

n x y z

n<TAB>x<TAB>y<TAB>z

separators

tabs, spaces or commas

tabs

numbers

any float; n is converted to an integer

n integer, coordinates %.9g

header

non-numeric lines before the first point are skipped (iDVC .txt/.csv)

none

comments

# to end of line, blank lines skipped

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

n

point label (point_id)

x y z

point position, voxels

status

CCPi status code, 0 to −3 (Status codes)

objmin

objective at the solution

u v w

displacement, voxels

zvDVC writes two variants:

zvdvc finalize --disp, zvdvc solve --disp (io.ccpi.write_disp)

zvdvc-dvc (ccpi_dropin.write_disp)

rows

every written point, sorted by point_id

the processed points (num_points_to_process), in processing order (distance from the start point)

number format

%.9g throughout

as CCPi: x y z status objmin in C++’s default format (6 significant digits, like %g), u v w fixed to 6 decimals

statuses

to_ccpi(): codes below −3 become −3

the same

failed points

displacement written as 0, non-finite objmin as 0, as CCPi writes failed points (the store and .npz keep the raw values)

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):

  1. Reads and checks every input before touching any output: converts dvc_in with run_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 .roi directly 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.

  2. Orders points by distance from starting_point (or the first point) and keeps the first num_points_to_process.

  3. Writes the .stat echo and a .disp header to temporary files next to the outputs, then prints a banner.

  4. 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, else fused with a GPU, else cpu with numba, else numpy. If a GPU engine runs out of memory for the two volumes, the solve falls back to the cpu engine with a warning (an error if numba is missing).

  5. 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_Fail or Not_Searched after the coordinates. If stdout is closed, it stops printing and still writes the results.

  6. Writes the final .disp and .stat to the temporary files and renames them to <output_filename>.stat and then <output_filename>.disp (last: a .disp means 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 .stat has 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_in cannot 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.