Giter Site home page Giter Site logo

slicerigt / slicermarkupstomodel Goto Github PK

View Code? Open in Web Editor NEW
10.0 7.0 10.0 2.83 MB

3D Slicer extension to create tube or closed surface model from markup fiducials

License: BSD 3-Clause "New" or "Revised" License

CMake 4.34% C++ 95.66%
3d-slicer-extension

slicermarkupstomodel's Introduction

Overview

Slicer Markups to Model is an extension of 3D Slicer for creating 3D surface models. The user first specifies a series of input control points, then the module creates a model from those points. Currently there are two types of surface models that can be created: closed surfaces and curves.

Overview

Example models created using SlicerMarkupsToModel. Left: Closed Surface. Right: Curves.

UseCaseClosedSurface

A simulated tumor is segmented on live ultrasound as a closed surface. Link

UseCaseCurve

Curves are used to reconstruct catheter paths in a phantom. Link (See "Electromagnetically-generated catheter paths for breast brachytherapy")

GUI Features

GUI

The main GUI for this module

The parameter node is used to store all options settings for the module. The parameter node can also be saved along with a Slicer scene. When the scene is later re-opened, all options and settings should be preserved.

The two radio buttons along the top indicate whether the model should be a closed surface or a curve.

The Input Node is used to store input points for the model. There is an option to create a new Markups Point List from the drop-down selector. A Markups Point List can be added or deleted using buttons beside the selector. (*Note that advanced users can also take as input a "Model" and work with points from polygonal data).

The Output Model Node stores the model created by this module.

The Update Button can be set either to manual mode (updates only happen when the button is clicked), or to automatic mode (updates happen whenever the parameters are changed or when the input points are changed). Click on the checkbox to toggle between these two modes.

The Display Panel allows convenient access to change basic rendering properties of the model and input markups.

DisplayPanel

The Display Panel as seen in the GUI.

  • Model Visibility: Toggle visibility in all views.

  • Model Opacity: Change opacity. (Larger = more opaque)

  • Model Color: Change the color of the model in all views.

  • Model Slice Intersections: Toggle visibility in the red, yellow, and green slice views. Model Visibility (above) must also be enabled.

  • Markups Text Scale: Change the size of text beside each input markup control point.

Closed Surfaces

ClosedSurfaceExample

Left: Example of a closed surface. Right: Example of how a closed surface might look in slice view.

Closed surfaces are convex models that enclose the input points. Every time a new input point is added, the closed surface expands to contain the new input point. There are a variety of parameters that can be tweaked through the Closed Surface Model Settings panel.

AdvancedPanelClosedSurface

Panel when working with a closed surface.

  • Clean Duplicated Input Points: Remove duplicates from the input points

  • Smoothing: Make the closed surface smoother by using the "Butterfly Subdivision". Note that sometimes concavities and self-intersections will occur after applying this smoothing. See "Force Convex Output" below.

  • Convexity: Only tetrahedral 'cells' contained in a sphere with this radius will be used to construct the model. Concavities can be introduced by changing this value. (Note that 0.0 means that this feature is ignored, 0.0 is recommended for most applications.)

  • Force Convex Output: The model will become fully convex after all other operations. Used to correct self-intersections introduced by butterfly subdivision.

Curves

CurveExample

Left: Example of a curve. Right: Example of how a curve might look in slice view.

Curves are models shaped like a tube that either interpolate the input points, or approximate them in a best fit. There are in fact four types of curve in this module: Piecewise Linear, Cardinal Spline, Kochanek Spline, and Polynomial. All curves share the following parameters that can be seen on the Curve Model Settings panel.

AdvancedPanelCurve

Panel when working with a curve.

  • Clean Duplicated Markups: Remove duplicates from the input points.

Piecewise linear curves are the simplest type of curve that can be created. A tube model is created that passes from one input point to the next in the original order specified from the point list.

Cardinal spline curves appear smooth. A tube model is created that passes through each input point in the order specified from the point list. Between each pair of points, there will be some curvature in the model. See Wikipedia to learn more about cardinal splines.

Kochanek spline curves appear smooth. A tube model is created that passes through each input point in the order specified from the point list. Between each pair of points, there will be some curvature in the model. See Wikipedia to learn more about Kochanek splines.

  • Curve is a Loop: Indicate if the Curve should loop from the last point back to the first point (Valid for splines only).

There are a few paramters specific to Kochanek Splines, as seen in the Fitting panel.

AdvancedPanelCurveKochanek

Additional parameters shown on the Fitting panel for Kochanek splines.

  • Ends copy nearest derivative: The first and last points should use the tangent from their nearest neighboring points.

  • Kochanek Bias, Kochanek Tension, and Kochanek Continuity: As indicated on Wikipedia.

Global Least Squares Polynomial curves appear smooth. Unlike the other types of curve, polynomials approximate the input points instead of interpolating them. This particular option creates a global approximation to the data. The curve is represented using a tube-shaped model.

Moving Least Squares Polynomial curves appear smooth. Unlike the other types of curve, polynomials approximate the input points instead of interpolating them. This particular option creates a curve based on local approximations to the data. It's slower than the global least squares polynomial, but it tends to follow the data better. The curve is represented using a tube-shaped model.

There are a few parameters specific to Polynomial curves, as seen in the Fitting panel.

AdvancedPanelCurvePolynomial

Additional parameters shown on the Fitting panel for polynomials.

  • Point Sorting: This tells the module how to determine the order of the input points. If the input points are already in order, use "Indices". If the point order is unknown and the polynomial should connect the farthest two points, use "Minimum Spanning Tree".

  • Polynomial Order: How closely the polynomial should follow the input points. (Larger = closer fit, but also increased risk of overfitting)

  • Sampling Width: (Moving Least Squares Polynomial only) How much of the data should be used to create local polynomial fits. This is represented in normalized parameter space, meaning that 0.5 (for example) will capture half of the length of underlying data. (Larger = looser fit but more numerically stable, smaller is closer fit but higher risk of numerical instability and risk of overfitting)

  • Weight Function: (Moving Least Squares Polynomial only) This tells the module how local polynomials should treat data that is farther away. Rectangular indicates that all data within the sampling width should be treated with equal importance in each fit (fast, but susceptible to noise and sudden turns in underlying data). The other options, Triangular, Cosine, and Gaussian, indicate that data should be treated less importantly if it is far away. Note that the Gaussian option uses a curve with three standard deviations (capturing 99.7% of the Gaussian curve area).

Under Tube Properties you can change certain aspects of the curve model's geometry (size, resolution).

  • Radius: (Under Tube Properties) Changes the radius of the tube model (larger = wider tube).

  • Number of Sides: (Under Tube Properties) Changes the outer smoothness of a tube model (larger = smoother appearance).

  • Segments Per Point: (Under Tube Properties) Changes the number of points used to interpolate/approximate a curve. (larger = smoother appearance).

  • Capping: (Under Tube Properties) Changes if the ends of the output tube should be capped.

slicermarkupstomodel's People

Contributors

che85 avatar chir-set avatar cpinter avatar jamesobutler avatar jcfr avatar lassoan avatar sunderlandkyl avatar tavaughan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

slicermarkupstomodel's Issues

Using Markups to Models module from python interactor

Hello everybody,
I'm trying to create a cylinder based on a user defined fiducial. The fiducial should be the center point of the base of the cylinder.
Using a python script I developed, I managed to setup all the fiducials I need in order to create the cylinder using the Markups to Models module. Now I'd like to automatically call the module from within the script, passing all the parameters I need. Is it possible?
Also, maybe I'm approaching the problem the wrong way; do you have any viable alternatives?
Thank you very much for the help
Marco

Create a Curvature Display

The curve maker module has some extra features for quantifying it's models, perhaps adding the curvature features (specifically mean, max, and min curvature) to markups to model would be useful to people. Distance and length would also be useful.

GitHub UI: Reduce noise

> Reduce noise

@tavaughan @Sunderlandkyl @lassoan

To remove the "noise" associated with the project, I suggest disabling the following unused features if it still applies:

Go to General settings and disable the Wiki, Projects and Discussions tabs If empty or unused, hide Releases and Packages section on the right side
GitHub: Projects & Wiki tabs GitHub: Release & Packages sections

Rational

It is just to simplify things.

For example, if user support is provided via a forum then it is better to turn off Discussions here, so that there is no need to monitor two user support sites, but only one.

If Releases and Packages are not used, so it is cleaner to hide them (to indicate that it is not the way how we manage releases and packages).

Projects feature is rarely used in general and this repository does not use it either. If the user clicks on Projects then an empty page is s displayed. It is better to not display the heading at all, to save the extra two clicks for users exploring the project.

Wiki on Github is meant to be a lighter weight tool for documentation. The issue is that it is too limited, for example contributors either can make changes directly (without pull request) or they cannot make changes at all. It also lead to write redundant content, since Github quite nicely renders markdown pages in the main repository. For small projects it is simpler and more consistent to keep all documentation in markdown files in the main repository.

Co-authored by @lassoan


This comment was adapted from my GitHub saved replies, it is licensed under a Creative Commons Attribution 4.0 International License and you were welcome to reuse it. Creative Commons License

Errors on entering MarkupsToModel

Long-standing issue, easy to reproduce:

  1. Open Slicer
  2. Open MarkupsToModel

There will be error messages in the log:
void qSlicerMarkupsToModelModuleWidget::onModelNodeSelectionChanged() : invalid markupsToModelModuleNode
void qSlicerMarkupsToModelModuleWidget::onModelNodeSelectionChanged() : invalid markupsToModelModuleNode

"Curve is a Loop" checkbox not working with Model input node

Hello,

I am encountering an issue when I attempt to generate a Curve model when the Input Node is a Model.

Workflow:

  1. Import centerline model (attached centerline_model.vtk in zip file) of lung airway. This was generated with Slicer VMTK from a surface model. Centerline model.zip
  2. Using MarkupsToModel set Model type to "Curve", set Input node to "Centerline model" and ensure the "Curve is a loop" box is left unchecked. Remaining setting are left at their defaults.
  3. Curve is generated.

Problem: The endpoints of the generated model connect back to the beginning of the centerline curve (i.e. the trachea) even when the "Curve is a loop" checkbox is left unchecked. This results in the undesirable model shown below:
image

Attempted fixes:

  1. Modifying the centerline by changing the location of the first trachael point of the line.
  2. This issue does not occur when the input node is of the MarkupFiducial type, in which case the "Curve is a loop" checkbox functions as intended.

Thank you

I found that these cannot be strongly constrained. Unable to achieve precise surfaces.

I found that these cannot be strongly constrained. Unable to achieve precise surfaces.

image

I have found that "Grid Surface" can achieve precise surfaces, so can we use this in turn to generate surfaces from countless points. Just like the effects of the minics below. Because it would be much more convenient to operate in this way。

minicCutDemo.mp4

GUI not updating correctly

Steps:

  1. Load a saved scene
  2. Open MarkupsToModel
  3. If not already done, disable auto-update
  4. Change between different types of curve, see that the GUI does not update unless you click on "Update"

Add Basic Documentation to README.md

At minimum:

  • A brief 1-paragraph description of what the module does
  • A few screenshots showing the main features
  • Use cases
  • Explanation of input options, parameters, etc.

Deleting unknown object: vtkMRMLMarkupsToModelNode

When closing, loading, or saving a scene:

Generic Warning: In /media/vaughan/workspace/lnx/devel/S4D/VTKv9/Common/Core/vtkDebugLeaks.cxx, line 281
Deleting unknown object: vtkMRMLMarkupsToModelNode

KochanekEndsCopyNearestDerivatives does nothing?

Flag was added so the user could tell the module to manually compute the derivatives at either end of the spline. It appears that the default vtkSpline behaviour now does the same thing.

We should test the module behaviour and make sure this is always the case. If so, then KochanekEndsCopyNearestDerivatives can be deprecated.

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.