Resample.exe
The resample.exe program was written by David Reddy and Johann Kim and reprogrammed by Dr. Ryan Raaum.
The program is designed to resample curves (= lines or ridges) of semilandmarks to a user-selected number of equispaced semilandmarks. This program can be run on single files or many files simultaneously; each file may contain one or more curves. Therefore multiple curves can all be resampled to contain the same number of semilandmarks. These semilandmarks can then be analyzed or converted into sliding semilandmarks.
The ‘resample.exe’ program should be downloaded to a user defined directory. A control file must be created and placed in the same directory as the program. The control file is a txt file that has the name of each curve (one word labels) followed by the desired number of semilandmarks for each curve. For example, if the control file looked like this:
midsag 5
coronr 8
coronl 8
then the three curves named midsag, coronr and coronl would be resampled to 5, 8 and 8 semilandmarks, respectively.
Input files should be space delimited (.prn) files. All landmarks and semilandmarks (curves) should be left-aligned, and each landmark and the first line of each curve should be followed by a one word label. (No landmarks should have an identical name to a curve.) For example:
x1 y1 z1 bregma
x2 y2 z2 lambda
x3 y3 z3 nasion
x y z midsag
x y z
x y z
x y z
x y z
x y z coronr
x y z
x y z
x y z
x y z
x y z
x y z
x y z
etc.
Run the program from a command prompt. (For DOS-haters, open a command prompt window and access the directory containing the program and the control file. For example if the program is on the C drive in a folder named ‘curve data’ you would do the following:
> cd C:/curve data )
Program commands can be accessed by typing:
> resample.exe –h
The single letter abbreviations on the left can be used with a single dash in front of them, or the full command can be used (e.g., match) with two dashes in front of it.
The various commands are as follows:
COMMANDACTION:
-c , --control-file CONTROL_FILE identifies CONTROL_FILE as your control file
-d, --directory DIRECTORY process files in DIRECTORY (default is
current directory)
-m, --match FILE_MATCH FILE_MATCH provides the name(s) of the
file(s) to be processed. This can be a space-delimited list (a.prn b.txt c.spo) or you can use wildcards (e.g., *.prn would process all files with a .prn file extension in DIRECTORY) *.* (i.e., all files) is the default.
-o, --output-directory DIRECTORY writes processed files to given DIRECTORY
(default creates a folder named RESAMPLE in the current directory)
-f, --output-format FORMATwrites processed files into DVLR or morpheus compatible files. Options are ‘dvlr’ or ‘morph.’ Default is DVLR. (see below for explanation)
-?, --missing-data IDif there are missing data in your files, then this must be indicated by ID (e.g., if 9999 represents a missing semilandmark, then ID=9999). Default is 9999.
-h, --help
Examples of how these commands work are given in the help screen.
DVLR program format will retain the names of the landmarks to the right of the landmarks and can be used in another NYCEP Morphometrics Group software program that aligns landmarks and semilandmarks taken in multiple orientations per observation. Morph (= GRF-ND) format will place any landmarks followed by all resampled lines and can be used for Dennis Slice’s Morpheus program (performs GPA). Output files will have the same name as the original file (but default will put them in a separate ‘resample’ folder).
If there is any missing data, the curve will not be resampled, but an equal number of lines of missing data will be output as the resampled lines so that all files can be combined and input into Morpheus with the same number of landmarks / semilandmarks.
The program resamples in the following manner: length of the curve is measured and divided by desired number of semilandmarks. New semilandmarks are calculated using weighted linear interpolation.