Difference between revisions of "Documentation/Nightly/Extensions/Sequences"

From Slicer Wiki
Jump to: navigation, search
Tag: 2017 source edit
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- ---------------------------- -->
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}
Author: Andras Lasso (PerkLab, Queen's University), Matthew Holden (PerkLab, Queen's University), Kevin Wang (Princess Margaret Cancer Centre), Gabor Fichtinger (PerkLab, Queen's University)<br>
Contact: Andras Lasso, <email>lasso@cs.queensu.ca</email><br>
Project website: http://www.slicerrt.org<br>
License: [http://www.slicer.org/pages/LicenseText Slicer license]
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/extension-section|Extension Description}}
| text  = [https://github.com/SNRLab/SNRMeasurement This page has been moved to GitHub.]
| background-color = 8FBC8F }}
Sequences is an extension of 3D Slicer to allow creating and visualization of higher-dimension data nodes, such as 4D volumes, models changing in time, markups changing in time, sequences of transforms, scene camera trajectory, or even sequence of sequences.
* Sequences can be created from any MRML nodes
* Multiple sequences can be replayed sycnhronized, in real-time, visualizing the contents in 2D and 3D
<!-- ---------------------------- -->
*[[Documentation/{{documentation/version}}/Modules/SequenceBrowser|Sequence browser]]
*[[Documentation/{{documentation/version}}/Modules/MetafileImporter|Tracked ultrasound sequence importer]]
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/extension-section|Use Cases}}
<gallery widths="200px" perrow="3">
Image:CardiacCtReplay.gif|4D Cardiac CT ([https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneCardiacCt.mrb download scene])
Image:UltrasoundToolGuidance3dOnly.gif|Tracked ultrasound with tool tracking ([https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneUsGuidedNeedleInsertion.mrb download scene])
Image:ShapeModelSequenceBrowsing3dOnly.gif|Model deformation ([https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneModelDeformation.mrb download scene])
Image:SequenceEditor.png|Sequences module for creating and editing sequences
Image:SequenceBrowser.png|Sequence browser module for browsing and replaying sequences
<!-- ---------------------------- -->
=== Using sample data ===
* Get sample data/scenes from here:
** [[Media:CardiacCT.seq.nrrd|Cardiac CT: volume sequence]]
** [https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneCardiacCt.mrb Cardiac CT: volume sequence, real-time volume rendering]
** [https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneModelDeformation.mrb Deformation of a 3D model]
** [https://github.com/SlicerRt/SequencesData/raw/master/SampleSceneUsGuidedNeedleInsertion.mrb Ultrasound-guided needle insertion: moving tracked ultrasound image and tools, synchronized replay of image ad transforms]
* Load the downloaded .mrb scene file into Slicer
* Open the Sequence browser module to browse the data set
=== Creating sequences from a set of nodes ===
* Load all your nodes (volumes, models, etc.) into Slicer - these will be referred to as ''data nodes''
* Open the Sequences module
* Click ''Select a Sequence'', choose ''Create new Sequence''
* In the ''Add/remove data nodes'' section select your first data node in the list and click the left arrow button
* Repeat this for all data nodes: select the next data node and click the left arrow button (Slicer will automatically jump to the next data node of the same type, so you may need to keep clicking the arrow button)
* To replay the sequence that you've just created: go to ''Sequence browser'' module
* Click on ''Select a Sequence'' in the Master node list and select your sequence node (it is called ''Sequence'' by default)
* Press play button to start replay of the data
* To visualize a volume in 2D: hover over the push-pin icon in the top-left corner of the slice viewer, select ''Sequence [time=...]'' node in the node selector at the bottom
* To visualize a volume in 3D viewer: go to ''Volume rendering'' module, select ''Sequence [time=...]'' node in the top node selector, and click the eye icon
==== Example: Create a segmentation node sequence ====
To allow segmenting each time point of the image, you need to create a segmentation sequence:
* Create a new Segmentation node (e.g., by segmenting image at one timepoint)
* Go to Sequence browser module
* Click the green “+” button next to “Create new sequence”. This creates a new sequence that will store the segmentation for each timepoint.
* Choose your segmentation node in the “Proxy node” column in the table (last row). This indicates that this sequence will store states of the chosen segmentation node.
* Check “Save changes” checkbox to allow modifying the sequence by editing the segmentation node.
=== Convert MultiVolume node to Sequence node ===
If your data is in a *MultiVolume* node then you can convert it to a *Sequence* node by following these steps:
* Save your 4D volume (to a .nrrd file)
* Make sure Sequences extension is installed (if not, install it using Extension manager)
* Load the saved .nrrd file as a sequence node: in Add data dialog, in Description column select "Volume Sequence"
=== Load DICOM file as Sequence node ===
In Application settings / DICOM / MultiVolumeImporterPlugin / Preferred multi-volume import format, select "volume sequence". After this, volume sequences will be loaded as Sequence nodes by default.
It is also possible to choose import format for each loaded DICOM data set, by following these steps:
* Open DICOM browser, select data set to load
* Check "Advanced" checkbox
* Click "Examine"
* In the populated table, check the checkbox in the row that contains "... frames Volume Sequence by ..." (to load data set as multi-volume node, select row "... frames Multivolume by ...")
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/extension-section|Similar Extensions}}
<!-- ---------------------------- -->
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
* Sequence: Contains an ordered array of data nodes, each data node is tagged with an index value.
* Data node: A regular MRML node, one item in the sequence. Data nodes are stored privately inside the sequence, therefore not visible in the main scene (where the sequence node is in). Singleton nodes are not allowed to be stored as data nodes. Sequence nodes can be data nodes, therefore sequence of sequence nodes can be used to represent higher-dimensional data sets.
* Sequence index: The index describes the dimension of the data node sequence. The index name (such as "time"), unit (such as "s"), and type (such as "numeric" or "text") is the same for the whole sequence. The index value is specified for each data node. The index type information is used for sorting (numerical or string sorting) and matching of the index values (in case of a numerical index we can find the closest data node even if there is no perfectly matching index value).
* Sequence browsing: A sequence node only contains the data nodes, but does not store any node relationships, such as parent transform, display properties, etc. These relationships can be only defined for the virtual output nodes that are generated by the Sequence browser module. Several browser nodes can be created to visualize data from the same sequence, which allows visualization, comparison of multiple different time points from the same sequence.
* Virtual output node: The sequence browser node creates a copy of the selected privately stored data node in the main scene. This copy is the virtual output node.
* Source code: https://github.com/SlicerRt/Sequences
* Issue tracker:  [https://github.com/SlicerRt/Sequences/issues open issues and enhancement requests]
* Changing all nodes in a sequence. If you have a sequence node ‘Sequence’ containing volumes then you can set the spacing in all data nodes by copy-pasting these two lines into the console:
    for nodeIndex in xrange(seq.GetNumberOfDataNodes()): seq.GetNthDataNode(nodeIndex).SetSpacing(1.5,1.5,2.0)
<!-- ---------------------------- -->
<!-- ---------------------------- -->
<!-- ---------------------------- -->
<!-- ---------------------------- -->

Latest revision as of 16:10, 17 June 2022

Home < Documentation < Nightly < Extensions < Sequences