VisionX V4VRDIFFVisionX V4
NAME

vrdiff − statistics and visualizations of region differences

SYNOPSIS

vrdiff if=<image> bf=<boundary file> [ig=<original img>] [of=<outputfile>] [os=<text file] [-wi] [-sh] [-ci] [-cs] [-cp] [-v] [-f]

DESCRIPTION

vrdiff compares two image regions or boundaries. The program computes the size of the region common to both images, pads both images so that they are the same size, and computes a number of comparison statistics.

vrdiff handles files from standard input; however, only 1 input can be read from standard input at a time.

OUTPUT IMAGE FORMAT

The output file is a byte image that may be color-indexed. The pixels are labeled according to the scheme below:

Pixel Value Meaning
254 (red) Included in both auto (if=) and manual (bf=)
180 (blue) Included in manual but not auto
90 (green) Included in auto but not manual
0 Not included in either manual or auto

REGION COMPARISON STATISTICS

If the -wi or -sh flags are specified, vrdiff will report several different counts and dervived statistics. These are explained below.

apcnt

The number of pixels in image if

bpcnt

The number of pixels in image bf

overlap

The number of pixels common to both if= and bf= images (AND).

anotb

The number of pixels in the if= image but not the bf= image.

bnota

The number of pixels in the bf= image but not the if= image.

union

The number of pixels in both segmentations (OR).

diff

The number of pixels that are different between the two images (XOR).

fpc

Fraction of Pixels Correct

(# of pixels in bf image - # of pixels in (if XOR bf))/(# of pixels in bf)
NOTE:
If there are no pixels in bf, fpc will be set to -(# of pixels in (if XOR bf))

sim

Similarity - overlap/union

NOTE: If there are no pixels in the union (that is, both images are blank), similarity will be set to 1.

tp

True positives - intersection of pixels that are 1 in if and bf (equivalent to overlap

tn

True negatvies - intersection of pixels that are 0 in if and bf (equivalent to (NOT A) AND (NOT B))

fp

False positives - intersection of pixels that are 1 in if but 0 in bf.

fn

False negatvies - intersection of pixels that are 0 in if but 1 in bf.

sens

Sensitivity - tp/(tp + fn)

NOTE: If the denominator is 0 (that is, bf is blank), then sensitivity will be set to 1.

spec

Specificity - tn/(tn + fp)

NOTE: If the denominator is 0 (that is, bf is all 1s), then specificity will be set to 1.

dsc

Dice Similarity Coefficient - (2*tp)/(2*tp + fp + fn)

NOTE: If the denominator is 0 (that is, both images are 0), then dsc will be set to 1.

EXAMPLES

Given an automated segmentation result (auto.vx), a boundary marking (manual.bb), and the original image (original.vx), output a grayscale image (comp.vx):

vrdiff if=auto.vx bf=manual.bb ig=original.vx of=comp.vx

To extract the region in the auto segmentation but not the manual segmentation:

vpix if=comp.vx th=100 tl=80 -range of=bnota.vx

OPTIONS

if=<image file>

specifies a VisionX byte image file, with non-zero pixels considered part of the region, OR a VisionX boundary file. If this parameter is not specified, it will be read from standard input.

ig=<image file>

if the image file specified by if= is not of the same size as the original image, you must specify the VisionX image file on which the boundary file was made in order to apply the correct frame offset to the boundary file. If this parameter is not specified, the image specified by if= is used to apply the frame offset to the boundary file. If this parameter is blank, it will be read from standard input.

bf=<boundary file>

specifies a VisionX boundary file, as generated by the marking tools in vdview or the Java viewer, OR a byte image file. The file type is automatically detected. If this parameter is blank or omitted, it will be read from standard input.

of=<output file>

specifies the output image. If no file is specified, output defaults to TCL text output only. Image is not output if -wi or -sh is specified with no of= specified. If this is blank, it will output to standard output. If none of the image options (-ci, -cs, -cp) are specified, the output is a grayscale image.

os=<text file>

specifies a text file to write the comparison statistics. If this option is specified, the statistics will always be written to the file, irregardless of other options. The text file is tab-separated, with a line for each statistic.

-ci

output the original image with regions described aboved overlayed on top.

-cs

output the difference image with the colors noted above

-cp

same as -ci, except the original image is clipped to the size of the comparison image.

-wi

output region comparison statistics in format suitable for TCL parsing.

-sh

output region comparison statistics in format suitable for shell parsing.

-v

verbose output.

-f

keep temporary files

SEE ALSO

vps(1), vpix(1), vop(1)

AUTHOR

A. C. Jirapatnakul and A. P. Reeves