A collection of questions and answers about the surface warp protocol workflows.
Octahedral Warp Protocol
Why do I get this error ? : "Error: The shapes must have the same number of vertices."
This is generated by the "Create Atlas" Module, during the process that averages a
group of contours. The contours to be averaged are listed in temporary file that
are saved in the "Atlas" directory specified in your pipeline module. The names of these
files begin with the text "flat_rsp_" and end in a ".txt" suffix. These files are
lists of the paths to sulcal contours. Each of these listed contours must contain the
same number of vertices. If not, the error message listed above appear.
Typically, the listed contour files are created when the protocol is run, ensuring that each
contour has the same number of vertices (100, by default). If this error occurs, something
has gone awry.
To determine the problem, examine all the contours to verify that they each contain the same
number of vertices. The ShapeTools? application [[][ShapeReporter]] will report the number of vertices
in a shape file, and is useful for this diagnostic procedure. A simple shell script that will report
the number of vertices in each file listed in a "flat_rsp_contourXXX.txt" file follows
# script name: countVertices.sh
# report the number of vertices in contours listed in a file.
# usage:
# sh countVertices.sh list_of_contour_files
# java interpreter location
java=/usr/bin/java
# shape tools binaries dir
bin=~shapetls/bin/ShapeTools
# ShapeReporter jar file
rpt=${bin}/ShapeReporter.jar
# disable/enable colum headers (uncomment one of the next two lines)
#noheader=""
noheader="-noheader"
# check usage
if [ $# -eq 0 ]; then
echo "Usage: `basename $0` listOfContourFilePaths ";
exit;
fi
for ucf in `cat $1`; do
n=`$java -jar $rpt $noheader -shape $ucf -numVertices`
echo $ucf $n
done
~ ~
As an example of it's use, we will examine the number of vertices in the list of
contours for a subject. This example looks at the vertex count for each time
that sulcus 27 was provided for a subject.
This is how the utility script is run:
sh countVertices.sh Atlas/flat_rsp_contour_27.txt
and it produces this output:
Subjects/10102/flat_rsp_contour_27.ucf 100
Subjects/10103/flat_rsp_contour_27.ucf 100
Subjects/10107/flat_rsp_contour_27.ucf 100
Subjects/10127/flat_rsp_contour_27.ucf 100
Subjects/10132/flat_rsp_contour_27.ucf 100
Subjects/10133/flat_rsp_contour_27.ucf 100
Subjects/10148/flat_rsp_contour_27.ucf 100
Subjects/10157/flat_rsp_contour_27.ucf 100
Subjects/10160/flat_rsp_contour_27.ucf 100
Subjects/10161/flat_rsp_contour_27.ucf 100
Subjects/10162/flat_rsp_contour_27.ucf 100
Subjects/10166/flat_rsp_contour_27.ucf 100
Subjects/10178/flat_rsp_contour_27.ucf 100
Subjects/10203/flat_rsp_contour_27.ucf 100
Subjects/10205/flat_rsp_contour_27.ucf 100
Subjects/10206/flat_rsp_contour_27.ucf 100
Subjects/10234/flat_rsp_contour_27.ucf 100
Subjects/10236/flat_rsp_contour_27.ucf 100
Subjects/10239/flat_rsp_contour_27.ucf 100
Subjects/10243/flat_rsp_contour_27.ucf 100
Subjects/10253/flat_rsp_contour_27.ucf 100
Subjects/10254/flat_rsp_contour_27.ucf 100
Subjects/10287/flat_rsp_contour_27.ucf 127
Subjects/10288/flat_rsp_contour_27.ucf 100
Subjects/10292/flat_rsp_contour_27.ucf 100
It seems that something is wrong with the files for subject number 10288.
The 'create atlas' module does not recompute files during successive runs, if they
are already present, so as not to needlessly recalculate interim data files.
The most likely explanation, in this case, is that the resampled contour
files for subject 10288 (files with prefixes of "rsp_" and "flat_rsp_") were created or copied
from a different warp protocol run. Thus, in this case, the problem can be fixed by deleting the
derived, temporary contours, and then restarting the warping workflow.