Skip to content.
CCB > CCBSIGS > ShapeToolLibraryProgram > ShapeToolProgramProductStatusSummary > ContourTopologyCheckerProjectDefintionV1x0
Public web page of ContourTopologyChecker

ContourTopoologyChecker Project Definition ( v1x01 )

Overview

Restrictions, Exclusions, Limitations

  • Only contour and surface files supported by the ShapeTools? libary are supported.
  • java 1.5 is expected.
  • The suface mesh must be formed only of triangular faces.

People Affected

Person Initials Role Notes
Bae Cheol BC programmer  
Craig Schwartz CS project supervisor and programmer  
Ryan Cabeen RC advisor  
Roger Woods RW project sponsor  

Version

1.0.1

Assumptions

  • if both test and reference contours are present, the N'th element of the test list is the same anatomical contour as the N'th element of the reference list.

Requirements

  • Java 1.5 is used to implement this program

Requirements Change Procedure

  • Changes to be mutually agreed upon by __ and __.
  • Changes and their date will be entered in a 'requirements change' list.

Requirements Changes

Add table output alternative

  • Change Date: 26 Feb 2008
  • Approved by
    • Ryan Cabeen
    • Craig Schwartz

The output table may optionally contain all input files. Each line of the output table will contain:

  • the path to the input file
  • A string indicating if the file passed or failed the test.

The text used to indicate "passed" or "failed" may be changed by the user via the command line arguments

  • -passedText text
  • -failedText text

If these arguments are not found, the default values will be

  • Passed - "Passed"
  • Failed - "Failed"

The two elements of the output lines of the table will be separated by a text delimiter whose default value is a tab. This delimiter may be changed via a runtime argument of

  • -delimiter delimiterText

Add table output alternative

Change Date: 24 March 2008

Approved by

  • Ryan Cabeen
  • Craig Schwartz

Change Details

Add an optional additional test for pass/fail - specify a set of atlas sulcal curves whose vertices (Vs) will each be compared with the homologous points in all the subject sulcal curves (Vh). If the distance between these two vertices iseither

  • significantly larger than the distance between two sucessive points of the same sulcal curve (Vh0, Vh1) then fail.
  • larger than a threshold value (defaults to 64) then fail.

Assumptions:

the file base names in the subject sulcal curves and in the set of atlas sulcal curves are the same, allowing the proper curve to be selected for comparison this assumption is not yet validated

example of new usage

java -jar checker.jar -atlas list_of_atlas_curves -files list_of_subject_sulcal_curves -passed -report report.out

Add distance to map edge test

Change Date: 9 April 08

Approved by

  • Ryan Cabeen (approval pending)
  • Craig Schwartz

Completed Date: 10 April 08

Change Details

Add to the "pass" testing the requirement that each vertex of the contour being tested be further than a specified distance from the edge of the flattend space.

  • This distance will default to 1
  • this distance may be changed at runtime by the user.
  • this test may be disabled at runtime by the user
  • the distance metric used is a Euclidean distance

Test reference contour vertices for boundary and inclusion on manifold.

Change Date: 11 April 08

Approved by

  • Ryan Cabeen
  • Craig Schwartz

Completed Date: 11 April 08

Change details

if present, each vertex of the reference contour homologous to the test contour is tested for

  • being on the manifold
  • being too close to the border of the mainfold.
These tests are exactly the same as those applied to the test contour references, except that the test contour vertices are also checked for closeness to the reference contour vertices.

"homologous to" means: if contour #N in the list of test contours is being checked, also check reference contour #N.

example of new usage

Reject contours containing vertices whose distance to the map edge is 5 or less java -jar checker.jar -distanceToEdge 5 -files list_of_subject_sulcal_curves -passed -report report.out

Disable the distance to edge test

java -jar checker.jar -disableDistanceToEdge -atlas list_of_atlas_curves -files list_of_subject_sulcal_curves -passed -report report.out

Allow for null elements that always fail

Change Date: 14 May 2008

Approved by

  • Ryan Cabeen
  • Craig Schwartz

Change Details

The user will specify a symbol on the command line that when encountered at the i-th element in either the target or the reference lists, the i-th element of the report will be the fail symbol.

example of new usage

Suppose we have the null symbol be "NULL" with the following lists:

$ cat tart_files.txt
target_a.obj
target_b.obj
target_c.obj

$ cat ref_files.txt
reference_a.obj
NULL
reference_c.obj

Then the following call:

java -jar checker.jar -null "NULL" -atlas tar_files.txt -files ref_files.txt -passed -report report.out

Would produce output where the second element of 'report.out' would be a fail.

Products

This project will result in the following products:
  • An application program that maps contours to a 2d grid
  • a pipleline wrapper (.pipe) file for the GRID build
  • A Twiki user web page describing the topology checking algorithm

Typical Usage

java -jar BlendFlatmap in.rdd inDual.rdd out.rdd

Lessons Learned

(filled out after the post-project review)
  • lesson 1

Contour Topology Checker

Overview

This program examines a group of flattened contours (see MapContour to flatten the contours) to determine if any contours in the group cross the edges of the two dimensional map obtained by flattening the three dimensional surface (flatmap).

Applications that attempt to create averages from such contours will fail unless the original three dimensional topology (implied by the flattened map) is fully accounted for; such lines may be referred to as having 'fallen off' the edge of the two dimensional flattened surface.

This program is useful to determine whether a particular contour may be properly handled by warping protocols that do not account for all these special case topologies. This enables a user of such protocols to prune troublesome contours before starting the time consuming warping process.

Project Components

A sample shell script

This C- Shell script determines which contours contain segments that extend over the edges of the 2d square onto which they are flattened.


#!/bin/csh

# this script determines which of a set of input contours
# contain segments that cross the bounds of the 2D, 256x256 space onto
# which they are flattened.


# version 7 January 2008

set verboseArg="-verbose "

# directory wth contour lines
set linesDir=data/10580/lines/R
set outputDir=output
mkdir -p ${outputDir}


# the surface on which these lines were drawn
set surface=data/10580/surface/10580_n3_305_6p_450_R.obj

# path to the output report 
set report="10580.fallen.txt"

# define the applications to use

# directory containing application jar files.
set jarDir=/nethome/users/shapetls/ShapeTools

# path to MapContour
set flattenContour=${jarDir}/MapContour.jar

# path to ContourTopologyCheck
set checkTopology=${jarDir}/ContourTopologyCheck.jar


foreach i ($linesDir/*.obj)
  set output=${outputDir}/$i:t
  echo "flattening contour $i into ${output}"
  java -jar ${flattenContour} ${verboseArg} -overwrite -shape ${surface}  -contour ${i} -output ${output}

  set output=$i:t
  set output=$output:r.dual.obj
  set output=${outputDir}/$output
  echo "flattening contour $i dual into ${output}"
  java -jar ${flattenContour} ${verboseArg} -dual -overwrite -shape ${surface}  -contour ${i} -output ${output}end

# check for flattened lines containiing vertices not in standard 2d flatmap space  ('falling off')

echo "checking for contour(s) that will fail"
java -jar ${checkTopology} ${verboseArg} -overwrite -directory ${outputDir}  -failed -report ${report}

echo "Done. The output report is in file ${report}"