Skip to content

Commit

Permalink
Convert threshold argument from HU to 8bit integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrodehl committed Aug 24, 2020
1 parent 9b25933 commit 059a732
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def plot_3d(image, desc, prefixpath="", threshold=-300, show=False,
# so the head of the patient would be at the top facing the camera
p = image.transpose(2, 1, 0)

verts, faces, normals, values = measure.marching_cubes(p, threshold)
hu_to_8bit = int(255. * (threshold + 1024.) / 4095.)
verts, faces, normals, values = measure.marching_cubes(p, hu_to_8bit)

fig = plt.figure(figsize=(10, 10))
ax = fig.add_subplot(111, projection='3d')
Expand Down

0 comments on commit 059a732

Please sign in to comment.