diff --git a/README.md b/README.md index fde3373..4920708 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 | | ------ | ---------------------------------------- | ------- | @@ -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: diff --git a/bioxelnodes/assets/Nodes/BioxelNodes_4.0.blend b/bioxelnodes/assets/Nodes/BioxelNodes_4.0.blend index fe2f780..32ee958 100644 --- a/bioxelnodes/assets/Nodes/BioxelNodes_4.0.blend +++ b/bioxelnodes/assets/Nodes/BioxelNodes_4.0.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b77277826c07703a1df84a4831e6c381591253a43b4ec9939232a5eeb0eb3998 -size 4849415 +oid sha256:b1675dac841e714283283fd5975deb33f0e776b1b4f55896b93ec0d9fb14c1f1 +size 4850215 diff --git a/bioxelnodes/assets/Nodes/BioxelNodes_4.1.blend b/bioxelnodes/assets/Nodes/BioxelNodes_4.1.blend index b2eaa79..cbe9a13 100644 --- a/bioxelnodes/assets/Nodes/BioxelNodes_4.1.blend +++ b/bioxelnodes/assets/Nodes/BioxelNodes_4.1.blend @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:175a8dfa1fa2e77f3491df8261868fe96a4fc262763c2f649b9727526995984b -size 4176434 +oid sha256:44905112564c51547c1565ef77ad2b2f08686c8500dce0aa010762f8ad5d53d2 +size 4178018 diff --git a/bioxelnodes/io.py b/bioxelnodes/io.py index f885943..ff8bfdf 100644 --- a/bioxelnodes/io.py +++ b/bioxelnodes/io.py @@ -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 @@ -535,7 +540,7 @@ class ImportVolumeDataDialog(bpy.types.Operator): 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): diff --git a/bioxelnodes/nodes.py b/bioxelnodes/nodes.py index 899b1b3..7589fdc 100644 --- a/bioxelnodes/nodes.py +++ b/bioxelnodes/nodes.py @@ -133,26 +133,26 @@ if bpy.app.version >= (4, 1, 0): ] }, { - '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': '', } ] @@ -282,26 +282,26 @@ else: ] }, { - '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': '', } ] diff --git a/bioxelnodes/utils.py b/bioxelnodes/utils.py index e563104..360d75d 100644 --- a/bioxelnodes/utils.py +++ b/bioxelnodes/utils.py @@ -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 diff --git a/docs/assets/as-labels.png b/docs/assets/as-labels.png deleted file mode 100644 index bc6c788..0000000 Binary files a/docs/assets/as-labels.png and /dev/null differ diff --git a/docs/assets/bake-node.png b/docs/assets/bake-node.png deleted file mode 100644 index 3594c13..0000000 Binary files a/docs/assets/bake-node.png and /dev/null differ diff --git a/docs/assets/before-sharing.png b/docs/assets/before-sharing.png deleted file mode 100644 index 6e7a0fa..0000000 Binary files a/docs/assets/before-sharing.png and /dev/null differ diff --git a/docs/assets/as-scalar.png b/docs/assets/features_as-scalar.png similarity index 100% rename from docs/assets/as-scalar.png rename to docs/assets/features_as-scalar.png diff --git a/docs/assets/features_concept.png b/docs/assets/features_concept.png new file mode 100644 index 0000000..31e2a4f Binary files /dev/null and b/docs/assets/features_concept.png differ diff --git a/docs/assets/features_container.png b/docs/assets/features_container.png new file mode 100644 index 0000000..d25ae7b Binary files /dev/null and b/docs/assets/features_container.png differ diff --git a/docs/assets/import-others.png b/docs/assets/features_import-others.png similarity index 100% rename from docs/assets/import-others.png rename to docs/assets/features_import-others.png diff --git a/docs/assets/resample.png b/docs/assets/features_resample.png similarity index 100% rename from docs/assets/resample.png rename to docs/assets/features_resample.png diff --git a/docs/assets/general-graph-example.png b/docs/assets/general-graph-example.png deleted file mode 100644 index b985894..0000000 Binary files a/docs/assets/general-graph-example.png and /dev/null differ diff --git a/docs/assets/general-graph.png b/docs/assets/general-graph.png deleted file mode 100644 index 2217cde..0000000 Binary files a/docs/assets/general-graph.png and /dev/null differ diff --git a/docs/assets/dependency.png b/docs/assets/getting-started_dependency.png similarity index 100% rename from docs/assets/dependency.png rename to docs/assets/getting-started_dependency.png diff --git a/docs/assets/getting-started_graph.png b/docs/assets/getting-started_graph.png new file mode 100644 index 0000000..acc90e8 Binary files /dev/null and b/docs/assets/getting-started_graph.png differ diff --git a/docs/assets/importing.png b/docs/assets/getting-started_importing.png similarity index 100% rename from docs/assets/importing.png rename to docs/assets/getting-started_importing.png diff --git a/docs/assets/result.png b/docs/assets/getting-started_result.png similarity index 100% rename from docs/assets/result.png rename to docs/assets/getting-started_result.png diff --git a/docs/assets/getting-started_share-file.png b/docs/assets/getting-started_share-file.png new file mode 100644 index 0000000..8d4e67c Binary files /dev/null and b/docs/assets/getting-started_share-file.png differ diff --git a/docs/assets/import-dialog.png b/docs/assets/import-dialog.png deleted file mode 100644 index f77dce9..0000000 Binary files a/docs/assets/import-dialog.png and /dev/null differ diff --git a/docs/assets/nodes_bake.png b/docs/assets/nodes_bake.png new file mode 100644 index 0000000..71b245d Binary files /dev/null and b/docs/assets/nodes_bake.png differ diff --git a/docs/assets/nodes_color-presets.png b/docs/assets/nodes_color-presets.png new file mode 100644 index 0000000..d4c2908 Binary files /dev/null and b/docs/assets/nodes_color-presets.png differ diff --git a/docs/assets/nodes_color-ramp-2.png b/docs/assets/nodes_color-ramp-2.png new file mode 100644 index 0000000..58eda88 Binary files /dev/null and b/docs/assets/nodes_color-ramp-2.png differ diff --git a/docs/assets/nodes_color-ramp-3.png b/docs/assets/nodes_color-ramp-3.png new file mode 100644 index 0000000..f3b4a7b Binary files /dev/null and b/docs/assets/nodes_color-ramp-3.png differ diff --git a/docs/assets/nodes_color-ramp-4.png b/docs/assets/nodes_color-ramp-4.png new file mode 100644 index 0000000..8619525 Binary files /dev/null and b/docs/assets/nodes_color-ramp-4.png differ diff --git a/docs/assets/nodes_color-ramp-5.png b/docs/assets/nodes_color-ramp-5.png new file mode 100644 index 0000000..22022c8 Binary files /dev/null and b/docs/assets/nodes_color-ramp-5.png differ diff --git a/docs/assets/nodes_concept.png b/docs/assets/nodes_concept.png new file mode 100644 index 0000000..6f5c149 Binary files /dev/null and b/docs/assets/nodes_concept.png differ diff --git a/docs/assets/nodes_cut.png b/docs/assets/nodes_cut.png new file mode 100644 index 0000000..99ac754 Binary files /dev/null and b/docs/assets/nodes_cut.png differ diff --git a/docs/assets/nodes_example.png b/docs/assets/nodes_example.png new file mode 100644 index 0000000..eb0a5d9 Binary files /dev/null and b/docs/assets/nodes_example.png differ diff --git a/docs/assets/nodes_join-component.png b/docs/assets/nodes_join-component.png new file mode 100644 index 0000000..ddfeb4a Binary files /dev/null and b/docs/assets/nodes_join-component.png differ diff --git a/docs/assets/nodes_mask-by-label.png b/docs/assets/nodes_mask-by-label.png new file mode 100644 index 0000000..6afc39b Binary files /dev/null and b/docs/assets/nodes_mask-by-label.png differ diff --git a/docs/assets/nodes_mask-by-range.png b/docs/assets/nodes_mask-by-range.png new file mode 100644 index 0000000..53f43e4 Binary files /dev/null and b/docs/assets/nodes_mask-by-range.png differ diff --git a/docs/assets/nodes_mask-by-threshold.png b/docs/assets/nodes_mask-by-threshold.png new file mode 100644 index 0000000..04d247f Binary files /dev/null and b/docs/assets/nodes_mask-by-threshold.png differ diff --git a/docs/assets/nodes_plane-cutter.png b/docs/assets/nodes_plane-cutter.png new file mode 100644 index 0000000..4b1c8da Binary files /dev/null and b/docs/assets/nodes_plane-cutter.png differ diff --git a/docs/assets/nodes_plane-object-cutter.png b/docs/assets/nodes_plane-object-cutter.png new file mode 100644 index 0000000..0840884 Binary files /dev/null and b/docs/assets/nodes_plane-object-cutter.png differ diff --git a/docs/assets/nodes_separate-component.png b/docs/assets/nodes_separate-component.png new file mode 100644 index 0000000..9f8da9c Binary files /dev/null and b/docs/assets/nodes_separate-component.png differ diff --git a/docs/assets/nodes_slime-shader.png b/docs/assets/nodes_slime-shader.png new file mode 100644 index 0000000..fb055f3 Binary files /dev/null and b/docs/assets/nodes_slime-shader.png differ diff --git a/docs/assets/nodes_solid-shader.png b/docs/assets/nodes_solid-shader.png new file mode 100644 index 0000000..b8cb875 Binary files /dev/null and b/docs/assets/nodes_solid-shader.png differ diff --git a/docs/assets/nodes_universal-shader.png b/docs/assets/nodes_universal-shader.png new file mode 100644 index 0000000..5a5b605 Binary files /dev/null and b/docs/assets/nodes_universal-shader.png differ diff --git a/docs/assets/nodes_volume-shader.png b/docs/assets/nodes_volume-shader.png new file mode 100644 index 0000000..1352190 Binary files /dev/null and b/docs/assets/nodes_volume-shader.png differ diff --git a/docs/assets/segment-node.png b/docs/assets/segment-node.png deleted file mode 100644 index 80af303..0000000 Binary files a/docs/assets/segment-node.png and /dev/null differ diff --git a/docs/assets/to-mesh.png b/docs/assets/to-mesh.png deleted file mode 100644 index 2dd73e5..0000000 Binary files a/docs/assets/to-mesh.png and /dev/null differ diff --git a/docs/features.md b/docs/features.md index 53caad5..21c106c 100644 --- a/docs/features.md +++ b/docs/features.md @@ -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 +- as Scalar -![alt text](assets/as-scalar.png) + ![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. + 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 +- as Labels -![alt text](assets/as-labels.png) + 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. -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. +- _as Vector (Not implemented yet)_ -#### as Vector (Not implemented) - -#### as Color (Not implemented) +- _as Color (Not implemented yet)_ ### Others -![alt text](assets/import-others.png) +![alt text](assets/features_import-others.png) -## Convert Bioxels to Mesh +`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. -In 3D view, select bioxels and right-click, Bioxels > Bioxels To Mesh +`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. -![alt text](assets/to-mesh.png) +## Adding Volume Data to an existing container -## Export Biovels as VDB +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. -File > Export > Biovels as VDB +## Convert Bioxel Components to Mesh + +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 Biovel Layer as VDB + +File > Export > Biovel Layer as VDB diff --git a/docs/getting-started.md b/docs/getting-started.md index c433390..cc0a271 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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 | | ------------------------------------------------------------------------------------ | ------------------ | @@ -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) +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) -![importing](assets/importing.png) +![importing](assets/getting-started_importing.png) -It may take a while to read data. After finishing reading, it will pop up a dialog box +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). -![import dialog](assets/import-dialog.png) +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: -Ignore the options, just click OK! - -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. - -![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. \ No newline at end of file +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. diff --git a/docs/index.md b/docs/index.md index 4eb71fb..a54bfff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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) @@ -9,7 +7,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. @@ -17,9 +15,9 @@ Below are some examples with Bioxel Nodes. Thanks to Cycles Render, the volumetr ![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 | | ------ | ---------------------------------------- | ------- | @@ -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 -- Time sequence volume not supported (will be supported soon) +- 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. + +Alternatively, objects from the old file that have nothing to do with Bioxel Nodes could be append to the new blender file. diff --git a/docs/nodes.md b/docs/nodes.md index cb2899f..8497dad 100644 --- a/docs/nodes.md +++ b/docs/nodes.md @@ -1,19 +1,408 @@ -# Geometry Nodes +# Nodes -The node, that named "Segment", is a preset node that combines the steps of 3D reconstruction process and shading process. In general, you need to add one of the segmentation node to reconstruction first, and followed by one of the shader node to set the shader. As you can see in the following figure: +## Nodes Design Concept -![general graph](assets/general-graph.png) +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 material 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 -Currently there are 3 types of nodes +![alt text](assets/nodes_concept.png) -- Segmentation nodes, responsible for splitting the volume into a reconstructed model (we call them "Segment"). -- Shader nodes, responsible for giving shader to the Segment. -- Slicer nodes, responsible for partially cutting the Segment. +A typical example looks like this: -For example: +![alt text](assets/nodes_example.png) -![general graph example](assets/general-graph-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). -You can add a "Bake" node between segmentation node and shader node, if the reconstruction process consumes too much computing time. But be sure, you are selecting the volume object, not the container object. +![alt text](assets/nodes_bake.png) -![bake node](assets/bake-node.png) +## Mask Methods + +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) + +### ⬆️ Mask by Threshold + +
+ +- ![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_ + +
+ +### ↕ Mask by Range + +
+ +- ![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_ + +
+ +### 🔤 Mask by Label + +
+ +- ![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_ + +
+ +## Shaders + +This type of node is responsible for setting material physical properties to the component to reflect the differences in rendering effects of different components. + +### 🥚 Solid Shader + +
+ +- ![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_ + +
+ +### 🦠 Slime Shader + +
+ +- ![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_ + +
+ +### ☁️ Volume Shader + +
+ +- ![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_ + +
+ +### 🔬 Universal Shader + +
+ +- ![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_ + +
+ +## Cutters + +This type of node is responsible for cutting components to present cross-section + +### 🪚 Cut + +
+ +- ![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_ + +
+ +### 🧀 Plane Cutter + +
+ +- ![alt text](assets/nodes_plane-cutter.png) + +- Flat plane cutter, cuts off above Z-axis in local. + + *** + + Node Parameter: + + - **Origin**, _plane cutter position_ + - **Direction**, _plane cutter orientation_ + - Guide + - **Show**, _show the cutter guide_ + - **Scale**, _scale the cutter guide_ + +
+ +### 🧀 Plane Object Cutter + +
+ +- ![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_ + +
+ +## Utils + +### 📦 Join Component + +
+ +- ![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_ + +
+ +### 🗂️ Separate Component + +
+ +- ![alt text](assets/nodes_separate-component.png) + +- Volumes, previews, and guides are included within a component. This node can split them by type. + + *** + + Node Parameter: + + - **Component**, _the upstream component_ + - **Type**, _the sub-object type, 0 is volume, 1 is preview, 2 is guide_ + +
+ +## Colors + +This type of node is responsible for setting the color properties of the shader + +### 🎨 Color Presents + +
+ +- ![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_ + +
+ +### 2️⃣ Color Ramp 2 + +
+ +- ![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_ + +
+ +### 3️⃣ Color Ramp 3 + +
+ +- ![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_ + +
+ +### 4️⃣ Color Ramp 4 + +
+ +- ![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_ + +
+ +### 5️⃣ Color Ramp 5 + +
+ +- ![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_ + +
diff --git a/mkdocs.yml b/mkdocs.yml index 7ab624c..7e89023 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,7 +11,7 @@ nav: - index.md - Getting Started: getting-started.md - Features & Options: features.md - - Geometry Nodes: nodes.md + - Nodes: nodes.md - Future Features: misc.md theme: @@ -68,6 +68,8 @@ plugins: - mkdocstrings markdown_extensions: + - attr_list + - md_in_html - mkdocs-click - admonition - pymdownx.highlight: