Skip to content.
CCB > CCBSIGS > ShapeToolLibraryProgram > MapContour > MapContourUserGuide1x0

Map Contour User Guide

Table of Contents

Overview

Three dimensional surface warping often uses sets of homologous fiducial points to define corresponding locations in of surfaces before, and after, a warp. In many cases it is convenient to treat these points as 3 dimensional lines, also know as contours.

The MapContour application is part of a warping protocol which maps the three dimensional shape onto a two dimensional plane before performing a warp, in two dimensions, that is guided by corresponding groups of contours. Like the surface to be warped, these contours must first be mapped to a two dimensional plane before being used to define the warp.

MapContour performs this mapping. Each line segment of the contour(s) mapped is first located on the original surface. The face(s) containing this segment are identified, and the vertices of this face are mapped to the two dimensional plane (see FlattenSurface). The mapping between these two triangles is then used to map the line segment, so that the mapped line segment is contained in the mapped face. If the line segment is not actually on the surface, the closest face is used.

This program assumes that the surface is composed of triangular faces, that it surface does not intersect itself, ant that it is everywhere C2-differentiable.

Command Line Usage

The command line follows this pattern:

"java {optional java arguments} -jar {optional command line arguments} -shape {input_file} -contour {contour_file} -output {output_file}".

The "optional command line arguments" are described by the table in the next section, and by the illustrative examples that follow. The "optional java arguments' control the behavior of the Java virtual machine used to run the application and, with one exception, are seldom used. That exception is the memory allocation argument, -Xmx{number}, which asks your computer's operating system to give more memory to the Java virtual machine that it ordinarily gets. This is used when the data to be manipulated exceed the amount of memory. If you run the program and see an error with text resembling

"Out of Memory"

then you will probably want to add the memory argument. Each java runtime will differ in how this is accomplished; The Sun java interpreter usess the -Xmx argument to do so, for example:

  • java -Xmx512M -jar
Sets the ammount of memory to 512MB.

Command line arguments

The program is controlled by use of command line arguments. The complete table of command line arguments follows. The "Default" values listed are the values used by the program if the corresponding command line argument is not specified.

Not all arguments need be specified by a user; generally, an argument is used only to override an unwanted default behavior of the program.

Argument Type Required Description Notes
-shape String Yes Specify original shape input file name. This argument is required.
-contour String Yes Specify a file name that stores the line. This argument is required.
-output String Yes Specify output file name. This argument is required.
-dual flag No Enable to use dual flat map.  
-overwrite flag No Allow to overwrite output file.  
-help flag No Prints help and usage information.  
-version flag No Prints version number of this application.  
-verbose flag No Enables detailed status messages.  
-license flag No Prints license details, and exits.  
-twiki flag No Writes command line arguments as a TWiki format table to output and exit.  
-pipeline flag No Write pipeline descriptor file to output and exit.  
-pipelineJar String No Specify path to an application jar file, as a pipeline resource. Example: "pipeline://localhost//home/zed/Connery.jar"
-pipelineJvm String No Specify a Java Virtual Machine called by a pipeline.  
-pipelineJvmOptions String No Specify Java Virtual Machine options used by a pipeline.  
-examples flag No Prints examples of common usage.  

Examples of common usage

In these examples we assume

  • the MapContour application is saved in a file named MapContour.jar.
  • the surface on which the original contours were drawn is stored in file surface.obj
  • the contour to be mapped onto a two dimensional surface is stored in file contour.ucf
  • the 2d output contour will be saved in a file named newContour.ucf

Map a ucf contour file onto a 2d surface

java -jar MapContour.jar -shape surface.obj -contour contour.ucf -output newContour.ucf

Map a contour in an Obj file onto the the 2d dual surface

java -jar MapContour.jar -dual -shape surface.obj -contour contour.obj -output newContour.obj

Flatten Sulcus No. 33 (Left Hemisphere)

The images, below, result from this flatten command:

java -jar MapContour.jar -shape 10102_n3_305_6p_475_L.obj -contour 33L.obj -output 33L.flat.obj

Sulcus 33 (Left):
Sulcus 33 (Left)
Flattened Sulcus 33 (Left):
Flattened Sulcus 33 (Left)

System requirements

  • Platform - Platform independent
  • Operating System - Any OS that has Java 1.5 or greater.

See Also

Acknowledgments

This program is a product of the CCB Shape Tools program.

Attachment sort Action Size Date Who Comment
33L.png manage 15.4 K 25 Jan 2008 - 23:04 CraigSchwartz Sulcus 33 (Left)
33L.flat.png manage 5.7 K 25 Jan 2008 - 23:05 CraigSchwartz Flattened Sulcus 33 (Left)