32 Commits

Author SHA1 Message Date
Ma Nan
508e6858d7 Add slicer to layer when container is new (#57) 2025-04-11 16:38:56 +08:00
1c49fbb813 Add slicer to layer when first import 2025-04-11 16:10:13 +08:00
35e405acd8 update version 2025-04-11 10:22:36 +08:00
Ma Nan
68748f509a Remove OSL scripts to improve render (#56)
* Remove OSL scripts to improve render

* Remove slice viewer

* Locator will be added next to selected node

* Improve specular in eevee
2025-04-11 10:14:40 +08:00
436296652b fix zip package in build extension step 2025-04-09 22:09:54 +08:00
c265777313 fix zip package in build extension step 2025-04-09 22:01:05 +08:00
e80a2b6683 fix zip package in build extension step 2025-04-09 21:11:11 +08:00
a6586b7304 bump version to 1.0.8 in pyproject.toml and blender_manifest.toml 2025-04-09 20:48:17 +08:00
Ma Nan
59bf9bff2d Fix compatibility with blender 4.4 (#55)
* migrate from poetry to uv

* fix No module named 'pyopenvdb' in blender 4.4

* update auto_load.py

* add vscode workspace

* update relase workflow
2025-04-09 17:47:06 +08:00
Ma Nan
d4bc355d94 Merge pull request #51 from OmooLab/feature/dev
Feature/dev
2024-11-01 11:58:31 +08:00
4e9dc1ce67 Merge branch 'main' of https://github.com/OmooLab/BioxelNodes into feature/dev 2024-11-01 11:57:41 +08:00
dc7d9382d6 fix: slice viewer change all 3d viewports
fix: eevee env light effect cycles render
feat: add gamma prop to correct color from non-linear image
feat: add "copy transform" node
2024-11-01 11:57:29 +08:00
Ma Nan
66aafb41bd Merge pull request #50 from OmooLab/feature/dev
Feature/dev
2024-10-30 13:32:19 +08:00
2c844c01ec Merge branch 'main' of https://github.com/OmooLab/BioxelNodes into feature/dev 2024-10-30 13:30:50 +08:00
e5be3ad5db feat: better shader in eevee
feat: add more control to transform node
feat: add env light to reduse volume shadow in eevee
2024-10-30 13:29:53 +08:00
Ma Nan
29b302531b Merge pull request #49 from OmooLab/feature/dev
feat: improve eevee render
2024-10-29 15:15:14 +08:00
3ca7c2ac5a feat: improve eevee render 2024-10-29 15:14:31 +08:00
Ma Nan
32138c1da6 Merge pull request #48 from OmooLab/feature/dev
feat: add help menu
2024-10-10 12:56:44 +08:00
86fc18ab69 feat: add help menu
feat: better surface topo
fix: cutter node invert not work
2024-10-10 12:54:51 +08:00
Ma Nan
928b15c722 Merge pull request #46 from OmooLab/feature/dev
fix: the as color button's text is incorrectly written as "as label"
2024-09-27 14:55:27 +08:00
487cea4662 fix: the as color button's text is incorrectly written as "as label"
feat: speed up convertion when as label
feat: add new "Extrude Transform" node
2024-09-27 14:53:47 +08:00
Ma Nan
92f85ff1f3 Merge pull request #45 from OmooLab/feature/dev
fix: relocate cannot work on missing layer
2024-09-19 12:28:35 +08:00
63c593f09a fix: relocate cannot work on missing layer
fix: import fail if label are all zero
fix: add cutter name to node
fix: cannot append node lib file on NAS (UNC path)
fix: join component cause disappear
feat: smooth label
feat: better topo on cutout by range
2024-09-19 12:27:39 +08:00
Ma Nan
3c5ff64afd Merge pull request #44 from OmooLab/feature/dev
Feature/dev
2024-09-13 17:12:41 +08:00
0ebc6dafbd fix cannot extract wire 2024-09-13 17:00:00 +08:00
c22ab2c85b Merge branch 'main' into feature/dev 2024-09-13 16:43:51 +08:00
133702619e fix: join component cause missing
feat: extract mesh from node
2024-09-13 16:42:18 +08:00
Ma Nan
e384798184 Merge pull request #43 from OmooLab/feature/dev
fix: cannot decode utf-8 issue
2024-09-11 15:36:19 +08:00
80da400891 fix: cannot decode utf-8 issue 2024-09-11 15:17:00 +08:00
Ma Nan
48700b3001 Merge pull request #42 from OmooLab/feature/dev
Feature/dev
2024-09-11 13:16:51 +08:00
b865d9d78d docs: fix image lost 2024-09-11 13:15:44 +08:00
20c6393344 docs: v1.0.0 2024-09-11 13:10:50 +08:00
148 changed files with 2035 additions and 2697 deletions

View File

@@ -1,31 +1,11 @@
name: Upload Assets to Release
name: Release Version
on:
push:
branches:
- "release/*"
tags:
- 'v*'
jobs:
# draft_release:
# name: Draft Release
# runs-on: ubuntu-latest
# outputs:
# upload_url: ${{ steps.draft_release.outputs.upload_url }}
# version: ${{ steps.set_env.outputs.version }}
# steps:
# - name: Set Version Env
# id: set_env
# run: |
# ref_name=${{ github.ref_name }}
# echo "version=${ref_name#release/}" >> "$GITHUB_OUTPUT"
# - name: Get release
# id: draft_release
# uses: cardinalby/git-get-release-action@1.2.4
# with:
# releaseName: Upload
# env:
# GITHUB_TOKEN: ${{ github.token }}
draft_release:
name: Draft Release
permissions:
@@ -50,7 +30,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_blender_add-on:
build_extension:
name: Build Blender Extension
needs: draft_release
runs-on: ubuntu-latest
@@ -66,12 +46,13 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Build Add-on
run: |
- name: Build Extension
run: | # build.py need tomlkit to edit blender_manifest.toml
pip install tomlkit
python build.py ${{ matrix.platform }}
zip -r package.zip bioxelnodes
- name: Upload Release Asset
cd src/bioxelnodes
zip -r ../../package.zip .
- name: Upload Extension
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:

11
.vscode/BioxelNodes.code-workspace vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"folders": [
{
"path": ".."
},
{
"path": "../src/bioxelnodes"
}
],
"settings": {}
}

View File

@@ -1,4 +1,4 @@
[中文文档](https://uj6xfhbzp0.feishu.cn/wiki/Qx3VwHuNPimeI8kr6nDcvl1DnHf?from=from_copylink)
[中文文档](https://uj6xfhbzp0.feishu.cn/wiki/LPKEwjooSivxjskWHlCcQznjnNf?from=from_copylink)
# Bioxel Nodes
@@ -26,18 +26,18 @@ Welcome to our [discord server](https://discord.gg/pYkNyq2TjE), if you have any
## Support Multiple Formats
| Format | EXT | Test |
| ------ | ---------------------------------------- | ------- |
| DICOM | .dcm, .DCM, .DICOM, .ima, .IMA | ✅ pass |
| BMP | .bmp, .BMP | ✅ pass |
| JPEG | .jpg, .JPG, .jpeg, .JPEG | ✅ pass |
| PNG | .png, .PNG | ✅ pass |
| TIFF | .tif, .TIF, .tiff, .TIFF | ✅ pass |
| Nifti | .nia, .nii, .nii.gz, .hdr, .img, .img.gz | ✅ pass |
| Nrrd | .nrrd, .nhdr | ✅ pass |
| HDF5 | .hdf, .h4, .hdf4, .he2, .h5, .hdf5, .he5 | ✅ pass |
| OME | .ome.tiff, .ome.tif | ✅ pass |
| MRC | .mrc, .mrc.gz, .map, .map.gz | ✅ pass |
| Format | EXT |
| ------ | ---------------------------------------- |
| 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 |
## Support 4D volumetric data
@@ -59,16 +59,6 @@ Welcome to our [discord server](https://discord.gg/pYkNyq2TjE), if you have any
- Only works with Cycles CPU , Cycles GPU (OptiX), EEVEE
- Section surface cannot be generated when convert to mesh (will be supported soon)
## Compatible to Newer Version
**v0.3.x is not compatible to v0.2.x, Updating this addon may break old files. Read the following carefully before upgradation**
Before upgradation, you need to ask yourself whether this project file will be modified again or not, if it's an archived project file, I would recommend that you run **Bioxel Nodes > Save Staged Data** to make the addon nodes permanent. In this way, there will be no potential problem with the nodes not functioning due to the addon update.
After the addon update, your old project files may not work either, this may be because you had executed **Save Staged Data**. If so, you need to execute **Bioxel Nodes > Relink Nodes to Addon** to relink them to make sure that the addon's new functionality and the addon nodes are synchronized.
Also, the older shaders are not based on OSL, so if you find that you can't render volumes, you need to turn on **Open Shading Language (OSL)** in the Render Settings.
## Roadmap
- Better multi-format import experience

View File

@@ -1,68 +0,0 @@
from pathlib import Path
import shutil
import bpy
from .common import get_file_prop, set_file_prop
from ..exceptions import Incompatible, NoFound
from ..constants import NODE_LIB_FILEPATH, VERSION
def get_node_group(node_type: str, use_link=True):
# unannotate below for local debug in node lib file.
# node_group = bpy.data.node_groups[node_type]
# return node_group
if get_file_prop("addon_version") is None:
set_file_prop("addon_version", VERSION)
local_lib_file = None
addon_lib_file = NODE_LIB_FILEPATH.as_posix()
for node_group in bpy.data.node_groups:
if node_group.name.startswith("BioxelNodes"):
node_group_lib = node_group.library
if node_group_lib:
abs_filepath = bpy.path.abspath(node_group_lib.filepath)
_local_lib_file = Path(abs_filepath).resolve().as_posix()
if _local_lib_file != addon_lib_file:
local_lib_file = _local_lib_file
break
# local lib first
lib_file = local_lib_file or addon_lib_file
bpy.ops.wm.append('EXEC_DEFAULT',
directory=f"{lib_file}/NodeTree",
filename=node_type,
link=use_link,
use_recursive=True,
do_reuse_local_id=True)
node_group = bpy.data.node_groups.get(node_type)
if node_group is None:
raise NoFound('No custom node found')
return node_group
def assign_node_group(node, node_type: str):
node.node_tree = bpy.data.node_groups[node_type]
node.width = 200.0
node.name = node_type
return node
def add_node_to_graph(node_name: str, node_group, use_link=True):
node_type = f"BioxelNodes_{node_name}"
# Deselect all nodes first
for node in node_group.nodes:
if node.select:
node.select = False
get_node_group(node_type, use_link)
node = node_group.nodes.new("GeometryNodeGroup")
assign_node_group(node, node_type)
node.show_options = False
return node

View File

@@ -1,37 +0,0 @@
schema_version = "1.0.0"
id = "bioxelnodes"
version = "1.0.0"
name = "Bioxel Nodes"
tagline = "For scientific volumetric data visualization in Blender"
maintainer = "Ma Nan <icrdr2010@outlook.com>"
type = "add-on"
website = "https://omoolab.github.io/BioxelNodes/latest"
tags = ["Geometry Nodes", "Render", "Import-Export"]
blender_version_min = "4.2.0"
license = ["SPDX:MIT"]
copyright = ["2024 OmooLab"]
platforms = ["windows-x64", "linux-x64", "macos-arm64", "macos-x64"]
wheels = [
"./wheels/SimpleITK-2.3.1-cp311-cp311-win_amd64.whl",
"./wheels/SimpleITK-2.3.1-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/SimpleITK-2.3.1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/SimpleITK-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/lxml-5.2.2-cp311-cp311-win_amd64.whl",
"./wheels/lxml-5.2.2-cp311-cp311-macosx_10_9_arm64.whl",
"./wheels/lxml-5.2.2-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/lxml-5.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/h5py-3.11.0-cp311-cp311-win_amd64.whl",
"./wheels/h5py-3.11.0-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/h5py-3.11.0-cp311-cp311-macosx_10_9_x86_64.whl",
"./wheels/h5py-3.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/tifffile-2024.7.24-py3-none-any.whl",
"./wheels/pyometiff-1.0.0-py3-none-any.whl",
"./wheels/mrcfile-1.5.1-py2.py3-none-any.whl",
"./wheels/transforms3d-0.4.2-py3-none-any.whl"
]
[permissions]
files = "Import/export volume data from/to disk"

View File

@@ -41,8 +41,8 @@ def run_python(args: str):
def build_extension(platform: Platform, python_version="3.11") -> None:
wheel_dirpath = Path("./bioxelnodes/wheels")
toml_filepath = Path("bioxelnodes/blender_manifest.toml")
wheel_dirpath = Path("./src/bioxelnodes/wheels")
toml_filepath = Path("./src/bioxelnodes/blender_manifest.toml")
scipy_ndimage_dirpath = Path("./scipy_ndimage", platform.blender_tag)
# download required_packages
@@ -60,7 +60,7 @@ def build_extension(platform: Platform, python_version="3.11") -> None:
f.name.replace("universal2", "arm64")))
for ndimage_filepath in scipy_ndimage_dirpath.iterdir():
to_filepath = Path("./bioxelnodes/bioxel/scipy", ndimage_filepath.name)
to_filepath = Path("./src/bioxelnodes/bioxel/scipy", ndimage_filepath.name)
shutil.copy(ndimage_filepath, to_filepath)
# Load the TOML file
@@ -71,12 +71,6 @@ def build_extension(platform: Platform, python_version="3.11") -> None:
manifest["wheels"] = [f"./wheels/{f.name}"
for f in wheel_dirpath.glob('*.whl')]
# build = tomlkit.table(True)
# generated = tomlkit.table()
# generated["platforms"] = [platform.blender_tag]
# generated["wheels"] = [f"./wheels/{f.name}"
# for f in wheel_dirpath.glob('*.whl')]
# build.append('generated', generated)
# manifest.append('build', build)

99
docs/SARS-Cov-2.md Normal file
View File

@@ -0,0 +1,99 @@
# SARS-Cov-2
![alt text](assets/SARS-Cov-2/image.png)
![alt text](assets/SARS-Cov-2/image-1.png)
In this tutorial, we'll make a structural visualzation of the SARS-Cov-2 Virus. Please see [step by step](step_by_step.md) to make sure you have a basic understanding of how to use the addon, and make sure the addon version is v1.0.2 or higher!
Research data is from paper published in September 2020 in Cell Press ([https://www.cell.com/cell/fulltext/S0092-8674(20)31159-4](<https://www.cell.com/cell/fulltext/S0092-8674(20)31159-4>)) by Li Sai team at Tsinghua University. This research revealed the molecular assembly of the authentic SARS-CoV-2 virus using cryoelectron tomography (cryo-ET) and subtomogram averaging (STA). Here is an official video of this study
<iframe width="560" height="315" src="https://www.youtube.com/embed/JSKl5VY4k5w?si=t4LhrCRebxrX_Saf&amp;controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
"It remains enigmatic how coronaviruses pack the ∼30-kb RNA into the ∼80-nm-diameter viral lumen. Are the RNPs ordered relative to each other to avoid RNA entangling, knotting, or even damage or are they involved in virus assembly?" Three assembly classes were proposed in the paper, we will make a visualzation of the "eggs-in-a-nest"-shaped RNPs assembly, based on real cryo-ET data.
## Download and import data
The data of this research is hosted on EMDB ([https://www.ebi.ac.uk/emdb](https://www.ebi.ac.uk/emdb)), and the website of SARS-Cov-2 virus is [here](https://www.ebi.ac.uk/emdb/EMD-30430). Open the page, find "Download" button and select the first selection "3D Volume (.map.gz)".
In case you can't download data, you can download here.
[SARS-Cov-2.map](https://drive.google.com/file/d/1LMybsmTVbwQ38_eqAx6hbZTc5p2fdcjK/view?usp=sharing)
After downloading, put it into any directory and import the data. In the import options, it is recommended to adjust the Bioxel Size to 5, in order to reduce the shape of the data to increase the speed of calculation and rendering. If you are confident in the performance of your hardware, you can leave the original 2.72 unchanged. After adjusting the Bioxel Size, the shape of the converted data will be calculated below based on the current bioxel size. The amount of data will increase exponentially with larger shape, and may result in OOM (out of memory).
## Cutout the Virus
After importing, you can get the virus by creating and connecting nodes and setting parameters as shown below
![alt text](assets/SARS-Cov-2/image-2.png)
Place the light and the camera in the way as below. The backlight is a area light, color white, intensity 500W, spread 90°, and inside the virus, place a point light, color `FFD08D`, intensity 5W. Camera focal length is 200 mm. the background color is pure black. The Look of the color management is High Contrast.
![alt text](assets/SARS-Cov-2/image-3.png)
Continue editing the node, followed by "Set Properies" and "Set Color by Ramp 4" node, the parameters of these two nodes are set as shown in the figure, where the color part, from top to bottom, is set to `E1D0FC` (1.0), `FFE42D` (0.5), `3793FF` (0.5), `FFFF8EC` (0.1) (alpha value in parentheses). Color alpha also affects density.
![alt text](assets/SARS-Cov-2/image-4.png)
If you feel that rendering is too slow, see [here](improve_performance.md) for suggestions
## Color the RNPs alone
The current rendering is pretty good, but considering that my goal is to make it clear how the RNPs are arranged within the virus, the RNPs should be colored differently than the others. So how to color the RNPs alone?
First of all, we have to separate the RNPs. The value of RNPs is between the membrane and S protein, so it is very difficult to separate. The good thing is that the virus is spherical, we can separate the RNPs part of the virus from the rest by using a sphere cutter. To do so, in the Geometry Nodes panel menu of the container, click **Bioxel Nodes > Add a Cutter > Sphere Cutter**, and adjust the scale and position of the newly created sphere object named "Sphere_Cutter" appropriately, so that it can just separate the internal RNPs and membrane of the virus.
![alt text](assets/SARS-Cov-2/image-5.png)
The process of changing the position of the "Sphere_Cutter" object can be very laggy, then you can turn off "With Surface" and do it in Slice Viewer mode. Once you are happy with it, you can restore the settings.
Then we turn on Invert in the "Sphere Cutter" node and you can see the opposite result. This way we've managed to separate the two, next let's color them separately and finally merge them with Join Component. Create and join the nodes as shown below, where the second Cutter node is copied and the color value in Set Color is `FFDDFE` (0.5). If all is well, the rendering should look like below.
![alt text](assets/SARS-Cov-2/image-6.png)
At this point, the rendering of a SARS-Cov-2 virus is complete!
## Render RNPs and Membranes
Realistic rendering is great, but Non-photorealistic rendering (NPR) is better for presenting structural information. So I will render ultrastructure of the RNPs assembly with toon shader.
![alt text](assets/SARS-Cov-2/image-7.png)
The silhouettes of RNPs uses Blender's Line Art feature, but Line Art must be based on a mesh. Select the nodes that are extruding the RNPs (i.e., the "Cut" nodes that are in charge of cutting out the RNPs), and right-click, click **Bioxel Nodes > Extract Mesh**. This gives you a new mesh object of the RNPs.
Extract the membrane mesh in the same way.
The membrane has a much higher value than the rest of the virus, so let's create a new "Cutout" node, also after the ReCenter, but with the threshold adjusted to 0.13. After the Cutout, connect to the "To Surface" node and parameterize it as shown in the figure, noting that the Remove Island Threshold is set to 1000 so that any fragments smaller than 1000 pts be eliminated. Then select the "To Surface" node, and perform the operation of extracting the mesh.
![alt text](assets/SARS-Cov-2/image-8.png)
The mesh of the membrane needs to be cut in half, this can be done with the Box Trim brush in sculpt mode or with the Boolean modifier. the mesh of the RNPs may also need some repair work, I cleaned up some of the broken surfaces of the RNPs. all the meshes are now ready to be used.
![alt text](assets/SARS-Cov-2/image-9.png)
For Line Art, please see the video tutorial from Blender Secrets.
<iframe width="560" height="315" src="https://www.youtube.com/embed/aIWdBq7-ias?si=CrcStx5VVJBwDpzu&amp;controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
Finally, an infographic on the ultrastructure of RNPs is done!
![alt text](assets/SARS-Cov-2/image-1.png)
If you have trouble following the docs, you can download the project files.
[SARS-Cov-2.zip](https://drive.google.com/file/d/15GpIoIjVAE-Jr98zWo7oupuk1KfRVPmk/view?usp=sharing)
## Homework
Other data relevant to the study are provided in the paper, you could try visualizing them.
![alt text](assets/SARS-Cov-2/image-10.png)
Go to the official EMDB website https://www.ebi.ac.uk/emdb/ and enter the EMD number in the search box to get them.
The Electron Microscopy Data Bank (EMDB) is a public repository for cryogenic-sample Electron Microscopy (cryoEM) volumes and representative tomograms of macromolecular complexes and subcellular structures. If you want to get data on other virus, just enter their name in the search box. For example, hepatitis B virus, enter it into the search box, then select Virus in the Sample Type on the left side, and download the data you need (it is better to find the corresponding paper to clarify the data information).
**Try to visualize hepatitis B virus.**
![alt text](assets/SARS-Cov-2/image-11.png)

118
docs/advanced_usage.md Normal file
View File

@@ -0,0 +1,118 @@
# 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!

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 770 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

View File

@@ -1 +0,0 @@
This type of node is responsible for setting the color properties of the shader

View File

@@ -1,46 +0,0 @@
# Concepts & Pipeline
## Container, Layer, Component
Bioxel Nodes imports volumetric data and put it into a **Container** as a **Layer**. One container may has more than one layer, and each layer stores the information of different fields under the same location, which is similar to the view layers in map app, except that here it is in 3D space.
In order to visualize the volumetric data the way we want it to, we need to build renderable objects from layers. We call those objects **Component**. The following diagram shows the relationship of **Container**, **Layer**, and **Component**:
![alt text](assets/features_concept.png)
### Container Structure
In Blender, container structure is like this:
```bash
Case_0000 # Container
|-- Case_0000_CT # Layer
|-- Case_0000_Label_1 # Layer
`-- Case_0000_Label_2 # Layer
```
The container also stores the build process in geometry nodes:
![alt text](assets/features_container.png)
### Layer Type
The layer is categorized into these by data type:
- Scalar
- Label
- Vector (Not implemented yet)
- Color (Not implemented yet)
## Component Building Pipline
In order to build a component, the general process is to first use a "Mask Method" node to build the surface of the component based on its layers, and then connect to a "Assign Shader" node to add the physical properties. Finally, if you need to cut the cross-section, then connect to a "Cut" node. The whole process is shown in the following diagram
![alt text](assets/nodes_concept.png)
A typical example looks like this:
![alt text](assets/nodes_example.png)
The "Mask Method" node tends to be very computationally intensive, and if it consumes too much time, then you can bake it with a "Bake" node after it (but you need to save the Blender file first).
![alt text](assets/nodes_bake.png)

View File

@@ -1 +0,0 @@
This type of node is responsible for cutting components to present cross-section

15
docs/faq.md Normal file
View File

@@ -0,0 +1,15 @@
# FAQ
## Nothing in the scene when rendering?
If you're using the Cycles renderer with GPU, make sure your GPU supports "Optix", as Bioxel Nodes relies on OSL (Open shader language) for volumetric rendering, otherwise you'll have to use the CPU for rendering.
If you're using the EEVEE renderer, this issue is due to EEVEE not loading shaders for some unknown reason, save the file and restart Blender to fix it.
## After updating the addon, the nodes in the file have turned red?
This is because the version of the nodes in the file does not match the current version of the addon after updating.
If you still want to edit the file with Bioxel Nodes, you can only roll back the addon version to the version that corresponds to the nodes.
If you just want the file to work and you won't rely on Bioxel Nodes any more, then you can just click **Bioxel Nodes > Relink Node Library >** in the top menu and select the corresponding version. Check to see if the nodes are working and rendering properly, and when everything is OK, click **Bioxel Nodes > Save Node Library** and select the save location in the dialog box.

View File

@@ -1,41 +0,0 @@
## First Time Import Volume Data
File > Import > Volume Data as Bioxel Layer
### Resample
![alt text](assets/features_resample.png)
Sometimes the original data is too big, or the spacing in the original data is not reasonable, you can modify the `Bioxel Size` and `Original Spacing` to adjust the Shape of the layer.
A bioxel is like a pixel, the larger the `Bioxel Size`, the lower the resolution of the image, Original Spacing will be read from the original data record, but sometimes the image doesn't have original spacing, you may need to input it manually to get the correct shape.
### Read as
- as Scalar
![alt text](assets/features_as-scalar.png)
In some cases the environment value is higher than the value of the target object, you can check `Invert Scalar` to adjust the value for better result.
- as Labels
Many AI segmentation task datasets, provide segmentation data, which are often an integer value representing a layer of segmentation labels. You can set it to `Labels` to load them.
- _as Vector (Not implemented yet)_
- _as Color (Not implemented yet)_
### Others
![alt text](assets/features_import-others.png)
`Scene Scale` determines how many units of length in the Blender world correspond to one unit of length in the Bioxel world. Since Blender defaults to meters, and the default size of blender primitives are around 1 blender unit. Therefore `Scene Scale` set to 0.01 is appropriate.
`Orient to RAS` determines whether the layer should be converted to the RAS coordinate system. Regardless of the format of the medical image data, the coordinate system is mostly the LPS coordinate system. Bioxel, however, are in the RAS coordinate system and therefore need to be transformed in most cases.
## Adding Volume Data to an existing container
In 3D view or outliner panel, select the container and right click, Bioxel Nodes > Add Volume Data to Container.
The import settings are the same as for the first time import.

View File

@@ -0,0 +1,39 @@
# 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,4 +1,4 @@
[中文文档](https://uj6xfhbzp0.feishu.cn/wiki/Qx3VwHuNPimeI8kr6nDcvl1DnHf?from=from_copylink)
[中文文档](https://uj6xfhbzp0.feishu.cn/wiki/LPKEwjooSivxjskWHlCcQznjnNf?from=from_copylink)
# Bioxel Nodes
@@ -26,18 +26,18 @@ Welcome to our [discord server](https://discord.gg/pYkNyq2TjE), if you have any
## Support Multiple Formats
| Format | EXT | Test |
| ------ | ---------------------------------------- | ------- |
| DICOM | .dcm, .DCM, .DICOM, .ima, .IMA | ✅ pass |
| BMP | .bmp, .BMP | ✅ pass |
| JPEG | .jpg, .JPG, .jpeg, .JPEG | ✅ pass |
| PNG | .png, .PNG | ✅ pass |
| TIFF | .tif, .TIF, .tiff, .TIFF | ✅ pass |
| Nifti | .nia, .nii, .nii.gz, .hdr, .img, .img.gz | ✅ pass |
| Nrrd | .nrrd, .nhdr | ✅ pass |
| HDF5 | .hdf, .h4, .hdf4, .he2, .h5, .hdf5, .he5 | ✅ pass |
| OME | .ome.tiff, .ome.tif | ✅ pass |
| MRC | .mrc, .mrc.gz, .map, .map.gz | ✅ pass |
| Format | EXT |
| ------ | ---------------------------------------- |
| 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 |
## Support 4D volumetric data
@@ -59,16 +59,6 @@ Welcome to our [discord server](https://discord.gg/pYkNyq2TjE), if you have any
- Only works with Cycles CPU , Cycles GPU (OptiX), EEVEE
- Section surface cannot be generated when convert to mesh (will be supported soon)
## Compatible to Newer Version
**v0.3.x is not compatible to v0.2.x, Updating this addon may break old files. Read the following carefully before upgradation**
Before upgradation, you need to ask yourself whether this project file will be modified again or not, if it's an archived project file, I would recommend that you run **Bioxel Nodes > Save Staged Data** to make the addon nodes permanent. In this way, there will be no potential problem with the nodes not functioning due to the addon update.
After the addon update, your old project files may not work either, this may be because you had executed **Save Staged Data**. If so, you need to execute **Bioxel Nodes > Relink Nodes to Addon** to relink them to make sure that the addon's new functionality and the addon nodes are synchronized.
Also, the older shaders are not based on OSL, so if you find that you can't render volumes, you need to turn on **Open Shading Language (OSL)** in the Render Settings.
## Roadmap
- Better multi-format import experience

View File

@@ -1,27 +1,19 @@
# Installation
> **Currently only support Blender 4.1 or above, make sure you have the correct version of Blender.**
**Currently only support Blender 4.2 or above, make sure you have the correct version of Blender.**
## For Blender 4.2 or higher
## Install in Blender (recommended)
The most recommended way is to open **Edit > Preferences > Extension**, enter "bio" in the search box and click **Install**. since the addon is quite large (20MB) you may need to wait a while!
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.
![extension](assets/installation_extension.png)
![alt text](assets/installation/image.png)
Thats it!
## Blender Official Extensions Website
> If it cannot be enable, reboot blender or install again as administrator
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.
Also, you can do it maually. Download the **Extension** version `BioxelNodes_Extension_{version}.zip` from https://github.com/OmooLab/BioxelNodes/releases/latest
In Blender, **Edit > Preferences > Extensions > Install from Disk**, select the zip file you just downloaded.
## Manual Install
## For Blender 4.1
Download the **Addon** version `BioxelNodes_Addon_{version}.zip` from https://github.com/OmooLab/BioxelNodes/releases/latest
In Blender, Edit > Preferences > Add-ons > Install, select the zip file you just downloaded.
The add-on requires a third-party python dependency called SimpleITK, click `Install SimpleITK` button below to install the dependency. After clicking, blender may get stuck, it is downloading and installing, just wait for a moment. After that, click `Reboot Blender` button.
![dependency](assets/installation_dependency.png)
This step may have failed due to network factors, just click "Set PyPI Mirror" to change the mirror.
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.

View File

View File

@@ -1 +0,0 @@
This type of node is responsible for culling out the extent of the component that does not need to be rendered, forming the interface between the object and the object, or the surface of the object (i.e., the interface between the object and the air)

View File

@@ -1,350 +0,0 @@
# Nodes
## Mask Methods
### ⬆️ Mask by Threshold
<div class="grid cards" markdown>
- ![alt text](assets/nodes_mask-by-threshold.png)
- Generate a mask by keeping only the positions that exceed the threshold (this only works with scalar)
***
Node Parameter:
- **Layer**, _the input scalar_
- **Threshold**, _the threshold value_
- Preview
- **Detail Factor**, _the fineness of the preview, the larger the factor, the coarser preview is_
- (Label Mask)
- **Layer**, _the input label_
- **Invert**, _invert mask_
- **Sample Size**, _the mask sample size_
- (Replacement)
- **Joined**, _the joined layer_
</div>
### ↕ Mask by Range
<div class="grid cards" markdown>
- ![alt text](assets/nodes_mask-by-range.png)
- Generate a mask by keeping only the positions that in range (this only works with scalar)
***
Node Parameter:
- **Layer**, _the input scalar_
- **Fram Min**, _the lower limit_
- **Fram Max**, _the upper limit_
- Preview
- **Detail Factor**, _the fineness of the preview, the larger the factor, the coarser preview is_
- (Label Mask)
- **Layer**, _the input label_
- **Invert**, _invert mask_
- **Sample Size**, _the mask sample size_
- (Replacement)
- **Joined**, _the joined layer_
</div>
### 🔤 Mask by Label
<div class="grid cards" markdown>
- ![alt text](assets/nodes_mask-by-label.png)
- Generate a mask by keeping only the positions that in label (this only works with label)
***
Node Parameter:
- **Layer**, _the input label_
- Preview
- **Detail Factor**, _the fineness of the preview, the larger the factor, the coarser preview is_
- (Replacement)
- **Joined**, _the joined layer_
</div>
## Shaders
### 🥚 Solid Shader
<div class="grid cards" markdown>
- ![alt text](assets/nodes_solid-shader.png)
- Assign a opaque shader based on a preview mesh with no inclusions visible. Fastest rendering speed. Does not support cross-section and color ramp.
***
Node Parameter:
- **Component**, _the upstream component_
- Base
- **Color**, _albedo or emission color_
- **Subsurface**, _the subsurface scale_
- **Opacity**, _the opacity of all_
- Specular
- **Specular**, _the specular of surface_
- **Roughness**, _the roughness of surface_
- Emission
- **Emission**, _the emission strength_
</div>
### 🦠 Slime Shader
<div class="grid cards" markdown>
- ![alt text](assets/nodes_slime-shader.png)
- Assign a semi-transparent shader based on the preview mesh with visible inclusions. Does not support cross-section and color ramp.
***
Node Parameter:
- **Component**, _the upstream component_
- Base
- **Color**, _albedo or emission color_
- **Density**, _the degree of solidity_
- **Anisotropy**, _the anisotropy of scatting_
- Specular
- **Specular**, _the specular of surface_
- **Roughness**, _the roughness of surface_
- Emission
- **Emission**, _the emission strength_
</div>
### ☁️ Volume Shader
<div class="grid cards" markdown>
- ![alt text](assets/nodes_volume-shader.png)
- Assign a volume-based shader with support for cross-section and color ramp.
***
Node Parameter:
- **Component**, _the upstream component_
- Base
- **Color**, _albedo or emission color_
- **Density**, _the degree of solidity_
- **Anisotropy**, _the anisotropy of scatting_
- Emission
- **Emission**, _the emission strength_
</div>
### 🔬 Universal Shader
<div class="grid cards" markdown>
- ![alt text](assets/nodes_universal-shader.png)
- Assign a ultimate shader, supporting all features of Bioxel Nodes. Of course, the price is slow rendering, which can be greatly improved by adjusting the Volumes > Step Rate to 100 in the Render Settings Panel.
***
Node Parameter:
- **Component**, _the upstream component_
- Base
- **Color**, _albedo or emission color_
- **Density**, _the degree of solidity_
- **Anisotropy**, _the anisotropy of scatting_
- Specular
- **Specular**, _the specular of surface_
- **Roughness**, _the roughness of surface_
- Emission
- **Emission**, _the emission strength_
</div>
## Cutters
### 🪚 Cut
<div class="grid cards" markdown>
- ![alt text](assets/nodes_cut.png)
- Execute all cutters on one component.
***
Node Parameter:
- **Component**, _the upstream component_
- **Cutter 0~4**, _the cutters_
- **Hide Guide**, _hide the cutter guide_
</div>
### 🧀 Plane Object Cutter
<div class="grid cards" markdown>
- ![alt text](assets/nodes_plane-object-cutter.png)
- Also a plane cutter, but origin and direction are based on exist object.
***
Node Parameter:
- **Plane**, _the plane object_
- Guide
- **Show**, _show the cutter guide_
- **Scale**, _scale the cutter guide_
</div>
## Colors
### 🎨 Color Presents
<div class="grid cards" markdown>
- ![alt text](assets/nodes_color-presets.png)
- Set color from presets.
***
Node Parameter:
- **Component**, _the upstream component_
- **Presets**, _select color presents_
- **Fram Min**, _ramp factor lower limit_
- **Fram Max**, _ramp factor upper limit_
</div>
### 2️⃣ Color Ramp 2
<div class="grid cards" markdown>
- ![alt text](assets/nodes_color-ramp-2.png)
- Set color ramp base on scalar value.
***
Node Parameter:
- **Component**, _the upstream component_
- **Fram Min**, _ramp factor lower limit_
- **Fram Max**, _ramp factor upper limit_
- Ramp
- **Pos0 Color**, _position 0% Color_
- **Pos1 Color**, _position 100% Color_
- **Gamma**, _non-linear coefficient, the larger the coefficient, the more lower value color_
- **Contrast**, _the larger the contrast, the harder color ramp will be_
</div>
### 3️⃣ Color Ramp 3
<div class="grid cards" markdown>
- ![alt text](assets/nodes_color-ramp-3.png)
- Set color ramp base on scalar value.
***
Node Parameter:
- **Component**, _the upstream component_
- **Fram Min**, _ramp factor lower limit_
- **Fram Max**, _ramp factor upper limit_
- Ramp
- **Pos0 Color**, _position 0% Color_
- **Pos1 Color**, _position 50% Color_
- **Pos2 Color**, _position 100% Color_
- **Gamma**, _non-linear coefficient, the larger the coefficient, the more lower value color_
- **Contrast**, _the larger the contrast, the harder color ramp will be_
</div>
### 4️⃣ Color Ramp 4
<div class="grid cards" markdown>
- ![alt text](assets/nodes_color-ramp-4.png)
- Set color ramp base on scalar value.
***
Node Parameter:
- **Component**, _the upstream component_
- **Fram Min**, _ramp factor lower limit_
- **Fram Max**, _ramp factor upper limit_
- Ramp
- **Pos0 Color**, _position 0% Color_
- **Pos1 Color**, _position 33.3% Color_
- **Pos2 Color**, _position 66.6% Color_
- **Pos3 Color**, _position 100% Color_
- **Gamma**, _non-linear coefficient, the larger the coefficient, the more lower value color_
- **Contrast**, _the larger the contrast, the harder color ramp will be_
</div>
### 5️⃣ Color Ramp 5
<div class="grid cards" markdown>
- ![alt text](assets/nodes_color-ramp-5.png)
- Set color ramp base on scalar value.
***
Node Parameter:
- **Component**, _the upstream component_
- **Fram Min**, _ramp factor lower limit_
- **Fram Max**, _ramp factor upper limit_
- Ramp
- **Pos0 Color**, _position 0% Color_
- **Pos1 Color**, _position 25% Color_
- **Pos2 Color**, _position 50% Color_
- **Pos3 Color**, _position 75% Color_
- **Pos4 Color**, _position 100% Color_
- **Gamma**, _non-linear coefficient, the larger the coefficient, the more lower value color_
- **Contrast**, _the larger the contrast, the harder color ramp will be_
</div>
## Utils
### 📦 Join Component
<div class="grid cards" markdown>
- ![alt text](assets/nodes_join-component.png)
- Components' combination should not be done by "Join Geometry" node because Blender Cycles can't render volumes in the same position, so the node will slightly offset all components randomly to avoid this problem.
***
Node Parameter:
- **Component 0~4**, _the components_
</div>

View File

@@ -1,45 +0,0 @@
# Prepare Your Data
## Support Formats
First thing first, you need to get your volumetric data ready in disk. Bioxel Nodes is developed based on Simple ITK, so theoretically all formats supported by Simple ITK are supported by the addon. If your data is not in the support list, you may do the data conversion first.
| Format | EXT | Test |
| ------ | ---------------------------------------- | ------- |
| DICOM | .dcm, .DCM, .DICOM, .ima, .IMA | ✅ pass |
| BMP | .bmp, .BMP | ✅ pass |
| JPEG | .jpg, .JPG, .jpeg, .JPEG | ✅ pass |
| PNG | .png, .PNG | ✅ pass |
| TIFF | .tif, .TIF, .tiff, .TIFF | ✅ pass |
| Nifti | .nia, .nii, .nii.gz, .hdr, .img, .img.gz | ✅ pass |
| Nrrd | .nrrd, .nhdr | ✅ pass |
| Meta | .mha, .mhd | yet |
| HDF5 | .hdf, .h4, .hdf4, .he2, .h5, .hdf5, .he5 | ✅ pass |
| VTK | .vtk | yet |
| BioRad | .PIC, .pic | yet |
| Gipl | .gipl, .gipl.gz | yet |
| LSM | .lsm, .LSM | yet |
| MINC | .mnc, .MNC | yet |
| MRC | .mrc, .rec | yet |
| OME | .ome.tiff, .ome.tif | ✅ pass |
| MRC | .mrc, .mrc.gz, .map, .map.gz | ✅ pass |
## Download Data from Internet
If you don't have any volumetric data, you can access open research data from list below.
> Note that just because they are open and available for download does not mean you can use them for anything! Be sure to look at the description of the available scopes from website.
| Source | Object |
| ------------------------------------------------------------------------------------ | ------------------ |
| [MorphoSource](https://www.morphosource.org/) | Open Research Data |
| [Dryad](https://datadryad.org) | Open Research Data |
| [Cell Image Library](http://cellimagelibrary.org/home) | Cells |
| [OpenOrganelle](https://openorganelle.janelia.org/datasets) | Cells |
| [Allen Cell Explorer](https://www.allencell.org/3d-cell-viewer.html) | Cells |
| [EMDB](https://www.ebi.ac.uk/emdb/) | Protein, Viruses |
| [Embodi3D](https://www.embodi3d.com/files/category/37-medical-scans/) | Medical Images |
| [Github](https://github.com/sfikas/medical-imaging-datasets) | Medical Images |
| [NIHR](https://nhsx.github.io/open-source-imaging-data-sets/) | Medical Images |
| [Medical Segmentation Decathlon](http://medicaldecathlon.com/) | Medical Images |
| [Visible Human Project](https://www.nlm.nih.gov/research/visible/visible_human.html) | Medical Images |

Some files were not shown because too many files have changed in this diff Show More