Wolfram 语言

用户界面的强化

三维图像的增强

默认情况下,三维图像不会响应照明. 色彩值由给定的颜色函数完全决定.

显示完整的 Wolfram 语言输入
In[1]:=
Click for copyable input
func = Blend[{{0, RGBColor[0.035, 0.058, 0, 0]}, {0.1, RGBColor[0.015, 0, 0.035, 0]}, {0.2, RGBColor[0, 0, 0, 0.032]}, {0.3, RGBColor[0.103, 0.032, 0, 0]}, {0.4, RGBColor[0, 0, 0, 0]}, {0.5, RGBColor[0.202, 0.203, 0.218, 0.337]}, {0.6, RGBColor[0.403, 0.405, 0.400, 0.457]}, {0.7, RGBColor[0.485, 0.474, 0.603, 0.682]}, {0.8, RGBColor[0.861, 0.836, 0.838, 0.794]}, {0.9, RGBColor[0.459, 0.475, 0.458, 0.842]}, {1, RGBColor[0.562, 0.519, 0.554, 0.962]}}, #] &; options = {BoxRatios -> {1, 1, 1}, ViewVertical -> {0, -0.5, -1}, ViewPoint -> {Left, Front}, ColorFunction -> func, Boxed -> False};
In[2]:=
Click for copyable input
data = Import["ExampleData/CThead.tiff", "Data"];
In[3]:=
Click for copyable input
img3d = Image3D[data, "Byte", options, ImageSize -> 400]
Out[3]=

打开体照明有助于突出表面细节. 在这种情况下,定向光被加到屏幕的平面上,镜面反射(specularity)被加到图像对象上.

In[4]:=
Click for copyable input
ImageCrop[ Show[Graphics3D[Specularity[Orange, 3], Background -> Black], Image3D[img3d, Method -> {"VolumeLighting" -> True}], options, Lighting -> {{"Directional", White, ImageScaled[{0, 0, 2}]}}, ImageSize -> 700], {410, 410}]
Out[4]=

通过内插值进一步增强颗粒状图像.

In[5]:=
Click for copyable input
fine = ImageCrop[ Show[Graphics3D[Specularity[Orange, 3], Background -> Black], Image3D[img3d, Method -> {"VolumeLighting" -> True, "InterpolateValues" -> True}], options, Lighting -> {{"Directional", White, ImageScaled[{0, 0, 2}]}}, ImageSize -> 700], {410, 410}]
Out[5]=

可视化从原始图像到内插和突出显示图像的过渡.

显示完整的 Wolfram 语言输入
In[6]:=
Click for copyable input
original = ImageCrop[ Show[img3d, options, Background -> Black, ImageSize -> 700], {410, 410}];
In[7]:=
Click for copyable input
Animate[Overlay[{original, SetAlphaChannel[fine, i]}], {i, 0, 1}, AnimationRate -> 1/3, AnimationDirection -> ForwardBackward]
播放动画
停止播放动画

相关范例

de en es fr ja ko pt-br ru