Home < Documentation < 4.8 < Modules < Models
Introduction and Acknowledgements
- Title: Models
- Author(s)/Contributor(s): Julien Finet (Kitware), Alex Yarmarkovich (Isomics), Nicole Aucoin (SPL, BWH)
- License: slicer4
- Acknowledgements: This work is part of the National Alliance for Medical Image Computing (NAMIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. This work is partially supported by the Air Force Research Laboratories (AFRL).
- Contact: Julien Finet,
Surgical Planning Laboratory (SPL)
National Alliance for Medical Image Computing (NA-MIC)
Neuroimage Analysis Center (NAC)
This module is used for changing the appearance of and organizing 3d surface models.
- Manipulating the appearance of the surface models that are part of anatomical atlases, for example one found in the SPL/PNL Brain Atlas or the SPL Knee Atlas.
- turning visibility on or off for individual structure (e.g. turn the skin off)
- change the color, opacity, and "shininess" of a structure (e.g. make the skin appear semitransparent)
- drag and drop interface to organize models into hierarchical groups (e.g. lateral ventricles, third and fourth ventricles of the brain under the name ventricles of the brain).
- these groups can be turned on and off by manipulating the parent.
- Adjusting the appearance of surface models generated from the ModelMaker module
Panels and their use
A list of all the panels in the interface, their features, what they mean, and how to use them.
Model Clipping Properties
- Top level:
- Include Fibers: Check this box to include fiber bundle nodes in the scene model hierarchy view.
- Scroll to...: Enter a model name to scroll the model hierarchy tree view to the first model matching that name.
- Hide All Models: Turn off the visibility flag on all models in the scene. If any hierarchies have the "Force color to children" checkbox selected, the hierarchy node visibility will override model visibility settings.
- Show All Models: Turn on the visibility flag on all models in the scene. If any hierarchies have the "Force color to children" checkbox selected, the hierarchy node visibility will override model visibility settings.
- Scene tree view: The tree view of all models and model hierarchies in the current MRML scene. You can right click on the Scene element to add hierarchies and drag and drop models into them. Control the Visible property of the model via the eye icon (open/close to show/hide the models). The model color and opacity are also displayed on the same line as the model name. Model hierarchies allow you to group together models. When using the ModelMaker module, multiple models created from one label map are grouped under a model hierarchy node.
- Information Panel:
- Information: Information about this surface model
- Surface Area: The calculated surface area of the model, in square millimetres
- Volume: The volume inside the surface model, in cubed millimetres
- Number of Points: Number of vertices in the surface model
- Number of Cells: Number of cells in the surface model
- Number of Point Scalars: Shows how many arrays of scalars are associated with the points of the surface model.
- Number of Cell Scalars: Shows how many arrays of scalars are associated with the cells of the surface model.
- Filename: Path to the file from which this surface model was loaded and/or where it will be saved.
- Display: Control the display properties of the currently selected model in the Scene.
- Visibility: Control the visibility of the model.
- Visible: Is this surface model visible in the 3D view?
- View: In which views is this surface model visible? If none are checked, the model is visible in all 2D and 3D views.
- Clip: Is clipping (using the slice planes) enabled for this model? Once it is on, go to the Clipping pane to set the options.
- Slice Intersections Visible: If this flag is set, the intersections of the model with the slices will be computed and shown as an outline on the slice planes.
- Slice Intersections Thickness: Width in pixels of the intersection lines of the model with the slice planes.
- Representation: Control the representation of the model.
- Representation: Control the surface geometry representation (points, wireframe or surface) for the object. The default is Surface. Note that you can change the representation of all the models to wireframe with the 'w' key shortcut in the 3D view.
- Point Size: Set the diameter of the model points (if the model is a point cloud or if the representation is "Points".) The size is expressed in screen units. 1.0 by default.
- Line Width: Set the width of the model lines (if the model is a polyline or representation is "Wireframe"). The width is expressed in screen units. 1.0 by default.
- Frontface culling: Turn on/off culling of polygons based on the orientation of normals with respect to the camera. If frontface culling is on, polygons facing toward the camera are not drawn. Visible by default.
- Backface culling: Turn on/off culling of polygons based on orientation of normals with respect to the camera. If backface culling is on, polygons facing away from the camera are not drawn. This feature needs to be turned off if the inside of a model is viewed, either when clipping or when moving the camera inside an object. Hidden by default.
- Color: Control the colors of the model.
- Color: Control the color of the model. Note that the lighting can alter the color. Gray by default.
- Opacity: Control the opacity of the model. 1.0 is totally opaque and 0.0 is completely transparent. 1.0 by default.
- Edge Visibility: Turn on/off the visibility of the model edges (the wireframe). Hidden by default
- Edge Color: Control the color of the model edges (if Edge Visibility is enabled). Black by default.
- Lighting: Control the lighting effects on the model.
- Lighting: Control whether the model representation is impacted by the frontfacing light. If enabled, Ambient, Diffuse and Specular parameters are used to compute the lighting effect. Enabled by default.
- Interpolation: Control the shading interpolation method (Flat, Gouraud, Phong) for the model. Gouraud by default.
- Shading: Control the shading of the model. The material properties must be set if enabled.
- Material Properties: Material properties of the currently selected model
- Ambient: Controls the base lighting for the model.
- Diffuse: Controls the amount of light scattered from the model.
- Specular: Controls the highlights on the model.
- Power: The specular power.
- Preview: A rendering of a sphere using the current material properties, useful if the surface model isn't regular.
- Scalars: Scalar overlay properties
- Visible: Are the scalars visible on the surface model?
- Active Scalar: A drop down menu listing the current scalar overlays associated with this model and shows which one is currently active. Most models will have normals, Freesurfer surface models can have multiple scalar overlay files associated with them (e.g. lh.sulc, lh.curv).
- Active Scalar Range: Displays the numerical range spanned by the currently active scalar array (used when the Data scalar range type is selected).
- Color Table: Select a color look up table used to map the scalar overlay's values (usually in the range of 0.0 to 1.0) to colors. There are built in color maps that can be browsed in the Colors module. The most commonly used color map for FreeSurfer scalar overlays is the GreenRed one. Legacy color maps from Slicer2 include Grey, Iron, Rainbow, etc. Those color maps with "labels" in their names are usually discrete and don't work well for the continuous scalar overlay ranges.
- Scalar Range Type: Select which scalar range to use: range in the scalar data array, Color Table range, Display Scalar Range, range of the data type of the scalar array.
- Display Scalar Range: Set the scalar range on the model's display node.
- Clipping Panel:
- Clipping: Control the clipping properties for this surface model
- Clipping Type: When more than one slice plane is used, this option controls if it's the union or intersection of the positive and/or negative spaces that is used to clip the model. The parts of the model inside the selected space is kept, parts outside of the selection are clipped away.
- Red Slice Clipping: Use the positive or negative space defined by the Red slice plane to clip the model. Positive side is toward the Superior, negative is toward the Inferior. Keeps the part of the model in the selected space, clips away the rest.
- Yellow Slice Clipping: Use the positive or negative space defined by the Yellow slice plane to clip the model. Positive side is toward the Right, negative is toward the Left. Keeps the part of the model in the selected space, clips away the rest.
- Green Slice Clipping: Use the positive or negative space defined by the Green slice plane to clip the model. Positive side is toward the Anterior, negative is toward the Posterior. Keeps the part of the model in the selected space, clips away the rest.
List of parameters generated transforming this XML file using this XSL file. To update the URL of the XML file, edit this page.
- The Annotations module uses geometry to mark locations and so has similar functionality to the models module.
- The Probe Volume With Model module allows a user to apply a scalar overlay to a model by sampling a volume.
- The Merge Models module will allow you to create a single model from two models
- The Model Maker module will allow you to create model(s) from a labelmap
- The Grayscale Model Maker module will allow you to create a model from an image
Information for Developers
Create a model node with a polydata
This solution works when you have a polydata that you want to render in the 3D view (and potentially in the 2D views by representing the intersection between the polydata and the view slice).
| Recommended: Using Models module dependency
|| Advanced: Prone to obsolescence, errors and memory leaks
vtkSlicerModelsLogic* modelsLogic =
vtkMRMLModelNode* modelNode =
modelsLogic->AddModel(polyData /*or polyDataAlgorithm->GetOutput()*/);
modelNode->SetAndObservePolyData(polyData /*or polyDataAlgorithm->GetOutput()*/);
How to display a model node into a specific view ?
It's possible to have multiple models combined into one model and have each shape assigned different color values, but it requires either using Merge Models to merge the shapes into one file and using python to create a scalar overlay to assign values to each vertex (assuming the user can determine which vertex belongs to which shape), or using Paraview, as per Andras Lasso:
Merge multiple STL files into a single colored VTK file in Paraview:
- Load all the models
- Assign a constant scalar to the points by using the Calculator filter (use a different constant for each model, e.g., 1, 2, 3, 4, ...)
- Merge the Calculator outputs with the Append Geometry filter
- Save the Append Geometry filter output with File / Save Data / File type VTK or VTP (download the sample ParaView state file from here)
Then in Slicer you can load the model, open the Models module, open Scalars, enable "Visible", select "Result" as active scalar, select a color table.
Missing model hierarchies in a loaded scene
There was a change made in how the Models GUI displays model hierarchies, moving to respecting a hide flag on the nodes. If you have an older scene (written before 2013) loaded into a newer Slicer and the Models GUI isn't showing the model hierarchy that you know is in the scene, you can use this code snippet in the Python Interactor to update the flags. You may need to save the scene and reopen it in order for the GUI to show the updated view.
numNodes = slicer.mrmlScene.GetNumberOfNodesByClass("vtkMRMLModelHierarchyNode")
for h in range(numNodes):
mh = slicer.mrmlScene.GetNthNodeByClass(h, "vtkMRMLModelHierarchyNode")
if mh.GetNumberOfChildrenNodes() > 0:
print "Showing", mh.GetName()
if mh.GetNumberOfChildrenNodes() == 0 and mh.GetAssociatedNodeID() != None:
print "Hiding", mh.GetName()