Add documentation for basic usage, supported formats, and performance tips

- Created English and Chinese documentation for basic usage of the add-on, including data download, import, extraction, and rendering steps.
- Added support format documentation listing compatible file types for the add-on.
- Included links to open databases for volumetric data.
- Provided performance improvement tips for voxel reconstruction and rendering, including settings for low-resolution previews and balanced rendering configurations.
This commit is contained in:
2026-05-26 15:44:17 +08:00
parent 89dc08c2ed
commit 387921965f
61 changed files with 330 additions and 544 deletions

View File

@@ -1,3 +1,5 @@
**v2.0.x has been released, supporting only Blender 5.0+. The usage is completely different from before and is not compatible with old version files. See http://docs.omoolab.xyz/bioxelnodes/2.0.x/en/basics/**
[中文文档](https://docs.omoolab.xyz/bioxelnodes/latest/)
# Bioxel Nodes

46
docs/advanced.en.md Normal file
View File

@@ -0,0 +1,46 @@
# Advanced Usage
## Cut "Structure"
"Structure" can be cut to show partial structure, accomplished through the O Cut series nodes. For example, add the **O Cut to Region** node as shown below and connect it. Add any object from the scene as the "Region", and input it into the node:
![](assets/cut-to-region.png)
By properly adjusting the position and rotation of the "Region" object, you can see that the skull structure is confined within the region.
!!! note
The add-on provides a function to quickly make objects phantom. In 3D Viewport mode, right-click the "Region" object and select **Bioxel Nodes > Toggle Phantom** from the menu.
!!! warning
Cutting increases computation and affects real-time performance. Check Resample on O Layer to improve performance.
**O Cut Small Parts** node is a cleanup tool that quickly removes scattered fragments and keeps only clean, continuous large structures. However, the computation is particularly time-consuming, so be aware of performance.
![](assets/cut-small-parts.png)
If you are familiar with geometry nodes, you can also directly define the cutting execution range through **O Cut Structure**. For example, in the image below, select the part where the cutting position X is greater than 0.
![](assets/cut-structure.png)
## Structure Property Settings
Expand the Properties of **O Cutout by Threshold**, where you can directly modify various property values, but they can only be set uniformly. We can use field-type data to assign differences. Take the color property as an example: for instance, connecting a Position node directly produces the effect shown below:
![](assets/set-color-by-pos.png)
We can also map layer values to color gradients, which requires the **O Scalar Layer to Color** node (such conversion function nodes are all under Add > O Bioxel > Utilities in the node menu). Adjust as follows:
- **O Cutout by Threshold**: Set Threshold to 20
- **O Scalar Layer to Color**: Set From Min and From Max to 20 and 90 respectively
![](assets/scalar-to-color.png)
Since soft tissue CT values are lower than bone tissue, when the threshold is lowered, you can see that in addition to the skull, the attached soft tissue is also presented. The From Min and From Max of **O Scalar Layer to Color** define the color mapping range from 0 to 1. Therefore, low-value soft tissue appears black, and high-value bone tissue appears white.
We can also customize the mapping method through the **Closure** node in Blender 5.0+. For example, connect a **Color Ramp** node to change the black area belonging to soft tissue to dark red:
![](assets/scalar-to-color-ramp.png)
Ta-da! The anatomical rendering is done!
Other "Structure" properties can also be adjusted in this way. In addition to **O Scalar Layer to Color**, there is also **O Scalar Layer to Factor** to convert to a single value from 0 to 1.

49
docs/advanced.md Normal file
View File

@@ -0,0 +1,49 @@
# 高级玩法
## 切割「结构体」
「结构体」可以被切割,呈现部分结构,通过 O Cut 系列节点完成。比如按下图添加 **O Cut to Region** 节点并连接,添加任意来自场景的物体作为「区域」,输入到节点:
![](assets/cut-to-region.png)
适当调整作为「区域」物体的位置旋转,可以看到头骨结构被限制在区域范围内。
!!! note
插件提供快速让物体虚化的功能,在 3D 视图模式下,右键「区域」物体,菜单选择 **Bioxel Nodes > Toggle Phantom**
!!! warning
切割会增加计算量,影响实时性能,勾选 O Layer 的 Resample 来提高性能
**O Cut Small Parts** 节点,是清理神器,能快速把零碎的结构删除,只干净连续的大结构。但是计算特别耗时,注意性能。
![](assets/cut-small-parts.png)
如果你对几何节点很了解,你也可以通过 **O Cut Structure** 直接定义切割的执行范围,比如下图中,选择切割位置 X 大于 0 的部分。
![](assets/cut-structure.png)
## 「结构体」属性设置
展开 **O Cutout by Threshold** 的 Properties,你可以直接修改各项属性值,但都只能均一设置,我们可以用场类型数据赋予差异。以颜色属性为例,比如直接接入 Position 节点,效果如下:
![](assets/set-color-by-pos.png)
我们还可以把数据层的值映射为颜色渐变,这里需要用到 **O Scalar Layer to Color** 节点(这类转换功能的节点都在节点菜单,Add > O Bioxel > Utilities 下)。调整如下
- **O Cutout by Threshold**:Threshold 设置为 20
- **O Scalar Layer to Color**:From Min 和 From Max 分别设置为 20 和 90
![](assets/scalar-to-color.png)
由于软组织的 CT 值小于骨质,当阈值降低,可以看到除了头骨外,附着的软组织也被呈现了出来。**O Scalar Layer to Color** 的 From Min 和 From Max,定义了颜色从 0~1 的取值范围。因此低值的软组织呈现黑色,高值的骨质呈现白色
我们还可以通过 Blender 5.0+ 的 **Closure** 节点来自定义映射方式。比如连接 **Color Ramp** 节点,把属于软组织的黑区,改为暗红色
![](assets/scalar-to-color-ramp.png)
哒哒!解剖渲染就做好啦👍
其他「结构体」属性也可以按这样的方式调整,除了 **O Scalar Layer to Color**,还有 **O Scalar Layer to Factor** 来转换为 0~1 的单值

View File

@@ -1,118 +0,0 @@
# Advanced Usage
## Concepts
In the previous section, I mentioned some key concepts, I'll describe them in detail so that you can better understand the following operations.
### Container
First is the **Container**, it is the easiest to describe, you can think of it as a scene, or a solver container. it is the stage that carries all stuffs.
### Layer
Second is the **Layer**, which represents different fields of data under the same location in container of the same subject. Just as view layers in any map app, one as roads, one as satellite view, while in Bioxel, one as MRI, one as CT, one as electrical signals, etc. Some layers are for material, such as color, density, etc., we call them **Material Layer**. One container contains different layers of one subject each. Any external data imported into the container is converted into the layer.
### Component
Finally, the **Component**, which is a fragment of **Material Layer**. Multiple materials (Matters) may exist within the same area with different meanings of presentation, like objects in blender, each representing a part of the scene. Bioxel Nodes provides a series of nodes and tools that allow the user to create material layers (Components) based on the other layers (serve as source data), In the previous section, we used the CT data (layer) to make the material (matter) of skull, this process known as materialization.
## Attache the Muscles to the Skull
Multiple components can exist in one container, just as multiple objects can exist in one scene. They can be controlled individually or combined with each other to build complex scenes. Next, let's try cutouting muscle from the VHP anatomical images and attaching the muscles to the skull that created in the previous section. The anatomical images are very large, so I've cropped and scaled them down to 1/4 of their original size for ease of use. Download the file and unzip it into a new directory.
[VHP_M_AnatomicalImages_Head.zip](https://drive.google.com/file/d/164AjQX0tmgUpWZlleJ5i1IKHco4ytDu2/view?usp=drive_link)
You can also download the data directly from the official website, [https://data.lhncbc.nlm.nih.gov/public/Visible-Human/Male-Images/PNG_format/head/index.html](https://data.lhncbc.nlm.nih.gov/public/Visible-Human/Male-Images/PNG_format/head/index.html)
First import the CT data as described in [step by step](step_by_step.md). Then import the anatomical images, but unlike before, this time from the Geometry Nodes menu of the existing container (not the top menu), click **Bioxel Nodes > Import Volumetric Data (Init) > as Color**, locate to the unzipped folder, and select any .png file (do not multi-select, and do not select the folder). This way the imported layer will be in the same container as the previous CT data. You can also import by dragging it into the container geometry node interface instead of the 3D Viewport interface. Also note that **as Color** (not as Scalar) is clicked because the anatomical images are RGB data.
![alt text](assets/advanced_usage/image.png)
Let's take more time in the import options this time 🫡, first let's talk about what the **Original Spacing** is in the options, you can simply think of it as the original "pixel size" of a image, since the volume is 3D, its pixels (i.e., voxels) are cuboids with a length, width, and height rather than 2D rectangles. And their length, width, and height size is the **Spacing**.
Normally, Bioxel Nodes can read the spacing from the data header, and you don't need to fill in the value, but there is no record of that in any PNG image, so you need to input it manually. in the official description of the VHP, it is mentioned that each pixel of the anatomical images corresponds to the size of .33mm, and the thickness of each slice is 1mm, so the Original Spacing of the anatomical images should be set to `(0.33, 0.33, 1)`.
However, the file I provided is scaled by 1/4 for each image, so the X and Y axes need to be multiplied by 4. So the final Original Spacing should be set to `(1.33, 1.33, 1)`, which should be understandable, right? (If you are importing an official file, then it should still be set to `(0.33, 0.33, 1)`)
Layer Name should be set to "Anatomical Images", other options remain default, click Ok.
![alt text](assets/advanced_usage/image-1.png)
After importing, connect the "Cutout by Hue" node (Add > Bioxel Nodes > Component > Cutout by Hue) after the newly created "Fetch Layer" node, and turn on the Slice Viewer mode preview, as shown below.
![alt text](assets/advanced_usage/image-2.png)
In addition to spacing, the Dicom file also records the subject's position and orientation, but those information is apparently not recorded in PNG format. This results in a mismatch between the CT data and the anatomical images in position. We need to manually align this two layers: First, set the threshold of the "Cutout by Threshold" node to 0.2 so that the full head can be cutouted and displayed. Then add "ReCenter" node before "Cutout by Hue" node and "Cutout by Threshold" node each, then add Locater to the "anatomical images" workflow (see [step by step](step_by_step.md) for details), and finally add "Join Component" node (Add > Bioxel Nodes > Component > Join Component), and connect them as shown below, with the parameters set as shown.
![alt text](assets/advanced_usage/image-3.png)
The "Join Component" node allows you to merge two components together. Move and rotate the Locater object so that the two components are exactly the same in position. If you're having trouble matching them up, here's the exact transform values to fill in the Locater object properties.
![alt text](assets/advanced_usage/image-4.png)
Next let's cutout the muscles individually.
First let's talk about the "Cutout by Hue" node. Literally, it cutout regions by hue of color. If you select this node and press "M" key to temporarily mute it, you'll see that the data becomes a cube with blue parts in Slice Viewer mode. the default value of Hue in the "Cutout by Hue" node is red, meaning that the node retains areas of the body that are close to red, and strip out the blue, which is on the opposite side of the red in the hue ring, leaving the human body parts.
If you turn down the value of Sensitivity, you'll see that the visabile part is decreasing, leaving only the part more closer to red, and the muscle happens to be red, so we can easily cutout the muscle. The color of the specimen tissue is not as vibrant as it is in the live state, and we can fine-tune the color to restore the vibrancy by using the "Set Color by Color" node (Add > Bioxel Nodes > Property > Set Color by Color).
To finally put it all together, connect and set the nodes as shown below, where the two colors in "Set Color by Ramp 2" node are `E7D2C5` and `FFEDEC`. If everything is working correctly, you'll get the rendering below.
![alt text](assets/advanced_usage/image-5.png)
You can also add "Transfrom" and "Cutter" nodes at the end and all components.
![alt text](assets/advanced_usage/image-6.png)
The multimodal data of VHP do not have any deformation or scaling differences, but only positional differences, so all data can be aligned easily. However, in most cases, the differences of different modalities are so great that they need to be registered first, which is not possible with Bioxel Nodes at the moment (but it is in plan). Nevertheless, you can build different components based on the same layer and combine them together. For example, based on the CT data, with the "Cutout by Range" node, you can eliminate the low value regions (fat), eliminate the high value regions (bone), and you can still get the muscle. And then attach it to the skull.
![alt text](assets/advanced_usage/image-7.png)
However, the CT values of brain and muscle are very close to each other, so it is extremely difficult to separate the brain from the muscle by threshold. So how should cutout the brain?
## Cutout the Brain
We can use AI technology to realize the division of brain regions, this process is called Segmentation, and the brain regions are as label. There are many models and methods for medical image segmentation, here we recommend [Total Segmentator](https://github.com/wasserth/TotalSegmentator).
It is an out-of-the-box CT/MRI medical image segmentation Python library. You can deploy Total Segmentator locally or process your data through the official online site [https://totalsegmentator.com](https://totalsegmentator.com).
Let me demonstrate the operation, we are still using the CT data from VHP. Click on "Drop DICOM.zip or ..." and select the VHP_M_CT_Head.zip file. Enter "brain" below "Selected task", press Enter to confirm. Finally click "Process data" button.
![alt text](assets/advanced_usage/image-8.png)
Wait for the uploading and processing, after all, you will be redirected to the following page, click "Download results" button, download and unzip segmentations.zip to any folder directory.
![alt text](assets/advanced_usage/image-9.png)
In case you can't get the brain segment (label), you can download it directly (without unzipping it).
[VHP_M_CT_Head_Brain.nii.gz](https://drive.google.com/file/d/1KGiZ3G11YLXkGszSrvWQ9kTF4TMpxUPd/view?usp=drive_link)
Next we import the brain segment (label) into the container in the same way as we imported the anatomical imagess(under the same container), but this time selecting **as Label**, with the Layer Name set to "Brain", and leaving the other options as default. Once the import is complete, a new "Fetch Layer" node will be added. Create and set the node as shown below, and you should be able to see the surface of brain.
![alt text](assets/advanced_usage/image-10.png)
Do you see the "step" like shape on surface? this is due to the low precision of the AI segmentation results. So How to addressing the issue? Select the Fetch Layer node of the brain label, right-click to pop up menu, click **Bioxel Nodes > Resample Value**, in the dialog box, change the "Smooth Size" to 3 or higher (the higher it is, the slower the calculation will be), click OK and wait for the calculation to finish. When it is done, a new layer will be added, replace the original one, is it smoother? The following figure lists different levels of smoothing.
![alt text](assets/advanced_usage/image-11.png)
The smoother it is, the more comfortable it looks, but it also means that more details are lost and the calculation is slower.
But if you cut the brain, you will find that the cross-section is homogeneous, this is because the label type layer is does not contain any modality data itself. Bioxel Nodes provides a function to fill in any layer values by label, if you set the value below brain tissue in the non-brain region of CT data, then any "Cutout" node will only keep the brain region.
The operation is like this, select the "Fetch Layer" node of the CT data, right-click to pop up the menu, click **Bioxel Nodes > Fill Value by Label**, in the dialog box, Label is set to the newly imported brain label layer, Fill Value is set to -100 (as long as it is less than the Hu value of the brain tissue), click OK. wait for the data processing, a new data layer will be added to the container when it is finished.
As shown in the following figure, connect the nodes and set the node parameters, in which the two colors of "Set Color by Ramp 2" node are `B26267` and `EBC5B7`, and the "Cutout by Range" and "Set Color by Ramp 2" node are changed to "Value" mode (the default is "Factor" mode), because the maximum and minimum values of the brain are too close to each other and difficult to adjust in "Factor" mode. To make the brain tissue look more transparent, I add the "Set Properties" (Add > Bioxel Nodes > Property > Set Properties) node at the end and changed the "Density" to 0.5.
![alt text](assets/advanced_usage/image-12.png)
(Still feel not smooth enough? It's really hard to get rid of "step" surface completely at the moment)
Now the brain is done. Finally we combine all together and you get something like the following.
![alt text](assets/advanced_usage/image-13.png)
🤗 If you've followed the docs up to this point, give yourself a round of applause, you've mastered this addon! If you have trouble following the docs instruction, you can download the project files to understand how the nodes work.
[VHP.zip](https://drive.google.com/file/d/1EHB7sxNSvJNwmoTfFnpyOSsm2M_2Y0hO/view?usp=sharing)
AI segmentation is an essential part of volumetric data visualization. Therefore, the future Bioxel Nodes will integrate some commonly used AI segmentation models, so that users can complete the volumetric data visualization in place!

View File

@@ -1,118 +0,0 @@
# 高级用法
## 概念
在上一节中,我提到了一些关键概念,这里我将详细描述它们,以便您更好地理解后续操作。
### 容器
首先是 **容器 (Container)**,它最容易描述,您可以将其想象为一个场景,或一个求解器容器。它是承载所有内容的舞台。
### 图层
其次是 **图层 (Layer)**,它表示同一容器中同一对象在不同位置的不同数据字段。就像任何地图应用中的视图图层,一个显示道路,一个显示卫星图,而在 Bioxel 中,一个显示 MRI,一个显示 CT,一个显示电信号等。有些图层用于材质,如颜色、密度等,我们称它们为 **材质图层 (Material Layer)**。一个容器包含同一对象的不同图层。任何导入容器的外部数据都会转换为图层。
### 组件
最后是 **组件 (Component)**,它是 **材质图层** 的一个片段。同一区域中可能存在多个具有不同呈现意义的材质(物质),就像 Blender 中的对象,每个代表场景的一部分。Bioxel Nodes 提供了一系列节点和工具,允许用户基于其他图层(作为源数据)创建材质图层(组件)。在上一节中,我们使用 CT 数据(图层)来制作颅骨的材质(物质),这个过程称为**材质化 (materialization)**。
## 将肌肉附着到颅骨
一个容器中可以存在多个组件,就像一个场景中可以存在多个对象一样。它们可以单独控制,也可以相互组合以构建复杂的场景。接下来,让我们从 VHP 解剖图像中提取肌肉,并将其附着到上一节创建的颅骨上。解剖图像非常大,为了便于使用,我将其裁剪并缩放到原始大小的 1/4。下载文件并解压到新文件夹。
[VHP_M_AnatomicalImages_Head.zip](https://drive.google.com/file/d/164AjQX0tmgUpWZlleJ5i1IKHco4ytDu2/view?usp=drive_link)
您也可以直接从官方网站下载数据:[https://data.lhncbc.nlm.nih.gov/public/Visible-Human/Male-Images/PNG_format/head/index.html](https://data.lhncbc.nlm.nih.gov/public/Visible-Human/Male-Images/PNG_format/head/index.html)
首先按[分步指南](step_by_step.md)中所述导入 CT 数据。然后导入解剖图像,但与之前不同的是,这次从现有容器的几何节点菜单(不是顶部菜单)中点击 **Bioxel Nodes > Import Volumetric Data (Init) > as Color**,定位到解压后的文件夹,选择任意一个 .png 文件(不要多选,也不要选择文件夹)。这样导入的图层将与之前的 CT 数据位于同一容器中。您也可以通过将其拖入容器几何节点界面而不是 3D 视图界面来导入。另外请注意,点击的是 **as Color**(而不是 as Scalar),因为解剖图像是 RGB 数据。
![alt text](assets/advanced_usage/image.png)
这次让我们在导入选项上多花点时间。首先谈谈选项中的 **Original Spacing** 是什么,您可以简单地将其理解为图像的原始"像素大小"。由于体数据是 3D 的,其像素(即体素)是长方体而不是 2D 矩形,它们有长度、宽度和高度,这就是 **Spacing**。
通常,Bioxel Nodes 可以从数据头文件中读取间距,您不需要填写该值,但任何 PNG 图像都没有记录该信息,因此您需要手动输入。在 VHP 的官方说明中,解剖图像的每个像素对应 0.33mm 的大小,每个切片的厚度为 1mm,因此解剖图像的 Original Spacing 应设置为 `(0.33, 0.33, 1)`。
但是,我提供的文件已将每个图像缩放了 1/4,因此 X 和 Y 轴需要乘以 4。所以最终的 Original Spacing 应设置为 `(1.33, 1.33, 1)`,这应该很容易理解,对吧?(如果您导入的是官方文件,则仍应设置为 `(0.33, 0.33, 1)`)
Layer Name 应设置为 "Anatomical Images",其他选项保持默认,点击确定。
![alt text](assets/advanced_usage/image-1.png)
导入完成后,在新创建的 "Fetch Layer" 节点之后连接 "Cutout by Hue" 节点(Add > Bioxel Nodes > Component > Cutout by Hue),并打开 Slice Viewer 模式预览,如下图所示。
![alt text](assets/advanced_usage/image-2.png)
除了间距,Dicom 文件还记录了对象的位置和方向,但这些信息显然没有记录在 PNG 格式中。这导致 CT 数据和解剖图像在位置上不匹配。我们需要手动对齐这两个图层:首先,将 "Cutout by Threshold" 节点的阈值设置为 0.2,以便可以提取并显示完整的头部。然后在 "Cutout by Hue" 节点和 "Cutout by Threshold" 节点之前各添加一个 "ReCenter" 节点,然后在"解剖图像"工作流程中添加 Locater(详见[分步指南](step_by_step.md)),最后添加 "Join Component" 节点(Add > Bioxel Nodes > Component > Join Component),并按如下图所示连接和设置参数。
![alt text](assets/advanced_usage/image-3.png)
"Join Component" 节点允许您将两个组件合并在一起。移动和旋转 Locater 对象,使两个组件的位置完全一致。如果您难以对齐,以下是 Locater 对象属性的精确变换值。
![alt text](assets/advanced_usage/image-4.png)
接下来让我们分别提取肌肉。
首先谈谈 "Cutout by Hue" 节点。它的名称表明通过颜色色调提取区域。如果您选择此节点并按 "M" 键暂时静音它,您会看到数据在 Slice Viewer 模式下变成一个带有蓝色部分的立方体。"Cutout by Hue" 节点的默认 Hue 值是红色,这意味着该节点保留接近红色的区域,并去除蓝色(它在色调环上与红色相对),留下人体部分。
如果调低 Sensitivity 的值,您会看到可见部分减少,只留下更接近红色的部分,而肌肉恰好是红色的,因此我们可以轻松提取肌肉。标本组织的颜色不如活体状态那样鲜艳,我们可以使用 "Set Color by Color" 节点(Add > Bioxel Nodes > Property > Set Color by Color)来微调颜色以恢复活力。
最后,按如下图所示连接和设置节点,其中 "Set Color by Ramp 2" 节点中的两个颜色是 `E7D2C5` 和 `FFEDEC`。如果一切正常,您将获得如下图所示的渲染结果。
![alt text](assets/advanced_usage/image-5.png)
您还可以在末尾和所有组件上添加 "Transform" 和 "Cutter" 节点。
![alt text](assets/advanced_usage/image-6.png)
VHP 的多模态数据没有任何变形或缩放差异,只有位置差异,因此所有数据都可以轻松对齐。然而,在大多数情况下,不同模态之间的差异非常大,需要先进行配准,目前 Bioxel Nodes 尚不支持(但在计划中)。尽管如此,您可以基于同一图层构建不同的组件并将它们组合在一起。例如,基于 CT 数据,使用 "Cutout by Range" 节点可以消除低值区域(脂肪),消除高值区域(骨骼),仍能得到肌肉。然后将其附着到颅骨上。
![alt text](assets/advanced_usage/image-7.png)
然而,大脑和肌肉的 CT 值非常接近,因此通过阈值将大脑与肌肉分离极其困难。那么应该如何提取大脑呢?
## 提取大脑
我们可以使用 AI 技术来实现大脑区域的划分,这个过程称为**分割 (Segmentation)**,大脑区域称为**标签 (Label)**。医学图像分割有很多模型和方法,这里推荐 [Total Segmentator](https://github.com/wasserth/TotalSegmentator)。
这是一个开箱即用的 CT/MRI 医学图像分割 Python 库。您可以在本地部署 Total Segmentator,也可以通过官方在线网站 [https://totalsegmentator.com](https://totalsegmentator.com) 处理您的数据。
让我演示一下操作,我们仍然使用 VHP 的 CT 数据。点击 "Drop DICOM.zip or..." 并选择 VHP_M_CT_Head.zip 文件。在 "Selected task" 下方输入 "brain",按 Enter 确认。最后点击 "Process data" 按钮。
![alt text](assets/advanced_usage/image-8.png)
等待上传和处理,之后您将被重定向到以下页面,点击 "Download results" 按钮,下载并解压 segmentations.zip 到任意文件夹。
![alt text](assets/advanced_usage/image-9.png)
如果您无法获取大脑分割(标签),可以直接下载(无需解压)。
[VHP_M_CT_Head_Brain.nii.gz](https://drive.google.com/file/d/1KGiZ3G11YLXkGszSrvWQ9kTF4TMpxUPd/view?usp=drive_link)
接下来,我们以与导入解剖图像相同的方式将大脑分割(标签)导入到容器中(在同一容器下),但这次选择 **as Label**,Layer Name 设置为 "Brain",其他选项保持默认。导入完成后,会添加一个新的 "Fetch Layer" 节点。按如下图所示创建和设置节点,您应该能够看到大脑表面。
![alt text](assets/advanced_usage/image-10.png)
您看到表面上有"台阶"状的形状了吗?这是因为 AI 分割结果精度较低。那么如何解决这个问题?选择大脑标签的 Fetch Layer 节点,右键弹出菜单,点击 **Bioxel Nodes > Resample Value**,在对话框中,将 "Smooth Size" 更改为 3 或更高(数值越高,计算越慢),点击确定并等待计算完成。完成后,会添加一个新的图层,替换原来的图层,它更平滑了吗?下图列出了不同平滑级别的效果。
![alt text](assets/advanced_usage/image-11.png)
越平滑,看起来越舒服,但这也意味着丢失更多细节,计算也更慢。
但是,如果您切开大脑,会发现截面是均匀的,这是因为标签类型图层本身不包含任何模态数据。Bioxel Nodes 提供了一种通过标签填充任意图层值的功能,如果您将 CT 数据中非大脑区域的脑组织值设置得低于大脑组织的 Hu 值,那么任何 "Cutout" 节点将只保留大脑区域。
操作如下:选择 CT 数据的 "Fetch Layer" 节点,右键弹出菜单,点击 **Bioxel Nodes > Fill Value by Label**,在对话框中,Label 设置为新导入的大脑标签图层,Fill Value 设置为 -100(只要小于大脑组织的 Hu 值即可),点击确定。等待数据处理,完成后会向容器添加一个新的数据图层。
如下图所示,连接节点并设置节点参数,其中 "Set Color by Ramp 2" 节点的两个颜色是 `B26267` 和 `EBC5B7`,"Cutout by Range" 和 "Set Color by Ramp 2" 节点改为 "Value" 模式(默认是 "Factor" 模式),因为大脑的最大值和最小值太接近,在 "Factor" 模式下难以调整。为了使脑组织看起来更透明,我在末尾添加了 "Set Properties"(Add > Bioxel Nodes > Property > Set Properties)节点并将 "Density" 改为 0.5。
![alt text](assets/advanced_usage/image-12.png)
(仍然觉得不够平滑?目前很难完全摆脱"台阶"表面。)
现在大脑完成了。最后,我们将所有内容组合在一起,您将得到如下图所示的结果。
![alt text](assets/advanced_usage/image-13.png)
如果您按照文档走到了这一步,为自己鼓掌吧,您已经掌握了这个插件!如果您按照文档操作有困难,可以下载项目文件来理解节点的工作方式。
[VHP.zip](https://drive.google.com/file/d/1EHB7sxNSvJNwmoTfFnpyOSsm2M_2Y0hO/view?usp=drive_link)
AI 分割是体数据可视化的重要组成部分。因此,未来的 Bioxel Nodes 将集成一些常用的 AI 分割模型,让用户可以就地完成体数据可视化!

BIN
docs/assets/add-o-layer.png LFS Normal file

Binary file not shown.

BIN
docs/assets/adjust-nodes.png LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

BIN
docs/assets/connect-nodes.png LFS Normal file

Binary file not shown.

BIN
docs/assets/cut-small-parts.png LFS Normal file

Binary file not shown.

BIN
docs/assets/cut-structure.png LFS Normal file

Binary file not shown.

BIN
docs/assets/cut-to-region.png LFS Normal file

Binary file not shown.

BIN
docs/assets/import-data.png LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

BIN
docs/assets/installation.png LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Binary file not shown.

BIN
docs/assets/scalar-to-color.png LFS Normal file

Binary file not shown.

BIN
docs/assets/set-color-by-pos.png LFS Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

50
docs/basics.en.md Normal file
View File

@@ -0,0 +1,50 @@
# Bacsic Usage
## 1. Download Data
Download and unzip [VHP_M_CT_Head.zip](https://drive.google.com/file/d/1bBGpt5pQ0evr-0-f4KDNRnKPoUYj2bJ-/view?usp=drive_link) to a folder.
The data comes from [Visible Human Project (VHP)](https://www.nlm.nih.gov/research/visible/visible_human.html), which is a CT scan image of a male head.
## 2. Import as "Layer"
Add a geometry node to the cube and open the geometry node interface sidebar. Switch to the Bioxel Nodes tab (1), click the Import Data button (2), and in the file selection dialog, choose any `.dcm` file from the data folder (3), then click the Import Data button (4).
![](assets/import-data.png)
Two dialogs will pop up in sequence, click OK for both. Wait for the data import (you can check the progress bar in the Blender interface status bar at the bottom right). After success, you will see a data preview in the Bioxel Nodes sidebar. Click the Add button at the bottom (1), move the mouse to the node panel, and place the **O Layer** node (2).
![](assets/add-o-layer.png)
The data import is complete!
The data cache is saved as a link in the Blender file in the form of a "Layer", and the "Layer" is loaded into geometry nodes through the **O Layer** node. Their relationship is as follows:
Data Cache -> Layer -> O Layer
## 3. Extract and Render "Structure"
Operations on "Layer" are done through the O Bioxel series geometry nodes.
We need two additional nodes: **O Cutout by Threshold** and **O Realize Structure** nodes (both are in the node menu under Add > O Bioxel > Structure), and connect them as shown below:
![](assets/connect-nodes.png)
If successful, you will see a gray head appear in the viewport. Now let's adjust the node parameters:
- **O Layer**: Check Center, uncheck Resample
- **O Cutout by Threshold**: Set Threshold to 90
- **O Realize Structure**: Set Density to 40, check Surface
Rotate the object, adjust the light position, set the renderer to Cycles, and the final effect is shown below:
![](assets/adjust-nodes.png)
Now we have completed the volumetric rendering of the head CT data!
Let's review the execution logic: First, cutout the "Structure" from the "Layer". As the name suggests, "Structure" is responsible for storing biological tissue structure, but its data type is volumetric and cannot be seen directly. It requires **O Realize Structure** to present the "Structure".
## 4. Save Data Cache (Optional)
Since the data cache is only saved as a link in the Blender file, passing only the Blender file to other devices will cause the "Layer" to lose its cache. Click the Save button in the Bioxel Nodes tab, and select a location to save the data cache to manage the cache resource.
Just like images, when sharing, send both the data cache and the Blender file together.

51
docs/basics.md Normal file
View File

@@ -0,0 +1,51 @@
# 入门
## 1. 下载数据
下载并解压到文件夹中 [VHP_M_CT_Head.zip](https://drive.google.com/file/d/1bBGpt5pQ0evr-0-f4KDNRnKPoUYj2bJ-/view?usp=drive_link)
数据来自 [Visible Human Project (VHP)](https://www.nlm.nih.gov/research/visible/visible_human.html)这是一个男性头部的 CT 扫描图像
## 2. 导入为「数据层」
给立方体添加几何节点,并打开几何节点界面侧边栏。切换到 Bioxel Nodes 分页(1),点击 Import Data 按钮(2),在文件选择对话框中,选择数据文件夹中任意一个`.dcm`文件(3),点击 Import Data 按钮(4)
![](assets/import-data.png)
依次会弹出两个对话框,都点击 OK 按钮,等待数据导入(可查看 Blender 界面右下角状态栏的进度条)成功后可以看到 Bioxel Nodes 侧边栏多了数据预览画面。点击下方的 Add 按钮(1),鼠标移动到节点面板,放置 **O Layer** 节点(2)
![](assets/add-o-layer.png)
数据的导入就完成啦👍
数据缓存在主目录里,以「数据层(Layer)」形式添加在 Blender 文件中,「数据层」通过 **O Layer** 节点装载到几何节点。它们的关系如下:
数据缓存 -> 数据层 -> O Layer
## 3. 提取并渲染「结构体」
对「数据层」的操作通过 O Bioxel 系列几何节点完成。
我们需要额外两个节点,**O Cutout by Threshold** 和 **O Realize Structure** 节点(它们都在节点菜单,Add > O Bioxel > Structure 下),并按下图连接:
![](assets/connect-nodes.png)
如果成功,可以看到视图中出现了灰色的头部。接下来我们调整节点参数:
- **O Layer**:勾选 Center,取消 Resample
- **O Cutout by Threshold**:Threshold 设置为 90
- **O Realize Structure**:Density 设置为 40,勾选 Surface
调整物体转向、灯位置,设置渲染器为 Cycles,最终效果如下图:
![](assets/adjust-nodes.png)
这样我们就完成了头部 CT 数据的体积渲染👍
简单捋一下执行逻辑,「数据层」先被剪出(Cutout)为「结构体」。「结构体」顾名思义就是负责储存生物组织结构的对象,但它本身数据类型是体积,并不能直接被看到。需要 **O Realize Structure** 来呈现「结构体」
## 4. 另存数据缓存(可选)
由于数据缓存只是以链接形式保存在 Blender 文件中,所以只传递 Blender 文件给其他设备,会导致「数据层」遗失缓存。点击 Bioxel Nodes 分页中 Save 按钮,选择数据缓存的另存位置来管理缓存资源。
就像图片一样,传递时把数据缓存和 Blender 文件一起发送。

0
docs/gallery.md Normal file
View File

View File

@@ -1,39 +0,0 @@
# Improve Performance
Volume reconstruction and volume rendering are very consuming computation, I believe that this add-on's experience is terrible on poorly hardware. here are tips to improve the add-on performance.
## Use Low-Res Data as Preview
The addon provides data resample function, the operation is as follows. First, in the container's geometry node, select the layer you need to resample, right-click **Bioxel Nodes > Resample Value**, in the dialog box, change the "Bioxel Size" value to twice or more than the current value, click OK. the addon will create a low-res version of the layer and load it into the container's geometry node.
![alt text](assets/improve_performance/image.png)
You can see that the speed of the reconstruction has been reduced from 240 ms to 37 ms, making it possible to compute in almost real-time, and improving the speed of the feedback of the changing the parameters. Once you are satisfied with the adjustment, you can then connect the original layer to the nodes. This tip can greatly improve the operation experience of the node.
## Raise the Step Rate of a Container
Step rate is a key setting in volume rendering. The higher the step rate, the faster the rendering will be, but at the same time, the thinner the volume will look. If you want to have a very thin effect, or if you don't need to cut through component, you can always set the step rate high, you can adjust step rate in the render settings globaly. However, I recommend you to adjust the step rate of the container separately, so that it doesn't affect the rendering of the other volume in the Blender file, do as follows.
In the container's geometry nodes panel menu, click **Bioxel Nodes > Change Container Properties**, in the dialog box, raise the "Step Rate" value (up to 100) and click OK.
![alt text](assets/improve_performance/image-1.png)
You can see that the rendering speed is much higher, but at the same time the cuts look blurry and transparent.
## Balance rendering settings
I list some of the settings that affect the volume rendering most, so you can find the most balanced settings for your needs.
- **Light Paths > Max Bounces > Volume** affects the number of bounces a volume has, the higher the value, the more transparent it will look.
- **Light Paths > Max Bounces > Transparent** affects the number of times transparent surfaces are transmitted, the higher the value, the more transparent it will look.
- **Volumes > Step Rate Render | Viewport** affects the volume rendering step, the smaller the value, the more detailed the volume will look
Bioxel Nodes provides some render setting presets for quick setup. In the top menu, click **Bioxel Nodes > Render Setting Presets**, including Performance (left), Balance (center), and Quality (right). Here is a comparison of them.
![alt text](assets/improve_performance/image-2.png)
## Rendering with EEVEE
EEVEE doesn't render volume as well as Cycles, but it does have the advantage of rendering the volumetric data, and is even a better choice if you want to get a clear view of slice. And EEVEE's real-time rendering make it possible to create interactive stuff in Blender.

View File

@@ -1,39 +0,0 @@
# 提升性能
体数据重建和体渲染是非常消耗计算资源的,我相信这个插件在性能较差的硬件上体验很差。以下是一些提升插件性能的建议。
## 使用低分辨率数据作为预览
插件提供数据重采样功能,操作如下。首先,在容器的几何节点中,选择需要重采样的图层,右键 **Bioxel Nodes > Resample Value**,在对话框中,将 "Bioxel Size" 值更改为当前值的两倍或更多,点击确定。插件将创建该图层的低分辨率版本并加载到容器的几何节点中。
![alt text](assets/improve_performance/image.png)
您可以看到重建速度从 240 ms 降低到 37 ms,使得几乎实时计算成为可能,并提高了参数变化的反馈速度。满意后,您可以将原始图层连接到节点。这个建议可以极大地改善节点操作体验。
## 提高容器的步率
步率是体渲染中的关键设置。步率越高,渲染速度越快,但同时体数据看起来会越薄。如果您想要非常薄的效果,或者不需要切开组件,可以始终将步率设置得很高。您可以在渲染设置中全局调整步率。但是,我建议您单独调整容器的步率,这样不会影响 Blender 文件中其他体数据的渲染,操作如下。
在容器的几何节点面板菜单中,点击 **Bioxel Nodes > Change Container Properties**,在对话框中,提高 "Step Rate" 值(最高可达 100)并点击确定。
![alt text](assets/improve_performance/image-1.png)
您可以看到渲染速度大大提高,但同时切割看起来模糊且透明。
## 平衡渲染设置
我列出了一些对体渲染影响最大的设置,以便您找到最适合自己的平衡点。
- **Light Paths > Max Bounces > Volume** 影响体数据的反弹次数,值越高,体数据看起来越透明。
- **Light Paths > Max Bounces > Transparent** 影响透明表面透射的次数,值越高,透明表面看起来越透明。
- **Volumes > Step Rate Render | Viewport** 影响体渲染的步长,值越小,体数据看起来越精细。
Bioxel Nodes 提供了一些渲染设置预设以便快速配置。点击顶部菜单 **Bioxel Nodes > Render Setting Presets**,包括 Performance(左侧)、Balance(中间)和 Quality(右侧)。以下是它们的比较。
![alt text](assets/improve_performance/image-2.png)
## 使用 EEVEE 渲染
EEVEE 渲染体数据不如 Cycles,但它确实有渲染体数据的优势,如果您想获得清晰的切片视图,它甚至是更好的选择。EEVEE 的实时渲染使得在 Blender 中创建交互式内容成为可能。

View File

@@ -1,3 +1,5 @@
**v2.0.x has been released, supporting only Blender 5.0+. The usage is completely different from before and is not compatible with old version files. See http://docs.omoolab.xyz/bioxelnodes/2.0.x/en/basics/**
# Bioxel Nodes
[![For Blender](https://img.shields.io/badge/Blender-orange?style=for-the-badge&logo=blender&logoColor=white&color=black)](https://blender.org/)

View File

@@ -1,3 +1,5 @@
**v2.0.X 已发布,仅支持 Blender 5.0+,使用方式和之前截然不同,也无法兼容旧版本文件。使用方式查看 http://docs.omoolab.xyz/bioxelnodes/2.0.x/basics/**
# Bioxel Nodes
[![For Blender](https://img.shields.io/badge/Blender-orange?style=for-the-badge&logo=blender&logoColor=white&color=black)](https://blender.org/)
@@ -24,18 +26,18 @@ Bioxel Nodes 是一款用于科学体数据可视化的 Blender 插件。它利
## 支持多种格式
| 格式 | 扩展名 |
| ---- | ---------------------------------------- |
| DICOM | .dcm, .DCM, .DICOM, .ima, .IMA |
| BMP | .bmp, .BMP |
| JPEG | .jpg, .JPG, .jpeg, .JPEG |
| PNG | .png, .PNG |
| TIFF | .tif, .TIF, .tiff, .TIFF |
| 格式 | 扩展名 |
| ----- | ---------------------------------------- |
| DICOM | .dcm, .DCM, .DICOM, .ima, .IMA |
| BMP | .bmp, .BMP |
| JPEG | .jpg, .JPG, .jpeg, .JPEG |
| PNG | .png, .PNG |
| TIFF | .tif, .TIF, .tiff, .TIFF |
| Nifti | .nia, .nii, .nii.gz, .hdr, .img, .img.gz |
| Nrrd | .nrrd, .nhdr |
| HDF5 | .hdf, .h4, .hdf4, .he2, .h5, .hdf5, .he5 |
| OME | .ome.tiff, .ome.tif |
| MRC | .mrc, .mrc.gz, .map, .map.gz |
| Nrrd | .nrrd, .nhdr |
| HDF5 | .hdf, .h4, .hdf4, .he2, .h5, .hdf5, .he5 |
| OME | .ome.tiff, .ome.tif |
| MRC | .mrc, .mrc.gz, .map, .map.gz |
## 支持 4D 体数据
@@ -61,4 +63,4 @@ EEVEE NEXT 太棒了!Bioxel Nodes 现在全面支持 EEVEE NEXT!但仍有以
- 更完善的多格式导入体验
- 一键烘焙带纹理模型
- AI 分割生成标签
- AI 分割生成标签

View File

@@ -1,19 +1,22 @@
# Installation
**Currently only support Blender 4.2 or above, make sure you have the correct version of Blender.**
!!! warning
**v2.0.x only supports Blender 5.0 and above**
## Install in Blender (recommended)
The add-on supports multiple installation methods, choose one.
This is the most recommended way, in the top menu, click **Edit > Preferences**, in "Get Extensions" Section, enter "bio" in the search box, then click Install. due to the add-on size (25MB~50MB) you may need to wait a while.
## Blender Preferences (Recommended)
![alt text](assets/installation/image.png)
Click the top menu **Edit > Preferences**, search for "biox" in the "Get Extensions" area. Then click Install. Due to the large add-on size (60~100MB), you may need to wait for a while.
![](assets/installation.png)
## Blender Official Extensions Website
Or you can visit the Blender official extensions website at [https://extensions.blender.org/add-ons/bioxelnodes/](https://extensions.blender.org/add-ons/bioxelnodes/)
Click Get Add-on, open Blender, drag in Blender and follow the instructions to install.
Visit [https://extensions.blender.org/add-ons/bioxelnodes/](https://extensions.blender.org/add-ons/bioxelnodes/)
Click Get Add-on, open Blender, drag the add-on into Blender and follow the prompts to install.
## Manual Install
## Manual Installation
You can also install _BioxelNodes\_{version}.zip_ manually by downloading from [bere](https://github.com/OmooLab/BioxelNodes/releases/latest).
In the top menu, click **Edit > Preferences**, **Add-ons > Install from Disk** and select the Zip file you just downloaded.
You can also download `BioxelNodes.{version}.zip` from [here](https://github.com/OmooLab/BioxelNodes/releases/latest) for manual installation.
Click the top menu **Edit > Preferences**, select **Add-ons > Install from Disk**, then choose the Zip file you downloaded.

View File

@@ -1,19 +1,22 @@
# 安装
**目前仅支持 Blender 4.2 及以上版本,请确保您安装了正确版本的 Blender。**
!!! warning
**v2.0.x 仅支持 Blender 5.0 及以上版本**
## 在 Blender 中安装(推荐)
插件支持多种安装方式,选其中之一即可
这是最推荐的方式。点击顶部菜单 **Edit > Preferences**,在 "Get Extensions" 区域搜索 "bio",然后点击 Install。由于插件体积较大(25MB~50MB),可能需要等待一段时间。
## Blender 偏好设置(推荐)
![alt text](assets/installation/image.png)
点击顶部菜单 **Edit > Preferences**,在 "Get Extensions" 区域搜索 "biox"。然后点击 Install。由于插件体积较大(60~100MB),可能需要等待一段时间。
![](assets/installation.png)
## Blender 官方扩展网站
您也可以访问 Blender 官方扩展网站 [https://extensions.blender.org/add-ons/bioxelnodes/](https://extensions.blender.org/add-ons/bioxelnodes/)
访问 [https://extensions.blender.org/add-ons/bioxelnodes/](https://extensions.blender.org/add-ons/bioxelnodes/)
点击 Get Add-on,打开 Blender,将插件拖入并按照提示安装。
## 手动安装
您也可以从 [这里](https://github.com/OmooLab/BioxelNodes/releases/latest) 下载 _BioxelNodes_{version}.zip_ 进行手动安装。
点击顶部菜单 **Edit > Preferences**,选择 **Add-ons > Install from Disk**,然后选择您下载的 Zip 文件。
您也可以从 [这里](https://github.com/OmooLab/BioxelNodes/releases/latest) 下载 `BioxelNodes.{version}.zip` 进行手动安装。
点击顶部菜单 **Edit > Preferences**,选择 **Add-ons > Install from Disk**,然后选择您下载的 Zip 文件。

25
docs/performance.en.md Normal file
View File

@@ -0,0 +1,25 @@
# Improve Performance
Voxel reconstruction and voxel rendering are very computation-intensive. Here are some tips to improve the add-on's performance.
## Use Low-Resolution Data as Preview
The resolution of voxels geometrically affects computational efficiency. Enabling Resample on O Layer can greatly improve calculation speed. You can uncheck it when you need to render for real. The Layer Nodes panel in the Bioxel Nodes tab lists all O Layers added in the current geometry nodes. You can uniformly manage whether Resample is enabled and the degree of resampling.
## Balanced Rendering Settings
I list some settings that have the greatest impact on volume rendering, so you can find the most suitable balance for your needs.
- **Light Paths > Max Bounces > Volume** affects the number of bounces for volume data. The higher the value, the more transparent the volume data appears.
- **Light Paths > Max Bounces > Transparent** affects the number of times transparent surfaces are transmitted. The higher the value, the more transparent the transparent surfaces appear.
- **Volumes > Step Rate Render | Viewport** affects the step size of volume rendering. The smaller the value, the more detailed the volume data appears.
Bioxel Nodes provides some render setting presets for quick configuration. Click the top menu **Bioxel Nodes > Render Setting Presets**, including Performance (left), Balance (center), and Quality (right). Here is a comparison:
![alt text](assets/render-performance.png)
## Rendering with EEVEE
EEVEE doesn't render volume as well as Cycles, but it does have the advantage of rendering volumetric data. If you want to get a clear slice view, it is even a better choice. EEVEE's real-time rendering makes it possible to create interactive content in Blender.

25
docs/performance.md Normal file
View File

@@ -0,0 +1,25 @@
# 提升性能
体素重建和体素渲染是非常消耗计算资源的,以下是一些提升插件性能的建议。
## 使用低分辨率数据作为预览
体素的分辨率几何倍地影响计算效率,O Layer 的 Resample 开启可以大大提高计算速度。当你需要正式渲染的时候再关闭即可。在 Bioxel Nodes 分页的 Layer Nodes 面板罗列了当前几何节点中添加的所有 O Layer,你可以统一管理是否开启 Resample,以及程度。
## 平衡的渲染设置
我列出了一些对体渲染影响最大的设置,以便您找到最适合自己的平衡点。
- **Light Paths > Max Bounces > Volume** 影响体数据的反弹次数,值越高,体数据看起来越透明。
- **Light Paths > Max Bounces > Transparent** 影响透明表面透射的次数,值越高,透明表面看起来越透明。
- **Volumes > Step Rate Render | Viewport** 影响体渲染的步长,值越小,体数据看起来越精细。
Bioxel Nodes 提供了一些渲染设置预设以便快速配置。点击顶部菜单 **Bioxel Nodes > Render Setting Presets**,包括 Performance(左侧)、Balance(中间)和 Quality(右侧)。以下是它们的比较。
![alt text](assets/render-performance.png)
## 使用 EEVEE 渲染
EEVEE 渲染体数据不如 Cycles,但它确实有渲染体数据的优势,如果您想获得清晰的切片视图,它甚至是更好的选择。EEVEE 的实时渲染使得在 Blender 中创建交互式内容成为可能。

View File

@@ -1,97 +0,0 @@
# Step by Step
## Download Data
Here is the open data from [Visible Human Project (VHP)](https://www.nlm.nih.gov/research/visible/visible_human.html) for you to learn how to use this addon. It is a CT scan image of a male head, download and unzip it to a new directry for later usage.
[VHP_M_CT_Head.zip](https://drive.google.com/file/d/1bBGpt5pQ0evr-0-f4KDNRnKPoUYj2bJ-/view?usp=drive_link)
VHP original radiology data was shared in the proprietary format that predated DICOM, complicating its use. Now all data has been harmonized to standard DICOM and released in [NCI Imaging Data Commons (IDC)](https://portal.imaging.datacommons.cancer.gov/), you also can download data from IDC by yourself.
## Import Data
In the top menu, click **Bioxel Nodes > Import Volumetric Data (Init) > as Scalar**, locate to the unzipped folder, select any DICOM file (don't select more than one, and don't select the folder either), and click **Import as Scalar**.
![alt text](assets/step_by_step/image.png)
You can also choose to import data by dragging one DICOM file into the 3D viewport (some DICOM files don't have extension suffix and can't be dragged in).
The process of reading the data may take a while, the bottom right corner of the Blender interface will show you the progress of the reading, and a dialog box will pop up when the reading is successful. Ignore all the options for now and just click OK, I will explain the purpose of these options later.
The import process involves data conversion, so there is more waiting time, and the progress of the import is displayed in the lower right corner of the interface. After importing, the addon will create a new object, with a new geometry nodes that will serve as a "workbench" for manipulating the data, the new object is called the **Container**. The newly imported data is stored in the Container as a **Layer**, which is loaded into the Container's Geometry node via the "Fetch Layer" node (the red one), and be converted into a **Component** that can be rendered.
![alt text](assets/step_by_step/image-1.png)
Next, let's preview the data in Blender.
In the container's geometry nodes panel menu, click **Bioxel Nodes > Add a Slicer**. The addon will insert a node named "Slice" between the "Fetch Layer" and the "Output" and create a new plane object named "Slicer". Click the "Slice Viewer" button in the upper right corner of the 3D viewport to enter the preview mode, then move and rotate the "Slicer" object. You will see a slice image of the data, which should be familiar to anyone who has used any DICOM viewing software.
![alt text](assets/step_by_step/image-2.png)
(If the volume disappears when you click the "Slice Viewer" button, save the file and restart Blender, it should be fixed, or you can turn on the Cycles rendering to see the slicer plane as well. The issue is caused by EEVEE's failure of reloading the shaders.)
The "Slicer" node is used to display the slices of the data, with an external object as the location of the slice plane. This step is not necessary for visualization, but it provides a quick way to preview the data in Blender for user perception. Next, let's turn the volumetric data into a renderable object.
## Cutout the Skull
Bone tends to have much higher CT values than soft tissue, so you can split bone and soft tissue by setting a threshold. In the Geometry Nodes panel menu of the container, click **Add > Bioxel Nodes > Component > Cutout by Threshold** to add a "Cutout" node and connect it between the "Fetch Layer" node and the "Output", and then set the "Threshold" parameter of the "Cutout by Threshold" node to 0.3 and turn on the "With Surface" option. Switch to viewport shading to "Render Preview". The node graph and the render result are shown below.
![alt text](assets/step_by_step/image-3.png)
If you want the render result to be consistent with the above image, you also need to change the default light object type from "Point" to "Area" to increase the brightness, and change the Look in Color Management to "High Contrast".
You can understand the role of the "Threshold" parameter in shaping the output by changing it. If you feel very laggy while draging the parameter, you can temporarily turn off the "With Surface" option in the "Cutout" node. When you are satisfied, turn it on again. In addition, the volume rendering is very computationally intensive, which is also a major cause of the lag, so you can adjust the parameters in "Slice Viewer" mode first, and then do the Cycles rendering when you are satisfied.
You may consider using GPU for faster rendering, but please note that Bioxel Nodes only supports Optix GPUs due to its dependency on OSL (Open shader language), and the first time you turn on GPU rendering, you may need to wait for Blender to load the appropriate dependencies (the screen will get stuck), so please be patient.
Although the output component looks like a mesh object, it retains its internal information through its volume, so when you cut through the component, you should see an inhomogeneous cross-section made up of volume, rather than just an empty shell like any mesh object. Let's cut the skull to see its complex internal structure.
## Cut and Color
In the container's geometry nodes panel menu, click **Bioxel Nodes > Add a Cutter > Plane Cutter**, the addon will insert a "Cut" node and a "Object Cutter" node. Also, it will create a new plane object named "Plane Cutter" to the scene, at this point you should be able to see that the skull has been cut through as expected.
Just like the "Slicer" object, move and rotate the "Plane Cutter" and the position and direction of the cut will change accordingly. Please adjust the Cutter object to a vertical orientation so that it cuts the skull vertically, as shown below.
![alt text](assets/step_by_step/image-4.png)
The CT value of the skull is inhomogeneous, which reflects the difference in substance density of the bone. We can enhance the display of this difference by coloring. In the Geometry Nodes panel menu of the container, click **Add > Bioxel Nodes > Propetry > Set Color by Ramp 5** to add the "Set Color" node and connect it after any node. Set the node's parameters "From Min" to 0.3 and "From Max" to 0.5, as shown below.
![alt text](assets/step_by_step/image-5.png)
When rendering is turned on, you can clearly see that the calvaria and teeth are colored red, meaning that the bone in these areas is denser. You can try to adjust the parameters of the "Set Color" node to recognize their roles. If you feel laggy when draging the parameters, you can temporarily turn off "With Surface" and switch to "Slice Viewer" mode.
## Transformation
You may find that the position of the skull is a bit off the origin, this is due to the fact that the addon keeps the position information from the original data record during the import process. If you need to change the position, do not move the container (object) directly as you would in 3D viewport; the addon provides dedicated "Transform" node to handle transformations.
In the Geometry Nodes panel menu of the container, click **Bioxel Nodes > Add a Locator**, the addon will insert the "Transform Parent" node and create a new empty object named "Locator". If you move, rotate, or scale the "Locator", the skull will Transform as well. If you also want the origin of the rotational transformation to be set at the geometric center of the skull, just add a "ReCenter" node (Add > Bioxel Nodes > Transform > ReCenter) in front of the "Transform Parent" node, as shown below.
![alt text](assets/step_by_step/image-6.png)
Being used to moving objects directly in the 3D viewport, you may find it strange to have an extra step to transform component like this. This is in consideration of the fact that there may be multiple components involved in one container with different transform needs, as well as future development plans for resampling mechanism, which I'll explain in more detail later.
## Surface Mesh
A mesh, made up of vertexs and faces, is the "greatest common" in the 3D world. Therefore, in order to be compatible with other 3D workflow, the addon provides the "To Surface" node (Add > Bioxel Nodes > Component > ToSurface), which converts the component into a mesh. Note that the surface mesh is not editable in the container's geometry node, and can only be connected to "Transform" and "Shader" nodes.
As shown below, you can connect "Slime Shader" node (Add > Bioxel Nodes > Surface > Slime Shader) after the "To Surface" node to give the surface a shader, or connect "Transform" nodes.
![alt text](assets/step_by_step/image-7.png)
If you want to edit the mesh, in the Geometry Nodes panel menu of the container, click **Bioxel Nodes > Extract from Container > Extract Mesh**, the addon will create a new mesh model object prefixed with the container name, and then you can perform the usual 3D operations, such as digitally sculpting, animating, exporting to 3D print format stl, etc.
## Deliver Blender File
The layers cache is stored in a temporary folder, while the addon's custom nodes are linked to the node library file in addon directory. Both of them are exist locally by default, and if you only deliver the Blender file to other devices, the file will not work properly because the resources are missing.
Therefore, you need to save all temporary files before you deliver the Blender file. The procedure is simple:
1. Save the Blender file.
2. in the top menu, click **Bioxel Nodes > Save Node Library**, and set the relative path.
3. in the top menu, click **Bioxel Nodes > Save All Layers Cache** and set the relative path.
Zip the Blender file together with the local node library file and the layer cache files (there may be more than one).
![alt text](assets/step_by_step/image-9.png)
🤗 If you can follow the documentation up to this point, you're already started!

View File

@@ -1,97 +0,0 @@
# 分步指南
## 下载数据
这里提供来自 [Visible Human Project (VHP)](https://www.nlm.nih.gov/research/visible/visible_human.html) 的公开数据供您学习插件使用。这是一个男性头部的 CT 扫描图像,下载并解压到新文件夹中备用。
[VHP_M_CT_Head.zip](https://drive.google.com/file/d/1bBGpt5pQ0evr-0-f4KDNRnKPoUYj2bJ-/view?usp=drive_link)
VHP 原始影像数据以 DICOM 前身专有格式共享,使用较为复杂。现在所有数据已统一为标准 DICOM 格式并发布在 [NCI Imaging Data Commons (IDC)](https://portal.imaging.datacommons.cancer.gov/) 上,您也可以自行从 IDC 下载数据。
## 导入数据
点击顶部菜单 **Bioxel Nodes > Import Volumetric Data (Init) > as Scalar**,定位到解压后的文件夹,选择任意一个 DICOM 文件(不要选择多个,也不要选择文件夹),然后点击 **Import as Scalar**。
![alt text](assets/step_by_step/image.png)
您也可以通过将一个 DICOM 文件拖入 3D 视图来导入数据(部分 DICOM 文件没有扩展名,无法拖入)。
读取数据可能需要一段时间,Blender 界面右下角会显示读取进度,读取成功后会弹出一个对话框。目前先忽略所有选项,直接点击确定,稍后我会解释这些选项的作用。
导入过程涉及数据转换,因此需要等待更长时间,导入进度会显示在界面右下角。导入完成后,插件会创建一个新对象,其中包含一个新的几何节点,用于操作数据。这个新对象称为 **Container(容器)**。导入的数据作为 **Layer(图层)** 存储在容器中,通过 "Fetch Layer" 节点(红色)加载到容器的几何节点中,并转换为可渲染的 **Component(组件)**。
![alt text](assets/step_by_step/image-1.png)
接下来,让我们在 Blender 中预览数据。
在容器的几何节点面板菜单中,点击 **Bioxel Nodes > Add a Slicer**。插件会插入一个名为 "Slice" 的节点,并创建一个新的平面对象 "Slicer"。点击 3D 视图右上角的 "Slice Viewer" 按钮进入预览模式,然后移动和旋转 "Slicer" 对象。您将看到数据的切片图像,任何使用过 DICOM 查看软件的人都会对此很熟悉。
![alt text](assets/step_by_step/image-2.png)
(如果点击 "Slice Viewer" 按钮后体积消失,保存文件并重启 Blender 即可修复。您也可以打开 Cycles 渲染器来查看切片平面。这是因为 EEVEE 未能重新加载着色器导致的。)
"Slicer" 节点用于显示数据的切片,切片平面的位置由外部对象控制。这一步对于可视化并非必须,但它提供了一种在 Blender 中快速预览数据的方式。接下来,让我们将体数据转换为可渲染的对象。
## 提取颅骨
骨骼的 CT 值通常比软组织高得多,因此可以通过设置阈值来分离骨骼和软组织。在容器的几何节点面板菜单中,点击 **Add > Bioxel Nodes > Component > Cutout by Threshold** 添加一个 "Cutout" 节点,并将其连接在 "Fetch Layer" 节点和 "Output" 之间。然后将 "Cutout by Threshold" 节点的 "Threshold" 参数设置为 0.3,并打开 "With Surface" 选项。切换视图着色为 "Render Preview"。节点图和渲染结果如下图所示。
![alt text](assets/step_by_step/image-3.png)
如果希望渲染结果与上图一致,还需要将默认灯光类型从 "Point" 改为 "Area" 以提高亮度,并将颜色管理中的 Look 改为 "High Contrast"。
您可以通过改变 "Threshold" 参数来理解它在塑造输出中的作用。如果您拖动参数时感到非常卡顿,可以暂时关闭 "Cutout" 节点中的 "With Surface" 选项。满意后再重新打开。此外,体渲染计算量很大,这也是导致卡顿的主要原因,因此建议先在 "Slice Viewer" 模式下调整参数,满意后再进行 Cycles 渲染。
您可能考虑使用 GPU 来加快渲染速度,但请注意,由于 Bioxel Nodes 依赖 OSL(Open Shader Language),目前仅支持 Optix GPU。初次开启 GPU 渲染时,可能需要等待 Blender 加载相应的依赖项(屏幕会卡住),请耐心等待。
虽然输出的组件看起来像网格对象,但它通过体数据保留了内部信息,因此当您切开组件时,会看到由体数据组成的不均匀截面,而不是像任何网格对象那样的空壳。让我们切开颅骨来观察其复杂的内部结构。
## 切割和着色
在容器的几何节点面板菜单中,点击 **Bioxel Nodes > Add a Cutter > Plane Cutter**,插件会插入一个 "Cut" 节点和一个 "Object Cutter" 节点。同时,它会创建一个新的平面对象 "Plane Cutter" 到场景中,此时您应该能看到颅骨已被切开。
与 "Slicer" 对象类似,移动和旋转 "Plane Cutter" 会改变切割的位置和方向。请将 Cutter 对象调整为垂直方向,使其垂直切开颅骨,如下图所示。
![alt text](assets/step_by_step/image-4.png)
颅骨的 CT 值不均匀,这反映了骨质密度的差异。我们可以通过着色来增强这种差异的显示。在容器的几何节点面板菜单中,点击 **Add > Bioxel Nodes > Property > Set Color by Ramp 5** 添加 "Set Color" 节点,并连接在任何节点之后。将节点的 "From Min" 设置为 0.3,"From Max" 设置为 0.5,如下图所示。
![alt text](assets/step_by_step/image-5.png)
开启渲染后,您可以清楚地看到顶骨和牙齿被染成红色,这意味着这些区域的骨骼密度更高。您可以尝试调整 "Set Color" 节点的参数来了解它们的作用。如果您拖动参数时感到卡顿,可以暂时关闭 "With Surface" 并切换到 "Slice Viewer" 模式。
## 变换
您可能会发现颅骨的位置有些偏离原点,这是因为插件在导入过程中保留了原始数据记录的位置信息。如果需要更改位置,请不要直接在 3D 视图中移动容器(如平常操作 3D 对象那样);插件提供了专门的 "Transform" 节点来处理变换。
在容器的几何节点面板菜单中,点击 **Bioxel Nodes > Add a Locator**,插件会插入 "Transform Parent" 节点并创建一个新的空对象 "Locator"。如果您移动、旋转或缩放 "Locator",颅骨也会随之变换。如果您希望旋转变换的原点设置在颅骨的几何中心,只需在 "Transform Parent" 节点之前添加一个 "ReCenter" 节点(Add > Bioxel Nodes > Transform > ReCenter),如下图所示。
![alt text](assets/step_by_step/image-6.png)
习惯了直接在 3D 视图中移动对象,您可能会觉得多一步来变换组件有些奇怪。这样做是考虑到一个容器中可能涉及多个组件,它们有不同的变换需求,以及未来重采样机制的开发计划,我稍后会详细说明。
## 表面网格
由顶点和面组成的网格是 3D 世界中的"最大公约数"。因此,为了与其他 3D 工作流程兼容,插件提供了 "To Surface" 节点(Add > Bioxel Nodes > Component > ToSurface),它将组件转换为网格。请注意,表面网格在容器的几何节点中不可编辑,只能连接到 "Transform" 和 "Shader" 节点。
如下图所示,您可以连接 "Slime Shader" 节点(Add > Bioxel Nodes > Surface > Slime Shader)在 "To Surface" 节点之后,为表面赋予着色器,也可以连接 "Transform" 节点。
![alt text](assets/step_by_step/image-7.png)
如果您想编辑网格,在容器的几何节点面板菜单中,点击 **Bioxel Nodes > Extract from Container > Extract Mesh**,插件会创建一个以容器名称为前缀的新网格模型对象,然后您可以执行常规的 3D 操作,如数字雕刻、动画、导出为 3D 打印格式 stl 等。
## 交付 Blender 文件
图层缓存存储在临时文件夹中,插件的自定义节点链接到插件目录中的节点库文件。两者默认都存在于本地,如果您只将 Blender 文件交付给其他设备,文件将无法正常工作,因为资源缺失。
因此,在交付 Blender 文件之前,您需要保存所有临时文件。步骤如下:
1. 保存 Blender 文件
2. 点击顶部菜单 **Bioxel Nodes > Save Node Library**,设置相对路径
3. 点击顶部菜单 **Bioxel Nodes > Save All Layers Cache**,设置相对路径
将 Blender 文件与本地节点库文件和图层缓存文件(可能不止一个)一起打包。
![alt text](assets/step_by_step/image-9.png)
如果您能按照文档走到这一步,您已经入门了!

View File

@@ -7,16 +7,15 @@ repo_name: OmooLab/BioxelNodes
repo_url: https://github.com/OmooLab/BioxelNodes
nav:
- index.md
- 胞素节点:
- index.md
- gallery.md
- 快速开始:
- installation.md
- step_by_step.md
- advanced_usage.md
- support_format.md
- improve_performance.md
- faq.md
- 案例教程:
- SARS-Cov-2.md
- basics.md
- advanced.md
- dataset.md
- performance.md
theme:
name: material
@@ -80,6 +79,7 @@ plugins:
- locale: en
name: English
nav_translations:
胞素节点: Bioxel Nodes
快速开始: Getting Started
案例教程: Tutorials