Difference between revisions of "Documentation/Nightly/Extensions/CurveMaker"
(5 intermediate revisions by the same user not shown) | |||
Line 52: | Line 52: | ||
***'''Cardinal Spline''': The default method. | ***'''Cardinal Spline''': The default method. | ||
***'''Hermite Spline''': The same interpolation method as the [[Documentation/Nightly/Modules/Endoscopy]] module. Useful for visualizing the trajectory of the virtual endoscope. | ***'''Hermite Spline''': The same interpolation method as the [[Documentation/Nightly/Modules/Endoscopy]] module. Useful for visualizing the trajectory of the virtual endoscope. | ||
− | **'''Ring Mode''' | + | **'''Ring Mode''': Generate a closed-loop. <font color="red"> (NOTE: Ring Mode does not support Hermit Spline. Ring Mode "On" is disabled, when Hermit Spline is selected.)</font> |
**'''Enable''': Start updating the curve model based on the curve. While this check box is on, the curve model is automatically updated whenever the parameters are modified. | **'''Enable''': Start updating the curve model based on the curve. While this check box is on, the curve model is automatically updated whenever the parameters are modified. | ||
− | * | + | *Length |
**'''Length''': The length of the current curve is shown in millimeter. | **'''Length''': The length of the current curve is shown in millimeter. | ||
+ | *Distance | ||
+ | **'''Distance from''': A MarkupsFiducial node that contains target points for distance measurement. The shortest distances between these points and the curve are calculated and shown in the table below. | ||
+ | **'''Extrapolate curves to measure the distances''': If enabled, the curve is extrapolated to find the closest point on the curve from the target points. | ||
+ | **'''Show error vectors''': Show vectors from the closet point on the curve to the target points on the table | ||
+ | *Curvature | ||
+ | **'''Curvature mode''': Color-map the curvature | ||
+ | **'''Color range''': Adjust the color range automatically, if "Auto" is selected. | ||
+ | **'''Color range''': Manually adjust the color range. | ||
+ | **'''Mean''': Mean curvature. | ||
+ | **'''Minimum''': Minimum curvature. | ||
+ | **'''Maximum''': Maximum curvature. | ||
+ | |||
<!-- ---------------------------- --> | <!-- ---------------------------- --> | ||
Line 129: | Line 141: | ||
[[Image:CurveMaker-2.0-Distance-DistanceTable.png|300px]] | [[Image:CurveMaker-2.0-Distance-DistanceTable.png|300px]] | ||
− | These are the distances between the Markups points and points on the curve closest to each point. | + | These are the distances between the Markups points and points on the curve closest to each point. If "Extrapolate curves to measure the distances" is checked, it will extrapolate curves before searching the closet point. If "Show error vectors" is checked, the table also shows the vector from the closest point on the curve to each Markups point. |
+ | |||
+ | ==Visualize Curvature== | ||
+ | |||
+ | Open the "Curvature" frame, and turn on "Curvature mode". Also, select "Auto" for "Color range" | ||
+ | |||
+ | [[Image:CurveMaker-2.0-CurvatureMode.png|300px]] [[Image:CurveMaker-2.0-Curvature.png|300px]] | ||
+ | |||
+ | |||
+ | |||
+ | ==Change Behaviour of the User Interface== | ||
+ | |||
+ | The ranges and steps for configuring the parameters in the GUI (i.e. radius, resolution) are limited. If you want to set the parameters beyond those limits, you can change the ranges from the Python interactor. | ||
+ | |||
+ | For example, the following code will change the step and minimum value of the curve radius to 0.05 mm and 0.0 mm respectively: | ||
+ | |||
+ | >>> cm = slicer.modules.CurveMakerWidget.RadiusSliderWidget | ||
+ | >>> cm.singleStep=0.05 | ||
+ | >>> cm.minimum=0.0 | ||
Latest revision as of 14:07, 13 April 2018
Home < Documentation < Nightly < Extensions < CurveMaker
For the latest Slicer documentation, visit the read-the-docs. |
Introduction and Acknowledgements
Author: Junichi Tokuda (BWH), Laurent Chauvin (BWH)
Contact: Junichi Tokuda <email> tokuda@bwh.harvard.edu</email>
License: Slicer license
|-
|
|
This work is supported by NA-MIC, NCIGT, and the Slicer Community. This work is partially supported by NIH R01CA138586 "A New Method For Improved Targeting in Image-Guided Abdominal Interventions" (PI: Nobuhiko Hata), P01-CA67165 "Image Guided Therapy" (PI: Clare M. Tempany)
The module has been developed based on ideas and feedback from the community. We would like to especially thank:
- Dr. Matthew Jolley, M.D., Fellow in Pediatric Anesthesia / Pediatric Cardiology, Boston Children's Hospital.
- Dr. Sumit Agrawal, MD, FRCS, Assistant Professor, Department of Otolaryngology, University of Western Ontario.
- Dr. Wei Wang, Ph.D., Department of Radiology, Brigham and Women's Hospital.
- Dr. Ron Kikinis, M.D. Department of Radiology, Brigham and Women's Hospital.
- Dr. Steve Pieper, Ph.D. Isomics, Inc.
Extension Description
CurveMaker is a simple scripted module to generate a 3D curve from a fiducial list. Curves between fiducial points are interpolated by vtkSplineFilter. The curve is dynamically updated as the fiducial list is modified (moved/added/deleted). The module is useful to draw lines in 3D space, or visualize tracked catheters.
Use Cases
- Draw lines in 3D.
- Visualization of catheters.
- Analysis of needle trajectories for image-guided percutaneous interventions
- Quantitative analysis of curves, including
- Length
- Distance from specific points
- Curvature
Panels and their use
- Parameters
- Source points: The list of fiducial points on the curve
- Curve model: The model of the curve.
- Radius: The radius of the curve model.
- Interpolation: The method to interpolate the fiducial points.
- None: The points are connected by a straight line.
- Cardinal Spline: The default method.
- Hermite Spline: The same interpolation method as the Documentation/Nightly/Modules/Endoscopy module. Useful for visualizing the trajectory of the virtual endoscope.
- Ring Mode: Generate a closed-loop. (NOTE: Ring Mode does not support Hermit Spline. Ring Mode "On" is disabled, when Hermit Spline is selected.)
- Enable: Start updating the curve model based on the curve. While this check box is on, the curve model is automatically updated whenever the parameters are modified.
- Length
- Length: The length of the current curve is shown in millimeter.
- Distance
- Distance from: A MarkupsFiducial node that contains target points for distance measurement. The shortest distances between these points and the curve are calculated and shown in the table below.
- Extrapolate curves to measure the distances: If enabled, the curve is extrapolated to find the closest point on the curve from the target points.
- Show error vectors: Show vectors from the closet point on the curve to the target points on the table
- Curvature
- Curvature mode: Color-map the curvature
- Color range: Adjust the color range automatically, if "Auto" is selected.
- Color range: Manually adjust the color range.
- Mean: Mean curvature.
- Minimum: Minimum curvature.
- Maximum: Maximum curvature.
Tutorials
Installation
The new features (Length, Distance, and Curvature) are available on nightly builds released on July 28 or later. First, open 3D Slicer:
Open the Slicer Extensions from the icon on the menu bar:
Choose "Curve Maker" module from the list of extensions and click "INSTALL" button.
Once you restart 3D Slicer, the Curve Maker module should show up on the Modules menu (under Informatics->Curve Maker)
Generate a curve from fiducial points
First, create a fiducial list. Click the fiducial button on the menu bar to change the mouse mode to "Create-and-Place Fiducial", and then click on the image to create a fiducial. Repeat those steps to create a list of fiducials. See the Markups module page for detail.
If you have created a fiducial list right after starting 3D Slicer, the fiducial list should be named "F". In the Curve Maker module, click the "Source Points" pull-down menu and select "F".
Also, create a 3D model node for the curve by selecting "Create new Model" from the "Curve model" pull-down menu.
Once the source points and curve models are specified, click "Generate Curve". A curve that connects the fiducial points will appear on the 3D viewer.
"Generate Curve" button only generates a curve once, and needs to be clicked every time parameters are changed. To update curves automatically, turn on "Auto update".
If "Ring mode" is "On", the first and the last points are connected to draw a ring.
Measure Curve Length
To measure the length of the curve, simply open the "Length" frame.
Measure Distances from Curve to Points
To measure distances from the curve to points, first create a second MarkupsFiducial node using the Markups module. Open the Markups and choose "Create new MarkupsFiducial as .." from "List" pull-down menu.
You will be prompted to enter a name for the new Markups node. In this tutorial, we use "Points"
Once the new MarkupsFiducial node is selected, start adding new points by clicking "Create-andPlace Fiducial" button on the menu bar followed by a point on the image.
Open the "Distance" frame and choose the MarkupsFiducial node created in the previous step (named "Points").
The distance from the curve to each point will be displayed.
These are the distances between the Markups points and points on the curve closest to each point. If "Extrapolate curves to measure the distances" is checked, it will extrapolate curves before searching the closet point. If "Show error vectors" is checked, the table also shows the vector from the closest point on the curve to each Markups point.
Visualize Curvature
Open the "Curvature" frame, and turn on "Curvature mode". Also, select "Auto" for "Color range"
Change Behaviour of the User Interface
The ranges and steps for configuring the parameters in the GUI (i.e. radius, resolution) are limited. If you want to set the parameters beyond those limits, you can change the ranges from the Python interactor.
For example, the following code will change the step and minimum value of the curve radius to 0.05 mm and 0.0 mm respectively:
>>> cm = slicer.modules.CurveMakerWidget.RadiusSliderWidget >>> cm.singleStep=0.05 >>> cm.minimum=0.0
Similar Extensions
References
Information for Developers
The code is available at Github.