Add source related to generation of functionality coverage.

Add python script that generates coverage_table.txt from coverage.csv file
which is included in the sphinx docs.
This commit is contained in:
Kyle Mandli
2011-07-15 18:55:00 -05:00
parent 06b0ddab67
commit fb8efcf904
2 changed files with 85 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
"Make movie from multiframe image ", immovie
"Play movies, videos, or image sequences ", implay
"Display image ", imshow
"Image Tool ", imtool
"Display multiple image frames as rectangular montage", montage
"Display multiple images in single figure ", subimage
"Display image as texture-mapped surface ", warp
"Read metadata from header file of Analyze 7.5 data set ",analyze75info
"Read image data from image file of Analyze 7.5 data set ",analyze75read
"Anonymize DICOM file ",dicomanon
"Get or set active DICOM data dictionary ",dicomdict
"Read metadata from DICOM message ",dicominfo
"Find attribute in DICOM data dictionary ",dicomlookup
"Read DICOM image ",dicomread
"Generate DICOM unique identifier ",dicomuid
"Write images as DICOM files ",dicomwrite
"Read high dynamic range (HDR) image ",hdrread
"Write Radiance high dynamic range (HDR) image file ",hdrwrite
"Read metadata from Interfile file ",interfileinfo
"Read images in Interfile format ",interfileread
"Check if file is R-Set ",isrset
"Create high dynamic range image ",makehdr
"Read metadata from National Imagery Transmission Format (NITF) file",nitfinfo
"Read image from NITF file ",nitfread
"Open R-Set file ",openrset
"Create reduced resolution data set from image file ",rsetwrite
"Render high dynamic range image for viewing ",tonemap
1 Make movie from multiframe image immovie
2 Play movies, videos, or image sequences implay
3 Display image imshow
4 Image Tool imtool
5 Display multiple image frames as rectangular montage montage
6 Display multiple images in single figure subimage
7 Display image as texture-mapped surface warp
8 Read metadata from header file of Analyze 7.5 data set analyze75info
9 Read image data from image file of Analyze 7.5 data set analyze75read
10 Anonymize DICOM file dicomanon
11 Get or set active DICOM data dictionary dicomdict
12 Read metadata from DICOM message dicominfo
13 Find attribute in DICOM data dictionary dicomlookup
14 Read DICOM image dicomread
15 Generate DICOM unique identifier dicomuid
16 Write images as DICOM files dicomwrite
17 Read high dynamic range (HDR) image hdrread
18 Write Radiance high dynamic range (HDR) image file hdrwrite
19 Read metadata from Interfile file interfileinfo
20 Read images in Interfile format interfileread
21 Check if file is R-Set isrset
22 Create high dynamic range image makehdr
23 Read metadata from National Imagery Transmission Format (NITF) file nitfinfo
24 Read image from NITF file nitfread
25 Open R-Set file openrset
26 Create reduced resolution data set from image file rsetwrite
27 Render high dynamic range image for viewing tonemap
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env python
import csv
def table_seperator(cols,lengths,character="-"):
output = "+"
output += '+'.join([character*(length+2) for length in lengths])
output += "+"
return output
def table_row(data,lengths,num_columns=None):
if num_columns is None:
num_columns = len(data)
output = "|"
for i in xrange(num_columns):
if len(data)-1 >= i:
entry = data[i]
else:
entry = ""
output += " " + entry + " "*(lengths[i] - len(entry)) + " |"
return output
csv_path = 'test.csv'
reader = csv.reader(open(csv_path,'r'),delimiter=',',quotechar='"')
# Find number of columns and column widths, base number of columns is
# determined by the headers
page_title = "Coverage Tables"
print page_title
print "="*len(page_title)
print
table_names = ["Image Display and Exploration","Image File I/O"]
for table in table_names:
num_columns = 3
data = [["Functionality","Matlab","Scipy"]]
for row in reader:
if len(row) == 0:
break
data.append([entry.expandtabs() for entry in row])
num_columns = max(num_columns,len(row))
column_lengths = [0]*num_columns
for row in data:
for i in xrange(len(row)):
column_lengths[i] = max(column_lengths[i],len(row[i]))
print table
print "-"*len(table)
print
print table_seperator(num_columns,column_lengths,character="-")
print table_row(data[0],column_lengths,num_columns)
print table_seperator(num_columns,column_lengths,character="=")
for row in data[1:]:
print table_row(row,column_lengths,num_columns)
print table_seperator(num_columns,column_lengths,character='-')
print
print