Git Product home page Git Product logo

medblend's Introduction

Colorful People Humanity Company Logo

MedBlend

A Medical Visualisation Add-On for Blender

This project is still in development. The code provided here is still being developed and has not been optimised yet

Introduction

Intended Use

This Blender add-on is intended to be used to create visulisations of radiation therapy treatment plans including DICOM images, plans, structures and dose. This can be used to create high quality figures for presentations or publications.

Disclaimer

This package is intended for research or educational purposes only and should not be used for clinical applications. By using this add-on you accept that this software is provided without warranty and the author will not be held liable for any damages caused by the use of this software.

Requirements

MedBlend utilises the pydicom module and is installed as a dependancy when you enable the add-on in Blender. The add-on also uses the pyopenvdb module which has recently been added to Blender version 3.5.

Installation

Download MedBlend

To download MedBlend, click the following link and select the latest release. https://github.com/drmichaeldouglass/MedBlend/tags

Download the add-on installation file which will be of the form: "medblend_0.0.1.zip", for MedBlend version 0.0.1 for example.

Install MedBlend (If you have administrator rights to your PC)

If you have local administrator rights to run Blender then use these instructions otherwise, use the instructions in the next section.

Open Blender 3.5, ensuring to run Blender using administrator privalidges. From the Edit-->Preferences menu. Select "Add-ons". Then press install and find the medblend_0.0.1.zip file in the file explorer.

Install_1 add_on_install

Once installed, under the Medical category in the 3D viewport, select MedBlend and then select "Install Python Modules". This will install some additonal python modules to the Blender python installation which are required for MedBlend to function. This process can take up to a few minutes to complete, please be patient.

install_python

Install MedBlend (If you don't have administrator rights to your PC)

If you don't have administrator rights to your PC, you can use MedBlend by installing the add-on to a portable version of Blender. The portable versions of Blender can be identified by the ".zip" type Blender downloads (shown in the figure below).

Releases of Blender can be downloaded from here: https://www.blender.org/download/

Experimental builds can be downloaded here: https://builder.blender.org/download/daily/

blender_portable

Ensure that the version of Blender that you download is 3.5 or later. Once downloaded, unzip the file and look for the file called Blender.exe. This version of Blender can be run locally without installation or saved to a USB drive.

Blender, by default will try and install add-ons to the directory: C:\Users(username)\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons. If you do not have administrator rights to your PC, you will not be able to install add-ons to this directory. Instead, you will need to manually install the add-on to the portable version of Blender you have just downloaded.

Start by un-zipping the MedBlend add-on (medblend_0.0.1.zip) for example. Once un-zipped, you should have a folder called "medblend" which contains a file called init.py. Copy the folder "medblend" to the directory "D:\Blender3.5\3.5\scripts\addons" so that the directory structure now looks like "D:\Blender3.5\3.5\scripts\addons\medblend\init.py". Your path to Blender 3.5 might look different, so change accordingly.

Load up Blender 3.5 portable by running blender.exe. When you select Edit-->Preferences and Add-Ons, you should find that MedBlend is already installed.

add_on_install

Once installed, under the Medical category in the 3D viewport, select MedBlend and then select "Install Dependancies". This will install some additonal python modules to the Blender python installation which are required for MedBlend to function. This process can take up to a few minutes to complete, please be patient.

install_python

Installing the python modules should download a module named "pydicom" to the following location "D:\Blender3.5\3.5\python\lib\site-packages". If pydicom is not in this location, MedBlend will not function correctly.

How to use MedBlend

Once installed, open the 3D viewport and select the Medical category from the sidebar. Press N on the keyboard if it is not visible.

medBlendFunctions

MedBlend currently has 4 main functions: Load DICOM images, Load DICOM Dose, Load DICOM structures and Load Proton Plan. Each of these functions imports a specific DICOM medical file.

-Load DICOM Images, will allow you to load a DICOM image sequence from a specified folder. When you press the load images button, a file dialog will appear. Select a single DICOM image from this folder. MedBlend will search through the same directory and load all DICOM images with the same study ID into Blender automatically. These image slices will be imported and converted to a volume object which can be rendered in Blender.

-Load DICOM Dose will allow you to import radiation therapy DICOM Dose Files from a treatment planning system and display the dose distribution as a volume in Blender.

-Load DICOM structures will import a DICOM structure file from a radiation therapy treatment planning system and import each structure as a separate point cloud.

-Load Proton Plan will import a DICOM RT Ion proton therapy plan file and extract the proton spot positions and weights and display them as spheres with a radius proportional to the relative spot weight.

How to add Materials to the CT and dose volumes

Some default materials have been included in the github repository in the assets folder and then assets.blend. Download this blender file. In blender, once you have imported your CT or dose volumes, go to the file menu --> append and find the assets.blend file. Go to the materials sub-folder and select Image Material and Dose Material. This will import the default materials so that they become available in Blender.

With the CT or dose object selected in the outliner (top right), go to the shader/material menu (red icon in lower right) and select either the Image Material or Dose Material depending on what type of volume you have imported.

materials2

To change the material properties, select the Shading tab from the top edge and you should see the Material node setup shown in the bottom panel. MedBlend works with both the Eevee and Cycles render engines but Cycles generally produces better results without too many changes. You can change from Eevee to Cycles from the panel on the right. From the material nodes (shown in panel at the bottom), the brightness of the volume can be changed by increasing the "multiply" value. The pixel threshold can be adjusted by moving the slider points in the colour ramp node.

materials3

Here are some examples:

A CT scan, structures and dose volumes imported and overlayed.

Dose

DICOM structures for a test prostate radiotherapy plan showing organs at risk such as prostate, urethra, bladder, rectum and the external structure.

Structure

A test proton therapy plan on a phantom. The CT images, dose distribution and proton spots are shown.

Proton

Known Issues

  • Not tested on MRI, SPECT, PET or other imaging modalities.
  • CT, Dose and Structure locations are not co-registered yet (user needs to manually align them at the moment).

Please report any bugs as an issue on this repository

Future Updates

Import Radaition Therapy Plan Files

Import radaition therapy DICOM plan files to visulise MLC or proton spot positions in the patient CT

Import Brachytherapy Dwell Points

Visulise brachytherapy dwell point positions and dwell times

Treatment simulation with Linac model.

How to Cite

MedBlend: A Medical Visualisation Add-On for Blender, M.Douglass https://github.com/drmichaeldouglass/MedBlend

Support the development of MedBlend via PayPal

download

References

medblend's People

Contributors

drmichaeldouglass avatar

Stargazers

harvey huang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.