-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #365 from K3D-tools/devel
2.14.5
- Loading branch information
Showing
73 changed files
with
1,386 additions
and
867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ObjectType = Image | ||
NDims = 3 | ||
BinaryData = True | ||
BinaryDataByteOrderMSB = False | ||
CompressedData = True | ||
CompressedDataSize = 809269 | ||
TransformMatrix = 1 0 0 0 1 0 0 0 1 | ||
Offset = -83.319299999999998 -245.31899999999999 -206.19999999999999 | ||
CenterOfRotation = 0 0 0 | ||
AnatomicalOrientation = RAI | ||
ElementSpacing = 0.36132799999999998 0.36132799999999998 0.5 | ||
DimSize = 512 512 317 | ||
ElementType = MET_SHORT | ||
ElementDataFile = mask.zraw |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import SimpleITK as sitk | ||
import numpy as np | ||
import os | ||
|
||
import k3d | ||
|
||
|
||
def generate(): | ||
filepath = os.path.join(os.path.abspath(os.path.dirname(__file__)), | ||
'../../assets/factory/heart.mhd') | ||
|
||
im_sitk = sitk.ReadImage(filepath) | ||
img = sitk.GetArrayFromImage(im_sitk) | ||
|
||
filepath = os.path.join(os.path.abspath(os.path.dirname(__file__)), | ||
'../../assets/factory/mask.mhd') | ||
|
||
mask_sitk = sitk.ReadImage(filepath) | ||
mask = sitk.GetArrayFromImage(mask_sitk) | ||
|
||
plt_mip = k3d.mip(img.astype(np.float32), | ||
mask=mask.astype(np.uint8), | ||
mask_opacities=[0.025, 3.0], | ||
color_range=[0, 700]) | ||
|
||
plot = k3d.plot() | ||
plot += plt_mip | ||
|
||
plot.snapshot_type = 'inline' | ||
|
||
return plot.get_snapshot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import SimpleITK as sitk | ||
import numpy as np | ||
import os | ||
|
||
import k3d | ||
|
||
|
||
def generate(): | ||
filepath = os.path.join(os.path.abspath(os.path.dirname(__file__)), | ||
'../../assets/factory/heart.mhd') | ||
|
||
im_sitk = sitk.ReadImage(filepath) | ||
img = sitk.GetArrayFromImage(im_sitk) | ||
|
||
filepath = os.path.join(os.path.abspath(os.path.dirname(__file__)), | ||
'../../assets/factory/mask.mhd') | ||
|
||
mask_sitk = sitk.ReadImage(filepath) | ||
mask = sitk.GetArrayFromImage(mask_sitk) | ||
|
||
plt_volume = k3d.volume(img.astype(np.float32), | ||
mask=mask.astype(np.uint8), | ||
mask_opacities=[0.025, 3.0], | ||
color_range=[0, 700]) | ||
|
||
plot = k3d.plot() | ||
plot += plt_volume | ||
|
||
plot.snapshot_type = 'inline' | ||
return plot.get_snapshot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.