Git Product home page Git Product logo

slicer-liver's Introduction

Table of content

Introduction

SlicerLiver is an extension for the medical research software 3D Slicer providing tools for analysis, quantification and therapy planning for hepatic interventions.

The extension provides a fast and accurate solution for:

  • Computation and visualization of liver vascular territories (liver segments).
  • Definition of surgical resection in 3D using deformable surfaces, as well as the visualization of resection margins (risk areas).

Installing the extension

  1. Download and install 3D Slicer according to your operating system from here : https://download.slicer.org/.
  2. Open Slicer.
  3. Press Ctrl+4 to open the extension manager. Or click the blue upper-right icon with the letter E.
  4. Once the Extension Manager pops up, make sure to select the Install Extensions tab.
  5. On the upper-right search box write "Liver"
  6. Click Install and give okay to install other extensions if asked.
  7. Restart Slicer.
  8. Once 3D Slicer restarts, click the search icon on the left of the module selector and write 'Liver'. Click Switch to module.

Slicer-Liver_screenshot_10

Sample Data

To test the extension, the LiverVolume and LiverSementation data can be loaded from the Sample Data module, after installing Slicer-Liver. To properly load the data in the plugin, it is advised to first open the extension and afterwards to navigate to the Sample module and to load the data.

Slicer-Liver_screenshot_9

Slicer-Liver Extension Usage

The extension is separated in the following three sections:

  • Distance Map Computation: projection of the safety margins in real-time onto the resection surface, which allows the user to modify the resection proposal until the safety requirement are met.
  • Resections: computation of the first approximation (planar Bézier) of the resection surface which can be subsequently modified through 16 control points.
  • Liver Segments: calculation and visualization of liver vascular territories (liver segments).

Each section is oriented towards one part of the liver resection planning workflow but, if desired, can work independently of the other ones. At the end of the workflow, the distance map, resection plan and liver segments can be saved to a given output directory.

Distance Map Computation

The computation of the Distance Map can be done using the following steps:

  1. Select the Reference Volume CT data.
  2. Select the Segmentation , i.e the binary labelmap representation which stores the segmentation of the liver, tumour and vascular territories.
  3. Select the Tumor segmentation.
  4. Select the Liver segmentation.
  5. Create new VectorVolume for Output Distance Map.
  6. Finally, click on Compute Distance Map.

Resections

The liver resection can be planned through the following process:

  1. Create a new Liver Resection for Resection.
  2. Select the labelmap (the same used in step 2 for the Distance Map Computation) for Liver Segmentation.
  3. Select the Liver segmentation.
  4. Optional: the user has the possibility to select the Distance Map computed at the end of the first section thought the collapsible button Distance Map.
  5. In the 3D View, slide the contour surrounding the liver in the desired position through the MarkupSlidingContour.
  6. The initial resection plane will appear after dropping the mouse.
  7. The resection can be deformed using the control points (4x4). It is also possible to modify the Resection grid, Resection margin and Uncertainty margin as desired.
  8. Check Preview resection checkbox if you want to visualize the final resection plan.

Slicer-Liver_screenshot_11

Slicer-Liver_screenshot_12

There are multiple options to create visualizations for the resection (color, opacity, configurable grid, etc).

Liver planning visualization

Liver Segments

Our approach to liver segments definition consist of the defintion of a segment by the centerline connecting user-defined sets of points. These centerlines will be the base for computation of liver segments in image space. The computation is based on shortest-distance mapping. The Liver segments can be defined using the following steps:

  1. Select the Segmentation.
  2. Select the hepatic/portal segmentation for Segment.
  3. You can hide the liver segmentation for better visibility in the 3D view by going to: Modules > search for Data > click on Switch to Module > Click on the eye botton next to the liver segmentation.
  4. Switch to Liver module again.
  5. Create a new Point List for Vessels points.
  6. Click the arrow button next to Vessel points," and place fixed landmark points on the hepatic/portal segmentation. These points will be useful for extracting the centralines of user-defined vessel branches.
  7. Once all the points are placed, Click Add Vessel Centerline Segments.
  8. Repeat steps 5 and 6 for creating new Point List, i.e extracting new centerlines.
  9. Click on Calculate Vascular Segments.

Liver segments -- placing fiducials

Liver segments -- placing fiducials

  1. If you want to visualize the liver segments in the 3D view:
    1. Click the search icon on the left of the module selector and write 'Data'. Click switch to module.
    2. Select the created VascularSegments labelmap and right click to Convert label map to segmentation node.
    3. Click again the search icon and go to Segmentations module.
    4. Select the new VascularSegmentations as Active segmentation.
    5. Click on Show 3D.

Slicer-Liver_screenshot_14

Video Tutorial

Slicer-Liver tutorial

Developers

Compilation

Slicer-Liver depends on the VMTK which can be installed in Slicer3D using the extension manager or built following the steps for developers here: https://github.com/vmtk/SlicerExtension-VMTK#for-developers.

SLICER_BUILD_DIR=/path/to/Slicer-SuperBuild

git clone https://github.com/ALive-research/Slicer-Liver.git
cmake -DSlicer_DIR:PATH=SLICER_BUILD_DIR/Slicer-build -S ../Slicer-Liver
make -j5
make package

Testing

  • To enable the developer mode go to :

    • Edit > Application Settings > Developer
  • Then check the Enable developer mode check box. The application may need to be restarted for this modification to be taken into account.

  • To run the unit tests, open the Slicer-Liver extension, expand the Reload & Test menu and click on the Reload and Test button.

  • To visualize the test results, open the Python console by going to: View > Python Interactor.

  • The number and the result of the tests will be displayed in the console. Should any of the test fail, please don't hesitate to open an issue or contact us through the Slicer forum.

Authors

  • Rafael Palomar (Oslo University Hospital / NTNU, Norway)
  • Ole Vegard Solberg (SINTEF, Norway)
  • Geir Arne Tangen (SINTEF, Norway)
  • Gabriella D'Albenzio (Oslo University Hospital)
  • Ruoyan Meng (NTNU)
  • Javier Pérez de Frutos (SINTEF, Norway)
  • Héctor Martínez (Universidad de Córdoba)
  • Francisco Javier Rodríguez Lozano (Universidad de Córdoba)
  • Joaquín Olivares Bueno (Universidad de Córdoba)
  • José Manuel Palomares Muñoz (Universidad de Córdoba)

Contact: [email protected]

License

This software is open source distributed under the 3-Clause BSD License

Acknowledgements

This software has partially been funded by The Research Council of Norway through the ALive project (grant nr. 311393).

slicer-liver's People

Contributors

cpinter avatar dalbenziog avatar gatangen avatar jamesobutler avatar lassoan avatar olevs avatar rafaelpalomar avatar ruoyanmeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

slicer-liver's Issues

Add functionality for loading/saving resections in CSV

I'm thinking about a JSON format for the resection, which should include, state, control points for markups and resection margin. The version of the file format should be included (v1.0).

Also the nodes for storing the MRML information should be created

Create new Slicer Ubuntu 20.04 Docker image

Currently Dockerhub only got one image on aliveresearch: aliveresearch/slicer-build.
This is based on the Centos7 slicer/slicer-base image, and isn't the best solution for the Slicer-Liver project.

I'm not allowed to create new repos for aliveresearch on Dockerhub, that's why we have been using olevs/slicer-build-ubuntu2004.
@RafaelPalomar Can you create aliveresearch/slicer-build-ubuntu2004 in Dockerhub?
I can update the documentation in https://github.com/ALive-research/ALive-Docker, and upload the new Docker image when I'm allowed.

Python interpreter does not find compiled libraries

Describe the bug
When executing Liver.py to build the UI, Python interpreter fails in loading the library qSlicerLiverResectionsModuleWidgetsPythonQt on Windows 10 (Liver.py line 178). The library file it is compiled and exists in the solution directory. Other modules are found and loaded correctly.

To Reproduce
Steps to reproduce the behaviour:

  1. Configure the project for VS 2019 v16
  2. Compile in Debug mode for Windows 10 (x64)
  3. Open Slicer, install the Liver extension
  4. Open the liver extension, this will execute Liver.py to build the UI an trigger the error.

Expected behaviour
To load the qSlicerLiverResectionsModuleWidgetsPythonQt library an complete the execution of Liver.py

Screenshots
python_issue

Desktop (please complete the following information):

  • OS: Windows 10 (version 21H1, build 19043.1415)
  • Version: Slicer 4.13.0, Slicer-liver updated to 27.01.2022

Additional context
The libraries are compiled as static (.lib) instead of dynamic (.dll)

Slicer-Liver Extension Manager Image

Discussed in #29

Originally posted by RafaelPalomar January 24, 2022
We need to create an image for SlicerLiver to show in the Slicer Extension Manager. This is not exactly a logo nor the icon of the extension in Slicer.

Here I post one I came up with:

g1123

Feedback and new suggestions welcome!

@ALive-research/alive-clinical
@ALive-research/alive-planning
@ALive-research/alive-hpc

Add a distance map node to have a selectable own type of node

vtkMRMLScalarVolumeNodes are adequate data structures to hold distance maps. However, their use is very extended in 3D Slicer and can lead to the situation that someone selects a medical volume as a distance map. To avoid this, volumes computed by distance maps functionality should be the only selectable ones. As a solution I propose to derive a new type that will prevent regular volumes to be used.

Computing distance maps

Compute distance maps between the tumor and the rest of the image or parenchyma in image space

Slow performance on bezier surface manipulation

  • Manipulating the bezier surface for a resection after its placement is very slow. This is due to the property of the display node that considers snapping to surface. Resections do not need this and should default to unconstrained

Memory leaks

Output for reference:

vtkDebugLeaks has detected LEAKS!
Class "CellMap" has 1 instance still around.
Class "vtkEmptyCell" has 1 instance still around.
Class "vtkAlgorithmOutput" has 1 instance still around.
Class "vtkMRMLNodeReference" has 1 instance still around.
Class "vtkObservation" has 1 instance still around.
Class "9vtkBufferIfE" has 2 instances still around.
Class "9vtkBufferIdE" has 1 instance still around.
Class "vtkTypeInt64Array" has 8 instances still around.
Class "vtkInformationExecutivePortVectorValue" has 1 instance still around.
Class "vtkObserverManager" has 1 instance still around.
Class "vtkInformationExecutivePortValue" has 1 instance still around.
Class "vtkInformationIterator" has 1 instance still around.
Class "vtkMRMLModelNode" has 1 instance still around.
Class "vtkEventBroker" has 1 instance still around.
Class "vtkInformationStringValue" has 1 instance still around.
Class "vtkInformationDoubleVectorValue" has 3 instances still around.
Class "vtkCellArray" has 4 instances still around.
Class "vtkPolyData" has 1 instance still around.
Class "vtkTimerLog" has 1 instance still around.
Class "vtkInformationVector" has 4 instances still around.
Class "9vtkBufferImE" has 1 instance still around.
Class "vtkFloatArray" has 2 instances still around.
Class "9vtkBufferIiE" has 5 instances still around.
Class "vtkCommand or subclass" has 7 instances still around.
Class "vtkIntArray" has 5 instances still around.
Class "vtkIdList" has 6 instances still around.
Class "vtkInformation" has 14 instances still around.
Class "vtkDoubleArray" has 1 instance still around.
Class "vtkIdTypeArray" has 4 instances still around.
Class "vtkCollection" has 2 instances still around.
Class "vtkUnsignedLongArray" has 1 instance still around.
Class "vtkCellData" has 1 instance still around.
Class "vtkFieldData" has 1 instance still around.
Class "vtkPointData" has 1 instance still around.
Class "vtkPoints" has 2 instances still around.
Class "vtkStreamingDemandDrivenPipeline" has 1 instance still around.
Class "vtkTrivialProducer" has 1 instance still around.
Class "vtkInformationIntegerValue" has 25 instances still around.
Class "vtkTagTable" has 1 instance still around.
Class "9vtkBufferIxE" has 12 instances still around.

`

Add option for visualization of interpolated distance map

  • My initial thought is that this is an attribute/property of vtkMRMLResectionDispalyNode

  • Another thing to check is whether there is an interpolated value in the vtkMRMLScalarVolumeNode that could be used.

  • Check whether this implies a new transfer of the texture. I believe not

  • Add GUI elements to support this

  • Add support in the vtk widget representations for enable/disable.

Fix README file

  • The README file should contain more information
  • The README file should correct the naming

Adding centerline endpoints don't work correcty

Describe the bug
When trying to add endpoints for the centerline calculation the user interface don't allow setting points in all parts of the selected structure. The issue seems to be that vtkOctreePointLocator::FindClosestPoint that is being used to find the closest point on the structure don't really provide the closest point to most of the structure.

To Reproduce
Steps to reproduce the behavior:

  1. Select the Liver module
  2. Press "Reload and Test"
  3. Choose LiverSegmentation000
  4. Select "hepatic" as "Reference Model"
  5. Press "Add segment" and try to select points on the vessels
  6. Now the white marker only show up for small parts of the vessels, and not for the whole structure

Expected behavior
I expect the white marker to show everywhere on the selected structure

Screenshots

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version 20.04

Additional context
Printing out the self.__distance shows that the distances gotten from vtkOctreePointLocator::FindClosestPoint are incorrect, suggesting that this function don't work for this model.

Multiple registration of the same MRML Nodes

Describe the bug
Warning about already registered vtkMRMLMarkupsSlicingContourNode, vtkMRMLMarkupsDistanceContourNode and vtkMRMLMarkupsBezierSurfaceNode:

Warning: In ../../Libs/MRML/Core/vtkMRMLScene.cxx, line 536
vtkMRMLScene (0x55b8c2d16440): Tag MarkupsSlicingContour has already been registered, unregistering previous node class vtkMRMLMarkupsSlicingContourNode to register vtkMRMLMarkupsSlicingContourNode


Warning: In ../../Libs/MRML/Core/vtkMRMLScene.cxx, line 536
vtkMRMLScene (0x55b8c2d16440): Tag MarkupsDistanceContour has already been registered, unregistering previous node class vtkMRMLMarkupsDistanceContourNode to register vtkMRMLMarkupsDistanceContourNode


Warning: In ../../Libs/MRML/Core/vtkMRMLScene.cxx, line 536
vtkMRMLScene (0x55b8c2d16440): Tag MarkupsBezierSurface has already been registered, unregistering previous node class vtkMRMLMarkupsBezierSurfaceNode to register vtkMRMLMarkupsBezierSurfaceNode

To Reproduce
Launch Slicer and observe the terminal output

Expected behavior
These warnings should not occur.

Desktop (please complete the following information):

  • OS: Linux
  • Version: v0.9

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.