Skip to content.
MAST > MastSoftware > TranslateTo

TranslateTo

version 1.0d0, 11 October 2010

Synopsis:

TranslateTo: A Java application that translates a Shape data file into a differing output file format.

TranslateTo -check -type OutputType -input inputFile
determines if the input file may be translated to the specified output type.
TranslateTo -input inputFile -type OutputType -output outputFile
Translates the input file to the specified file type and saved in a file named outputFile.
TranslateTo -list
list the output file format abbreviations acceptable as a -type value.
TranslateTo -help
print a synopiss of usage and command lne arguments accepted by TranslateTo.

Description

TranslateTo provides an automatic file format translation service for file formats read by the ShapeToolsIO library. TranslateTo uses the file format properties descriptions and the ShapePreparer classes contained in the ShapeToolsIO library file readers and writsr to map common geometry file compoenents to an output file format, if supported by the output format.

Where possible, per-vertex attributes are written to the output format; however, because each output format varies in the number and data type of allowed per-vertex attributes, lossless copying of vertex attributes cannot be guaranteed.

Each file format writer is reqauired to supply the means to prepare an arbitary input Shape for writing; This may include creating requried components (e.g. vertex normals). Thus, TranslateTo is essenially a wrapper for the various ShapePreparer classes provided by the ShapeToolsIO library file format writers. The sophistication and completeness of the preparation process varies with the output file format.

Download

The TranslateTo application is availble in the Shape Tools Application Software download package.

Usage

The only required parameter is an input file.

Usage: java -jar TranslateTo.jar -input inputFile [options]

Argument Type Required Description Notes
-list flag No Lists supported file types.  
-check flag No checks to see if translation is possible. No translation performed. Result may be changed via the "-canPrepareValue" and "-cannotPrepareValue" arguments
-o flag No Enables replacing of output file, if it already exists..  
inputType String No Input file type used to check whether translation is possible.  
-type String Yes Set output file type.  
-input File Yes input file  
-output File No output file  
-triangulate flag No Attempt to triangulate surface before translations  
-orient flag No Attempt to triangulate and consistently orient surface before translations  
-options String No Set format specific translation options  
-canPrepareValue String No String printed checking indicates a translation is possible. Default value is:yes
-cannotPrepareValue String No String printed checking indicates a translation is not possible. Default value is:no
-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.  

Features

  • Supports all writable Shape Tools file formats
  • Has preview mode which determines if a translatiion is possible without actually performing the translation.
  • Lists all valid output type abbreviations (-list).
  • The printed text results of a -check operation may be changed. The default values are "yes" and "no". These may be changed to any text string via the -canPrepareValue and -cannotPrepareValue arguments.
  • Allows explicit triangulation of surfaces

Examples

Check whether a contour file may be translated to a PLY surface mesh

Running "java -jar TranslateTo.jar -check -verbose -input k.ucf -type PlyAsciiMeshRead causes a "no" to be printed to the output

Running 'java -jar TranslateTo.jar -check -verbose -input data/xytorus01.tm -type PlyAsciiMesh causes a "yes" to be printed to the output. (.tm denots a trinagle model surface file).

List valid output file type abbreviations

The elements of the list printed to the standard output are valid "-type" values.

Excuting the command "java -jar TranslateTo.jar -list" produces the following output (version 1.) :

BrainVisaAsciiMesh A BrainVisa Mesh Ascii encoded file
CCBBM A CCB BM surface mesh file.
DFS2 A Duff DFS surface file, version 2.
FreeSurferBinaryTriangle A FreeSurfer binary endcoded triangle mesh surface file.
GeomviewOFF A GeomView OFF geometry surface file.
LoniTM A LONI Triangle Model surface file.
LoniUCF A LONI Universal Contour File
MincAsciiObj A MINC ascii encoded polygon surface file.
MincBinaryObj A MINC binary encoded polygon surface file.
MincLinesObj A MINC ascii encoded line file.
OpenDxNative An OpenDX general format file.
PlyAsciiMesh A PLY ascii encoded surface file.
PlyBigEndianBinaryMesh A PLY Big Endian binary encoded surface file.
PlyLittleEndianBinaryMesh A PLY Little Endian binary encoded surface file.
VTKAsciiXmlPolyData A VTK XML ascii encoded PolyData file
VTKBigEndianXmlPolyDataAppended A VTK XML PolyData file storing data in a Big Endian binary AppendedData element.
VTKBigEndianXmlPolyDataInline A VTK XML PolyData file storing data in inline Little Endian binary elements.
VTKLittleEndianXmlPolyDataAppended A VTK XML PolyData file storing data in a Little Endian binary AppendedData element.
VTKLittleEndianXmlPolyDataInline A VTK XML PolyData file storing data in inline Little Endian binary elements.
VTKUnstructuredGrid A VTK Ascii encoded Unstructured Grid file

Check whether a translation is possible

Translate contour files to a LONI UCF

  java -jar TranslateTo.jar -input k.vtp -type LoniUCF -output k.ucf 

Translate Ucf files to other contour formats

 java -jar TranslateTo -input hippo.ucf  -type MincLinesObj -output hippo.obj

Frequently Asked Questions

How can I determine if a particular translation is possible ?

Use the "-check" mode of TranslateTo. TranslateTo will determine if the translation is possible. A text string is printed to the console output showing if the requested translation is supported. The default output values ("yes", "no") may be changed via the output flags "-canPrepareValue" and "-cannotPrepareValue"

To illustrate, checking to determine if and open dx surface may be translated into a Minc Lines object will cause "no" to be printed to the console output.

   >TranslateTo -input Cortex.dx -check -type MincLinesObj
   >no

Translating a surface to the output types "LoniUCF" or "MincLinesObj" fails; how can I determine if I'm missing something ?

Usually, this occurs when translating a connnected mesh surface to a collection of lines (LoniUcf, MincLinesObj); TranslateTo will not change the surface topology. Surfaces are not turned into lines because TranslateTo does not know where to cut the surface. Future versions may add this capability.

The error messge:

Cannot prepare input: Cortex.dx as LoniUCF Reasons(s): 
Shape does not contain start and end vertex index attribute

occurs when the translation software cannot determine the endpoints of the Loni Ucf file contours.

Please see FAQ topic "How can I determine if a particular translation is possible ?"