Skip to content

Commit

Permalink
docs: v0.2.0 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
icrdr committed May 30, 2024
1 parent fa031e6 commit f21f7d6
Show file tree
Hide file tree
Showing 49 changed files with 528 additions and 87 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Bioxel Nodes is a Blender add-on for scientific volumetric data visualization. It using Blender's powerful Geometry Nodes | Cycles to process and render volumetric data.

# About
## About

Before us, there have been many tutorials and add-ons for importing volumetric data into Blender. However, we found that there were many details that were not addressed in place, some scientific facts were ignored, and the volume rendering was not pretty enough. With Bioxel Nodes, you can easily import the volumetric data into Blender, and more importantly, it can quickly make a beautiful realistic rendering of it.

Expand All @@ -19,7 +19,7 @@ Below are some examples with Bioxel Nodes. Thanks to Cycles Render, the volumetr

The "Bioxel" in "Bioxel Nodes", is a combination of the words "Bio-" and "Voxel". Bioxel is a voxel that stores biological data. We are developing a toolkit around Bioxel for better biological data visualization. but before its release, we made this Blender version of bioxels toolkit first, in order to let more people to have fun with volumetric data. [Getting Started](https://omoolab.github.io/BioxelNodes/latest/getting-started)

# Supported Format
## Supported Format

| Format | EXT | Test |
| ------ | ---------------------------------------- | ------- |
Expand All @@ -39,12 +39,12 @@ The "Bioxel" in "Bioxel Nodes", is a combination of the words "Bio-" and "Voxel"
| MINC | .mnc, .MNC | yet |
| MRC | .mrc, .rec | yet |

# Known limitations
## Known Limitations

- Sections cannot be generated (will be supported soon)
- Time sequence volume not supported (will be supported soon)

# To Upgrade Add-on
## To Upgrade Add-on

To upgrade from an older version of the add-on to the latest, you need to do the following:

Expand Down
4 changes: 2 additions & 2 deletions bioxelnodes/assets/Nodes/BioxelNodes_4.0.blend
Git LFS file not shown
4 changes: 2 additions & 2 deletions bioxelnodes/assets/Nodes/BioxelNodes_4.1.blend
Git LFS file not shown
11 changes: 8 additions & 3 deletions bioxelnodes/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,13 @@ class ImportVolumeDataDialog(bpy.types.Operator):
subtype="FILE_PATH"
) # type: ignore

container_name: bpy.props.StringProperty() # type: ignore
layer_name: bpy.props.StringProperty() # type: ignore
container_name: bpy.props.StringProperty(
name="Container Name"
) # type: ignore

layer_name: bpy.props.StringProperty(
name="Layer Name",
) # type: ignore

series_id: bpy.props.StringProperty() # type: ignore

Expand Down Expand Up @@ -535,7 +540,7 @@ def create_layer(array, layer_name, layer_type="scalar"):
return {'FINISHED'}

def invoke(self, context, event):
context.window_manager.invoke_props_dialog(self, width=400)
context.window_manager.invoke_props_dialog(self, width=500)
return {'RUNNING_MODAL'}

def draw(self, context):
Expand Down
28 changes: 14 additions & 14 deletions bioxelnodes/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,26 @@ def set_prop_to_node_factory(source_prop, target_prop):
]
},
{
'label': 'Slicers',
'label': 'Cutters',
'icon': 'MOD_BEVEL',
'items': [
{
'label': 'Apply Slicers',
'label': 'Cut',
'icon': 'MOD_BEVEL',
'node_type': 'BioxelNodes_ApplySlicers',
'node_type': 'BioxelNodes_Cut',
'node_description': ''
},
"separator",
{
'label': 'Plane Slicer',
'label': 'Plane Cutter',
'icon': 'MOD_LATTICE',
'node_type': 'BioxelNodes_PlaneSlicer',
'node_type': 'BioxelNodes_PlaneCutter',
'node_description': '',
},
{
'label': 'Object Plane Slicer',
'label': 'Plane Object Cutter',
'icon': 'OUTLINER_OB_LATTICE',
'node_type': 'BioxelNodes_ObjectPlaneSlicer',
'node_type': 'BioxelNodes_PlaneObjectCutter',
'node_description': '',
}
]
Expand Down Expand Up @@ -282,26 +282,26 @@ def set_prop_to_node_factory(source_prop, target_prop):
]
},
{
'label': 'Slicers',
'label': 'Cutters',
'icon': 'MOD_BEVEL',
'items': [
{
'label': 'Apply Slicers',
'label': 'Apply Cutters',
'icon': 'MOD_BEVEL',
'node_type': 'BioxelNodes_ApplySlicers',
'node_type': 'BioxelNodes_ApplyCutters',
'node_description': ''
},
"separator",
{
'label': 'Plane Slicer',
'label': 'Plane Cutter',
'icon': 'MOD_LATTICE',
'node_type': 'BioxelNodes_PlaneSlicer',
'node_type': 'BioxelNodes_PlaneCutter',
'node_description': '',
},
{
'label': 'Object Plane Slicer',
'label': 'Plane Object Cutter',
'icon': 'OUTLINER_OB_LATTICE',
'node_type': 'BioxelNodes_ObjectPlaneSlicer',
'node_type': 'BioxelNodes_PlaneObjectCutter',
'node_description': '',
}
]
Expand Down
10 changes: 5 additions & 5 deletions bioxelnodes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def hide_in_ray(obj):
def get_container(current_obj):
if current_obj:
return current_obj if current_obj.get('bioxel_container') else None
else:
return None
return None


def get_layer(current_obj):
if current_obj.get('bioxel_layer') and current_obj.parent:
if current_obj.parent.get('bioxel_container'):
return current_obj
if current_obj:
if current_obj.get('bioxel_layer') and current_obj.parent:
if current_obj.parent.get('bioxel_container'):
return current_obj
return None


Expand Down
Binary file removed docs/assets/as-labels.png
Binary file not shown.
Binary file removed docs/assets/bake-node.png
Binary file not shown.
Binary file removed docs/assets/before-sharing.png
Binary file not shown.
File renamed without changes
Binary file added docs/assets/features_concept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/features_container.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file removed docs/assets/general-graph-example.png
Binary file not shown.
Binary file removed docs/assets/general-graph.png
Binary file not shown.
File renamed without changes
Binary file added docs/assets/getting-started_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
Binary file added docs/assets/getting-started_share-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/assets/import-dialog.png
Binary file not shown.
Binary file added docs/assets/nodes_bake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_color-presets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_color-ramp-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_color-ramp-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_color-ramp-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_color-ramp-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_concept.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_cut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/nodes_join-component.png
Binary file added docs/assets/nodes_mask-by-label.png
Binary file added docs/assets/nodes_mask-by-range.png
Binary file added docs/assets/nodes_mask-by-threshold.png
Binary file added docs/assets/nodes_plane-cutter.png
Binary file added docs/assets/nodes_plane-object-cutter.png
Binary file added docs/assets/nodes_separate-component.png
Binary file added docs/assets/nodes_slime-shader.png
Binary file added docs/assets/nodes_solid-shader.png
Binary file added docs/assets/nodes_universal-shader.png
Binary file added docs/assets/nodes_volume-shader.png
Binary file removed docs/assets/segment-node.png
Diff not rendered.
Binary file removed docs/assets/to-mesh.png
Diff not rendered.
74 changes: 55 additions & 19 deletions docs/features.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,81 @@
# Features & Options

## Import Volume Data as Biovels
## Bioxel Design Concept

File > Import > Volume Data as Biovels
According to Bioxel design concept, Bioxel Nodes imports volume 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 layer of map app, except that here it is in 3D space. In order to render the volume the way we want it to, we need to build a renderable object from layers. We call this object **Component**. The following diagram shows the relationship of **Container**, **Layer**, and **Component**:

![alt text](assets/features_concept.png)

Bioxel Nodes staging the layer as an openvdb file. The process of building from layers to a component is taking place in blender geometry nodes graph with blender native geometry nodes. Therefore, **the blender file works without Bioxel Nodes.**

## 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)

The layer is categorized into these by data type:

- Scalar
- Label
- Vector (Not implemented yet)
- Color (Not implemented yet)

## First Time Import Volume Data

File > Import > Volume Data as Bioxel Layer

### Resample

![alt text](assets/resample.png)
![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 Bixoels.
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/as-scalar.png)
- as Scalar
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.
![alt text](assets/features_as-scalar.png)
#### as Labels
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.
![alt text](assets/as-labels.png)
- 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 the Label Index to determine exactly which labels to load.
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)
- _as Vector (Not implemented yet)_
#### as Color (Not implemented)
- _as Color (Not implemented yet)_
### Others
![alt text](assets/import-others.png)
![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
## Convert Bioxels to Mesh
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.
In 3D view, select bioxels and right-click, Bioxels > Bioxels To Mesh
## Convert Bioxel Components to Mesh
![alt text](assets/to-mesh.png)
In 3D view or outliner panel, select the container and right click, Bioxel Nodes > Bioxel Components To Mesh
Once it has been turned into a mesh model, you can perform any traditional 3D editing operations on it, such as sculpting, boolean, etc.
## Export Biovels as VDB
## Export Biovel Layer as VDB
File > Export > Biovels as VDB
File > Export > Biovel Layer as VDB
34 changes: 16 additions & 18 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ In Blender, Edit > Preferences > Add-ons > Install, select the `BioxelNodes_{ver

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/dependency.png)
![dependency](assets/getting-started_dependency.png)

This step may have failed due to network factors, just click "Set PyPI Mirror" to change the mirror.

## Prepare Your Data

First you need to have your volumetric data ready. If not, you can access open research data from list below:
First you need to have your volumetric data ready. If not, 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 |
| ------------------------------------------------------------------------------------ | ------------------ |
Expand All @@ -30,34 +32,30 @@ First you need to have your volumetric data ready. If not, you can access open r

## Import Volume Data

File > Import > Volume Data as Bioxels, select **one** of the .dcm files and click on "Volume Data as Bioxels" (you can also drag one of the .dcm files directly into the 3D viewport to trigger the import)

![importing](assets/importing.png)

It may take a while to read data. After finishing reading, it will pop up a dialog box
File > Import > Volume Data as Bioxel Layer, select **one** of the .dcm files and click on "Volume Data as Bioxel Layer" (you can also drag one of the .dcm files directly into the 3D viewport to trigger the import)

![import dialog](assets/import-dialog.png)
![importing](assets/getting-started_importing.png)

Ignore the options, just click OK!
It may take a while to read data. After finishing reading, it will pop up a dialog box. Ignore all the options, just click OK (we will tell about these options later).

After importing, the necessary nodes are automatically added, the reconstruction and shader are created. Click select Bioxels Object, and open the Geometry Nodes panel, change the "Threshold" in segment node.
After importing the data, the add-on will automatically add the necessary nodes to build the component. Click on the new created object in outliner, open the geometry nodes panel, set `Threshold` in "Mask by Threshold" node to 200, and then connect a Slime Shader node (Add > Bioxel Nodes > Slime Shader) after it. The node graph should be as following:

![segment node](assets/segment-node.png)
![alt text](assets/getting-started_graph.png)

and then turned on the cycles rendering to directly see the result.

![result](assets/result.png)
![result](assets/getting-started_result.png)

You can change the "Threshold" to modify the reconstruction model, or change the "Color", "Density" to modify the shader effect. All the parameters are straightforward, you can understand them by changing the values.
You can change the "Threshold" to modify the preview model, or change the "Color", "Density" to modify the shader effect. All the parameters are straightforward, you can understand them by changing the values.

## Share Your File

The VDB cache and the Bioxel nodes are not reachable to computers if you don't save them. If you need to give your blender file to someone else, you will need to perform the following steps:
The VDB cache and the Bioxel nodes are not reachable to other computers if you don't save them. If you want to give your blender file to someone else, you will need to perform the following steps first:

1. Save your blender file
2. Click Scene > Bioxels > Save All Bioxels in the Properties panel.
3. Click Scene > Custom Nodes > Save All Custom Nodes under the Properties panel.
2. Click Scene > Bioxels > Save All Bioxels in the properties panel.
3. Click Scene > Custom Nodes > Save All Custom Nodes in the properties panel.

![before sharin](assets/before-sharing.png)
![alt text](assets/getting-started_share-file.png)

After that, both the VDB cache and the Bioxel nodes are stored in relative locations. When you share a file with someone, pack the entire directory so that the resources are not lost. The other person will be able to load correctly, regardless of whether they have Bioxel Nodes installed.
After that, both the VDB cache and the Bioxel nodes are restored in relative locations. When you share this file with someone, pack the entire directory so that the resources will be not lost. The other person will be able to open it correctly, regardless of whether they have Bioxel Nodes installed or not.
27 changes: 19 additions & 8 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[中文文档](https://uj6xfhbzp0.feishu.cn/wiki/Qx3VwHuNPimeI8kr6nDcvl1DnHf?from=from_copylink)

# Bioxel Nodes

![Static Badge](https://img.shields.io/badge/Blender-orange?style=for-the-badge&logo=blender&logoColor=white)
Expand All @@ -9,17 +7,17 @@

Bioxel Nodes is a Blender add-on for scientific volumetric data visualization. It using Blender's powerful Geometry Nodes | Cycles to process and render volumetric data.

# About
## About

Before us, there have been many tutorials and add-ons for importing volumetric data into Blender. However, we found that there were many details that were not addressed in place, some scientific facts were ignored, and the volume rendering was not pretty enough. With Bioxel Nodes, you can easily import the volumetric data into Blender, and more importantly, it can quickly make a beautiful realistic rendering of it.

Below are some examples with Bioxel Nodes. Thanks to Cycles Render, the volumetric data can be rendered with great detail:

![gallery](assets/gallery.png)

The "Bioxel" in "Bioxel Nodes", is a combination of the words "Bio-" and "Voxel". Bioxel is a voxel that stores biological data. The volumetric data made up of Bioxel is called Bioxels. We are developing a toolkit around Bioxels for better biological data visualization. but before its release, we made this Blender version of bioxels toolkit first, in order to let more people to have fun with volumetric data. [Getting Started](https://omoolab.github.io/BioxelNodes/latest/getting-started)
The "Bioxel" in "Bioxel Nodes", is a combination of the words "Bio-" and "Voxel". Bioxel is a voxel that stores biological data. We are developing a toolkit around Bioxel for better biological data visualization. but before its release, we made this Blender version of bioxels toolkit first, in order to let more people to have fun with volumetric data. [Getting Started](https://omoolab.github.io/BioxelNodes/latest/getting-started)

# Supported Format
## Supported Format

| Format | EXT | Test |
| ------ | ---------------------------------------- | ------- |
Expand All @@ -39,7 +37,20 @@ The "Bioxel" in "Bioxel Nodes", is a combination of the words "Bio-" and "Voxel"
| MINC | .mnc, .MNC | yet |
| MRC | .mrc, .rec | yet |

# Known limitations
## Known Limitations

- Sections cannot be generated (will be supported soon)
- Time sequence volume not supported (will be supported soon)

## To Upgrade Add-on

To upgrade from an older version of the add-on to the latest, you need to do the following:

1. Remove the old version of Bioxel Nodes at Preferences > Add-ons
2. Add the new version and restart Blender.

It is not support editing the same blender file across add-on versions. In order to make sure that the previous file works properly. You need to save the staged data before upgrading ( read the last section of [Getting Started](https://omoolab.github.io/BioxelNodes/latest/getting-started/#share-your-file) ).

But even then, there is still no guarantee that the new version of the add-on will work on the old blender file. Therefore, it is highly recommended to open a new blender file to start the creating, not based on the old one.

- Sections cannot be generated
- Time sequence volume not supported (will be supported soon)
Alternatively, objects from the old file that have nothing to do with Bioxel Nodes could be append to the new blender file.
Loading

0 comments on commit f21f7d6

Please sign in to comment.