mergestacks - Merge overlapping stacks of Analyze images into single volume

blue bar

Command line program to merge overlapping stacks of Analyze images into a single volume. The input Analyze file will contain a volume which consists of a number of overlapping stacks (sub-volumes) which contain some common slices. The program combines the overlapping slices to produce a contiguous output volume. There must be an exact number of overlapping slices. For multi-volume files, the same stack combination should occur for each volume (untested).

mergestacks [-ns <num>] [-os <num>] [-cut | -add | -mean] [-d]
       [input_filename [output_filename]]
-ns <num>
Sets the number of stacks in the input file to be num. If not specified, then the program prompts for this value.
-os <num>
Sets the number of overlapping slices in the input file to be num. The number of overlapping slices refers to the number of common slice positions between adjacent stacks, i.e., if adjacent stacks consisting of 0.5 mm thick slices overlap by 3 mm (as set in the Philips scanner user interface) then the number of overlapping slices will be 6. A negative number of overlapping slices (i.e., a gap between stacks) is not allowed. If not specified, then the program prompts for this value.
-cut
The overlap region in the output image file consists of the first half of overlapping slices from the lower stack followed by the second half of overlapping slices from the upper stack. This is the default and usually produces good results.
-add
The overlap region in the output image file consists of the addition of pixel intensities from each overlapping slice.
-mean
The overlap region in the output image file consists of the mean of pixel intensities from each overlapping slice.
-d
Displays additional diagnostic output.
input_filename
The filename of the Analyze file containing multiple stacks. Filenames may contain either the .img or .hdr extension, or neither. If the input_filename is not specified on the command line then the program will prompt for a filename.
output_filename
If an input_filename has already been specified then the second filename is assumed to be the Analyze file to contain the output images. If the output_filename is not specified on the command line then the program will prompt for a filename.