Skip to content

Commit

Permalink
fix double array
Browse files Browse the repository at this point in the history
  • Loading branch information
szou28 committed Nov 20, 2017
1 parent 7ef00bd commit ce3bbda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, fn):
# NB: 1 byte becomes 1 double here! I.e. we were using 0-255 levels.
def Get(self):
bytes = File.ReadAllBytes(self._fn_)
return Utils.UArray.ToDoubleArrayFromDoubleBytes(bytes)
return Utils.UArray.ToDoubleArray(bytes)

class TxtDataAccessor(Accessor):
def __init__(self, fn):
Expand Down
2 changes: 1 addition & 1 deletion IOUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def ReadData(fsL, fsI, maxImageCount, startImage):
while i < readImageCount:
# Step 4a: Read the image
fsI.Read(image, 0, image.Length)
images.append(Utils.UArray.ToDoubleArrayFromInt8Bytes(image))
images.append(Utils.UArray.ToDoubleArray(image))
i += 1
# Step 5: Build the data point collection
print "Done reading images"
Expand Down
4 changes: 2 additions & 2 deletions Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def ToDoubleArray(point):

# NB: Python and our script treat 'float' arrays as C# doubles!
# Hence 8 byte offets!
def ToDoubleArrayFromDoubleBytes(point):
def ToDoubleArray(point):
result = Array.CreateInstance(Double, point.Length / 8)
n = 0
while n < point.Length:
Expand All @@ -42,7 +42,7 @@ def ToDoubleArrayFromDoubleBytes(point):

ToDoubleArrayFromDoubleBytes = staticmethod(ToDoubleArrayFromDoubleBytes)

def ToDoubleArrayFromInt8Bytes(point):
def ToDoubleArray(point):
result = Array.CreateInstance(Double, point.Length)
i = 0
while i < point.Length:
Expand Down

0 comments on commit ce3bbda

Please sign in to comment.