Browse files

Added a legend to the filter table script

At the end the script now adds a small table that describe the colors
used in the filter table.

Also fixed a bug when the output file name was just a file name
without a path.

Change-Id: I5620becec26a5fd53cb641d5170efd84e9fdec92
  • Loading branch information...
1 parent 2071e84 commit 17e1ca7b420917a3fbbd6f9e32f8d95bcc2cfd2e @dave3d dave3d committed Sep 5, 2012
Showing with 34 additions and 1 deletion.
  1. +34 −1 Utilities/CSVtoTable.py
View
35 Utilities/CSVtoTable.py
@@ -79,8 +79,10 @@ def usage():
print inname, outname
+# if outname includes a path that doesn't exist, create that path
if not os.path.isdir( os.path.dirname( outname ) ):
- os.makedirs( os.path.dirname( outname ) )
+ if len(os.path.dirname(outname)):
+ os.makedirs( os.path.dirname( outname ) )
outfile = open(outname, "w")
color = "FFFFFF"
@@ -152,6 +154,37 @@ def usage():
outfile.write( "</table>\n" )
+# Legend table
+outfile.write( "<p style=\"font-size:20px; margin-bottom:0px;\"><b>Legend</b></p>\n" )
+
+outfile.write( "<table border=1>\n" )
+
+outfile.write( "<tr>\n" )
+outfile.write( "<th>Color</th>\n" )
+outfile.write( "<th>Meaning</th>\n" )
+outfile.write( "</tr>\n" )
+
+outfile.write( "<tr>\n" )
+outfile.write( "<td bgcolor=20FF20> </th>\n" )
+outfile.write( "<td>Supported by SimpleITK and ITK</td>\n" )
+outfile.write( "</tr>\n" )
+
+outfile.write( "<tr>\n" )
+outfile.write( "<td bgcolor=C0FFC0> </th>\n" )
+outfile.write( "<td>SimpleITK only filter</td>\n" )
+outfile.write( "</tr>\n" )
+
+outfile.write( "<tr>\n" )
+outfile.write( "<td bgcolor=FFFFFF> </th>\n" )
+outfile.write( "<td>ITK filter that we plan to support in the future</td>\n" )
+outfile.write( "</tr>\n" )
+
+outfile.write( "<tr>\n" )
+outfile.write( "<td bgcolor=FF7070> </th>\n" )
+outfile.write( "<td>ITK filter that we will not support</td>\n" )
+outfile.write( "</tr>\n" )
+outfile.write( "</table>\n" )
+
if doxyFlag:
outfile.write( "*/\n" )

0 comments on commit 17e1ca7

Please sign in to comment.