Skip to content

Commit

Permalink
fix overfull knossos cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
normanrz committed Dec 5, 2019
1 parent 1f6521d commit 0b77402
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wkcuber/knossos.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def read_cube(self, cube_xyz):
cube_data = np.fromfile(cube_file, dtype=self.dtype)
if cube_data.size != CUBE_SIZE:
padded_data = np.zeros(CUBE_SIZE, dtype=self.dtype)
padded_data[0 : min(cube_data.size, CUBE_SIZE)] = cube_data
padded_data[0 : min(cube_data.size, CUBE_SIZE)] = cube_data[
0 : min(cube_data.size, CUBE_SIZE)
]
cube_data = padded_data
cube_data = cube_data.reshape(CUBE_SHAPE, order="F")
return cube_data
Expand Down

0 comments on commit 0b77402

Please sign in to comment.