<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fedorov</id>
	<title>Slicer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fedorov"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/wiki/Special:Contributions/Fedorov"/>
	<updated>2026-04-05T15:02:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/TCIABrowser&amp;diff=64384</id>
		<title>Documentation/Nightly/Extensions/TCIABrowser</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/TCIABrowser&amp;diff=64384"/>
		<updated>2023-08-03T20:57:50Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: redirect to the docs in GitHub&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
'''Please see documentation of this module here: https://github.com/QIICR/TCIABrowser'''&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=62085</id>
		<title>Documentation/Nightly/Modules/PkModeling</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=62085"/>
		<updated>2019-11-21T17:43:42Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/PkModeling|PkModeling]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, and by National Cancer Institute as part of the Quantitative Imaging Network initiative (U01CA151261) and QIICR (U24CA180918).&amp;lt;br&amp;gt;&lt;br /&gt;
Implementation of the pharmacokinetics modeling was contributed by Yingxuan Zhu and Jim Miller from GE Research.&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Yingxuan Zhu (while at GE), Andrey Fedorov (SPL), John Evans (MGH), Jim Miller ({{collaborator|name|ge}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Jim Miller, &amp;lt;email&amp;gt;millerjv@ge.com&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|ge}}|{{collaborator|longname|ge}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
PkModeling (Pharmacokinetics Modeling) calculates quantitative parameters from Dynamic Contrast Enhanced DCE-MRI images. This module performs two operations: &lt;br /&gt;
# Converts signal intensities to concentration values. The concentration values are used to calculate quantitative parameters. &lt;br /&gt;
# Calculates quantitative parameters from concentration values. These parameters include:&lt;br /&gt;
;Ktrans: Volume transfer constant between blood plasma and EES (extracellular-extravascular space) at each voxel (min^-1)&lt;br /&gt;
;Ve: Fractional volume for extracellular space at each voxel&lt;br /&gt;
;MaxSlope: Maximum slope in the time series curve of each voxel&lt;br /&gt;
;AUC: Area under the curve of each voxel, measured from bolus arrival time to the end time of interval, normalized by the AUC of the AIF&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
* estimation of quantitative perfusion parameters from DCE MRI&lt;br /&gt;
* treatment response evaluation&lt;br /&gt;
* breast, prostate, brain DCE MRI analysis&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BC1_DCE.png|thumb|340px|Sample frame from a breast DCE MRI dataset (one of the datasets presented in a study by Huang et al. [6]]]&lt;br /&gt;
|[[Image:BC1_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_DCE.png|thumb|340px|Sample frame from a prostate DCE MRI dataset (QIN-PROSTATE-002 from TCIA QIN-PROSTATE collection)]]&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;Exploration and Study of MultiVolume Image Data using 3D Slicer&amp;quot; by Meysam Torabi, Brigham and Women's Hospital: https://github.com/QIICR/PkModeling/files/3875977/MultiVolumeExplorer_Meysam_SNR-April2013-v4.pdf&lt;br /&gt;
* &amp;quot;3D Slicer for DCE-MRI Image Analysis&amp;quot; by Madeline Carr, University of Wollongong Australia: https://github.com/QIICR/PkModeling/files/3870911/DCE.and.3D.Slicer.Tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Panels and their use}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:PkModelingUI061912.png|thumb|340px|PkModeling]]&lt;br /&gt;
| &lt;br /&gt;
* '''PkModeling Parameters''': &lt;br /&gt;
** T1 Blood Value (milliseconds)&lt;br /&gt;
** T1 Tissue Value (milliseconds) (default value is the published value for prostate tissue estimated in healthy individuals (see Ref. de Bazelaire et al.)&lt;br /&gt;
** r1 Relaxivity Value of the contrast agent, L x mol^(-1) x s^(-1). This value is contrast agent specific. Default setting of 0.0039 corresponds to Gd-DPTA (Magnevist) at 3T, see Ref. Pintaske et al. You will need to adjust this setting based on the magnet signal strength and contrast agent.&lt;br /&gt;
** Hematocrit Value. Volume percentage of red blood cells in blood.&lt;br /&gt;
** AUC Time Interval Value: Time interval for AUC calculation&lt;br /&gt;
** Use Population AIF:  A mean AIF is calculated from a functional form instead of from the input using the aifMask or a prescribed AIF.  See Ref. Parker et al.&lt;br /&gt;
* '''IO'''&lt;br /&gt;
** '''Input 4D Image''': 4D DCE-MRI data&lt;br /&gt;
** '''T1 Map Image''': T1 Map&lt;br /&gt;
** '''AIF Mask Image''': Mask designating the location of the arterial input function (AIF). AIF can either be calculated from the input using the aifMask, prescribed directly in concentration units using the prescribedAIF option, or via a population AIF.&lt;br /&gt;
** '''Prescribed AIF''': Prescribed arterial input function (AIF). AIF can either be calculated from the input using the aifMask option, via a population AIF, or can be prescribed directly in concentration units using the prescribedAIF option. An example of how a prescribed AIF can be defined is in [[File:AIF_example.mcsv.zip|this example .mcsv file]] (unzip before importing into Slicer!). Note that the x column corresponds to timestamps in seconds, and the y column is the contrast agent concentration (NOT image signal intensity).&lt;br /&gt;
** '''Output Ktrans image''': volume transfer constant between blood plasma and extravascular extracellular space (EES) (min^-1)&lt;br /&gt;
** '''Output ve image''': volume of EES per unit volume of tissue&lt;br /&gt;
** '''Output fpv image''': (or v_p) blood plasma volume per unit of tissue&lt;br /&gt;
** '''Output maximum slope image''': maximum slope of the signal intensity curve between any two consecutive timepoints&lt;br /&gt;
** '''Output AUC image''': area under the curve in the first 90 seconds&lt;br /&gt;
* '''Advanced options''':&lt;br /&gt;
** '''BAT Calculation Mode''': PeakGradient (Default) or UseConstantBAT&lt;br /&gt;
** '''Constant BAT''': Constant Bolus Arrival Time Index (frame number)&lt;br /&gt;
** '''Output R-squared goodness of fit image''': each pixel will be initialized to a value between 0 and 1 characterizing the goodness of fit. Larger values correspond to a better fit (see [http://en.wikipedia.org/wiki/Coefficient_of_determination R^2 measure description])&lt;br /&gt;
** '''Output Bolus Arrival Time Image''':  the bolus arrival time calculated at each pixel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following acquisition parameters should be available in the NRRD header of the input data (if you are analyzing a DICOM time series, they will typically be extracted from the DICOM data):&lt;br /&gt;
* TR Value: Repetition time (milliseconds) &lt;br /&gt;
* TE Value: Echo time (milliseconds)&lt;br /&gt;
* FA Value: Flip angle (degrees)&lt;br /&gt;
* Timestamps for the dynamic series (in milliseconds)&lt;br /&gt;
&lt;br /&gt;
Here is an example how this information is represented in the NRRD header:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MultiVolume.DICOM.EchoTime:=2.93&lt;br /&gt;
MultiVolume.DICOM.FlipAngle:=10&lt;br /&gt;
MultiVolume.DICOM.RepetitionTime:=6.13&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagName:=AcquisitionTime&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagUnits:=ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Auto generated documentation of the parameters'''&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-parametersdescription}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Similar Modules}}&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeExplorer|MultiVolumeExplorer]]&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeImporter|MultiVolumeImporter]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* [1] Knopp MV, Giesel FL, Marcos H et al: Dynamic contrast-enhanced magnetic resonance imaging in oncology. Top Magn Reson Imaging, 2001; 12:301-308.&lt;br /&gt;
* [2] Rijpkema M, Kaanders JHAM, Joosten FBM et al: Method for quantitative mapping of dynamic MRI contrast agent uptake in human tumors. J Magn Reson Imaging 2001; 14:457-463.&lt;br /&gt;
* [3] de Bazelaire, C.M., et al., MR imaging relaxation times of abdominal and pelvic tissues measured in vivo at 3.0 T: preliminary results. Radiology, 2004. 230(3): p. 652-9.&lt;br /&gt;
* [4] Pintaske J, Martirosian P, Graf H, Erb G, Lodemann K-P, Claussen CD, Schick F. Relaxivity of Gadopentetate Dimeglumine (Magnevist), Gadobutrol (Gadovist), and Gadobenate Dimeglumine (MultiHance) in human blood plasma at 0.2, 1.5, and 3 Tesla. Investigative radiology. 2006 March;41(3):213–21.&lt;br /&gt;
* [5] Parker GJ, Roberts C, Macdonald A, Buonaccorsi GA, Cheung S, Buckley DL, Jackson A, Watson Y, Davies K, Jayson GC.  Experimentally-derived functional form for a population-averaged high-temporal-resolution arterial input function for dynamic contrast-enhanced MRI.  Magnetic Resonance in Medicine, 2006 Nov; 56(5):993-1000.&lt;br /&gt;
* [6] Huang, W., Li, X., Chen, Y., Li, X., Chang, M.-C., Oborski, M. J., … Kalpathy-Cramer, J. (2014). Variations of dynamic contrast-enhanced magnetic resonance imaging in evaluation of breast cancer therapy response: a multicenter data analysis challenge. Translational Oncology, 7(1), 153–66. doi:10.1593/tlo.13838 http://dx.doi.org/10.1593/tlo.13838&lt;br /&gt;
* [7] Tofts, P. S., Brix, G., Buckley, D. L., Evelhoch, J. L., Henderson, E., Knopp, M. V, … Weisskoff, R. M. (1999). Estimating kinetic parameters from Contrast-Enhanced T 1 -Weighted MRI of a Diffusable Tracer : Standardized Quantities and Symbols. J Magn Reson Imaging, 10(3), 223–232.&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
Source code: https://github.com/millerjv/PkModeling&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Quantification]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=61591</id>
		<title>Documentation/Nightly/Modules/PkModeling</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=61591"/>
		<updated>2019-11-20T21:47:36Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/PkModeling|PkModeling]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, and by National Cancer Institute as part of the Quantitative Imaging Network initiative (U01CA151261) and QIICR (U24CA180918).&amp;lt;br&amp;gt;&lt;br /&gt;
Implementation of the pharmacokinetics modeling was contributed by Yingxuan Zhu and Jim Miller from GE Research.&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Yingxuan Zhu (while at GE), Andrey Fedorov (SPL), John Evans (MGH), Jim Miller ({{collaborator|name|ge}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Jim Miller, &amp;lt;email&amp;gt;millerjv@ge.com&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|ge}}|{{collaborator|longname|ge}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
PkModeling (Pharmacokinetics Modeling) calculates quantitative parameters from Dynamic Contrast Enhanced DCE-MRI images. This module performs two operations: &lt;br /&gt;
# Converts signal intensities to concentration values. The concentration values are used to calculate quantitative parameters. &lt;br /&gt;
# Calculates quantitative parameters from concentration values. These parameters include:&lt;br /&gt;
;Ktrans: Volume transfer constant between blood plasma and EES (extracellular-extravascular space) at each voxel (min^-1)&lt;br /&gt;
;Ve: Fractional volume for extracellular space at each voxel&lt;br /&gt;
;MaxSlope: Maximum slope in the time series curve of each voxel&lt;br /&gt;
;AUC: Area under the curve of each voxel, measured from bolus arrival time to the end time of interval, normalized by the AUC of the AIF&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
* estimation of quantitative perfusion parameters from DCE MRI&lt;br /&gt;
* treatment response evaluation&lt;br /&gt;
* breast, prostate, brain DCE MRI analysis&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BC1_DCE.png|thumb|340px|Sample frame from a breast DCE MRI dataset (one of the datasets presented in a study by Huang et al. [6]]]&lt;br /&gt;
|[[Image:BC1_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_DCE.png|thumb|340px|Sample frame from a prostate DCE MRI dataset (QIN-PROSTATE-002 from TCIA QIN-PROSTATE collection)]]&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&lt;br /&gt;
* &amp;quot;3D Slicer for DCE-MRI Image Analysis&amp;quot; by Madeline Carr, University of Wollongong Australia: https://github.com/QIICR/PkModeling/files/3870911/DCE.and.3D.Slicer.Tutorial.pdf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Panels and their use}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:PkModelingUI061912.png|thumb|340px|PkModeling]]&lt;br /&gt;
| &lt;br /&gt;
* '''PkModeling Parameters''': &lt;br /&gt;
** T1 Blood Value (milliseconds)&lt;br /&gt;
** T1 Tissue Value (milliseconds) (default value is the published value for prostate tissue estimated in healthy individuals (see Ref. de Bazelaire et al.)&lt;br /&gt;
** r1 Relaxivity Value of the contrast agent, L x mol^(-1) x s^(-1). This value is contrast agent specific. Default setting of 0.0039 corresponds to Gd-DPTA (Magnevist) at 3T, see Ref. Pintaske et al. You will need to adjust this setting based on the magnet signal strength and contrast agent.&lt;br /&gt;
** Hematocrit Value. Volume percentage of red blood cells in blood.&lt;br /&gt;
** AUC Time Interval Value: Time interval for AUC calculation&lt;br /&gt;
** Use Population AIF:  A mean AIF is calculated from a functional form instead of from the input using the aifMask or a prescribed AIF.  See Ref. Parker et al.&lt;br /&gt;
* '''IO'''&lt;br /&gt;
** '''Input 4D Image''': 4D DCE-MRI data&lt;br /&gt;
** '''T1 Map Image''': T1 Map&lt;br /&gt;
** '''AIF Mask Image''': Mask designating the location of the arterial input function (AIF). AIF can either be calculated from the input using the aifMask, prescribed directly in concentration units using the prescribedAIF option, or via a population AIF.&lt;br /&gt;
** '''Prescribed AIF''': Prescribed arterial input function (AIF). AIF can either be calculated from the input using the aifMask option, via a population AIF, or can be prescribed directly in concentration units using the prescribedAIF option. An example of how a prescribed AIF can be defined is in [[File:AIF_example.mcsv.zip|this example .mcsv file]] (unzip before importing into Slicer!). Note that the x column corresponds to timestamps in seconds, and the y column is the contrast agent concentration (NOT image signal intensity).&lt;br /&gt;
** '''Output Ktrans image''': volume transfer constant between blood plasma and extravascular extracellular space (EES) (min^-1)&lt;br /&gt;
** '''Output ve image''': volume of EES per unit volume of tissue&lt;br /&gt;
** '''Output fpv image''': (or v_p) blood plasma volume per unit of tissue&lt;br /&gt;
** '''Output maximum slope image''': maximum slope of the signal intensity curve between any two consecutive timepoints&lt;br /&gt;
** '''Output AUC image''': area under the curve in the first 90 seconds&lt;br /&gt;
* '''Advanced options''':&lt;br /&gt;
** '''BAT Calculation Mode''': PeakGradient (Default) or UseConstantBAT&lt;br /&gt;
** '''Constant BAT''': Constant Bolus Arrival Time Index (frame number)&lt;br /&gt;
** '''Output R-squared goodness of fit image''': each pixel will be initialized to a value between 0 and 1 characterizing the goodness of fit. Larger values correspond to a better fit (see [http://en.wikipedia.org/wiki/Coefficient_of_determination R^2 measure description])&lt;br /&gt;
** '''Output Bolus Arrival Time Image''':  the bolus arrival time calculated at each pixel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following acquisition parameters should be available in the NRRD header of the input data (if you are analyzing a DICOM time series, they will typically be extracted from the DICOM data):&lt;br /&gt;
* TR Value: Repetition time (milliseconds) &lt;br /&gt;
* TE Value: Echo time (milliseconds)&lt;br /&gt;
* FA Value: Flip angle (degrees)&lt;br /&gt;
* Timestamps for the dynamic series (in milliseconds)&lt;br /&gt;
&lt;br /&gt;
Here is an example how this information is represented in the NRRD header:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MultiVolume.DICOM.EchoTime:=2.93&lt;br /&gt;
MultiVolume.DICOM.FlipAngle:=10&lt;br /&gt;
MultiVolume.DICOM.RepetitionTime:=6.13&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagName:=AcquisitionTime&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagUnits:=ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Auto generated documentation of the parameters'''&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-parametersdescription}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Similar Modules}}&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeExplorer|MultiVolumeExplorer]]&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeImporter|MultiVolumeImporter]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* [1] Knopp MV, Giesel FL, Marcos H et al: Dynamic contrast-enhanced magnetic resonance imaging in oncology. Top Magn Reson Imaging, 2001; 12:301-308.&lt;br /&gt;
* [2] Rijpkema M, Kaanders JHAM, Joosten FBM et al: Method for quantitative mapping of dynamic MRI contrast agent uptake in human tumors. J Magn Reson Imaging 2001; 14:457-463.&lt;br /&gt;
* [3] de Bazelaire, C.M., et al., MR imaging relaxation times of abdominal and pelvic tissues measured in vivo at 3.0 T: preliminary results. Radiology, 2004. 230(3): p. 652-9.&lt;br /&gt;
* [4] Pintaske J, Martirosian P, Graf H, Erb G, Lodemann K-P, Claussen CD, Schick F. Relaxivity of Gadopentetate Dimeglumine (Magnevist), Gadobutrol (Gadovist), and Gadobenate Dimeglumine (MultiHance) in human blood plasma at 0.2, 1.5, and 3 Tesla. Investigative radiology. 2006 March;41(3):213–21.&lt;br /&gt;
* [5] Parker GJ, Roberts C, Macdonald A, Buonaccorsi GA, Cheung S, Buckley DL, Jackson A, Watson Y, Davies K, Jayson GC.  Experimentally-derived functional form for a population-averaged high-temporal-resolution arterial input function for dynamic contrast-enhanced MRI.  Magnetic Resonance in Medicine, 2006 Nov; 56(5):993-1000.&lt;br /&gt;
* [6] Huang, W., Li, X., Chen, Y., Li, X., Chang, M.-C., Oborski, M. J., … Kalpathy-Cramer, J. (2014). Variations of dynamic contrast-enhanced magnetic resonance imaging in evaluation of breast cancer therapy response: a multicenter data analysis challenge. Translational Oncology, 7(1), 153–66. doi:10.1593/tlo.13838 http://dx.doi.org/10.1593/tlo.13838&lt;br /&gt;
* [7] Tofts, P. S., Brix, G., Buckley, D. L., Evelhoch, J. L., Henderson, E., Knopp, M. V, … Weisskoff, R. M. (1999). Estimating kinetic parameters from Contrast-Enhanced T 1 -Weighted MRI of a Diffusable Tracer : Standardized Quantities and Symbols. J Magn Reson Imaging, 10(3), 223–232.&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
Source code: https://github.com/millerjv/PkModeling&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Quantification]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=61590</id>
		<title>Documentation/Nightly/Modules/PkModeling</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/PkModeling&amp;diff=61590"/>
		<updated>2019-11-20T21:44:03Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/PkModeling|PkModeling]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, and by National Cancer Institute as part of the Quantitative Imaging Network initiative (U01CA151261) and QIICR (U24CA180918).&amp;lt;br&amp;gt;&lt;br /&gt;
Implementation of the pharmacokinetics modeling was contributed by Yingxuan Zhu and Jim Miller from GE Research.&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Yingxuan Zhu (while at GE), Andrey Fedorov (SPL), John Evans (MGH), Jim Miller ({{collaborator|name|ge}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Jim Miller, &amp;lt;email&amp;gt;millerjv@ge.com&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|ge}}|{{collaborator|longname|ge}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
PkModeling (Pharmacokinetics Modeling) calculates quantitative parameters from Dynamic Contrast Enhanced DCE-MRI images. This module performs two operations: &lt;br /&gt;
# Converts signal intensities to concentration values. The concentration values are used to calculate quantitative parameters. &lt;br /&gt;
# Calculates quantitative parameters from concentration values. These parameters include:&lt;br /&gt;
;Ktrans: Volume transfer constant between blood plasma and EES (extracellular-extravascular space) at each voxel (min^-1)&lt;br /&gt;
;Ve: Fractional volume for extracellular space at each voxel&lt;br /&gt;
;MaxSlope: Maximum slope in the time series curve of each voxel&lt;br /&gt;
;AUC: Area under the curve of each voxel, measured from bolus arrival time to the end time of interval, normalized by the AUC of the AIF&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
* estimation of quantitative perfusion parameters from DCE MRI&lt;br /&gt;
* treatment response evaluation&lt;br /&gt;
* breast, prostate, brain DCE MRI analysis&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:BC1_DCE.png|thumb|340px|Sample frame from a breast DCE MRI dataset (one of the datasets presented in a study by Huang et al. [6]]]&lt;br /&gt;
|[[Image:BC1_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_DCE.png|thumb|340px|Sample frame from a prostate DCE MRI dataset (QIN-PROSTATE-002 from TCIA QIN-PROSTATE collection)]]&lt;br /&gt;
|[[Image:QIN-PROSTATE-2_Ktrans_map_ROI.png|thumb|340px|Ktrans map result of PK modeling using population AIF (Parker et al., [5])]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&lt;br /&gt;
* test&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Panels and their use}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:PkModelingUI061912.png|thumb|340px|PkModeling]]&lt;br /&gt;
| &lt;br /&gt;
* '''PkModeling Parameters''': &lt;br /&gt;
** T1 Blood Value (milliseconds)&lt;br /&gt;
** T1 Tissue Value (milliseconds) (default value is the published value for prostate tissue estimated in healthy individuals (see Ref. de Bazelaire et al.)&lt;br /&gt;
** r1 Relaxivity Value of the contrast agent, L x mol^(-1) x s^(-1). This value is contrast agent specific. Default setting of 0.0039 corresponds to Gd-DPTA (Magnevist) at 3T, see Ref. Pintaske et al. You will need to adjust this setting based on the magnet signal strength and contrast agent.&lt;br /&gt;
** Hematocrit Value. Volume percentage of red blood cells in blood.&lt;br /&gt;
** AUC Time Interval Value: Time interval for AUC calculation&lt;br /&gt;
** Use Population AIF:  A mean AIF is calculated from a functional form instead of from the input using the aifMask or a prescribed AIF.  See Ref. Parker et al.&lt;br /&gt;
* '''IO'''&lt;br /&gt;
** '''Input 4D Image''': 4D DCE-MRI data&lt;br /&gt;
** '''T1 Map Image''': T1 Map&lt;br /&gt;
** '''AIF Mask Image''': Mask designating the location of the arterial input function (AIF). AIF can either be calculated from the input using the aifMask, prescribed directly in concentration units using the prescribedAIF option, or via a population AIF.&lt;br /&gt;
** '''Prescribed AIF''': Prescribed arterial input function (AIF). AIF can either be calculated from the input using the aifMask option, via a population AIF, or can be prescribed directly in concentration units using the prescribedAIF option. An example of how a prescribed AIF can be defined is in [[File:AIF_example.mcsv.zip|this example .mcsv file]] (unzip before importing into Slicer!). Note that the x column corresponds to timestamps in seconds, and the y column is the contrast agent concentration (NOT image signal intensity).&lt;br /&gt;
** '''Output Ktrans image''': volume transfer constant between blood plasma and extravascular extracellular space (EES) (min^-1)&lt;br /&gt;
** '''Output ve image''': volume of EES per unit volume of tissue&lt;br /&gt;
** '''Output fpv image''': (or v_p) blood plasma volume per unit of tissue&lt;br /&gt;
** '''Output maximum slope image''': maximum slope of the signal intensity curve between any two consecutive timepoints&lt;br /&gt;
** '''Output AUC image''': area under the curve in the first 90 seconds&lt;br /&gt;
* '''Advanced options''':&lt;br /&gt;
** '''BAT Calculation Mode''': PeakGradient (Default) or UseConstantBAT&lt;br /&gt;
** '''Constant BAT''': Constant Bolus Arrival Time Index (frame number)&lt;br /&gt;
** '''Output R-squared goodness of fit image''': each pixel will be initialized to a value between 0 and 1 characterizing the goodness of fit. Larger values correspond to a better fit (see [http://en.wikipedia.org/wiki/Coefficient_of_determination R^2 measure description])&lt;br /&gt;
** '''Output Bolus Arrival Time Image''':  the bolus arrival time calculated at each pixel&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The following acquisition parameters should be available in the NRRD header of the input data (if you are analyzing a DICOM time series, they will typically be extracted from the DICOM data):&lt;br /&gt;
* TR Value: Repetition time (milliseconds) &lt;br /&gt;
* TE Value: Echo time (milliseconds)&lt;br /&gt;
* FA Value: Flip angle (degrees)&lt;br /&gt;
* Timestamps for the dynamic series (in milliseconds)&lt;br /&gt;
&lt;br /&gt;
Here is an example how this information is represented in the NRRD header:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MultiVolume.DICOM.EchoTime:=2.93&lt;br /&gt;
MultiVolume.DICOM.FlipAngle:=10&lt;br /&gt;
MultiVolume.DICOM.RepetitionTime:=6.13&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagName:=AcquisitionTime&lt;br /&gt;
MultiVolume.FrameIdentifyingDICOMTagUnits:=ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Auto generated documentation of the parameters'''&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-parametersdescription}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Similar Modules}}&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeExplorer|MultiVolumeExplorer]]&lt;br /&gt;
* [[Documentation/{{documentation/version}}/Modules/MultiVolumeImporter|MultiVolumeImporter]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* [1] Knopp MV, Giesel FL, Marcos H et al: Dynamic contrast-enhanced magnetic resonance imaging in oncology. Top Magn Reson Imaging, 2001; 12:301-308.&lt;br /&gt;
* [2] Rijpkema M, Kaanders JHAM, Joosten FBM et al: Method for quantitative mapping of dynamic MRI contrast agent uptake in human tumors. J Magn Reson Imaging 2001; 14:457-463.&lt;br /&gt;
* [3] de Bazelaire, C.M., et al., MR imaging relaxation times of abdominal and pelvic tissues measured in vivo at 3.0 T: preliminary results. Radiology, 2004. 230(3): p. 652-9.&lt;br /&gt;
* [4] Pintaske J, Martirosian P, Graf H, Erb G, Lodemann K-P, Claussen CD, Schick F. Relaxivity of Gadopentetate Dimeglumine (Magnevist), Gadobutrol (Gadovist), and Gadobenate Dimeglumine (MultiHance) in human blood plasma at 0.2, 1.5, and 3 Tesla. Investigative radiology. 2006 March;41(3):213–21.&lt;br /&gt;
* [5] Parker GJ, Roberts C, Macdonald A, Buonaccorsi GA, Cheung S, Buckley DL, Jackson A, Watson Y, Davies K, Jayson GC.  Experimentally-derived functional form for a population-averaged high-temporal-resolution arterial input function for dynamic contrast-enhanced MRI.  Magnetic Resonance in Medicine, 2006 Nov; 56(5):993-1000.&lt;br /&gt;
* [6] Huang, W., Li, X., Chen, Y., Li, X., Chang, M.-C., Oborski, M. J., … Kalpathy-Cramer, J. (2014). Variations of dynamic contrast-enhanced magnetic resonance imaging in evaluation of breast cancer therapy response: a multicenter data analysis challenge. Translational Oncology, 7(1), 153–66. doi:10.1593/tlo.13838 http://dx.doi.org/10.1593/tlo.13838&lt;br /&gt;
* [7] Tofts, P. S., Brix, G., Buckley, D. L., Evelhoch, J. L., Henderson, E., Knopp, M. V, … Weisskoff, R. M. (1999). Estimating kinetic parameters from Contrast-Enhanced T 1 -Weighted MRI of a Diffusable Tracer : Standardized Quantities and Symbols. J Magn Reson Imaging, 10(3), 223–232.&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
Source code: https://github.com/millerjv/PkModeling&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Quantification]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/ScriptRepository&amp;diff=61588</id>
		<title>Documentation/Nightly/ScriptRepository</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/ScriptRepository&amp;diff=61588"/>
		<updated>2019-11-20T19:47:17Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Community-contributed modules=  &lt;br /&gt;
&lt;br /&gt;
The examples in this section are [[Documentation/{{documentation/version}}/Developers/Modules#Scripted_Modules| Scripted Modules]] that provide a user interface in the module panel along with specialized implementation logic.&lt;br /&gt;
&lt;br /&gt;
Usage: save the .py file to a directory, add the directory to the additional module paths in the Slicer application settings (choose in the menu: Edit / Application settings, click Modules, click &amp;gt;&amp;gt; next to Additional module paths, click Add, and choose the .py file's location).&lt;br /&gt;
&lt;br /&gt;
More information about python scripted modules and more usage examples can be found in the[[Documentation/{{documentation/version}}/Developers/Python_scripting | Python scripting]] wiki page.&lt;br /&gt;
&lt;br /&gt;
==Filters==&lt;br /&gt;
&lt;br /&gt;
*[https://raw.github.com/pieper/VolumeMasker/master/VolumeMasker.py VolumeMasker.py]: Update a target volume with the results of setting all input volume voxels to 0 except for those that correspond to a selected label value in an input label map (Used for example in the volume rendering in [https://www.youtube.com/watch?v=dfu2gugHLHs this video).&lt;br /&gt;
&lt;br /&gt;
==DICOM==&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/pieper/6186477 dicom header browser] to easily scroll through dicom files using dcmdump.&lt;br /&gt;
*[https://github.com/SlicerRt/SlicerRT/tree/master/BatchProcessing SlicerRT batch processing] to batch convert RT structure sets to labelmap NRRD files.&lt;br /&gt;
&lt;br /&gt;
==Informatics==&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/bf0954d93cacc8cbe27cd4a3ad503f2f MarkupsInfo.py]: Compute the total length between all the points of a markup list.&lt;br /&gt;
*[https://github.com/lassoan/SlicerLineProfile/blob/master/LineProfile/LineProfile.py LineProfile.py]: Compute intensity profile in a volume along a line.&lt;br /&gt;
&lt;br /&gt;
=Community-contributed examples=&lt;br /&gt;
&lt;br /&gt;
Usage: Copy-paste the shown code lines or linked .py file contents into Python console in Slicer.  Or save them to a file and run them using execfile.&lt;br /&gt;
&lt;br /&gt;
==Capture==&lt;br /&gt;
&lt;br /&gt;
*Capture the full Slicer screen and save it into a file&lt;br /&gt;
&lt;br /&gt;
  img = qt.QPixmap.grabWidget(slicer.util.mainWindow()).toImage()&lt;br /&gt;
  img.save('c:/tmp/test.png')&lt;br /&gt;
&lt;br /&gt;
*Capture all the views save it into a file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
cap = ScreenCapture.ScreenCaptureLogic()&lt;br /&gt;
cap.showViewControllers(False)&lt;br /&gt;
cap.captureImageFromView(None,'c:/tmp/test.png')&lt;br /&gt;
cap.showViewControllers(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Capture a single view:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
viewNodeID = 'vtkMRMLViewNode1'&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
cap = ScreenCapture.ScreenCaptureLogic()&lt;br /&gt;
view = cap.viewFromNode(slicer.mrmlScene.GetNodeByID(viewNodeID))&lt;br /&gt;
cap.captureImageFromView(view,'c:/tmp/test.png')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Common values for viewNodeID: vtkMRMLSliceNodeRed, vtkMRMLSliceNodeYellow, vtkMRMLSliceNodeGreen, vtkMRMLViewNode1, vtkMRMLViewNode2. &lt;br /&gt;
The ScreenCapture module can also create video animations of rotating views, slice sweeps, etc.&lt;br /&gt;
&lt;br /&gt;
*Capture a slice view sweep into a series of PNG files - for example, Red slice view, 30 images, from position -125.0 to 75.0, into c:/tmp folder, with name image_00001.png, image_00002.png, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
ScreenCapture.ScreenCaptureLogic().captureSliceSweep(getNode('vtkMRMLSliceNodeRed'), -125.0, 75.0, 30, &amp;quot;c:/tmp&amp;quot;, &amp;quot;image_%05d.png&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Capture 3D view into PNG file with transparent background&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow()&lt;br /&gt;
renderWindow.SetAlphaBitPlanes(1)&lt;br /&gt;
wti = vtk.vtkWindowToImageFilter()&lt;br /&gt;
wti.SetInputBufferTypeToRGBA()&lt;br /&gt;
wti.SetInput(renderWindow)&lt;br /&gt;
writer = vtk.vtkPNGWriter()&lt;br /&gt;
writer.SetFileName(&amp;quot;c:/tmp/screenshot.png&amp;quot;)&lt;br /&gt;
writer.SetInputConnection(wti.GetOutputPort())&lt;br /&gt;
writer.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Launching Slicer==&lt;br /&gt;
&lt;br /&gt;
*How to open an .mrb file with Slicer at the command line?&lt;br /&gt;
&lt;br /&gt;
  Slicer.exe --python-code &amp;quot;slicer.util.loadScene( 'f:/2013-08-23-Scene.mrb' )&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*How to run a script in the Slicer environment in batch mode (without showing any graphical user interface)?&lt;br /&gt;
&lt;br /&gt;
  Slicer.exe --python-code &amp;quot;doSomething; doSomethingElse; etc.&amp;quot; --testing --no-splash --no-main-window&lt;br /&gt;
&lt;br /&gt;
==Load volume from file==&lt;br /&gt;
When loading a volume from file, it is recommended to set returnNode=True to retrieve the loaded volume node.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loadedVolumeNode = slicer.util.loadVolume('c:/Users/abc/Documents/MRHead.nrrd')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Get a MRML node in the scene based on the node name and call methods of that object. For the MRHead sample data:&lt;br /&gt;
&lt;br /&gt;
  vol=slicer.util.getNode('MR*')&lt;br /&gt;
  vol.GetImageData().GetDimensions()&lt;br /&gt;
&lt;br /&gt;
==Show volume rendering automatically when a volume is loaded==&lt;br /&gt;
&lt;br /&gt;
To show volume rendering of a volume automatically when it is loaded, add the lines below to your &lt;br /&gt;
[[Documentation/{{documentation/version}}/Developers/Python_scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F|.slicerrc file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@vtk.calldata_type(vtk.VTK_OBJECT)&lt;br /&gt;
def onNodeAdded(caller, event, calldata):&lt;br /&gt;
  node = calldata&lt;br /&gt;
  if isinstance(node, slicer.vtkMRMLVolumeNode):&lt;br /&gt;
    # Call showVolumeRendering using a timer instead of calling it directly&lt;br /&gt;
    # to allow the volume loading to fully complete.&lt;br /&gt;
    qt.QTimer.singleShot(0, lambda: showVolumeRendering(node))&lt;br /&gt;
&lt;br /&gt;
def showVolumeRendering(volumeNode):&lt;br /&gt;
  print(&amp;quot;Show volume rendering of node &amp;quot;+volumeNode.GetName())&lt;br /&gt;
  volRenLogic = slicer.modules.volumerendering.logic()&lt;br /&gt;
  displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)&lt;br /&gt;
  displayNode.SetVisibility(True)&lt;br /&gt;
  scalarRange = volumeNode.GetImageData().GetScalarRange()&lt;br /&gt;
  if scalarRange[1]-scalarRange[0] &amp;lt; 1500:&lt;br /&gt;
    # small dynamic range, probably MRI&lt;br /&gt;
    displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName('MR-Default'))&lt;br /&gt;
  else:&lt;br /&gt;
    # larger dynamic range, probably CT&lt;br /&gt;
    displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName('CT-Chest-Contrast-Enhanced'))&lt;br /&gt;
    &lt;br /&gt;
slicer.mrmlScene.AddObserver(slicer.vtkMRMLScene.NodeAddedEvent, onNodeAdded)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Automatically load volumes that are copied into a folder==&lt;br /&gt;
&lt;br /&gt;
This example shows how to implement a simple background task by using a timer. The background task is to check for any new volume files in folder and if there is any then automatically load it.&lt;br /&gt;
&lt;br /&gt;
There are more efficient methods for file system monitoring or exchanging image data in real-time (for example, using OpenIGTLink), the example below is just for demonstration purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
incomingVolumeFolder = &amp;quot;c:/tmp/incoming&amp;quot;&lt;br /&gt;
incomingVolumesProcessed = []&lt;br /&gt;
&lt;br /&gt;
def checkForNewVolumes():&lt;br /&gt;
  # Check if there is a new file in the &lt;br /&gt;
  from os import listdir&lt;br /&gt;
  from os.path import isfile, join&lt;br /&gt;
  for f in listdir(incomingVolumeFolder):&lt;br /&gt;
    if f in incomingVolumesProcessed:&lt;br /&gt;
      # this is an incoming file, it was already there&lt;br /&gt;
      continue&lt;br /&gt;
    filePath = join(incomingVolumeFolder, f)&lt;br /&gt;
    if not isfile(filePath):&lt;br /&gt;
      # ignore directories&lt;br /&gt;
      continue&lt;br /&gt;
    logging.info(&amp;quot;Loading new file: &amp;quot;+f)&lt;br /&gt;
    incomingVolumesProcessed.append(f)&lt;br /&gt;
    slicer.util.loadVolume(filePath)&lt;br /&gt;
  # Check again in 3000ms&lt;br /&gt;
  qt.QTimer.singleShot(3000, checkForNewVolumes)&lt;br /&gt;
&lt;br /&gt;
# Start monitoring&lt;br /&gt;
checkForNewVolumes()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DICOM==&lt;br /&gt;
===How to access top level tags of DICOM images imported into Slicer? For example, to print the first patient's first study's first series' &amp;quot;0020,0032&amp;quot; field:===&lt;br /&gt;
  db=slicer.dicomDatabase&lt;br /&gt;
  patientList=db.patients()&lt;br /&gt;
  studyList=db.studiesForPatient(patientList[0])&lt;br /&gt;
  seriesList=db.seriesForStudy(studyList[0])&lt;br /&gt;
  fileList=db.filesForSeries(seriesList[0])&lt;br /&gt;
  # Note, fileValue accesses the database of cached top level tags&lt;br /&gt;
  # (nested tags are not included)&lt;br /&gt;
  print(db.fileValue(fileList[0],'0020,0032'))&lt;br /&gt;
&lt;br /&gt;
===How to access DICOM tags nested in a sequence===&lt;br /&gt;
  db=slicer.dicomDatabase&lt;br /&gt;
  patientList=db.patients()&lt;br /&gt;
  studyList=db.studiesForPatient(patientList[0])&lt;br /&gt;
  seriesList=db.seriesForStudy(studyList[0])&lt;br /&gt;
  fileList=db.filesForSeries(seriesList[0])&lt;br /&gt;
  # use pydicom to access the full header, which requires&lt;br /&gt;
  # re-reading the dataset instead of using the database cache&lt;br /&gt;
  import pydicom&lt;br /&gt;
  pydicom.dcmread(fileList[0])&lt;br /&gt;
  ds.CTExposureSequence[0].ExposureModulationType&lt;br /&gt;
&lt;br /&gt;
===How to access tag of a volume loaded from DICOM? For example, get the patient position stored in a volume:===&lt;br /&gt;
  volumeName='2: ENT IMRT'&lt;br /&gt;
  n=slicer.util.getNode(volumeName)&lt;br /&gt;
  instUids=n.GetAttribute('DICOM.instanceUIDs').split()&lt;br /&gt;
  filename=slicer.dicomDatabase.fileForInstance(instUids[0])&lt;br /&gt;
  print(slicer.dicomDatabase.fileValue(filename,'0018,5100'))&lt;br /&gt;
&lt;br /&gt;
===How to access tag of an item in the Subject Hierachy tree? For example, get the content time tag of a structure set:===&lt;br /&gt;
  rtStructName = '3: RTSTRUCT: PROS'&lt;br /&gt;
  rtStructNode = slicer.util.getNode(rtStructName)&lt;br /&gt;
  shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
  rtStructShItemID = shNode.GetItemByDataNode(rtStructNode)&lt;br /&gt;
  ctSliceInstanceUids = shNode.GetItemAttribute(rtStructShItemID, 'DICOM.ReferencedInstanceUIDs').split()&lt;br /&gt;
  filename = slicer.dicomDatabase.fileForInstance(ctSliceInstanceUids[0])&lt;br /&gt;
  print(slicer.dicomDatabase.fileValue(filename,'0008,0033'))&lt;br /&gt;
&lt;br /&gt;
===How to get path and filename of a loaded DICOM volume?===&lt;br /&gt;
  def pathFromNode(node):&lt;br /&gt;
    storageNode=node.GetStorageNode()&lt;br /&gt;
    if storageNode is not None: # loaded via drag-drop&lt;br /&gt;
        filepath=storageNode.GetFullNameFromFileName()&lt;br /&gt;
    else: # loaded via DICOM browser&lt;br /&gt;
        instanceUIDs=node.GetAttribute('DICOM.instanceUIDs').split()&lt;br /&gt;
        filepath=slicer.dicomDatabase.fileForInstance(instUids[0])&lt;br /&gt;
    return filepath&lt;br /&gt;
  &lt;br /&gt;
  # example:&lt;br /&gt;
  node=slicer.util.getNode('volume1')&lt;br /&gt;
  path=self.pathFromNode(node)&lt;br /&gt;
  print(&amp;quot;DICOM path=%s&amp;quot; % path)&lt;br /&gt;
&lt;br /&gt;
===How can I convert DICOM to NRRD on the command line?===&lt;br /&gt;
&lt;br /&gt;
 /Applications/Slicer-4.6.2.app/Contents/MacOS/Slicer --no-main-window --python-code &amp;quot;node=slicer.util.loadVolume('/tmp/series/im0.dcm'); slicer.util.saveNode(node, '/tmp/output.nrrd'); exit()&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same can be done on windows by using the top level Slicer.exe.  Be sure to use forward slashes in the pathnames within quotes on the command line.&lt;br /&gt;
&lt;br /&gt;
===Export a volume to DICOM file format===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = getNode('CTChest')&lt;br /&gt;
outputFolder = &amp;quot;c:/tmp/dicom-output&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Create patient and study and put the volume under the study&lt;br /&gt;
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
patientItemID = shNode.CreateSubjectItem(shNode.GetSceneItemID(), &amp;quot;test patient&amp;quot;)&lt;br /&gt;
studyItemID = shNode.CreateStudyItem(patientItemID, &amp;quot;test study&amp;quot;)&lt;br /&gt;
volumeShItemID = shNode.GetItemByDataNode(volumeNode)&lt;br /&gt;
shNode.SetItemParent(volumeShItemID, studyItemID)&lt;br /&gt;
&lt;br /&gt;
import DICOMScalarVolumePlugin&lt;br /&gt;
exporter = DICOMScalarVolumePlugin.DICOMScalarVolumePluginClass()&lt;br /&gt;
exportables = exporter.examineForExport(volumeShItemID)&lt;br /&gt;
for exp in exportables:&lt;br /&gt;
  exp.directory = outputFolder&lt;br /&gt;
&lt;br /&gt;
exporter.export(exportables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Customize table columns in DICOM browser===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get browser and database&lt;br /&gt;
dicomBrowser = slicer.modules.dicom.widgetRepresentation().self().dicomBrowser&lt;br /&gt;
dicomDatabase = dicomBrowser.database() # Need to go this way, do not use slicer.dicomDatabase for this&lt;br /&gt;
&lt;br /&gt;
# Change column order&lt;br /&gt;
dicomDatabase.setWeightForField('Series', 'SeriesDescription', 7)&lt;br /&gt;
dicomDatabase.setWeightForField('Studies', 'StudyDescription', 6)&lt;br /&gt;
# Change column visibility&lt;br /&gt;
dicomDatabase.setVisibilityForField('Patients', 'PatientsBirthDate', False)&lt;br /&gt;
# Change column name&lt;br /&gt;
dicomDatabase.setDisplayedNameForField('Series', 'DisplayedCount', 'Number of images')&lt;br /&gt;
# Customize table manager in DICOM browser&lt;br /&gt;
dicomTableManager = dicomBrowser.dicomTableManager()&lt;br /&gt;
dicomTableManager.selectionMode = qt.QAbstractItemView.SingleSelection&lt;br /&gt;
dicomTableManager.autoSelectSeries = False&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Toolbar functions==&lt;br /&gt;
&lt;br /&gt;
*How to turn on slice intersections in the crosshair menu on the toolbar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
viewNodes = slicer.util.getNodesByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
for viewNode in viewNodes:&lt;br /&gt;
  viewNode.SetSliceIntersectionVisibility(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to find similar functions? For this one I searched for &amp;quot;slice intersections&amp;quot; text in the whole slicer source code, found that the function is implemented in Base\QTGUI\qSlicerViewersToolBar.cxx, then translated the qSlicerViewersToolBarPrivate::setSliceIntersectionVisible(bool visible) method to Python.&lt;br /&gt;
&lt;br /&gt;
==Manipulating objects in the slice viewer==&lt;br /&gt;
&lt;br /&gt;
*How to define/edit a circular region of interest in a slice viewer?&lt;br /&gt;
&lt;br /&gt;
Drop two markup points on a slice view and copy-paste the code below into the Python console. After this, as you move the markups you’ll see a circle following the markups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the sphere from the fiducial points&lt;br /&gt;
def UpdateSphere(param1, param2):  &lt;br /&gt;
  import math&lt;br /&gt;
  centerPointCoord = [0.0, 0.0, 0.0]&lt;br /&gt;
  markups.GetNthFiducialPosition(0,centerPointCoord)&lt;br /&gt;
  circumferencePointCoord = [0.0, 0.0, 0.0]&lt;br /&gt;
  markups.GetNthFiducialPosition(1,circumferencePointCoord)&lt;br /&gt;
  sphere.SetCenter(centerPointCoord)&lt;br /&gt;
  radius=math.sqrt((centerPointCoord[0]-circumferencePointCoord[0])**2+(centerPointCoord[1]-circumferencePointCoord[1])**2+(centerPointCoord[2]-circumferencePointCoord[2])**2)&lt;br /&gt;
  sphere.SetRadius(radius)&lt;br /&gt;
  sphere.SetPhiResolution(30)&lt;br /&gt;
  sphere.SetThetaResolution(30)&lt;br /&gt;
  sphere.Update()&lt;br /&gt;
&lt;br /&gt;
# Get markup node from scene&lt;br /&gt;
markups=slicer.util.getNode('F')&lt;br /&gt;
sphere = vtk.vtkSphereSource()&lt;br /&gt;
UpdateSphere(0,0)&lt;br /&gt;
 &lt;br /&gt;
# Create model node and add to scene&lt;br /&gt;
modelsLogic = slicer.modules.models.logic()&lt;br /&gt;
model = modelsLogic.AddModel(sphere.GetOutput())&lt;br /&gt;
model.GetDisplayNode().SetSliceIntersectionVisibility(True)&lt;br /&gt;
model.GetDisplayNode().SetSliceIntersectionThickness(3)&lt;br /&gt;
model.GetDisplayNode().SetColor(1,1,0)&lt;br /&gt;
 &lt;br /&gt;
# Call UpdateSphere whenever the fiducials are changed&lt;br /&gt;
markups.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, UpdateSphere, 2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Measure angle between two slice planes==&lt;br /&gt;
&lt;br /&gt;
Measure angle between red and yellow slice nodes. Whenever any of the slice nodes are moved, the updated angle is printed on the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNodeIds = ['vtkMRMLSliceNodeRed', 'vtkMRMLSliceNodeYellow']&lt;br /&gt;
&lt;br /&gt;
# Print angles between slice nodes&lt;br /&gt;
def ShowAngle(unused1=None, unused2=None):&lt;br /&gt;
    sliceNormalVector = []&lt;br /&gt;
    for sliceNodeId in sliceNodeIds:&lt;br /&gt;
        sliceToRAS = slicer.mrmlScene.GetNodeByID(sliceNodeId).GetSliceToRAS()&lt;br /&gt;
        sliceNormalVector.append([sliceToRAS.GetElement(0,2), sliceToRAS.GetElement(1,2), sliceToRAS.GetElement(2,2)])&lt;br /&gt;
    angleRad = vtk.vtkMath.AngleBetweenVectors(sliceNormalVector[0], sliceNormalVector[1])&lt;br /&gt;
    angleDeg = vtk.vtkMath.DegreesFromRadians(angleRad)&lt;br /&gt;
    print('Angle between slice planes = {0:0.3f}'.format(angleDeg))&lt;br /&gt;
&lt;br /&gt;
# Observe slice node changes&lt;br /&gt;
for sliceNodeId in sliceNodeIds:&lt;br /&gt;
    slicer.mrmlScene.GetNodeByID(sliceNodeId).AddObserver(vtk.vtkCommand.ModifiedEvent, ShowAngle)&lt;br /&gt;
&lt;br /&gt;
# Print current angle&lt;br /&gt;
ShowAngle()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set slice position and orientation from 3 markup fiducials==&lt;br /&gt;
&lt;br /&gt;
Drop 3 markup points in the scene and copy-paste the code below into the Python console. After this, as you move the markups you’ll see the red slice view position and orientation will be set to make it fit to the 3 points.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update plane from fiducial points&lt;br /&gt;
def UpdateSlicePlane(param1=None, param2=None):&lt;br /&gt;
  # Get point positions as numpy array&lt;br /&gt;
  import numpy as np&lt;br /&gt;
  nOfFiduciallPoints = markups.GetNumberOfFiducials()&lt;br /&gt;
  if nOfFiduciallPoints &amp;lt; 3:&lt;br /&gt;
    return  # not enough points&lt;br /&gt;
  points = np.zeros([3,nOfFiduciallPoints])&lt;br /&gt;
  for i in range(0, nOfFiduciallPoints):&lt;br /&gt;
    markups.GetNthFiducialPosition(i, points[:,i])&lt;br /&gt;
  # Compute plane position and normal&lt;br /&gt;
  planePosition = points.mean(axis=1)&lt;br /&gt;
  planeNormal = np.cross(points[:,1] - points[:,0], points[:,2] - points[:,0])&lt;br /&gt;
  planeX = points[:,1] - points[:,0]&lt;br /&gt;
  sliceNode.SetSliceToRASByNTP(planeNormal[0], planeNormal[1], planeNormal[2],&lt;br /&gt;
    planeX[0], planeX[1], planeX[2],&lt;br /&gt;
    planePosition[0], planePosition[1], planePosition[2], 0)&lt;br /&gt;
&lt;br /&gt;
# Get markup node from scene&lt;br /&gt;
sliceNode = slicer.app.layoutManager().sliceWidget('Red').mrmlSliceNode()&lt;br /&gt;
markups = slicer.util.getNode('F')&lt;br /&gt;
&lt;br /&gt;
# Update slice plane manually&lt;br /&gt;
UpdateSlicePlane()&lt;br /&gt;
&lt;br /&gt;
# Update slice plane automatically whenever points are changed&lt;br /&gt;
markupObservation = [markups, markups.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, UpdateSlicePlane, 2)]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop automatic updates, run this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
markupObservation[0].RemoveObserver(markupObservation[1])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set slice position and orientation from a normal vector and position==&lt;br /&gt;
&lt;br /&gt;
This code snippet shows how to display a slice view defined by a normal vector and position in an anatomically sensible way: rotating slice view so that &amp;quot;up&amp;quot; direction (or &amp;quot;right&amp;quot; direction) is towards an anatomical axis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def setSlicePoseFromSliceNormalAndPosition(sliceNode, sliceNormal, slicePosition, defaultViewUpDirection=None, backupViewRightDirection=None):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Set slice pose from the provided plane normal and position. View up direction is determined automatically,&lt;br /&gt;
    to make view up point towards defaultViewUpDirection.&lt;br /&gt;
    :param defaultViewUpDirection Slice view will be spinned in-plane to match point approximately this up direction. Default: patient superior.&lt;br /&gt;
    :param backupViewRightDirection Slice view will be spinned in-plane to match point approximately this right direction&lt;br /&gt;
        if defaultViewUpDirection is too similar to sliceNormal. Default: patient left.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    # Fix up input directions&lt;br /&gt;
    if defaultViewUpDirection is None:&lt;br /&gt;
        defaultViewUpDirection = [0,0,1]&lt;br /&gt;
    if backupViewRightDirection is None:&lt;br /&gt;
        backupViewRightDirection = [-1,0,0]&lt;br /&gt;
    if sliceNormal[1]&amp;gt;=0:&lt;br /&gt;
        sliceNormalStandardized = sliceNormal&lt;br /&gt;
    else:&lt;br /&gt;
        sliceNormalStandardized = [-sliceNormal[0], -sliceNormal[1], -sliceNormal[2]]&lt;br /&gt;
    # Compute slice axes&lt;br /&gt;
    sliceNormalViewUpAngle = vtk.vtkMath.AngleBetweenVectors(sliceNormalStandardized, defaultViewUpDirection)&lt;br /&gt;
    angleTooSmallThresholdRad = 0.25 # about 15 degrees&lt;br /&gt;
    if sliceNormalViewUpAngle &amp;gt; angleTooSmallThresholdRad and sliceNormalViewUpAngle &amp;lt; vtk.vtkMath.Pi() - angleTooSmallThresholdRad:&lt;br /&gt;
        viewUpDirection = defaultViewUpDirection&lt;br /&gt;
        sliceAxisY = viewUpDirection&lt;br /&gt;
        sliceAxisX = [0, 0, 0]&lt;br /&gt;
        vtk.vtkMath.Cross(sliceAxisY, sliceNormalStandardized, sliceAxisX)&lt;br /&gt;
    else:&lt;br /&gt;
        sliceAxisX = backupViewRightDirection&lt;br /&gt;
    # Set slice axes&lt;br /&gt;
    sliceNode.SetSliceToRASByNTP(sliceNormalStandardized[0], sliceNormalStandardized[1], sliceNormalStandardized[2],&lt;br /&gt;
        sliceAxisX[0], sliceAxisX[1], sliceAxisX[2],&lt;br /&gt;
        slicePosition[0], slicePosition[1], slicePosition[2], 0)&lt;br /&gt;
&lt;br /&gt;
# Example usage:&lt;br /&gt;
sliceNode = getNode('vtkMRMLSliceNodeRed')&lt;br /&gt;
transformNode = getNode('Transform_3')&lt;br /&gt;
transformMatrix = vtk.vtkMatrix4x4()&lt;br /&gt;
transformNode.GetMatrixTransformToParent(transformMatrix)&lt;br /&gt;
sliceNormal = [transformMatrix.GetElement(0,2), transformMatrix.GetElement(1,2), transformMatrix.GetElement(2,2)]&lt;br /&gt;
slicePosition = [transformMatrix.GetElement(0,3), transformMatrix.GetElement(1,3), transformMatrix.GetElement(2,3)]&lt;br /&gt;
setSlicePoseFromSliceNormalAndPosition(sliceNode, sliceNormal, slicePosition)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switching to markup fiducial placement mode==&lt;br /&gt;
&lt;br /&gt;
To activate a fiducial placement mode, both interaction mode has to be set and a fiducial node has to be selected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interactionNode = slicer.app.applicationLogic().GetInteractionNode()&lt;br /&gt;
selectionNode = slicer.app.applicationLogic().GetSelectionNode()&lt;br /&gt;
selectionNode.SetReferenceActivePlaceNodeClassName(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
fiducialNode = slicer.vtkMRMLMarkupsFiducialNode()&lt;br /&gt;
slicer.mrmlScene.AddNode(fiducialNode)&lt;br /&gt;
fiducialNode.CreateDefaultDisplayNodes() &lt;br /&gt;
selectionNode.SetActivePlaceNodeID(fiducialNode.GetID())&lt;br /&gt;
interactionNode.SetCurrentInteractionMode(interactionNode.Place)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, ''qSlicerMarkupsPlaceWidget'' widget can be used to initiate markup placement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Temporary markups node&lt;br /&gt;
markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def placementModeChanged(active):&lt;br /&gt;
  print(&amp;quot;Placement: &amp;quot; +(&amp;quot;active&amp;quot; if active else &amp;quot;inactive&amp;quot;))&lt;br /&gt;
  # You can inspect what is in the markups node here, delete the temporary markup node, etc.&lt;br /&gt;
&lt;br /&gt;
# Create and set up widget that contains a single &amp;quot;place markup&amp;quot; button. The widget can be placed in the module GUI.&lt;br /&gt;
placeWidget = slicer.qSlicerMarkupsPlaceWidget()&lt;br /&gt;
placeWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
placeWidget.setCurrentNode(markupsNode)&lt;br /&gt;
placeWidget.buttonsVisible=False&lt;br /&gt;
placeWidget.placeButton().show()&lt;br /&gt;
placeWidget.connect('activeMarkupsFiducialPlaceModeChanged(bool)', placementModeChanged)&lt;br /&gt;
placeWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change markup fiducial display properties==&lt;br /&gt;
&lt;br /&gt;
Display properties are stored in display node(s) associated with the fiducial node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fiducialNode = getNode('F')&lt;br /&gt;
fiducialDisplayNode = fiducialNode.GetDisplayNode()&lt;br /&gt;
fiducialDisplayNode.SetVisibility(False) # Hide all points&lt;br /&gt;
fiducialDisplayNode.SetVisibility(True) # Show all points&lt;br /&gt;
fiducialDisplayNode.SetSelectedColor(1,1,0) # Set color to yellow&lt;br /&gt;
fiducialDisplayNode.SetViewNodeIDs([&amp;quot;vtkMRMLSliceNodeRed&amp;quot;, &amp;quot;vtkMRMLViewNode1&amp;quot;]) # Only show in red slice view and first 3D view&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get a notification if a markup point position is modified==&lt;br /&gt;
&lt;br /&gt;
Event management of Slicer-4.11 version is still subject to change. The example below shows how point manipulation can be observed now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onMarkupChanged(caller,event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()&lt;br /&gt;
    if movingMarkupIndex &amp;gt;= 0:&lt;br /&gt;
        pos = [0,0,0]&lt;br /&gt;
        markupsNode.GetNthFiducialPosition(movingMarkupIndex, pos)&lt;br /&gt;
        isPreview = markupsNode.GetNthControlPointPositionStatus(movingMarkupIndex) == slicer.vtkMRMLMarkupsNode.PositionPreview&lt;br /&gt;
        if isPreview:&lt;br /&gt;
            logging.info(&amp;quot;Point {0} is previewed at {1} in slice view {2}&amp;quot;.format(movingMarkupIndex, pos, sliceView))&lt;br /&gt;
        else:&lt;br /&gt;
            logging.info(&amp;quot;Point {0} was moved {1} in slice view {2}&amp;quot;.format(movingMarkupIndex, pos, sliceView))&lt;br /&gt;
    else:&lt;br /&gt;
        logging.info(&amp;quot;Points modified: slice view = {0}&amp;quot;.format(sliceView))&lt;br /&gt;
&lt;br /&gt;
def onMarkupStartInteraction(caller, event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()    &lt;br /&gt;
    logging.info(&amp;quot;Start interaction: point ID = {0}, slice view = {1}&amp;quot;.format(movingMarkupIndex, sliceView))&lt;br /&gt;
&lt;br /&gt;
def onMarkupEndInteraction(caller, event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()&lt;br /&gt;
    logging.info(&amp;quot;End interaction: point ID = {0}, slice view = {1}&amp;quot;.format(movingMarkupIndex, sliceView))&lt;br /&gt;
&lt;br /&gt;
markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
markupsNode.CreateDefaultDisplayNodes()&lt;br /&gt;
markupsNode.AddFiducial(0,0,0)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, onMarkupChanged)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointStartInteractionEvent, onMarkupStartInteraction)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointEndInteractionEvent, onMarkupEndInteraction)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get a notification if a transform is modified==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onTransformNodeModified(transformNode, unusedArg2=None, unusedArg3=None):&lt;br /&gt;
  transformMatrix = vtk.vtkMatrix4x4()&lt;br /&gt;
  transformNode.GetMatrixTransformToWorld(transformMatrix)&lt;br /&gt;
  print(&amp;quot;Position: [{0}, {1}, {2}]&amp;quot;.format(transformMatrix.GetElement(0,3), transformMatrix.GetElement(1,3), transformMatrix.GetElement(2,3)))&lt;br /&gt;
&lt;br /&gt;
transformNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLTransformNode&amp;quot;)&lt;br /&gt;
transformNode.AddObserver(slicer.vtkMRMLTransformNode.TransformModifiedEvent, onTransformNodeModified)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a context menu when a markup point is clicked in a slice or 3D view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Example actions to perform&lt;br /&gt;
&lt;br /&gt;
def action1():&lt;br /&gt;
  print('Action1 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
def action2():&lt;br /&gt;
  print('Action2 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
def action3():&lt;br /&gt;
  print('Action3 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
# Clicked markup index is saved here to let the action&lt;br /&gt;
# know which markup needs to be manipulated.&lt;br /&gt;
slicer.clickedMarkupIndex = -1&lt;br /&gt;
  &lt;br /&gt;
# Create a simple menu&lt;br /&gt;
&lt;br /&gt;
menu = qt.QMenu()&lt;br /&gt;
a1 = qt.QAction(&amp;quot;Test&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a1.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a1)&lt;br /&gt;
a2 = qt.QAction(&amp;quot;Action&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a2.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a2)&lt;br /&gt;
a3 = qt.QAction(&amp;quot;Here&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a3.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a3)&lt;br /&gt;
&lt;br /&gt;
# Add observer to a markup fiducial list&lt;br /&gt;
&lt;br /&gt;
@vtk.calldata_type(vtk.VTK_INT)&lt;br /&gt;
def markupClickedCallback(caller, eventId, callData):&lt;br /&gt;
  slicer.clickedMarkupIndex = callData&lt;br /&gt;
  print('Open menu on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
  menu.move(qt.QCursor.pos())&lt;br /&gt;
  menu.show()&lt;br /&gt;
&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
observerTag = markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointClickedEvent, markupClickedCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Write markup positions to JSON file==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
markupNode = getNode('F')&lt;br /&gt;
outputFileName = 'c:/tmp/test.json'&lt;br /&gt;
&lt;br /&gt;
# Get markup positions&lt;br /&gt;
data = []&lt;br /&gt;
for fidIndex in range(markupNode.GetNumberOfFiducials()):&lt;br /&gt;
  coords=[0,0,0]&lt;br /&gt;
  markupNode.GetNthFiducialPosition(fidIndex,coords)&lt;br /&gt;
  data.append({'label': markupNode.GetNthFiducialLabel(), 'position': coords})&lt;br /&gt;
&lt;br /&gt;
import json&lt;br /&gt;
with open(outputFileName, 'w') as outfile:&lt;br /&gt;
  json.dump(data, outfile)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Write annotation ROI to JSON file==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roiNode = getNode('R')&lt;br /&gt;
outputFileName = &amp;quot;c:/tmp/test.json&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get annotation ROI data&lt;br /&gt;
center = [0,0,0]&lt;br /&gt;
radius = [0,0,0]&lt;br /&gt;
roiNode.GetControlPointWorldCoordinates(0, center)&lt;br /&gt;
roiNode.GetControlPointWorldCoordinates(1, radius)&lt;br /&gt;
data = {'center': radius, 'radius': radius}&lt;br /&gt;
&lt;br /&gt;
# Write to json file&lt;br /&gt;
import json&lt;br /&gt;
with open(outputFileName, 'w') as outfile:&lt;br /&gt;
  json.dump(data, outfile)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a simple surface mesh as a model node==&lt;br /&gt;
&lt;br /&gt;
This example shows how to display a simple surface mesh (a box, created by a VTK source filter) as a model node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Create and set up polydata source&lt;br /&gt;
box = vtk.vtkCubeSource()&lt;br /&gt;
box.SetXLength(30)&lt;br /&gt;
box.SetYLength(20)&lt;br /&gt;
box.SetZLength(15)&lt;br /&gt;
box.SetCenter(10,20,5)&lt;br /&gt;
&lt;br /&gt;
# Create a model node that displays output of the source&lt;br /&gt;
boxNode = slicer.modules.models.logic().AddModel(box.GetOutputPort())&lt;br /&gt;
&lt;br /&gt;
# Adjust display properties&lt;br /&gt;
boxNode.GetDisplayNode().SetColor(1,0,0)&lt;br /&gt;
boxNode.GetDisplayNode().SetOpacity(0.8)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add a texture mapped plane to the scene as a model==&lt;br /&gt;
Note that model textures are not exposed in the GUI and are not saved in the scene&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# use dummy image data here&lt;br /&gt;
e = vtk.vtkImageEllipsoidSource()&lt;br /&gt;
&lt;br /&gt;
scene = slicer.mrmlScene&lt;br /&gt;
&lt;br /&gt;
# Create model node&lt;br /&gt;
model = slicer.vtkMRMLModelNode()&lt;br /&gt;
model.SetScene(scene)&lt;br /&gt;
model.SetName(scene.GenerateUniqueName(&amp;quot;2DImageModel&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
planeSource = vtk.vtkPlaneSource()&lt;br /&gt;
model.SetAndObservePolyData(planeSource.GetOutput())&lt;br /&gt;
&lt;br /&gt;
# Create display node&lt;br /&gt;
modelDisplay = slicer.vtkMRMLModelDisplayNode()&lt;br /&gt;
modelDisplay.SetColor(1,1,0) # yellow&lt;br /&gt;
modelDisplay.SetBackfaceCulling(0)&lt;br /&gt;
modelDisplay.SetScene(scene)&lt;br /&gt;
scene.AddNode(modelDisplay)&lt;br /&gt;
model.SetAndObserveDisplayNodeID(modelDisplay.GetID())&lt;br /&gt;
&lt;br /&gt;
# Add to scene&lt;br /&gt;
modelDisplay.SetAndObserveTextureImageData(e.GetOutput())&lt;br /&gt;
scene.AddNode(model) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
transform = slicer.vtkMRMLLinearTransformNode()&lt;br /&gt;
scene.AddNode(transform) &lt;br /&gt;
model.SetAndObserveTransformNodeID(transform.GetID())&lt;br /&gt;
&lt;br /&gt;
vTransform = vtk.vtkTransform()&lt;br /&gt;
vTransform.Scale(50,50,50)&lt;br /&gt;
vTransform.RotateX(30)&lt;br /&gt;
transform.SetAndObserveMatrixTransformToParent(vTransform.GetMatrix())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get scalar values at surface of a model==&lt;br /&gt;
&lt;br /&gt;
The following script allows getting selected scalar value at a selected position of a model. Position can be selected by moving the mouse while holding down Shift key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelNode = getNode('sphere')&lt;br /&gt;
modelPointValues = modelNode.GetPolyData().GetPointData().GetArray(&amp;quot;Normals&amp;quot;)&lt;br /&gt;
markupsNode = slicer.mrmlScene.GetFirstNodeByName('F')&lt;br /&gt;
&lt;br /&gt;
if not markupsNode:&lt;br /&gt;
  markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;,&amp;quot;F&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
pointsLocator = vtk.vtkPointLocator() # could try using vtk.vtkStaticPointLocator() if need to optimize&lt;br /&gt;
pointsLocator.SetDataSet(modelNode.GetPolyData())&lt;br /&gt;
pointsLocator.BuildLocator()&lt;br /&gt;
&lt;br /&gt;
def onMouseMoved(observer,eventid):  &lt;br /&gt;
  ras=[0,0,0]&lt;br /&gt;
  crosshairNode.GetCursorPositionRAS(ras)&lt;br /&gt;
  if markupsNode.GetNumberOfFiducials() == 0:&lt;br /&gt;
    markupsNode.AddFiducial(*ras)&lt;br /&gt;
  else:&lt;br /&gt;
    markupsNode.SetNthFiducialPosition(0,*ras)&lt;br /&gt;
  closestPointId = pointsLocator.FindClosestPoint(ras)&lt;br /&gt;
  closestPointValue = modelPointValues.GetTuple(closestPointId)&lt;br /&gt;
  print(&amp;quot;RAS = &amp;quot; + repr(ras) + &amp;quot;    value = &amp;quot; + repr(closestPointValue))&lt;br /&gt;
&lt;br /&gt;
crosshairNode=slicer.util.getNode('Crosshair') &lt;br /&gt;
observationId = crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, onMouseMoved)&lt;br /&gt;
&lt;br /&gt;
# To stop printing of values run this:&lt;br /&gt;
# crosshairNode.RemoveObserver(observationId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select cells of a using markups fiducial points==&lt;br /&gt;
&lt;br /&gt;
The following script selects cells of a model node that are closest to positions of markups fiducial points.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get input nodes&lt;br /&gt;
modelNode = slicer.util.getNode('Segment_1') # select cells in this model&lt;br /&gt;
markupsNode = slicer.util.getNode('F') # points will be selected at positions specified by this markups fiducial node&lt;br /&gt;
&lt;br /&gt;
# Create scalar array that will store selection state&lt;br /&gt;
cellScalars = modelNode.GetMesh().GetCellData()&lt;br /&gt;
selectionArray = cellScalars.GetArray('selection')&lt;br /&gt;
if not selectionArray:&lt;br /&gt;
    selectionArray = vtk.vtkIntArray()&lt;br /&gt;
    selectionArray.SetName('selection')&lt;br /&gt;
    selectionArray.SetNumberOfValues(modelNode.GetMesh().GetNumberOfCells())&lt;br /&gt;
    selectionArray.Fill(0)&lt;br /&gt;
    cellScalars.AddArray(selectionArray)&lt;br /&gt;
&lt;br /&gt;
# Set up coloring by selection array&lt;br /&gt;
modelNode.GetDisplayNode().SetActiveScalar(&amp;quot;selection&amp;quot;, vtk.vtkAssignAttribute.CELL_DATA)&lt;br /&gt;
modelNode.GetDisplayNode().SetAndObserveColorNodeID(&amp;quot;vtkMRMLColorTableNodeWarm1&amp;quot;)&lt;br /&gt;
modelNode.GetDisplayNode().SetScalarVisibility(True)&lt;br /&gt;
&lt;br /&gt;
# Initialize cell locator&lt;br /&gt;
cell = vtk.vtkCellLocator()&lt;br /&gt;
cell.SetDataSet(modelNode.GetMesh())&lt;br /&gt;
cell.BuildLocator()&lt;br /&gt;
&lt;br /&gt;
def onPointsModified(observer=None, eventid=None):&lt;br /&gt;
    global markupsNode, selectionArray&lt;br /&gt;
    selectionArray.Fill(0) # set all cells to non-selected by default&lt;br /&gt;
    markupPoints = slicer.util.arrayFromMarkupsControlPoints(markupsNode)&lt;br /&gt;
    closestPoint = [0.0, 0.0, 0.0]&lt;br /&gt;
    cellObj = vtk.vtkGenericCell()&lt;br /&gt;
    cellId = vtk.mutable(0)&lt;br /&gt;
    subId = vtk.mutable(0)&lt;br /&gt;
    dist2 = vtk.mutable(0.0)&lt;br /&gt;
    for markupPoint in markupPoints:&lt;br /&gt;
        cell.FindClosestPoint(markupPoint, closestPoint, cellObj, cellId, subId, dist2)&lt;br /&gt;
        closestCell = cellId.get()&lt;br /&gt;
        if closestCell &amp;gt;=0:&lt;br /&gt;
            selectionArray.SetValue(closestCell, 100) # set selected cell's scalar value to non-zero&lt;br /&gt;
    selectionArray.Modified()&lt;br /&gt;
&lt;br /&gt;
# Initial update&lt;br /&gt;
onPointsModified()&lt;br /&gt;
# Automatic update each time when a markup point is modified&lt;br /&gt;
markupsNodeObserverTag = markupsNode.AddObserver(slicer.vtkMRMLMarkupsFiducialNode.PointModifiedEvent, onPointsModified)&lt;br /&gt;
&lt;br /&gt;
# To stop updating selection, run this:&lt;br /&gt;
# markupsNode.RemoveObserver(markupsNodeObserverTag)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export entire scene as VRML==&lt;br /&gt;
&lt;br /&gt;
Save all surface meshes displayed in the scene (models, markups, etc). Solid colors and coloring by scalar is preserved. Textures are not supported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exporter = vtk.vtkVRMLExporter()&lt;br /&gt;
exporter.SetRenderWindow(slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow())&lt;br /&gt;
exporter.SetFileName('C:/tmp/something.wrl')&lt;br /&gt;
exporter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export model to Blender, including color by scalar==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelNode = getNode(&amp;quot;Model&amp;quot;)&lt;br /&gt;
plyFilePath = &amp;quot;c:/tmp/model.ply&amp;quot;&lt;br /&gt;
&lt;br /&gt;
modelDisplayNode = modelNode.GetDisplayNode()&lt;br /&gt;
triangles = vtk.vtkTriangleFilter()&lt;br /&gt;
triangles.SetInputConnection(modelDisplayNode.GetOutputPolyDataConnection())&lt;br /&gt;
&lt;br /&gt;
plyWriter = vtk.vtkPLYWriter()&lt;br /&gt;
plyWriter.SetInputConnection(triangles.GetOutputPort())&lt;br /&gt;
lut = vtk.vtkLookupTable()&lt;br /&gt;
lut.DeepCopy(modelDisplayNode.GetColorNode().GetLookupTable())&lt;br /&gt;
lut.SetRange(modelDisplayNode.GetScalarRange())&lt;br /&gt;
plyWriter.SetLookupTable(lut)&lt;br /&gt;
plyWriter.SetArrayName(modelDisplayNode.GetActiveScalarName())&lt;br /&gt;
&lt;br /&gt;
plyWriter.SetFileName(plyFilePath)&lt;br /&gt;
plyWriter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export a tract (FiberBundle) to Blender, including color==&lt;br /&gt;
&amp;lt;div id=&amp;quot;Export_a_fiber_tracts_to_Blender.2C_including_color&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
Note: an interactive version of this script is now included in the [http://dmri.slicer.org/ SlicerDMRI extension] ([https://github.com/SlicerDMRI/SlicerDMRI/tree/master/Modules/Scripted/TractographyExportPLY module code]). &lt;br /&gt;
After installing SlicerDMRI, go to ''Modules -&amp;gt; Diffusion -&amp;gt; Import and Export -&amp;gt; Export tractography to PLY (mesh)''.&lt;br /&gt;
&lt;br /&gt;
The example below shows how to export a tractography &amp;quot;FiberBundleNode&amp;quot; to a PLY file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lineDisplayNode = getNode(&amp;quot;*LineDisplay*&amp;quot;)&lt;br /&gt;
plyFilePath = &amp;quot;/tmp/fibers.ply&amp;quot;&lt;br /&gt;
&lt;br /&gt;
tuber = vtk.vtkTubeFilter()&lt;br /&gt;
tuber.SetInputData(lineDisplayNode.GetOutputPolyData())&lt;br /&gt;
tuber.Update()&lt;br /&gt;
tubes = tuber.GetOutputDataObject(0)&lt;br /&gt;
scalars = tubes.GetPointData().GetArray(0)&lt;br /&gt;
scalars.SetName(&amp;quot;scalars&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
triangles = vtk.vtkTriangleFilter()&lt;br /&gt;
triangles.SetInputData(tubes)&lt;br /&gt;
triangles.Update()&lt;br /&gt;
&lt;br /&gt;
colorNode = lineDisplayNode.GetColorNode()&lt;br /&gt;
lookupTable = vtk.vtkLookupTable()&lt;br /&gt;
lookupTable.DeepCopy(colorNode.GetLookupTable())&lt;br /&gt;
lookupTable.SetTableRange(0,1)&lt;br /&gt;
&lt;br /&gt;
plyWriter = vtk.vtkPLYWriter()&lt;br /&gt;
plyWriter.SetInputData(triangles.GetOutput())&lt;br /&gt;
plyWriter.SetLookupTable(lookupTable)&lt;br /&gt;
plyWriter.SetArrayName(&amp;quot;scalars&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plyWriter.SetFileName(plyFilePath)&lt;br /&gt;
plyWriter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Iterate over tract (FiberBundle) streamline points==&lt;br /&gt;
&lt;br /&gt;
This example shows how to access the points in each line of a FiberBundle as a numpy array (view).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from vtk.util.numpy_support import vtk_to_numpy&lt;br /&gt;
&lt;br /&gt;
fb = getNode(&amp;quot;FiberBundle_F&amp;quot;) # &amp;lt;- fill in node ID here&lt;br /&gt;
&lt;br /&gt;
# get point data as 1d array&lt;br /&gt;
points = slicer.util.arrayFromModelPoints(fb)&lt;br /&gt;
&lt;br /&gt;
# get line cell ids as 1d array&lt;br /&gt;
line_ids = vtk_to_numpy(fb.GetPolyData().GetLines().GetData())&lt;br /&gt;
&lt;br /&gt;
# VTK cell ids are stored as&lt;br /&gt;
#   [ N0 c0_id0 ... c0_id0&lt;br /&gt;
#     N1 c1_id0 ... c1_idN1 ]&lt;br /&gt;
# so we need to&lt;br /&gt;
# - read point count for each line (cell)&lt;br /&gt;
# - grab the ids in that range from `line_ids` array defined above&lt;br /&gt;
# - index the `points` array by those ids&lt;br /&gt;
cur_idx = 1&lt;br /&gt;
for _ in range(pd.GetLines().GetNumberOfCells()):&lt;br /&gt;
    # - read point count for this line (cell)&lt;br /&gt;
    count = lines[cur_idx - 1]&lt;br /&gt;
&lt;br /&gt;
    # - grab the ids in that range from `lines`&lt;br /&gt;
    index_array = line_ids[ cur_idx : cur_idx + count]&lt;br /&gt;
    # update to the next range &lt;br /&gt;
    cur_idx += count + 1&lt;br /&gt;
&lt;br /&gt;
    # - index the point array by those ids&lt;br /&gt;
    line_points = points[index_array]&lt;br /&gt;
&lt;br /&gt;
    # do work here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Clone a node==&lt;br /&gt;
&lt;br /&gt;
This example shows how to make a copy of any node that appears in Subject Hierarchy (in Data module).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a node from SampleData that we will clone&lt;br /&gt;
import SampleData&lt;br /&gt;
nodeToClone = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
&lt;br /&gt;
# Clone the node&lt;br /&gt;
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
itemIDToClone = shNode.GetItemByDataNode(nodeToClone)&lt;br /&gt;
clonedItemID = slicer.modules.subjecthierarchy.logic().CloneSubjectHierarchyItem(shNode, itemIDToClone)&lt;br /&gt;
clonedNode = shNode.GetItemDataNode(clonedItemID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Clone a volume==&lt;br /&gt;
This example shows how to clone the MRHead sample volume, including its pixel data and display settings.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourceVolumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
volumesLogic = slicer.modules.volumes.logic()&lt;br /&gt;
clonedVolumeNode = volumesLogic.CloneVolume(slicer.mrmlScene, sourceVolumeNode, 'Cloned volume')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create a new volume==&lt;br /&gt;
This example shows how to create a new empty volume.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nodeName = &amp;quot;MyNewVolume&amp;quot;&lt;br /&gt;
imageSize = [512, 512, 512]&lt;br /&gt;
voxelType=vtk.VTK_UNSIGNED_CHAR&lt;br /&gt;
imageOrigin = [0.0, 0.0, 0.0]&lt;br /&gt;
imageSpacing = [1.0, 1.0, 1.0]&lt;br /&gt;
imageDirections = [[1,0,0], [0,1,0], [0,0,1]]&lt;br /&gt;
fillVoxelValue = 0&lt;br /&gt;
&lt;br /&gt;
# Create an empty image volume, filled with fillVoxelValue&lt;br /&gt;
imageData = vtk.vtkImageData()&lt;br /&gt;
imageData.SetDimensions(imageSize)&lt;br /&gt;
imageData.AllocateScalars(voxelType, 1)&lt;br /&gt;
imageData.GetPointData().GetScalars().Fill(fillVoxelValue)&lt;br /&gt;
# Create volume node&lt;br /&gt;
volumeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;, nodeName)&lt;br /&gt;
volumeNode.SetOrigin(imageOrigin)&lt;br /&gt;
volumeNode.SetSpacing(imageSpacing)&lt;br /&gt;
volumeNode.SetIJKToRASDirections(imageDirections)&lt;br /&gt;
volumeNode.SetAndObserveImageData(imageData)&lt;br /&gt;
volumeNode.CreateDefaultDisplayNodes()&lt;br /&gt;
volumeNode.CreateDefaultStorageNode()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get value of a volume at specific voxel coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get voxel value of &amp;quot;volumeNode&amp;quot; at &amp;quot;ijk&amp;quot; volume voxel coordinates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
ijk = [20,40,30]  # volume voxel coordinates&lt;br /&gt;
&lt;br /&gt;
voxels = slicer.util.arrayFromVolume(volumeNode)  # get voxels as a numpy array&lt;br /&gt;
voxelValue = voxels[ijk[2], ijk[1], ijk[0]]  # note that numpy array index order is kji (not ijk)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modify voxels in a volume==&lt;br /&gt;
&lt;br /&gt;
Typically the fastest and simplest way of modifying voxels is by using numpy operators. Voxels can be retrieved in a numpy array using the `array` method and modified using standard numpy methods. For example, threshold a volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nodeName = 'MRHead'&lt;br /&gt;
thresholdValue = 100&lt;br /&gt;
voxelArray = array(nodeName) # get voxels as numpy array&lt;br /&gt;
voxelArray[voxelArray &amp;lt; thresholdValue] = 0 # modify voxel values&lt;br /&gt;
getNode(nodeName).Modified() # at the end of all processing, notify Slicer that the image modification is completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to change voxels values of the MRHead sample volume.&lt;br /&gt;
The values will be computed by function f(r,a,s,) = (r-10)*(r-10)+(a+15)*(a+15)+s*s.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode=slicer.util.getNode('MRHead')&lt;br /&gt;
ijkToRas = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetIJKToRASMatrix(ijkToRas)&lt;br /&gt;
imageData=volumeNode.GetImageData()&lt;br /&gt;
extent = imageData.GetExtent()&lt;br /&gt;
for k in range(extent[4], extent[5]+1):&lt;br /&gt;
  for j in range(extent[2], extent[3]+1):&lt;br /&gt;
    for i in range(extent[0], extent[1]+1):&lt;br /&gt;
      position_Ijk=[i, j, k, 1]&lt;br /&gt;
      position_Ras=ijkToRas.MultiplyPoint(position_Ijk)&lt;br /&gt;
      r=position_Ras[0]&lt;br /&gt;
      a=position_Ras[1]&lt;br /&gt;
      s=position_Ras[2]      &lt;br /&gt;
      functionValue=(r-10)*(r-10)+(a+15)*(a+15)+s*s&lt;br /&gt;
      imageData.SetScalarComponentFromDouble(i,j,k,0,functionValue)&lt;br /&gt;
imageData.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get volume voxel coordinates from markup fiducial RAS coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get voxel coordinate of a volume corresponding to a markup fiducial point position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Inputs&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
markupsIndex = 0&lt;br /&gt;
&lt;br /&gt;
# Get point coordinate in RAS&lt;br /&gt;
point_Ras = [0, 0, 0, 1]&lt;br /&gt;
markupsNode.GetNthFiducialWorldCoordinates(markupsIndex, point_Ras)&lt;br /&gt;
&lt;br /&gt;
# If volume node is transformed, apply that transform to get volume's RAS coordinates&lt;br /&gt;
transformRasToVolumeRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(None, volumeNode.GetParentTransformNode(), transformRasToVolumeRas)&lt;br /&gt;
point_VolumeRas = transformRasToVolumeRas.TransformPoint(point_Ras[0:3])&lt;br /&gt;
&lt;br /&gt;
# Get voxel coordinates from physical coordinates&lt;br /&gt;
volumeRasToIjk = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetRASToIJKMatrix(volumeRasToIjk)&lt;br /&gt;
point_Ijk = [0, 0, 0, 1]&lt;br /&gt;
volumeRasToIjk.MultiplyPoint(np.append(point_VolumeRas,1.0), point_Ijk)&lt;br /&gt;
point_Ijk = [ int(round(c)) for c in point_Ijk[0:3] ]&lt;br /&gt;
&lt;br /&gt;
# Print output&lt;br /&gt;
print(point_Ijk)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get markup fiducial RAS coordinates from volume voxel coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get position of maximum intensity voxel of a volume (determined by numpy, in IJK coordinates) in RAS coordinates so that it can be marked with a markup fiducial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Inputs&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
&lt;br /&gt;
# Get voxel position in IJK coordinate system&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeArray = slicer.util.arrayFromVolume(volumeNode)&lt;br /&gt;
# Get position of highest voxel value&lt;br /&gt;
point_Kji = np.where(volumeArray == volumeArray.max())&lt;br /&gt;
point_Ijk = [point_Kji[2][0], point_Kji[1][0], point_Kji[0][0]]&lt;br /&gt;
&lt;br /&gt;
# Get physical coordinates from voxel coordinates&lt;br /&gt;
volumeIjkToRas = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetIJKToRASMatrix(volumeIjkToRas)&lt;br /&gt;
point_VolumeRas = [0, 0, 0, 1]&lt;br /&gt;
volumeIjkToRas.MultiplyPoint(np.append(point_Ijk,1.0), point_VolumeRas)&lt;br /&gt;
&lt;br /&gt;
# If volume node is transformed, apply that transform to get volume's RAS coordinates&lt;br /&gt;
transformVolumeRasToRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(volumeNode.GetParentTransformNode(), None, transformVolumeRasToRas)&lt;br /&gt;
point_Ras = transformVolumeRasToRas.TransformPoint(point_VolumeRas[0:3])&lt;br /&gt;
&lt;br /&gt;
# Add a markup at the computed position and print its coordinates&lt;br /&gt;
markupsNode.AddFiducial(point_Ras[0], point_Ras[1], point_Ras[2], &amp;quot;max&amp;quot;)&lt;br /&gt;
print(point_Ras)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get the values of all voxels for a label value==&lt;br /&gt;
&lt;br /&gt;
If you have a background image called ‘Volume’ and a mask called ‘Volume-label’ created with the Editor you could do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
volume = array(‘Volume’)&lt;br /&gt;
label = array(‘Volume-label’)&lt;br /&gt;
points  = numpy.where( label == 1 )  # or use another label number depending on what you segmented&lt;br /&gt;
values  = volume[points] # this will be a list of the label values&lt;br /&gt;
values.mean() # should match the mean value of LabelStatistics calculation as a double-check&lt;br /&gt;
numpy.savetxt(‘values.txt’, values)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Access values in a DTI tensor volume==&lt;br /&gt;
This example shows how to access individual tensors at the voxel level.&lt;br /&gt;
&lt;br /&gt;
First load your DWI volume and estimate tensors to produce a DTI volume called ‘Output DTI Volume’&lt;br /&gt;
&lt;br /&gt;
Then open the python window: View-&amp;gt;Python interactor&lt;br /&gt;
&lt;br /&gt;
Use this command to access tensors through numpy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tensors = array('Output DTI Volume')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Type the following code into the Python window to access all tensor components using vtk commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode=slicer.util.getNode('Output DTI Volume')&lt;br /&gt;
imageData=volumeNode.GetImageData()&lt;br /&gt;
tensors = imageData.GetPointData().GetTensors()&lt;br /&gt;
extent = imageData.GetExtent()&lt;br /&gt;
idx = 0&lt;br /&gt;
for k in range(extent[4], extent[5]+1):&lt;br /&gt;
  for j in range(extent[2], extent[3]+1):&lt;br /&gt;
    for i in range(extent[0], extent[1]+1):&lt;br /&gt;
      tensors.GetTuple9(idx)&lt;br /&gt;
      idx += 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change window/level (brightness/contrast) or colormap of a volume==&lt;br /&gt;
This example shows how to change window/level of the MRHead sample volume.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
displayNode = volumeNode.GetDisplayNode()&lt;br /&gt;
displayNode.AutoWindowLevelOff()&lt;br /&gt;
displayNode.SetWindow(50)&lt;br /&gt;
displayNode.SetLevel(100)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change color mapping from grayscale to rainbow:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
displayNode.SetAndObserveColorNodeID('vtkMRMLColorTableNodeRainbow')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make mouse left-click and drag on the image adjust window/level==&lt;br /&gt;
&lt;br /&gt;
In older Slicer versions, by default, left-click and drag in a slice view adjusted window/level of the displayed image. Window/level adjustment is now a new mouse mode that can be activated by clicking on its toolbar button or running this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.app.applicationLogic().GetInteractionNode().SetCurrentInteractionMode(slicer.vtkMRMLInteractionNode.AdjustWindowLevel)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create custom color table==&lt;br /&gt;
This example shows how to create a new color table, for example with inverted color range from the default Ocean color table.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
invertedocean = slicer.vtkMRMLColorTableNode()&lt;br /&gt;
invertedocean.SetTypeToUser()&lt;br /&gt;
invertedocean.SetNumberOfColors(256)&lt;br /&gt;
invertedocean.SetName(&amp;quot;InvertedOcean&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
for i in range(0,255):&lt;br /&gt;
    invertedocean.SetColor(i, 0.0, 1 - (i+1e-16)/255.0, 1.0, 1.0)&lt;br /&gt;
&lt;br /&gt;
slicer.mrmlScene.AddNode(invertedocean)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Manipulate a Slice View==&lt;br /&gt;
&lt;br /&gt;
===Change slice offset===&lt;br /&gt;
&lt;br /&gt;
Equivalent to moving the slider in slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
red = layoutManager.sliceWidget('Red')&lt;br /&gt;
redLogic = red.sliceLogic()&lt;br /&gt;
# Print current slice offset position&lt;br /&gt;
print(redLogic.GetSliceOffset())&lt;br /&gt;
# Change slice position&lt;br /&gt;
redLogic.SetSliceOffset(20)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change slice orientation===&lt;br /&gt;
&lt;br /&gt;
Get 'Red' slice node and rotate around X and Y axes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.app.layoutManager().sliceWidget('Red').mrmlSliceNode()&lt;br /&gt;
sliceToRas = sliceNode.GetSliceToRAS()&lt;br /&gt;
transform=vtk.vtkTransform()&lt;br /&gt;
transform.SetMatrix(SliceToRAS)&lt;br /&gt;
transform.RotateX(20)&lt;br /&gt;
transform.RotateY(15)&lt;br /&gt;
sliceToRas.DeepCopy(transform.GetMatrix())&lt;br /&gt;
sliceNode.UpdateMatrices()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show slice views in 3D window===&lt;br /&gt;
&lt;br /&gt;
Equivalent to clicking 'eye' icon in the slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  controller = layoutManager.sliceWidget(sliceViewName).sliceController()&lt;br /&gt;
  controller.setSliceVisible(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reset field of view to show background volume maximized===&lt;br /&gt;
&lt;br /&gt;
Equivalent to click small rectangle button (&amp;quot;Adjust the slice viewer's field of view...&amp;quot;) in the slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.resetSliceViews()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rotate slice views to volume plane===&lt;br /&gt;
&lt;br /&gt;
Aligns slice views to volume axes, shows original image acquisition planes in slice views.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  layoutManager.sliceWidget(sliceViewName).mrmlSliceNode().RotateToVolumePlane(volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Iterate over current visible slice views, and set foreground and background images===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=mrVolume, foreground=ctVolume)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internally, this method performs something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
     compositeNode = layoutManager.sliceWidget(sliceViewName).sliceLogic().GetSliceCompositeNode()&lt;br /&gt;
     # setup background volume&lt;br /&gt;
     compositeNode.SetBackgroundVolumeID(mrVolume.GetID())&lt;br /&gt;
     # setup foreground volume&lt;br /&gt;
     compositeNode.SetForegroundVolumeID(ctVolume.GetID())&lt;br /&gt;
     # change opacity&lt;br /&gt;
     compositeNode.SetForegroundOpacity(0.3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a volume in slice views==&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Show volume in all visible views where volume selection propagation is enabled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
applicationLogic = slicer.app.applicationLogic()&lt;br /&gt;
selectionNode = applicationLogic.GetSelectionNode()&lt;br /&gt;
selectionNode.SetSecondaryVolumeID(volumeNode.GetID())&lt;br /&gt;
applicationLogic.PropagateForegroundVolumeSelection(0) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Show volume in selected views:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n =  slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
for color in ['Red', 'Yellow', 'Green']:&lt;br /&gt;
    slicer.app.layoutManager().sliceWidget(color).sliceLogic().GetSliceCompositeNode().SetForegroundVolumeID(n.GetID())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change opacity of foreground volume in slice views==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.setSliceViewerLayers(foregroundOpacity=0.4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Change opacity in a selected view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
sliceLogic = lm.sliceWidget('Red').sliceLogic()&lt;br /&gt;
compositeNode = sliceLogic.GetSliceCompositeNode()&lt;br /&gt;
compositeNode.SetForegroundOpacity(0.4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fit slice plane to markup fiducials==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID(&amp;quot;vtkMRMLSliceNodeRed&amp;quot;)&lt;br /&gt;
markupsNode = slicer.mrmlScene.GetFirstNodeByName(&amp;quot;F&amp;quot;)&lt;br /&gt;
# Get markup point positions as numpy arrays&lt;br /&gt;
import numpy as np&lt;br /&gt;
p1 = np.array([0,0,0])&lt;br /&gt;
p2 = np.array([0,0,0])&lt;br /&gt;
p3 = np.array([0,0,0])&lt;br /&gt;
markupsNode.GetNthFiducialPosition(0, p1)&lt;br /&gt;
markupsNode.GetNthFiducialPosition(1, p2)&lt;br /&gt;
markupsNode.GetNthFiducialPosition(2, p3)&lt;br /&gt;
# Get plane axis directions&lt;br /&gt;
n = np.cross(p2-p1, p2-p3) # plane normal direction&lt;br /&gt;
n = n/np.linalg.norm(n)&lt;br /&gt;
t = np.cross([0, 0, 1], n) # plane transverse direction&lt;br /&gt;
t = t/np.linalg.norm(t)&lt;br /&gt;
# Set slice plane orientation and position&lt;br /&gt;
sliceNode.SetSliceToRASByNTP(n[0], n[1], n[2], t[0], t[1], t[2], p1[0], p1[1], p1[2], 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save a series of images from a Slice View==&lt;br /&gt;
&lt;br /&gt;
You can use ScreenCapture module to capture series of images. To do it programmatically, save the following into a file such as '/tmp/record.py' and then in the slicer python console type &amp;quot;execfile('/tmp/record.py')&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = 'Green'&lt;br /&gt;
imagePathPattern = '/tmp/image-%03d.png'&lt;br /&gt;
steps = 10&lt;br /&gt;
&lt;br /&gt;
widget = slicer.app.layoutManager().sliceWidget(layoutName)&lt;br /&gt;
view = widget.sliceView()&lt;br /&gt;
logic = widget.sliceLogic()&lt;br /&gt;
bounds = [0,]*6&lt;br /&gt;
logic.GetSliceBounds(bounds)&lt;br /&gt;
&lt;br /&gt;
for step in range(steps):&lt;br /&gt;
    offset = bounds[4] + step/(1.*steps) * (bounds[5]-bounds[4])&lt;br /&gt;
    logic.SetSliceOffset(offset)&lt;br /&gt;
    view.forceRender()&lt;br /&gt;
    image = qt.QPixmap.grabWidget(view).toImage()&lt;br /&gt;
    image.save(imagePathPattern % step)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save the scene into a new directory==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Create a new directory where the scene will be saved into&lt;br /&gt;
import time&lt;br /&gt;
sceneSaveDirectory = slicer.app.temporaryPath + &amp;quot;/saved-scene-&amp;quot; + time.strftime(&amp;quot;%Y%m%d-%H%M%S&amp;quot;)&lt;br /&gt;
if not os.access(sceneSaveDirectory, os.F_OK):&lt;br /&gt;
  os.makedirs(sceneSaveDirectory)&lt;br /&gt;
&lt;br /&gt;
# Save the scene&lt;br /&gt;
if slicer.app.applicationLogic().SaveSceneToSlicerDataBundleDirectory(sceneSaveDirectory, None):&lt;br /&gt;
  logging.info(&amp;quot;Scene saved to: {0}&amp;quot;.format(sceneSaveDirectory))&lt;br /&gt;
else:&lt;br /&gt;
  logging.error(&amp;quot;Scene saving failed&amp;quot;) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save the scene into a single MRB file==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Generate file name&lt;br /&gt;
import time&lt;br /&gt;
sceneSaveFilename = slicer.app.temporaryPath + &amp;quot;/saved-scene-&amp;quot; + time.strftime(&amp;quot;%Y%m%d-%H%M%S&amp;quot;) + &amp;quot;.mrb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Save scene&lt;br /&gt;
if slicer.util.saveScene(sceneSaveFilename):&lt;br /&gt;
  logging.info(&amp;quot;Scene saved to: {0}&amp;quot;.format(sceneSaveFilename))&lt;br /&gt;
else:&lt;br /&gt;
  logging.error(&amp;quot;Scene saving failed&amp;quot;) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save a node to file==&lt;br /&gt;
&lt;br /&gt;
Save a transform node to file (should work with any other node type, if file extension is set to a supported one):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myNode = getNode(&amp;quot;LinearTransform_3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
myStorageNode = myNode.CreateDefaultStorageNode()&lt;br /&gt;
myStorageNode.SetFileName(&amp;quot;c:/tmp/something.tfm&amp;quot;)&lt;br /&gt;
myStorageNode.WriteData(myNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Center the 3D View on the Scene==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
threeDWidget = layoutManager.threeDWidget(0)&lt;br /&gt;
threeDView = threeDWidget.threeDView()&lt;br /&gt;
threeDView.resetFocalPoint()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rotate the 3D View==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
threeDWidget = layoutManager.threeDWidget(0)&lt;br /&gt;
threeDView = threeDWidget.threeDView()&lt;br /&gt;
threeDView.yaw()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Display text in a 3D view or slice view==&lt;br /&gt;
&lt;br /&gt;
The easiest way to show information overlaid on a viewer is to use corner annotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
view=slicer.app.layoutManager().threeDWidget(0).threeDView()&lt;br /&gt;
# Set text to &amp;quot;Something&amp;quot;&lt;br /&gt;
view.cornerAnnotation().SetText(vtk.vtkCornerAnnotation.UpperRight,&amp;quot;Something&amp;quot;)&lt;br /&gt;
# Set color to red&lt;br /&gt;
view.cornerAnnotation().GetTextProperty().SetColor(1,0,0)&lt;br /&gt;
# Update the view&lt;br /&gt;
view.forceRender()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide slice view annotations (DataProbe)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Disable slice annotations immediately&lt;br /&gt;
slicer.modules.DataProbeInstance.infoWidget.sliceAnnotations.sliceViewAnnotationsEnabled=False&lt;br /&gt;
slicer.modules.DataProbeInstance.infoWidget.sliceAnnotations.updateSliceViewFromGUI()&lt;br /&gt;
# Disable slice annotations persistently (after Slicer restarts)&lt;br /&gt;
settings = qt.QSettings()&lt;br /&gt;
settings.setValue('DataProbe/sliceViewAnnotations.enabled', 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Turning off interpolation==&lt;br /&gt;
&lt;br /&gt;
You can turn off interpolation for newly loaded volumes with this script from Steve Pieper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def NoInterpolate(caller,event):&lt;br /&gt;
  for node in slicer.util.getNodes('*').values():&lt;br /&gt;
    if node.IsA('vtkMRMLScalarVolumeDisplayNode'):&lt;br /&gt;
      node.SetInterpolate(0)&lt;br /&gt;
	&lt;br /&gt;
slicer.mrmlScene.AddObserver(slicer.mrmlScene.NodeAddedEvent, NoInterpolate)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below link explains how to put this in your startup script.&lt;br /&gt;
&lt;br /&gt;
http://www.na-mic.org/Wiki/index.php/AHM2012-Slicer-Python#Refining_the_code_and_UI_with_slicerrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Customize viewer layout==&lt;br /&gt;
&lt;br /&gt;
Show a custom layout of a 3D view on top of the red slice view:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
customLayout = &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;layout type=&amp;quot;vertical&amp;quot; split=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;&lt;br /&gt;
   &amp;lt;view class=&amp;quot;vtkMRMLViewNode&amp;quot; singletontag=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;viewlabel&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;1&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;/view&amp;gt;&lt;br /&gt;
  &amp;lt;/item&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;&lt;br /&gt;
   &amp;lt;view class=&amp;quot;vtkMRMLSliceNode&amp;quot; singletontag=&amp;quot;Red&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;orientation&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;Axial&amp;lt;/property&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;viewlabel&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;R&amp;lt;/property&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;viewcolor&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;#F34A33&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;/view&amp;gt;&lt;br /&gt;
  &amp;lt;/item&amp;gt;&lt;br /&gt;
&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Built-in layout IDs are all below 100, so you can choose any large random number&lt;br /&gt;
# for your custom layout ID.&lt;br /&gt;
customLayoutId=501&lt;br /&gt;
&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
layoutManager.layoutLogic().GetLayoutNode().AddLayoutDescription(customLayoutId, customLayout)                                         &lt;br /&gt;
&lt;br /&gt;
# Switch to the new custom layout &lt;br /&gt;
layoutManager.setLayout(customLayoutId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See description of standard layouts (that can be used as examples) here:&lt;br /&gt;
https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Logic/vtkMRMLLayoutLogic.cxx&lt;br /&gt;
&lt;br /&gt;
You can use this code snippet to add a button to the layout selector toolbar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add button to layout selector toolbar for this custom layout&lt;br /&gt;
viewToolBar = mainWindow().findChild('QToolBar', 'ViewToolBar')&lt;br /&gt;
layoutMenu = viewToolBar.widgetForAction(viewToolBar.actions()[0]).menu()&lt;br /&gt;
layoutSwitchActionParent = layoutMenu  # use `layoutMenu` to add inside layout list, use `viewToolBar` to add next the standard layout list&lt;br /&gt;
layoutSwitchAction = layoutSwitchActionParent.addAction(&amp;quot;My view&amp;quot;) # add inside layout list&lt;br /&gt;
layoutSwitchAction.setData(layoutId)&lt;br /&gt;
layoutSwitchAction.setIcon(qt.QIcon(':Icons/Go.png'))&lt;br /&gt;
layoutSwitchAction.setToolTip('3D and slice view')&lt;br /&gt;
layoutSwitchAction.connect('triggered()', lambda layoutId = customLayoutId: slicer.app.layoutManager().setLayout(layoutId))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Customize keyboard shortcuts==&lt;br /&gt;
&lt;br /&gt;
Keyboard shortcuts can be specified for activating any Slicer feature by adding a couple of lines to your &lt;br /&gt;
[[Documentation/{{documentation/version}}/Developers/Python_scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F|.slicerrc file]].&lt;br /&gt;
&lt;br /&gt;
For example, this script registers ''Ctrl+b'', ''Ctrl+n'', ''Ctrl+m'', ''Ctrl+,'' keyboard shortcuts to switch between red, yellow, green, and 4-up view layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
shortcuts = [&lt;br /&gt;
    ('Ctrl+b', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpRedSliceView)),&lt;br /&gt;
    ('Ctrl+n', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpYellowSliceView)),&lt;br /&gt;
    ('Ctrl+m', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpGreenSliceView)),&lt;br /&gt;
    ('Ctrl+,', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView))&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
for (shortcutKey, callback) in shortcuts:&lt;br /&gt;
    shortcut = qt.QShortcut(slicer.util.mainWindow())&lt;br /&gt;
    shortcut.setKey(qt.QKeySequence(shortcutKey))&lt;br /&gt;
    shortcut.connect( 'activated()', callback)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disable certain user interactions in slice views==&lt;br /&gt;
&lt;br /&gt;
For example, disable slice browsing using mouse wheel and keyboard shortcuts in the red slice viewer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interactorStyle = slicer.app.layoutManager().sliceWidget('Red').sliceView().sliceViewInteractorStyle()&lt;br /&gt;
interactorStyle.SetActionEnabled(interactorStyle.BrowseSlice, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hide all slice view controllers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in lm.sliceViewNames():&lt;br /&gt;
  lm.sliceWidget(sliceViewName).sliceController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hide all 3D view controllers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for viewIndex in range(slicer.app.layoutManager().threeDViewCount):&lt;br /&gt;
  lm.threeDWidget(0).threeDController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change default slice view orientation==&lt;br /&gt;
&lt;br /&gt;
You can left-right &amp;quot;flip&amp;quot; slice view orientation presets (show patient left side on left/right side of the screen) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Axial slice axes:&lt;br /&gt;
#  1 0 0&lt;br /&gt;
#  0 1 0&lt;br /&gt;
#  0 0 1&lt;br /&gt;
axialSliceToRas=vtk.vtkMatrix3x3()&lt;br /&gt;
&lt;br /&gt;
# Coronal slice axes:&lt;br /&gt;
#  1 0 0 &lt;br /&gt;
#  0 0 -1&lt;br /&gt;
#  0 1 0&lt;br /&gt;
coronalSliceToRas=vtk.vtkMatrix3x3()&lt;br /&gt;
coronalSliceToRas.SetElement(1,1, 0)&lt;br /&gt;
coronalSliceToRas.SetElement(1,2, -1)&lt;br /&gt;
coronalSliceToRas.SetElement(2,1, 1)&lt;br /&gt;
coronalSliceToRas.SetElement(2,2, 0)&lt;br /&gt;
&lt;br /&gt;
# Replace orientation presets in all existing slice nodes and in the default slice node&lt;br /&gt;
sliceNodes = slicer.util.getNodesByClass('vtkMRMLSliceNode')&lt;br /&gt;
sliceNodes.append(slicer.mrmlScene.GetDefaultNodeByClass('vtkMRMLSliceNode'))&lt;br /&gt;
for sliceNode in sliceNodes:&lt;br /&gt;
  orientationPresetName = sliceNode.GetOrientation()&lt;br /&gt;
  sliceNode.RemoveSliceOrientationPreset(&amp;quot;Axial&amp;quot;)&lt;br /&gt;
  sliceNode.AddSliceOrientationPreset(&amp;quot;Axial&amp;quot;, axialSliceToRas)&lt;br /&gt;
  sliceNode.RemoveSliceOrientationPreset(&amp;quot;Coronal&amp;quot;)&lt;br /&gt;
  sliceNode.AddSliceOrientationPreset(&amp;quot;Coronal&amp;quot;, coronalSliceToRas)&lt;br /&gt;
  sliceNode.SetOrientation(orientationPresetName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set all slice views linked by default==&lt;br /&gt;
&lt;br /&gt;
You can make slice views linked by default (when application starts or the scene is cleared) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set linked slice views  in all existing slice composite nodes and in the default node&lt;br /&gt;
sliceCompositeNodes = slicer.util.getNodesByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
defaultSliceCompositeNode = slicer.mrmlScene.GetDefaultNodeByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
if not defaultSliceCompositeNode:&lt;br /&gt;
  defaultSliceCompositeNode = slicer.mrmlScene.CreateNodeByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
  slicer.mrmlScene.AddDefaultNode(defaultSliceCompositeNode)&lt;br /&gt;
sliceCompositeNodes.append(defaultSliceCompositeNode)&lt;br /&gt;
for sliceCompositeNode in sliceCompositeNodes:&lt;br /&gt;
  sliceCompositeNode.SetLinkedControl(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set crosshair jump mode to centered by default==&lt;br /&gt;
&lt;br /&gt;
You can change default slice jump mode (when application starts or the scene is cleared) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crosshair=slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLCrosshairNode&amp;quot;)&lt;br /&gt;
crosshair.SetCrosshairBehavior(crosshair.CenteredJumpSlice)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set up custom units in slice view ruler==&lt;br /&gt;
&lt;br /&gt;
For microscopy or micro-CT images you may want to switch unit to micrometer instead of the default mm. To do that, 1. change the unit in Application settings / Units and 2. update ruler display settings using the script below (it can be copied to your Application startup script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in lm.sliceViewNames():&lt;br /&gt;
  sliceView = lm.sliceWidget(sliceViewName).sliceView()&lt;br /&gt;
  displayableManagerCollection = vtk.vtkCollection()&lt;br /&gt;
  sliceView.getDisplayableManagers(displayableManagerCollection)&lt;br /&gt;
  for dmIndex in range(displayableManagerCollection.GetNumberOfItems()):&lt;br /&gt;
    displayableManager = displayableManagerCollection.GetItemAsObject(dmIndex)&lt;br /&gt;
    if not displayableManager.IsA(&amp;quot;vtkMRMLRulerDisplayableManager&amp;quot;):&lt;br /&gt;
      continue&lt;br /&gt;
    displayableManager.RemoveAllRulerScalePresets()&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.001, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.010, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.100, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.500, 5, 1, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   1.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   5.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(  10.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(  50.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset( 100.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset( 500.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(1000.0,   5, 2, &amp;quot;mm&amp;quot;,    0.001)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a slice view outside the view layout==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = &amp;quot;TestSlice&amp;quot;&lt;br /&gt;
layoutLabel = &amp;quot;TS&amp;quot;&lt;br /&gt;
# ownerNode manages this view instead of the layout manager (it can be any node in the scene)&lt;br /&gt;
viewOwnerNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScriptedModuleNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create MRML nodes&lt;br /&gt;
viewNode = slicer.vtkMRMLSliceNode()&lt;br /&gt;
viewNode.SetName(layoutName)&lt;br /&gt;
viewNode.SetLayoutName(layoutName)&lt;br /&gt;
viewNode.SetLayoutLabel(layoutLabel)&lt;br /&gt;
viewNode.SetLayoutColor(1, 1, 0)&lt;br /&gt;
viewNode.SetAndObserveParentLayoutNodeID(viewOwnerNode.GetID())&lt;br /&gt;
viewNode = slicer.mrmlScene.AddNode(viewNode)&lt;br /&gt;
sliceCompositeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLSliceCompositeNode&amp;quot;)&lt;br /&gt;
sliceCompositeNode.SetLayoutName(layoutName)&lt;br /&gt;
&lt;br /&gt;
# Create widget&lt;br /&gt;
viewWidget = slicer.qMRMLSliceWidget()&lt;br /&gt;
viewWidget.sliceViewName = layoutName&lt;br /&gt;
viewWidget.sliceViewLabel = layoutLabel&lt;br /&gt;
c = viewNode.GetLayoutColor()&lt;br /&gt;
viewWidget.sliceViewColor = qt.QColor.fromRgbF(c[0],c[1],c[2])&lt;br /&gt;
viewWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
viewWidget.setMRMLSliceNode(viewNode)&lt;br /&gt;
viewWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a 3D view outside the view layout==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = &amp;quot;Test3DView&amp;quot;&lt;br /&gt;
layoutLabel = &amp;quot;T3&amp;quot;&lt;br /&gt;
# ownerNode manages this view instead of the layout manager (it can be any node in the scene)&lt;br /&gt;
viewOwnerNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScriptedModuleNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create MRML node&lt;br /&gt;
viewNode = slicer.vtkMRMLViewNode()&lt;br /&gt;
viewNode.SetName(layoutName)&lt;br /&gt;
viewNode.SetLayoutName(layoutName)&lt;br /&gt;
viewNode.SetLayoutLabel(layoutLabel)&lt;br /&gt;
viewNode.SetLayoutColor(1, 1, 0)&lt;br /&gt;
viewNode.SetAndObserveParentLayoutNodeID(viewOwnerNode.GetID())&lt;br /&gt;
viewNode = slicer.mrmlScene.AddNode(viewNode)&lt;br /&gt;
&lt;br /&gt;
# Create widget&lt;br /&gt;
viewWidget = slicer.qMRMLThreeDWidget()&lt;br /&gt;
viewWidget.viewLabel = layoutLabel&lt;br /&gt;
viewWidget.viewColor = qt.QColor.fromRgbF(c[0],c[1],c[2])&lt;br /&gt;
viewWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
viewWidget.setMRMLViewNode(viewNode)&lt;br /&gt;
viewWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get displayable manager of a certain type for a certain view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelDisplayableManager = None&lt;br /&gt;
threeDViewWidget = slicer.app.layoutManager().threeDWidget(0)&lt;br /&gt;
managers = vtk.vtkCollection()&lt;br /&gt;
threeDViewWidget.getDisplayableManagers(managers)&lt;br /&gt;
for i in range(managers.GetNumberOfItems()):&lt;br /&gt;
  obj = managers.GetItemAsObject(i)&lt;br /&gt;
  if obj.IsA('vtkMRMLModelDisplayableManager'):&lt;br /&gt;
    modelDisplayableManager = obj&lt;br /&gt;
    break&lt;br /&gt;
if modelDisplayableManager is None:&lt;br /&gt;
  logging.error('Failed to find the model displayable manager')&lt;br /&gt;
  return&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running an ITK filter in Python using SimpleITK==&lt;br /&gt;
Open the &amp;quot;Sample Data&amp;quot; module and download &amp;quot;MR Head&amp;quot;, then paste the following snippet in Python interactor:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import SampleData&lt;br /&gt;
import SimpleITK as sitk&lt;br /&gt;
import sitkUtils&lt;br /&gt;
&lt;br /&gt;
# Get input volume node&lt;br /&gt;
inputVolumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
# Create new volume node for output&lt;br /&gt;
outputVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLScalarVolumeNode', 'MRHeadFiltered')&lt;br /&gt;
&lt;br /&gt;
# Run processing&lt;br /&gt;
inputImage = sitkUtils.PullVolumeFromSlicer(inputVolumeNode)&lt;br /&gt;
filter = sitk.SignedMaurerDistanceMapImageFilter()&lt;br /&gt;
outputImage = filter.Execute(inputImage)&lt;br /&gt;
sitkUtils.PushVolumeToSlicer(outputImage, outputVolumeNode)&lt;br /&gt;
&lt;br /&gt;
# Show processing result&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=outputVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
*See the SimpleITK documentation for SimpleITK examples: http://www.itk.org/SimpleITKDoxygen/html/examples.html&lt;br /&gt;
*sitkUtils in Slicer is used for pushing and pulling images from Slicer to SimpleITK: https://github.com/Slicer/Slicer/blob/master/Base/Python/sitkUtils.py&lt;br /&gt;
&lt;br /&gt;
==Get current mouse coordinates in a slice view==&lt;br /&gt;
&lt;br /&gt;
You can get 3D (RAS) coordinates of the current mouse cursor from the crosshair singleton node as shown in the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onMouseMoved(observer,eventid):  &lt;br /&gt;
  ras=[0,0,0]&lt;br /&gt;
  crosshairNode.GetCursorPositionRAS(ras)&lt;br /&gt;
  print(ras)&lt;br /&gt;
&lt;br /&gt;
crosshairNode=slicer.util.getNode('Crosshair') &lt;br /&gt;
crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, onMouseMoved)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get DataProbe text==&lt;br /&gt;
&lt;br /&gt;
You can get the mouse location in pixel coordinates along with the pixel value at the mouse by hitting the '.' (period) key in a slice view after pasting in the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def printDataProbe():&lt;br /&gt;
  infoWidget = slicer.modules.DataProbeInstance.infoWidget&lt;br /&gt;
  for layer in ('B', 'F', 'L'):&lt;br /&gt;
    print(infoWidget.layerNames[layer].text, infoWidget.layerIJKs[layer].text, infoWidget.layerValues[layer].text)&lt;br /&gt;
&lt;br /&gt;
s = qt.QShortcut(qt.QKeySequence('.'), mainWindow())&lt;br /&gt;
s.connect('activated()', printDataProbe)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get reformatted image from a slice viewer as numpy array==&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show thick slab reconstructed from 3 slices:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNodeID = 'vtkMRMLSliceNodeRed'&lt;br /&gt;
&lt;br /&gt;
# Get image data from slice view&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID(sliceNodeID)&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslicedImage = vtk.vtkImageData()&lt;br /&gt;
reslicedImage.DeepCopy(reslice.GetOutput())&lt;br /&gt;
&lt;br /&gt;
# Create new volume node using resliced image&lt;br /&gt;
volumeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;)&lt;br /&gt;
volumeNode.SetIJKToRASMatrix(sliceNode.GetXYToRAS())&lt;br /&gt;
volumeNode.SetAndObserveImageData(reslicedImage)&lt;br /&gt;
volumeNode.CreateDefaultDisplayNodes()&lt;br /&gt;
volumeNode.CreateDefaultStorageNode()&lt;br /&gt;
&lt;br /&gt;
# Get voxels as a numpy array&lt;br /&gt;
voxels = slicer.util.arrayFromVolume(volumeNode)&lt;br /&gt;
print voxels.shape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combine multiple volumes into one==&lt;br /&gt;
&lt;br /&gt;
This example combines two volumes into a new one by subtracting one from the other.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import SampleData&lt;br /&gt;
[input1Volume, input2Volume] = SampleData.SampleDataLogic().downloadDentalSurgery()&lt;br /&gt;
&lt;br /&gt;
import slicer.util&lt;br /&gt;
a = slicer.util.arrayFromVolume(input1Volume)&lt;br /&gt;
b = slicer.util.arrayFromVolume(input2Volume)&lt;br /&gt;
&lt;br /&gt;
# 'a' and 'b' are numpy arrays,&lt;br /&gt;
# they can be combined using any numpy array operations&lt;br /&gt;
# to produce the result array 'c'&lt;br /&gt;
c = b-a&lt;br /&gt;
&lt;br /&gt;
volumeNode = slicer.modules.volumes.logic().CloneVolume(input1Volume, &amp;quot;Difference&amp;quot;)&lt;br /&gt;
slicer.util.updateVolumeFromArray(volumeNode, c)&lt;br /&gt;
setSliceViewerLayers(background=volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Thick slab reconstruction and maximum/minimum intensity volume projections==&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show thick slab reconstructed from 3 slices:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslice.SetSlabModeToMean()&lt;br /&gt;
reslice.SetSlabNumberOfSlices(10) # mean of 10 slices will computed&lt;br /&gt;
reslice.SetSlabSliceSpacingFraction(0.3) # spacing between each slice is 0.3 pixel (total 10 * 0.3 = 3 pixel neighborhood)&lt;br /&gt;
sliceNode.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show maximum intensity projection (MIP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslice.SetSlabModeToMax()&lt;br /&gt;
reslice.SetSlabNumberOfSlices(600) # use a large number of slices (600) to cover the entire volume&lt;br /&gt;
reslice.SetSlabSliceSpacingFraction(0.5) # spacing between slices are 0.5 pixel (supersampling is useful to reduce interpolation artifacts)&lt;br /&gt;
sliceNode.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The projected image is available in a ''vtkImageData'' object by calling ''reslice.GetOutput()''.&lt;br /&gt;
&lt;br /&gt;
==Change default file type for nodes (that have never been saved yet)==&lt;br /&gt;
Default node can be specified that will be used as a basis of all new storage nodes. This can be used for setting default file extension. For example, change file format to STL for model nodes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
defaultModelStorageNode = slicer.vtkMRMLModelStorageNode()&lt;br /&gt;
defaultModelStorageNode.SetDefaultWriteFileExtension('stl')&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultModelStorageNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To permanently change default file extension on your computer, copy-paste the code above into your application startup script (you can find its location in menu: Edit / Application settings / General / Application startup script).&lt;br /&gt;
&lt;br /&gt;
==Change file type for saving for all volumes (with already existing storage nodes)==&lt;br /&gt;
&lt;br /&gt;
If it is not necessary to preserve file paths then the simplest is to configure default storage node (as shown in the example above), then delete all existing storage nodes. When save dialog is opened, default storage nodes will be recreated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Delete existing model storage nodes so that they will be recreated with default settings&lt;br /&gt;
existingModelStorageNodes = slicer.util.getNodesByClass('vtkMRMLModelStorageNode')&lt;br /&gt;
for modelStorageNode in existingModelStorageNodes:&lt;br /&gt;
  slicer.mrmlScene.RemoveNode(modelStorageNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To update existing storage nodes to use new file extension (but keep all other parameters unchanged) you can use this approach (example is for volume storage):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
requiredFileExtension = '.nia'&lt;br /&gt;
originalFileExtension = '.nrrd'&lt;br /&gt;
volumeNodes = slicer.util.getNodesByClass('vtkMRMLScalarVolumeNode')&lt;br /&gt;
for volumeNode in volumeNodes:&lt;br /&gt;
  volumeStorageNode = volumeNode.GetStorageNode()&lt;br /&gt;
  if not volumeStorageNode:&lt;br /&gt;
    volumeNode.AddDefaultStorageNode()&lt;br /&gt;
    volumeStorageNode = volumeNode.GetStorageNode()&lt;br /&gt;
    volumeStorageNode.SetFileName(volumeNode.GetName()+requiredFileExtension)&lt;br /&gt;
  else:&lt;br /&gt;
    volumeStorageNode.SetFileName(volumeStorageNode.GetFileName().replace(originalFileExtension, requiredFileExtension))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To set all volume nodes to save uncompressed by default (add this to .slicerrc.py so it takes effect for the whole session):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#set the default volume storage to not compress by default&lt;br /&gt;
defaultVolumeStorageNode = slicer.vtkMRMLVolumeArchetypeStorageNode()&lt;br /&gt;
defaultVolumeStorageNode.SetUseCompression(0)&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)&lt;br /&gt;
logging.info(&amp;quot;Volume nodes will be stored uncompressed by default&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same thing as above, but applied to all  segmentations instead of volumes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#set the default volume storage to not compress by default&lt;br /&gt;
defaultVolumeStorageNode = slicer.vtkMRMLSegmentationStorageNode()&lt;br /&gt;
defaultVolumeStorageNode.SetUseCompression(0)&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)&lt;br /&gt;
logging.info(&amp;quot;Segmentation nodes will be stored uncompressed &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sequences==&lt;br /&gt;
&lt;br /&gt;
===Concatenate all sequences in the scene into a new sequence===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get all sequence nodes in the scene&lt;br /&gt;
sequenceNodes = slicer.util.getNodesByClass('vtkMRMLSequenceNode')&lt;br /&gt;
mergedSequenceNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSequenceNode', 'Merged sequence')&lt;br /&gt;
&lt;br /&gt;
# Merge all sequence nodes into a new sequence node&lt;br /&gt;
mergedIndexValue = 0&lt;br /&gt;
for sequenceNode in sequenceNodes:&lt;br /&gt;
    for itemIndex in range(sequenceNode.GetNumberOfDataNodes()):&lt;br /&gt;
        dataNode = sequenceNode.GetNthDataNode(itemIndex)&lt;br /&gt;
        mergedSequenceNode.SetDataNodeAtValue(dataNode, str(mergedIndexValue))&lt;br /&gt;
        mergedIndexValue += 1&lt;br /&gt;
    # Delete the sequence node we copied the data from, to prevent sharing of the same&lt;br /&gt;
    # node by multiple sequences&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(sequenceNode)&lt;br /&gt;
&lt;br /&gt;
# Create a sequence browser node for the new merged sequence&lt;br /&gt;
mergedSequenceBrowserNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSequenceBrowserNode', 'Merged')&lt;br /&gt;
mergedSequenceBrowserNode.AddSynchronizedSequenceNode(mergedSequenceNode)&lt;br /&gt;
slicer.modules.sequencebrowser.setToolBarActiveBrowserNode(mergedSequenceBrowserNode)&lt;br /&gt;
# Show proxy node in slice viewers&lt;br /&gt;
mergedProxyNode = mergedSequenceBrowserNode.GetProxyNode(mergedSequenceNode)&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=mergedProxyNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Segmentations==&lt;br /&gt;
&lt;br /&gt;
===Create a segmentation from a labelmap volume and display in 3D===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmapVolumeNode = getNode('label')&lt;br /&gt;
seg = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSegmentationNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(labelmapVolumeNode, seg)&lt;br /&gt;
seg.CreateClosedSurfaceRepresentation()&lt;br /&gt;
slicer.mrmlScene.RemoveNode(labelmapVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line is optional. It removes the original labelmap volume so that the same information is not shown twice.&lt;br /&gt;
&lt;br /&gt;
===Export labelmap node from segmentation node===&lt;br /&gt;
&lt;br /&gt;
Export smallest possible labelmap:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportAllSegmentsToLabelmapNode(seg, labelmapVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Export labelmap that matches geometry of a chosen reference volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportVisibleSegmentsToLabelmapNode(segmentationNode, labelmapVolumeNode, referenceVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Export by pressing Ctrl+Shift+s key:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
outputPath = &amp;quot;c:/tmp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
def exportLabelmap():&lt;br /&gt;
    segmentationNode = slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLSegmentationNode&amp;quot;)&lt;br /&gt;
    referenceVolumeNode = slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;)&lt;br /&gt;
    labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
    slicer.modules.segmentations.logic().ExportVisibleSegmentsToLabelmapNode(segmentationNode, labelmapVolumeNode, referenceVolumeNode)&lt;br /&gt;
    filepath = outputPath + &amp;quot;/&amp;quot; + referenceVolumeNode.GetName()+&amp;quot;-label.nrrd&amp;quot;&lt;br /&gt;
    slicer.util.saveNode(labelmapVolumeNode, filepath)&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(labelmapVolumeNode.GetDisplayNode().GetColorNode())&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(labelmapVolumeNode)&lt;br /&gt;
    slicer.util.delayDisplay(&amp;quot;Segmentation saved to &amp;quot;+filepath)&lt;br /&gt;
&lt;br /&gt;
shortcut = qt.QShortcut(slicer.util.mainWindow())&lt;br /&gt;
shortcut.setKey(qt.QKeySequence('Ctrl+Shift+s'))&lt;br /&gt;
shortcut.connect( 'activated()', exportLabelmap)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Export model nodes from segmentation node===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
exportedModelsNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLModelHierarchyNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportAllSegmentsToModelHierarchy(seg, exportedModelsNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show a segmentation in 3D===&lt;br /&gt;
Segmentation can only be shown in 3D if closed surface representation (or other 3D-displayable representation) is available. To create closed surface representation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentation.CreateClosedSurfaceRepresentation()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Get a representation of a segment===&lt;br /&gt;
Access binary labelmap stored in a segmentation node (without exporting it to a volume node) - if it does not exist, it will return None:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
image = segmentationNode.GetBinaryLabelmapRepresentation(segmentID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Get closed surface, if it does not exist, it will return None:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
polydata = segmentationNode.GetClosedSurfaceRepresentation(segmentID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Get binary labelmap representation. If it does not exist then it will be created for that single segment. Applies parent transforms by default (if not desired, another argument needs to be added to the end: false):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
outputOrientedImageData = vtkSegmentationCore.vtkOrientedImageData()&lt;br /&gt;
slicer.vtkSlicerSegmentationsModuleLogic.GetSegmentBinaryLabelmapRepresentation(segmentationNode, segmentID, outputOrientedImageData)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Same as above, for closed surface representation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
outputPolyData = vtk.vtkPolyData()&lt;br /&gt;
slicer.vtkSlicerSegmentationsModuleLogic.GetSegmentClosedSurfaceRepresentation(segmentationNode, segmentID, outputPolyData)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Convert all segments using default path and conversion parameters===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentationNode.CreateBinaryLabelmapRepresentation()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Convert all segments using custom path or conversion parameters===&lt;br /&gt;
Change reference image geometry parameter based on an existing referenceImageData image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
referenceGeometry = vtkSegmentationCore.vtkSegmentationConverter.SerializeImageGeometry(referenceImageData)&lt;br /&gt;
segmentation.SetConversionParameter(vtkSegmentationCore.vtkSegmentationConverter.GetReferenceImageGeometryParameterName(), referenceGeometry)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Re-convert using a modified conversion parameter===&lt;br /&gt;
Changing smoothing factor for closed surface generation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
segmentation = getNode('Segmentation').GetSegmentation()&lt;br /&gt;
&lt;br /&gt;
# Turn of surface smoothing&lt;br /&gt;
segmentation.SetConversionParameter('Smoothing factor','0.0')&lt;br /&gt;
&lt;br /&gt;
# Recreate representation using modified parameters (and default conversion path)&lt;br /&gt;
segmentation.RemoveRepresentation(vtkSegmentationCore.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())&lt;br /&gt;
segmentation.CreateRepresentation(vtkSegmentationCore.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Get centroid of a segment in world (RAS) coordinates===&lt;br /&gt;
&lt;br /&gt;
This example shows how to get centroid of a segment in world coordinates and show that position in all slice views.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentationNode = getNode('Segmentation')&lt;br /&gt;
segmentId = 'Segment_1'&lt;br /&gt;
&lt;br /&gt;
# Get array voxel coordinates&lt;br /&gt;
import numpy as np&lt;br /&gt;
seg=arrayFromSegment(segmentation_node, segmentId)&lt;br /&gt;
# numpy array has voxel coordinates in reverse order (KJI instead of IJK)&lt;br /&gt;
# and the array is cropped to minimum size in the segmentation&lt;br /&gt;
mean_KjiCropped = [coords.mean() for coords in np.nonzero(seg)]&lt;br /&gt;
&lt;br /&gt;
# Get segmentation voxel coordinates&lt;br /&gt;
segImage = segmentationNode.GetBinaryLabelmapRepresentation(segmentId)&lt;br /&gt;
segImageExtent = segImage.GetExtent()&lt;br /&gt;
# origin of the array in voxel coordinates is determined by the start extent&lt;br /&gt;
mean_Ijk = [mean_KjiCropped[2], mean_KjiCropped[1], mean_KjiCropped[0]] + np.array([segImageExtent[0], segImageExtent[2], segImageExtent[4]])&lt;br /&gt;
&lt;br /&gt;
# Get segmentation physical coordinates&lt;br /&gt;
ijkToWorld = vtk.vtkMatrix4x4()&lt;br /&gt;
segImage.GetImageToWorldMatrix(ijkToWorld)&lt;br /&gt;
mean_World = [0, 0, 0, 1]&lt;br /&gt;
ijkToRas.MultiplyPoint(np.append(mean_Ijk,1.0), mean_World)&lt;br /&gt;
mean_World = mean_World[0:3]&lt;br /&gt;
&lt;br /&gt;
# If segmentation node is transformed, apply that transform to get RAS coordinates&lt;br /&gt;
transformWorldToRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(segmentationNode.GetParentTransformNode(), None, transformWorldToRas)&lt;br /&gt;
mean_Ras = transformWorldToRas.TransformPoint(mean_World)&lt;br /&gt;
&lt;br /&gt;
# Show mean position value and jump to it in all slice viewers&lt;br /&gt;
print(mean_Ras)&lt;br /&gt;
slicer.modules.markups.logic().JumpSlicesToLocation(mean_Ras[0], mean_Ras[1], mean_Ras[2], True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How to run segment editor effects from a script===&lt;br /&gt;
&lt;br /&gt;
Editor effects are complex because they need to handle changing master volumes, undo/redo, masking operations, etc. Therefore, instead of using a segment editor effect, it is simpler to run the underlying filters directly from script.&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use Segment editor effects (without GUI, using qMRMLSegmentEditorWidget):&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/2d5a5b73645f65a5eb6f8d5f97abf31b brain tumor segmentation using grow from seeds effect]&lt;br /&gt;
*[https://gist.github.com/lassoan/1673b25d8e7913cbc245b4f09ed853f9 skin surface extraction using thresholding and smoothing]&lt;br /&gt;
*[https://gist.github.com/lassoan/2f5071c562108dac8efe277c78f2620f mask a volume with segments and compute histogram for each region]&lt;br /&gt;
*[https://gist.github.com/lassoan/5ad51c89521d3cd9c5faf65767506b37 create fat/muscle/bone segment by thresholding and report volume of each segment]&lt;br /&gt;
&lt;br /&gt;
This example shows how to perform operations on segmentations using VTK filters:&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/7c94c334653010696b2bf96abc0ac8e7 brain tumor segmentation using grow from seeds effect]&lt;br /&gt;
&lt;br /&gt;
==Accessing views, renderers, and cameras==&lt;br /&gt;
&lt;br /&gt;
Iterate through all 3D views in current layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for threeDViewIndex in range(layoutManager.threeDViewCount) :&lt;br /&gt;
  view = layoutManager.threeDWidget(threeDViewIndex).threeDView()&lt;br /&gt;
  threeDViewNode = view.mrmlViewNode()&lt;br /&gt;
  cameraNode = slicer.modules.cameras.logic().GetViewActiveCameraNode(threeDViewNode)&lt;br /&gt;
  print('View node for 3D widget ' + str(threeDViewIndex))&lt;br /&gt;
  print('  Name: ' + threeDViewNode .GetName())&lt;br /&gt;
  print('  ID: ' + threeDViewNode .GetID())&lt;br /&gt;
  print('  Camera ID: ' + cameraNode.GetID())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Iterate through all slice views in current layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  view = layoutManager.sliceWidget(sliceViewName).sliceView()&lt;br /&gt;
  sliceNode = view.mrmlSliceNode()&lt;br /&gt;
  sliceLogic = slicer.app.applicationLogic().GetSliceLogic(sliceNode)&lt;br /&gt;
  compositeNode = sliceLogic.GetSliceCompositeNode()&lt;br /&gt;
  print('Slice view ' + str(sliceViewName))&lt;br /&gt;
  print('  Name: ' + sliceNode.GetName())&lt;br /&gt;
  print('  ID: ' + sliceNode.GetID())&lt;br /&gt;
  print('  Background volume: {0}'.format(compositeNode.GetBackgroundVolumeID()))&lt;br /&gt;
  print('  Foreground volume: {0} (opacity: {1})'.format(compositeNode.GetForegroundVolumeID(), compositeNode.GetForegroundOpacity()))&lt;br /&gt;
  print('  Label volume: {0} (opacity: {1})'.format(compositeNode.GetLabelVolumeID(), compositeNode.GetLabelOpacity()))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For low-level manipulation of views, it is possible to access VTK render windows, renderers and cameras of views in the current layout.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = view.renderWindow()&lt;br /&gt;
renderers = renderWindow.GetRenderers()&lt;br /&gt;
renderer = renderers.GetItemAsObject(0)&lt;br /&gt;
camera = cameraNode.GetCamera()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide view controller bars==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.app.layoutManager().threeDWidget(0).threeDController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().sliceWidget('Red').sliceController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().plotWidget(0).plotController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().tableWidget(0).tableController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Customize widgets in view controller bars==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceController = slicer.app.layoutManager().sliceWidget(&amp;quot;Red&amp;quot;).sliceController()&lt;br /&gt;
&lt;br /&gt;
# hide what is not needed&lt;br /&gt;
sliceController.pinButton().hide()&lt;br /&gt;
#sliceController.viewLabel().hide()&lt;br /&gt;
sliceController.fitToWindowToolButton().hide()&lt;br /&gt;
sliceController.sliceOffsetSlider().hide()&lt;br /&gt;
&lt;br /&gt;
# add custom widgets&lt;br /&gt;
myButton = qt.QPushButton(&amp;quot;My custom button&amp;quot;)&lt;br /&gt;
sliceController.barLayout().addWidget(b)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change 3D view background color==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow()&lt;br /&gt;
renderer = renderWindow.GetRenderers().GetFirstRenderer()&lt;br /&gt;
renderer.SetBackground(1,0,0)&lt;br /&gt;
renderer.SetBackground2(1,0,0)&lt;br /&gt;
renderWindow.Render()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide Slicer logo from main window (to increase space)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.findChild(slicer.util.mainWindow(), 'LogoLabel').visible = False&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Subject hierarchy== &lt;br /&gt;
====Get the pseudo-singleton subject hierarchy node====&lt;br /&gt;
It manages the whole hierarchy and provides functions to access and manipulate&lt;br /&gt;
  shNode = slicer.mrmlScene.GetSubjectHierarchyNode()&lt;br /&gt;
&lt;br /&gt;
====Create subject hierarchy item====&lt;br /&gt;
  # If it is for a data node, it is automatically created, but the create function can be used to set parent:&lt;br /&gt;
  shNode.CreateItem(parentItemID, dataNode)&lt;br /&gt;
  # If it is a hierarchy item without a data node, then the create function must be used:&lt;br /&gt;
  shNode.CreateSubjectItem(parentItemID, name)&lt;br /&gt;
  shNode.CreateFolderItem(parentItemID, name)&lt;br /&gt;
  shNode.CreateHierarchyItem(parentItemID, name, level) # Advanced method to set level attribute manually (usually subject, study, or folder, but it can be a virtual branch for example)&lt;br /&gt;
&lt;br /&gt;
====Get subject hierarchy item====&lt;br /&gt;
Items in subject hierarchy are uniquely identified by integer IDs&lt;br /&gt;
  # Get scene item ID first because it is the root item:&lt;br /&gt;
  sceneItemID = shNode.GetSceneItemID()&lt;br /&gt;
  # Get direct child by name&lt;br /&gt;
  subjectItemID = shNode.GetItemChildWithName(sceneItemID, 'Subject_1')&lt;br /&gt;
  # Get item for data node&lt;br /&gt;
  itemID = shNode.GetItemByDataNode(dataNode)&lt;br /&gt;
  # Get item by UID (such as DICOM)&lt;br /&gt;
  itemID = shNode.GetItemByUID(slicer.vtkMRMLSubjectHierarchyConstants.GetDICOMUIDName(), seriesInstanceUid)&lt;br /&gt;
  itemID = shNode.GetItemByUIDList(slicer.vtkMRMLSubjectHierarchyConstants.GetDICOMInstanceUIDName(), instanceUID)&lt;br /&gt;
  # Invalid item ID for checking validity of a given ID (most functions return the invalid ID when item is not found)&lt;br /&gt;
  invalidItemID = slicer.vtkMRMLSubjectHierarchyNode.GetInvalidItemID()&lt;br /&gt;
&lt;br /&gt;
====Traverse children of a subject hierarchy item====&lt;br /&gt;
  children = vtk.vtkIdList()&lt;br /&gt;
  shNode.GetItemChildren(parent, children)&lt;br /&gt;
  for i in range(children.GetNumberOfIds()):&lt;br /&gt;
    child = children.GetId(i)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
====Manipulate subject hierarchy item====&lt;br /&gt;
Instead of node operations on the individual subject hierarchy nodes, item operations are performed on the one subject hierarchy node.&lt;br /&gt;
  # Set item name&lt;br /&gt;
  shNode.SetItemName(itemID, 'NewName')&lt;br /&gt;
  # Set item parent (reparent)&lt;br /&gt;
  shNode.SetItemParent(itemID, newParentItemID)&lt;br /&gt;
  # Set visibility of data node associated to an item&lt;br /&gt;
  shNode.SetItemDisplayVisibility(itemID, 1)&lt;br /&gt;
  # Set visibility of whole branch&lt;br /&gt;
  # Note: Folder-type items (fodler, subject, study, etc.) create their own display nodes when show/hiding from UI.&lt;br /&gt;
  #       The displayable managers use SH information to determine visibility of an item, so no need to show/hide individual leaf nodes any more.&lt;br /&gt;
  #       Once the folder display node is created, it can be shown hidden simply using shNode.SetItemDisplayVisibility&lt;br /&gt;
  # From python, this is how to trigger creating a folder display node&lt;br /&gt;
  pluginHandler = slicer.qSlicerSubjectHierarchyPluginHandler().instance()&lt;br /&gt;
  folderPlugin = pluginHandler.pluginByName('Folder')&lt;br /&gt;
  folderPlugin.setDisplayVisibility(folderItemID, 1)&lt;br /&gt;
&lt;br /&gt;
====Filter items in TreeView or ComboBox====&lt;br /&gt;
Displayed items can be filtered using ''setAttributeFilter'' method. An example of the usage can be found in the  [https://github.com/Slicer/Slicer/blob/e66e3b08e35384526528e6ae678e9ec9f079f286/Applications/SlicerApp/Testing/Python/SubjectHierarchyGenericSelfTest.py#L352-L360 unit test]. Modified version here:&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 5&lt;br /&gt;
    shTreeView.setAttributeFilter('DICOM.Modality') # Nodes must have this attribute&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 3&lt;br /&gt;
    shTreeView.setAttributeFilter('DICOM.Modality','CT') # Have attribute and equal 'CT'&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 1&lt;br /&gt;
    shTreeView.removeAttributeFilter()&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 5&lt;br /&gt;
&lt;br /&gt;
===Listen to subject hierarchy item events===&lt;br /&gt;
The subject hierarchy node sends the node item id as calldata. Item IDs are vtkIdType, which are NOT vtkObjects. You need to use vtk.calldata_type(vtk.VTK_LONG) (otherwise the application crashes).&lt;br /&gt;
  &lt;br /&gt;
  class MyListenerClass(VTKObservationMixin):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
      VTKObservationMixin.__init__(self)&lt;br /&gt;
      &lt;br /&gt;
      shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
      self.addObserver(shNode, shNode.SubjectHierarchyItemModifiedEvent, self.shItemModifiedEvent)&lt;br /&gt;
     &lt;br /&gt;
    @vtk.calldata_type(vtk.VTK_LONG) &lt;br /&gt;
    def shItemModifiedEvent(self, caller, eventId, callData):&lt;br /&gt;
      print(&amp;quot;SH Node modified&amp;quot;)&lt;br /&gt;
      print(&amp;quot;SH item ID: {0}&amp;quot;.format(callData))&lt;br /&gt;
&lt;br /&gt;
==Plotting==&lt;br /&gt;
&lt;br /&gt;
===Slicer plots displayed in view layout===&lt;br /&gt;
&lt;br /&gt;
Create histogram plot of a volume and show it embedded in the view layout. More information: https://www.slicer.org/wiki/Documentation/Nightly/Developers/Plots&lt;br /&gt;
&lt;br /&gt;
====Using &amp;lt;code&amp;gt;slicer.util.plot&amp;lt;/code&amp;gt; utility function====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a volume from SampleData and compute its histogram&lt;br /&gt;
import SampleData&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
chartNode = slicer.util.plot(histogram, xColumnIndex = 1)&lt;br /&gt;
chartNode.SetYAxisRangeAuto(False)&lt;br /&gt;
chartNode.SetYAxisRange(0, 4e5)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:SlicerPlot.png]]&lt;br /&gt;
&lt;br /&gt;
====Using MRML classes only====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a volume from SampleData&lt;br /&gt;
import SampleData&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
&lt;br /&gt;
# Compute histogram values&lt;br /&gt;
import numpy as np&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
# Save results to a new table node&lt;br /&gt;
tableNode=slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLTableNode&amp;quot;)&lt;br /&gt;
updateTableFromArray(tableNode, histogram)&lt;br /&gt;
tableNode.GetTable().GetColumn(0).SetName(&amp;quot;Count&amp;quot;)&lt;br /&gt;
tableNode.GetTable().GetColumn(1).SetName(&amp;quot;Intensity&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create plot&lt;br /&gt;
plotSeriesNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLPlotSeriesNode&amp;quot;, volumeNode.GetName() + ' histogram')&lt;br /&gt;
plotSeriesNode.SetAndObserveTableNodeID(tableNode.GetID())&lt;br /&gt;
plotSeriesNode.SetXColumnName(&amp;quot;Intensity&amp;quot;)&lt;br /&gt;
plotSeriesNode.SetYColumnName(&amp;quot;Count&amp;quot;)&lt;br /&gt;
plotSeriesNode.SetPlotType(plotSeriesNode.PlotTypeScatterBar)&lt;br /&gt;
plotSeriesNode.SetColor(0, 0.6, 1.0)&lt;br /&gt;
&lt;br /&gt;
# Create chart and add plot&lt;br /&gt;
plotChartNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLPlotChartNode&amp;quot;)&lt;br /&gt;
plotChartNode.AddAndObservePlotSeriesNodeID(plotSeriesNode.GetID())&lt;br /&gt;
plotChartNode.YAxisRangeAutoOff()&lt;br /&gt;
plotChartNode.SetYAxisRange(0, 500000)&lt;br /&gt;
&lt;br /&gt;
# Show plot in layout&lt;br /&gt;
slicer.modules.plots.logic().ShowChartInLayout(plotChartNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using matplotlib===&lt;br /&gt;
&lt;br /&gt;
Matplotlib may be used from within Slicer, but the default Tk backend locks up and crashes Slicer. However, Matplotlib may still be used through other backends. More details can be found on the [http://matplotlib.sourceforge.net/ MatPlotLib] pages.&lt;br /&gt;
&lt;br /&gt;
====Non-interactive plot====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
matplotlib.use('Agg')&lt;br /&gt;
from pylab import *&lt;br /&gt;
&lt;br /&gt;
t1 = arange(0.0, 5.0, 0.1)&lt;br /&gt;
t2 = arange(0.0, 5.0, 0.02)&lt;br /&gt;
t3 = arange(0.0, 2.0, 0.01) &lt;br /&gt;
&lt;br /&gt;
subplot(211)&lt;br /&gt;
plot(t1, cos(2*pi*t1)*exp(-t1), 'bo', t2, cos(2*pi*t2)*exp(-t2), 'k')&lt;br /&gt;
grid(True)&lt;br /&gt;
title('A tale of 2 subplots')&lt;br /&gt;
ylabel('Damped')&lt;br /&gt;
&lt;br /&gt;
subplot(212)&lt;br /&gt;
plot(t3, cos(2*pi*t3), 'r--')&lt;br /&gt;
grid(True)&lt;br /&gt;
xlabel('time (s)')&lt;br /&gt;
ylabel('Undamped')&lt;br /&gt;
savefig('MatplotlibExample.png')&lt;br /&gt;
&lt;br /&gt;
# Static image view&lt;br /&gt;
pm = qt.QPixmap(&amp;quot;MatplotlibExample.png&amp;quot;)&lt;br /&gt;
imageWidget = qt.QLabel()&lt;br /&gt;
imageWidget.setPixmap(pm)&lt;br /&gt;
imageWidget.setScaledContents(True)&lt;br /&gt;
imageWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:MatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Plot in Slicer Jupyter notebook====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
matplotlib.use('Agg')&lt;br /&gt;
from pylab import *&lt;br /&gt;
&lt;br /&gt;
t1 = arange(0.0, 5.0, 0.1)&lt;br /&gt;
t2 = arange(0.0, 5.0, 0.02)&lt;br /&gt;
t3 = arange(0.0, 2.0, 0.01) &lt;br /&gt;
&lt;br /&gt;
subplot(211)&lt;br /&gt;
plot(t1, cos(2*pi*t1)*exp(-t1), 'bo', t2, cos(2*pi*t2)*exp(-t2), 'k')&lt;br /&gt;
grid(True)&lt;br /&gt;
title('A tale of 2 subplots')&lt;br /&gt;
ylabel('Damped')&lt;br /&gt;
&lt;br /&gt;
subplot(212)&lt;br /&gt;
plot(t3, cos(2*pi*t3), 'r--')&lt;br /&gt;
grid(True)&lt;br /&gt;
xlabel('time (s)')&lt;br /&gt;
ylabel('Undamped')&lt;br /&gt;
savefig('MatplotlibExample.png')&lt;br /&gt;
display(filename='MatplotlibExample.png', type=&amp;quot;image/png&amp;quot;, binary=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:JupyterNotebookMatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Interactive plot using wxWidgets GUI toolkit====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
  import wx&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib wxPython')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
# Get a volume from SampleData and compute its histogram&lt;br /&gt;
import SampleData&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
# Set matplotlib to use WXAgg backend&lt;br /&gt;
import matplotlib&lt;br /&gt;
matplotlib.use('WXAgg')&lt;br /&gt;
&lt;br /&gt;
# Show an interactive plot&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
ax.plot(histogram[1][1:], histogram[0].astype(float))&lt;br /&gt;
ax.grid(True)&lt;br /&gt;
ax.set_ylim((0, 4e5))&lt;br /&gt;
plt.show(block=False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:InteractiveMatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
==Execute external applications==&lt;br /&gt;
&lt;br /&gt;
How to run external applications from Slicer.&lt;br /&gt;
&lt;br /&gt;
===Run process in default environment===&lt;br /&gt;
&lt;br /&gt;
When a process is launched from Slicer then by default Slicer's ITK, VTK, Qt, etc. libraries are used. If an external application has its own version of these libraries, then the application is expected to crash. To prevent crashing, the application must be run in the environment where Slicer started up (without all Slicer-specific library paths). This startup environment can be retrieved using ''slicer.util.startupEnvironment()''.&lt;br /&gt;
&lt;br /&gt;
Example: run Python3 script from Slicer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command_to_execute = [&amp;quot;/usr/bin/python3&amp;quot;, &amp;quot;-c&amp;quot;, &amp;quot;print('hola')&amp;quot;]&lt;br /&gt;
from subprocess import check_output&lt;br /&gt;
check_output(&lt;br /&gt;
  command_to_execute, &lt;br /&gt;
  env=slicer.util.startupEnvironment()&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'hola\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On some systems, ''shell=True'' must be specified as well.&lt;br /&gt;
&lt;br /&gt;
==Manage extensions==&lt;br /&gt;
&lt;br /&gt;
===Download and install extension===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
extensionName = 'SlicerIGT'&lt;br /&gt;
em = slicer.app.extensionsManagerModel()&lt;br /&gt;
if not em.isExtensionInstalled(extensionName):&lt;br /&gt;
    extensionMetaData = em.retrieveExtensionMetadataByName(extensionName)&lt;br /&gt;
    url = em.serverUrl().toString()+'/download/item/'+extensionMetaData['item_id']&lt;br /&gt;
    extensionPackageFilename = slicer.app.temporaryPath+'/'+extensionMetaData['md5']&lt;br /&gt;
    slicer.util.downloadFile(url, extensionPackageFilename)&lt;br /&gt;
    em.installExtension(extensionPackageFilename)&lt;br /&gt;
    slicer.util.restart()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/ScriptRepository&amp;diff=61587</id>
		<title>Documentation/Nightly/ScriptRepository</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/ScriptRepository&amp;diff=61587"/>
		<updated>2019-11-20T19:45:59Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Community-contributed modules =&lt;br /&gt;
&lt;br /&gt;
The examples in this section are [[Documentation/{{documentation/version}}/Developers/Modules#Scripted_Modules| Scripted Modules]] that provide a user interface in the module panel along with specialized implementation logic.&lt;br /&gt;
&lt;br /&gt;
Usage: save the .py file to a directory, add the directory to the additional module paths in the Slicer application settings (choose in the menu: Edit / Application settings, click Modules, click &amp;gt;&amp;gt; next to Additional module paths, click Add, and choose the .py file's location).&lt;br /&gt;
&lt;br /&gt;
More information about python scripted modules and more usage examples can be found in the[[Documentation/{{documentation/version}}/Developers/Python_scripting | Python scripting]] wiki page.&lt;br /&gt;
&lt;br /&gt;
==Filters==&lt;br /&gt;
&lt;br /&gt;
*[https://raw.github.com/pieper/VolumeMasker/master/VolumeMasker.py VolumeMasker.py]: Update a target volume with the results of setting all input volume voxels to 0 except for those that correspond to a selected label value in an input label map (Used for example in the volume rendering in [https://www.youtube.com/watch?v=dfu2gugHLHs this video).&lt;br /&gt;
&lt;br /&gt;
==DICOM==&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/pieper/6186477 dicom header browser] to easily scroll through dicom files using dcmdump.&lt;br /&gt;
*[https://github.com/SlicerRt/SlicerRT/tree/master/BatchProcessing SlicerRT batch processing] to batch convert RT structure sets to labelmap NRRD files.&lt;br /&gt;
&lt;br /&gt;
==Informatics==&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/bf0954d93cacc8cbe27cd4a3ad503f2f MarkupsInfo.py]: Compute the total length between all the points of a markup list.&lt;br /&gt;
*[https://github.com/lassoan/SlicerLineProfile/blob/master/LineProfile/LineProfile.py LineProfile.py]: Compute intensity profile in a volume along a line.&lt;br /&gt;
&lt;br /&gt;
=Community-contributed examples=&lt;br /&gt;
&lt;br /&gt;
Usage: Copy-paste the shown code lines or linked .py file contents into Python console in Slicer.  Or save them to a file and run them using execfile.&lt;br /&gt;
&lt;br /&gt;
==Capture==&lt;br /&gt;
&lt;br /&gt;
*Capture the full Slicer screen and save it into a file&lt;br /&gt;
&lt;br /&gt;
  img = qt.QPixmap.grabWidget(slicer.util.mainWindow()).toImage()&lt;br /&gt;
  img.save('c:/tmp/test.png')&lt;br /&gt;
&lt;br /&gt;
*Capture all the views save it into a file:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
cap = ScreenCapture.ScreenCaptureLogic()&lt;br /&gt;
cap.showViewControllers(False)&lt;br /&gt;
cap.captureImageFromView(None,'c:/tmp/test.png')&lt;br /&gt;
cap.showViewControllers(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Capture a single view:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
viewNodeID = 'vtkMRMLViewNode1'&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
cap = ScreenCapture.ScreenCaptureLogic()&lt;br /&gt;
view = cap.viewFromNode(slicer.mrmlScene.GetNodeByID(viewNodeID))&lt;br /&gt;
cap.captureImageFromView(view,'c:/tmp/test.png')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Common values for viewNodeID: vtkMRMLSliceNodeRed, vtkMRMLSliceNodeYellow, vtkMRMLSliceNodeGreen, vtkMRMLViewNode1, vtkMRMLViewNode2. &lt;br /&gt;
The ScreenCapture module can also create video animations of rotating views, slice sweeps, etc.&lt;br /&gt;
&lt;br /&gt;
*Capture a slice view sweep into a series of PNG files - for example, Red slice view, 30 images, from position -125.0 to 75.0, into c:/tmp folder, with name image_00001.png, image_00002.png, ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import ScreenCapture&lt;br /&gt;
ScreenCapture.ScreenCaptureLogic().captureSliceSweep(getNode('vtkMRMLSliceNodeRed'), -125.0, 75.0, 30, &amp;quot;c:/tmp&amp;quot;, &amp;quot;image_%05d.png&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Capture 3D view into PNG file with transparent background&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow()&lt;br /&gt;
renderWindow.SetAlphaBitPlanes(1)&lt;br /&gt;
wti = vtk.vtkWindowToImageFilter()&lt;br /&gt;
wti.SetInputBufferTypeToRGBA()&lt;br /&gt;
wti.SetInput(renderWindow)&lt;br /&gt;
writer = vtk.vtkPNGWriter()&lt;br /&gt;
writer.SetFileName(&amp;quot;c:/tmp/screenshot.png&amp;quot;)&lt;br /&gt;
writer.SetInputConnection(wti.GetOutputPort())&lt;br /&gt;
writer.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Launching Slicer==&lt;br /&gt;
&lt;br /&gt;
*How to open an .mrb file with Slicer at the command line?&lt;br /&gt;
&lt;br /&gt;
  Slicer.exe --python-code &amp;quot;slicer.util.loadScene( 'f:/2013-08-23-Scene.mrb' )&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*How to run a script in the Slicer environment in batch mode (without showing any graphical user interface)?&lt;br /&gt;
&lt;br /&gt;
  Slicer.exe --python-code &amp;quot;doSomething; doSomethingElse; etc.&amp;quot; --testing --no-splash --no-main-window&lt;br /&gt;
&lt;br /&gt;
==Load volume from file==&lt;br /&gt;
When loading a volume from file, it is recommended to set returnNode=True to retrieve the loaded volume node.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
loadedVolumeNode = slicer.util.loadVolume('c:/Users/abc/Documents/MRHead.nrrd')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Get a MRML node in the scene based on the node name and call methods of that object. For the MRHead sample data:&lt;br /&gt;
&lt;br /&gt;
  vol=slicer.util.getNode('MR*')&lt;br /&gt;
  vol.GetImageData().GetDimensions()&lt;br /&gt;
&lt;br /&gt;
==Show volume rendering automatically when a volume is loaded==&lt;br /&gt;
&lt;br /&gt;
To show volume rendering of a volume automatically when it is loaded, add the lines below to your &lt;br /&gt;
[[Documentation/{{documentation/version}}/Developers/Python_scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F|.slicerrc file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@vtk.calldata_type(vtk.VTK_OBJECT)&lt;br /&gt;
def onNodeAdded(caller, event, calldata):&lt;br /&gt;
  node = calldata&lt;br /&gt;
  if isinstance(node, slicer.vtkMRMLVolumeNode):&lt;br /&gt;
    # Call showVolumeRendering using a timer instead of calling it directly&lt;br /&gt;
    # to allow the volume loading to fully complete.&lt;br /&gt;
    qt.QTimer.singleShot(0, lambda: showVolumeRendering(node))&lt;br /&gt;
&lt;br /&gt;
def showVolumeRendering(volumeNode):&lt;br /&gt;
  print(&amp;quot;Show volume rendering of node &amp;quot;+volumeNode.GetName())&lt;br /&gt;
  volRenLogic = slicer.modules.volumerendering.logic()&lt;br /&gt;
  displayNode = volRenLogic.CreateDefaultVolumeRenderingNodes(volumeNode)&lt;br /&gt;
  displayNode.SetVisibility(True)&lt;br /&gt;
  scalarRange = volumeNode.GetImageData().GetScalarRange()&lt;br /&gt;
  if scalarRange[1]-scalarRange[0] &amp;lt; 1500:&lt;br /&gt;
    # small dynamic range, probably MRI&lt;br /&gt;
    displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName('MR-Default'))&lt;br /&gt;
  else:&lt;br /&gt;
    # larger dynamic range, probably CT&lt;br /&gt;
    displayNode.GetVolumePropertyNode().Copy(volRenLogic.GetPresetByName('CT-Chest-Contrast-Enhanced'))&lt;br /&gt;
    &lt;br /&gt;
slicer.mrmlScene.AddObserver(slicer.vtkMRMLScene.NodeAddedEvent, onNodeAdded)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Automatically load volumes that are copied into a folder==&lt;br /&gt;
&lt;br /&gt;
This example shows how to implement a simple background task by using a timer. The background task is to check for any new volume files in folder and if there is any then automatically load it.&lt;br /&gt;
&lt;br /&gt;
There are more efficient methods for file system monitoring or exchanging image data in real-time (for example, using OpenIGTLink), the example below is just for demonstration purposes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
incomingVolumeFolder = &amp;quot;c:/tmp/incoming&amp;quot;&lt;br /&gt;
incomingVolumesProcessed = []&lt;br /&gt;
&lt;br /&gt;
def checkForNewVolumes():&lt;br /&gt;
  # Check if there is a new file in the &lt;br /&gt;
  from os import listdir&lt;br /&gt;
  from os.path import isfile, join&lt;br /&gt;
  for f in listdir(incomingVolumeFolder):&lt;br /&gt;
    if f in incomingVolumesProcessed:&lt;br /&gt;
      # this is an incoming file, it was already there&lt;br /&gt;
      continue&lt;br /&gt;
    filePath = join(incomingVolumeFolder, f)&lt;br /&gt;
    if not isfile(filePath):&lt;br /&gt;
      # ignore directories&lt;br /&gt;
      continue&lt;br /&gt;
    logging.info(&amp;quot;Loading new file: &amp;quot;+f)&lt;br /&gt;
    incomingVolumesProcessed.append(f)&lt;br /&gt;
    slicer.util.loadVolume(filePath)&lt;br /&gt;
  # Check again in 3000ms&lt;br /&gt;
  qt.QTimer.singleShot(3000, checkForNewVolumes)&lt;br /&gt;
&lt;br /&gt;
# Start monitoring&lt;br /&gt;
checkForNewVolumes()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==DICOM==&lt;br /&gt;
===How to access top level tags of DICOM images imported into Slicer? For example, to print the first patient's first study's first series' &amp;quot;0020,0032&amp;quot; field:===&lt;br /&gt;
  db=slicer.dicomDatabase&lt;br /&gt;
  patientList=db.patients()&lt;br /&gt;
  studyList=db.studiesForPatient(patientList[0])&lt;br /&gt;
  seriesList=db.seriesForStudy(studyList[0])&lt;br /&gt;
  fileList=db.filesForSeries(seriesList[0])&lt;br /&gt;
  # Note, fileValue accesses the database of cached top level tags&lt;br /&gt;
  # (nested tags are not included)&lt;br /&gt;
  print(db.fileValue(fileList[0],'0020,0032'))&lt;br /&gt;
&lt;br /&gt;
===How to access DICOM tags nested in a sequence===&lt;br /&gt;
  db=slicer.dicomDatabase&lt;br /&gt;
  patientList=db.patients()&lt;br /&gt;
  studyList=db.studiesForPatient(patientList[0])&lt;br /&gt;
  seriesList=db.seriesForStudy(studyList[0])&lt;br /&gt;
  fileList=db.filesForSeries(seriesList[0])&lt;br /&gt;
  # use pydicom to access the full header, which requires&lt;br /&gt;
  # re-reading the dataset instead of using the database cache&lt;br /&gt;
  import pydicom&lt;br /&gt;
  pydicom.dcmread(fileList[0])&lt;br /&gt;
  ds.CTExposureSequence[0].ExposureModulationType&lt;br /&gt;
&lt;br /&gt;
===How to access tag of a volume loaded from DICOM? For example, get the patient position stored in a volume:===&lt;br /&gt;
  volumeName='2: ENT IMRT'&lt;br /&gt;
  n=slicer.util.getNode(volumeName)&lt;br /&gt;
  instUids=n.GetAttribute('DICOM.instanceUIDs').split()&lt;br /&gt;
  filename=slicer.dicomDatabase.fileForInstance(instUids[0])&lt;br /&gt;
  print(slicer.dicomDatabase.fileValue(filename,'0018,5100'))&lt;br /&gt;
&lt;br /&gt;
===How to access tag of an item in the Subject Hierachy tree? For example, get the content time tag of a structure set:===&lt;br /&gt;
  rtStructName = '3: RTSTRUCT: PROS'&lt;br /&gt;
  rtStructNode = slicer.util.getNode(rtStructName)&lt;br /&gt;
  shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
  rtStructShItemID = shNode.GetItemByDataNode(rtStructNode)&lt;br /&gt;
  ctSliceInstanceUids = shNode.GetItemAttribute(rtStructShItemID, 'DICOM.ReferencedInstanceUIDs').split()&lt;br /&gt;
  filename = slicer.dicomDatabase.fileForInstance(ctSliceInstanceUids[0])&lt;br /&gt;
  print(slicer.dicomDatabase.fileValue(filename,'0008,0033'))&lt;br /&gt;
&lt;br /&gt;
===How to get path and filename of a loaded DICOM volume?===&lt;br /&gt;
  def pathFromNode(node):&lt;br /&gt;
    storageNode=node.GetStorageNode()&lt;br /&gt;
    if storageNode is not None: # loaded via drag-drop&lt;br /&gt;
        filepath=storageNode.GetFullNameFromFileName()&lt;br /&gt;
    else: # loaded via DICOM browser&lt;br /&gt;
        instanceUIDs=node.GetAttribute('DICOM.instanceUIDs').split()&lt;br /&gt;
        filepath=slicer.dicomDatabase.fileForInstance(instUids[0])&lt;br /&gt;
    return filepath&lt;br /&gt;
  &lt;br /&gt;
  # example:&lt;br /&gt;
  node=slicer.util.getNode('volume1')&lt;br /&gt;
  path=self.pathFromNode(node)&lt;br /&gt;
  print(&amp;quot;DICOM path=%s&amp;quot; % path)&lt;br /&gt;
&lt;br /&gt;
===How can I convert DICOM to NRRD on the command line?===&lt;br /&gt;
&lt;br /&gt;
 /Applications/Slicer-4.6.2.app/Contents/MacOS/Slicer --no-main-window --python-code &amp;quot;node=slicer.util.loadVolume('/tmp/series/im0.dcm'); slicer.util.saveNode(node, '/tmp/output.nrrd'); exit()&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The same can be done on windows by using the top level Slicer.exe.  Be sure to use forward slashes in the pathnames within quotes on the command line.&lt;br /&gt;
&lt;br /&gt;
===Export a volume to DICOM file format===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = getNode('CTChest')&lt;br /&gt;
outputFolder = &amp;quot;c:/tmp/dicom-output&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Create patient and study and put the volume under the study&lt;br /&gt;
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
patientItemID = shNode.CreateSubjectItem(shNode.GetSceneItemID(), &amp;quot;test patient&amp;quot;)&lt;br /&gt;
studyItemID = shNode.CreateStudyItem(patientItemID, &amp;quot;test study&amp;quot;)&lt;br /&gt;
volumeShItemID = shNode.GetItemByDataNode(volumeNode)&lt;br /&gt;
shNode.SetItemParent(volumeShItemID, studyItemID)&lt;br /&gt;
&lt;br /&gt;
import DICOMScalarVolumePlugin&lt;br /&gt;
exporter = DICOMScalarVolumePlugin.DICOMScalarVolumePluginClass()&lt;br /&gt;
exportables = exporter.examineForExport(volumeShItemID)&lt;br /&gt;
for exp in exportables:&lt;br /&gt;
  exp.directory = outputFolder&lt;br /&gt;
&lt;br /&gt;
exporter.export(exportables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Customize table columns in DICOM browser===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get browser and database&lt;br /&gt;
dicomBrowser = slicer.modules.dicom.widgetRepresentation().self().dicomBrowser&lt;br /&gt;
dicomDatabase = dicomBrowser.database() # Need to go this way, do not use slicer.dicomDatabase for this&lt;br /&gt;
&lt;br /&gt;
# Change column order&lt;br /&gt;
dicomDatabase.setWeightForField('Series', 'SeriesDescription', 7)&lt;br /&gt;
dicomDatabase.setWeightForField('Studies', 'StudyDescription', 6)&lt;br /&gt;
# Change column visibility&lt;br /&gt;
dicomDatabase.setVisibilityForField('Patients', 'PatientsBirthDate', False)&lt;br /&gt;
# Change column name&lt;br /&gt;
dicomDatabase.setDisplayedNameForField('Series', 'DisplayedCount', 'Number of images')&lt;br /&gt;
# Customize table manager in DICOM browser&lt;br /&gt;
dicomTableManager = dicomBrowser.dicomTableManager()&lt;br /&gt;
dicomTableManager.selectionMode = qt.QAbstractItemView.SingleSelection&lt;br /&gt;
dicomTableManager.autoSelectSeries = False&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Toolbar functions==&lt;br /&gt;
&lt;br /&gt;
*How to turn on slice intersections in the crosshair menu on the toolbar:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
viewNodes = slicer.util.getNodesByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
for viewNode in viewNodes:&lt;br /&gt;
  viewNode.SetSliceIntersectionVisibility(1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How to find similar functions? For this one I searched for &amp;quot;slice intersections&amp;quot; text in the whole slicer source code, found that the function is implemented in Base\QTGUI\qSlicerViewersToolBar.cxx, then translated the qSlicerViewersToolBarPrivate::setSliceIntersectionVisible(bool visible) method to Python.&lt;br /&gt;
&lt;br /&gt;
==Manipulating objects in the slice viewer==&lt;br /&gt;
&lt;br /&gt;
*How to define/edit a circular region of interest in a slice viewer?&lt;br /&gt;
&lt;br /&gt;
Drop two markup points on a slice view and copy-paste the code below into the Python console. After this, as you move the markups you’ll see a circle following the markups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update the sphere from the fiducial points&lt;br /&gt;
def UpdateSphere(param1, param2):  &lt;br /&gt;
  import math&lt;br /&gt;
  centerPointCoord = [0.0, 0.0, 0.0]&lt;br /&gt;
  markups.GetNthFiducialPosition(0,centerPointCoord)&lt;br /&gt;
  circumferencePointCoord = [0.0, 0.0, 0.0]&lt;br /&gt;
  markups.GetNthFiducialPosition(1,circumferencePointCoord)&lt;br /&gt;
  sphere.SetCenter(centerPointCoord)&lt;br /&gt;
  radius=math.sqrt((centerPointCoord[0]-circumferencePointCoord[0])**2+(centerPointCoord[1]-circumferencePointCoord[1])**2+(centerPointCoord[2]-circumferencePointCoord[2])**2)&lt;br /&gt;
  sphere.SetRadius(radius)&lt;br /&gt;
  sphere.SetPhiResolution(30)&lt;br /&gt;
  sphere.SetThetaResolution(30)&lt;br /&gt;
  sphere.Update()&lt;br /&gt;
&lt;br /&gt;
# Get markup node from scene&lt;br /&gt;
markups=slicer.util.getNode('F')&lt;br /&gt;
sphere = vtk.vtkSphereSource()&lt;br /&gt;
UpdateSphere(0,0)&lt;br /&gt;
 &lt;br /&gt;
# Create model node and add to scene&lt;br /&gt;
modelsLogic = slicer.modules.models.logic()&lt;br /&gt;
model = modelsLogic.AddModel(sphere.GetOutput())&lt;br /&gt;
model.GetDisplayNode().SetSliceIntersectionVisibility(True)&lt;br /&gt;
model.GetDisplayNode().SetSliceIntersectionThickness(3)&lt;br /&gt;
model.GetDisplayNode().SetColor(1,1,0)&lt;br /&gt;
 &lt;br /&gt;
# Call UpdateSphere whenever the fiducials are changed&lt;br /&gt;
markups.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, UpdateSphere, 2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Measure angle between two slice planes==&lt;br /&gt;
&lt;br /&gt;
Measure angle between red and yellow slice nodes. Whenever any of the slice nodes are moved, the updated angle is printed on the console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNodeIds = ['vtkMRMLSliceNodeRed', 'vtkMRMLSliceNodeYellow']&lt;br /&gt;
&lt;br /&gt;
# Print angles between slice nodes&lt;br /&gt;
def ShowAngle(unused1=None, unused2=None):&lt;br /&gt;
    sliceNormalVector = []&lt;br /&gt;
    for sliceNodeId in sliceNodeIds:&lt;br /&gt;
        sliceToRAS = slicer.mrmlScene.GetNodeByID(sliceNodeId).GetSliceToRAS()&lt;br /&gt;
        sliceNormalVector.append([sliceToRAS.GetElement(0,2), sliceToRAS.GetElement(1,2), sliceToRAS.GetElement(2,2)])&lt;br /&gt;
    angleRad = vtk.vtkMath.AngleBetweenVectors(sliceNormalVector[0], sliceNormalVector[1])&lt;br /&gt;
    angleDeg = vtk.vtkMath.DegreesFromRadians(angleRad)&lt;br /&gt;
    print('Angle between slice planes = {0:0.3f}'.format(angleDeg))&lt;br /&gt;
&lt;br /&gt;
# Observe slice node changes&lt;br /&gt;
for sliceNodeId in sliceNodeIds:&lt;br /&gt;
    slicer.mrmlScene.GetNodeByID(sliceNodeId).AddObserver(vtk.vtkCommand.ModifiedEvent, ShowAngle)&lt;br /&gt;
&lt;br /&gt;
# Print current angle&lt;br /&gt;
ShowAngle()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set slice position and orientation from 3 markup fiducials==&lt;br /&gt;
&lt;br /&gt;
Drop 3 markup points in the scene and copy-paste the code below into the Python console. After this, as you move the markups you’ll see the red slice view position and orientation will be set to make it fit to the 3 points.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Update plane from fiducial points&lt;br /&gt;
def UpdateSlicePlane(param1=None, param2=None):&lt;br /&gt;
  # Get point positions as numpy array&lt;br /&gt;
  import numpy as np&lt;br /&gt;
  nOfFiduciallPoints = markups.GetNumberOfFiducials()&lt;br /&gt;
  if nOfFiduciallPoints &amp;lt; 3:&lt;br /&gt;
    return  # not enough points&lt;br /&gt;
  points = np.zeros([3,nOfFiduciallPoints])&lt;br /&gt;
  for i in range(0, nOfFiduciallPoints):&lt;br /&gt;
    markups.GetNthFiducialPosition(i, points[:,i])&lt;br /&gt;
  # Compute plane position and normal&lt;br /&gt;
  planePosition = points.mean(axis=1)&lt;br /&gt;
  planeNormal = np.cross(points[:,1] - points[:,0], points[:,2] - points[:,0])&lt;br /&gt;
  planeX = points[:,1] - points[:,0]&lt;br /&gt;
  sliceNode.SetSliceToRASByNTP(planeNormal[0], planeNormal[1], planeNormal[2],&lt;br /&gt;
    planeX[0], planeX[1], planeX[2],&lt;br /&gt;
    planePosition[0], planePosition[1], planePosition[2], 0)&lt;br /&gt;
&lt;br /&gt;
# Get markup node from scene&lt;br /&gt;
sliceNode = slicer.app.layoutManager().sliceWidget('Red').mrmlSliceNode()&lt;br /&gt;
markups = slicer.util.getNode('F')&lt;br /&gt;
&lt;br /&gt;
# Update slice plane manually&lt;br /&gt;
UpdateSlicePlane()&lt;br /&gt;
&lt;br /&gt;
# Update slice plane automatically whenever points are changed&lt;br /&gt;
markupObservation = [markups, markups.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, UpdateSlicePlane, 2)]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To stop automatic updates, run this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
markupObservation[0].RemoveObserver(markupObservation[1])&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set slice position and orientation from a normal vector and position==&lt;br /&gt;
&lt;br /&gt;
This code snippet shows how to display a slice view defined by a normal vector and position in an anatomically sensible way: rotating slice view so that &amp;quot;up&amp;quot; direction (or &amp;quot;right&amp;quot; direction) is towards an anatomical axis.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def setSlicePoseFromSliceNormalAndPosition(sliceNode, sliceNormal, slicePosition, defaultViewUpDirection=None, backupViewRightDirection=None):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Set slice pose from the provided plane normal and position. View up direction is determined automatically,&lt;br /&gt;
    to make view up point towards defaultViewUpDirection.&lt;br /&gt;
    :param defaultViewUpDirection Slice view will be spinned in-plane to match point approximately this up direction. Default: patient superior.&lt;br /&gt;
    :param backupViewRightDirection Slice view will be spinned in-plane to match point approximately this right direction&lt;br /&gt;
        if defaultViewUpDirection is too similar to sliceNormal. Default: patient left.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    # Fix up input directions&lt;br /&gt;
    if defaultViewUpDirection is None:&lt;br /&gt;
        defaultViewUpDirection = [0,0,1]&lt;br /&gt;
    if backupViewRightDirection is None:&lt;br /&gt;
        backupViewRightDirection = [-1,0,0]&lt;br /&gt;
    if sliceNormal[1]&amp;gt;=0:&lt;br /&gt;
        sliceNormalStandardized = sliceNormal&lt;br /&gt;
    else:&lt;br /&gt;
        sliceNormalStandardized = [-sliceNormal[0], -sliceNormal[1], -sliceNormal[2]]&lt;br /&gt;
    # Compute slice axes&lt;br /&gt;
    sliceNormalViewUpAngle = vtk.vtkMath.AngleBetweenVectors(sliceNormalStandardized, defaultViewUpDirection)&lt;br /&gt;
    angleTooSmallThresholdRad = 0.25 # about 15 degrees&lt;br /&gt;
    if sliceNormalViewUpAngle &amp;gt; angleTooSmallThresholdRad and sliceNormalViewUpAngle &amp;lt; vtk.vtkMath.Pi() - angleTooSmallThresholdRad:&lt;br /&gt;
        viewUpDirection = defaultViewUpDirection&lt;br /&gt;
        sliceAxisY = viewUpDirection&lt;br /&gt;
        sliceAxisX = [0, 0, 0]&lt;br /&gt;
        vtk.vtkMath.Cross(sliceAxisY, sliceNormalStandardized, sliceAxisX)&lt;br /&gt;
    else:&lt;br /&gt;
        sliceAxisX = backupViewRightDirection&lt;br /&gt;
    # Set slice axes&lt;br /&gt;
    sliceNode.SetSliceToRASByNTP(sliceNormalStandardized[0], sliceNormalStandardized[1], sliceNormalStandardized[2],&lt;br /&gt;
        sliceAxisX[0], sliceAxisX[1], sliceAxisX[2],&lt;br /&gt;
        slicePosition[0], slicePosition[1], slicePosition[2], 0)&lt;br /&gt;
&lt;br /&gt;
# Example usage:&lt;br /&gt;
sliceNode = getNode('vtkMRMLSliceNodeRed')&lt;br /&gt;
transformNode = getNode('Transform_3')&lt;br /&gt;
transformMatrix = vtk.vtkMatrix4x4()&lt;br /&gt;
transformNode.GetMatrixTransformToParent(transformMatrix)&lt;br /&gt;
sliceNormal = [transformMatrix.GetElement(0,2), transformMatrix.GetElement(1,2), transformMatrix.GetElement(2,2)]&lt;br /&gt;
slicePosition = [transformMatrix.GetElement(0,3), transformMatrix.GetElement(1,3), transformMatrix.GetElement(2,3)]&lt;br /&gt;
setSlicePoseFromSliceNormalAndPosition(sliceNode, sliceNormal, slicePosition)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Switching to markup fiducial placement mode==&lt;br /&gt;
&lt;br /&gt;
To activate a fiducial placement mode, both interaction mode has to be set and a fiducial node has to be selected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interactionNode = slicer.app.applicationLogic().GetInteractionNode()&lt;br /&gt;
selectionNode = slicer.app.applicationLogic().GetSelectionNode()&lt;br /&gt;
selectionNode.SetReferenceActivePlaceNodeClassName(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
fiducialNode = slicer.vtkMRMLMarkupsFiducialNode()&lt;br /&gt;
slicer.mrmlScene.AddNode(fiducialNode)&lt;br /&gt;
fiducialNode.CreateDefaultDisplayNodes() &lt;br /&gt;
selectionNode.SetActivePlaceNodeID(fiducialNode.GetID())&lt;br /&gt;
interactionNode.SetCurrentInteractionMode(interactionNode.Place)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, ''qSlicerMarkupsPlaceWidget'' widget can be used to initiate markup placement:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Temporary markups node&lt;br /&gt;
markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
def placementModeChanged(active):&lt;br /&gt;
  print(&amp;quot;Placement: &amp;quot; +(&amp;quot;active&amp;quot; if active else &amp;quot;inactive&amp;quot;))&lt;br /&gt;
  # You can inspect what is in the markups node here, delete the temporary markup node, etc.&lt;br /&gt;
&lt;br /&gt;
# Create and set up widget that contains a single &amp;quot;place markup&amp;quot; button. The widget can be placed in the module GUI.&lt;br /&gt;
placeWidget = slicer.qSlicerMarkupsPlaceWidget()&lt;br /&gt;
placeWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
placeWidget.setCurrentNode(markupsNode)&lt;br /&gt;
placeWidget.buttonsVisible=False&lt;br /&gt;
placeWidget.placeButton().show()&lt;br /&gt;
placeWidget.connect('activeMarkupsFiducialPlaceModeChanged(bool)', placementModeChanged)&lt;br /&gt;
placeWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change markup fiducial display properties==&lt;br /&gt;
&lt;br /&gt;
Display properties are stored in display node(s) associated with the fiducial node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fiducialNode = getNode('F')&lt;br /&gt;
fiducialDisplayNode = fiducialNode.GetDisplayNode()&lt;br /&gt;
fiducialDisplayNode.SetVisibility(False) # Hide all points&lt;br /&gt;
fiducialDisplayNode.SetVisibility(True) # Show all points&lt;br /&gt;
fiducialDisplayNode.SetSelectedColor(1,1,0) # Set color to yellow&lt;br /&gt;
fiducialDisplayNode.SetViewNodeIDs([&amp;quot;vtkMRMLSliceNodeRed&amp;quot;, &amp;quot;vtkMRMLViewNode1&amp;quot;]) # Only show in red slice view and first 3D view&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get a notification if a markup point position is modified==&lt;br /&gt;
&lt;br /&gt;
Event management of Slicer-4.11 version is still subject to change. The example below shows how point manipulation can be observed now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onMarkupChanged(caller,event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()&lt;br /&gt;
    if movingMarkupIndex &amp;gt;= 0:&lt;br /&gt;
        pos = [0,0,0]&lt;br /&gt;
        markupsNode.GetNthFiducialPosition(movingMarkupIndex, pos)&lt;br /&gt;
        isPreview = markupsNode.GetNthControlPointPositionStatus(movingMarkupIndex) == slicer.vtkMRMLMarkupsNode.PositionPreview&lt;br /&gt;
        if isPreview:&lt;br /&gt;
            logging.info(&amp;quot;Point {0} is previewed at {1} in slice view {2}&amp;quot;.format(movingMarkupIndex, pos, sliceView))&lt;br /&gt;
        else:&lt;br /&gt;
            logging.info(&amp;quot;Point {0} was moved {1} in slice view {2}&amp;quot;.format(movingMarkupIndex, pos, sliceView))&lt;br /&gt;
    else:&lt;br /&gt;
        logging.info(&amp;quot;Points modified: slice view = {0}&amp;quot;.format(sliceView))&lt;br /&gt;
&lt;br /&gt;
def onMarkupStartInteraction(caller, event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()    &lt;br /&gt;
    logging.info(&amp;quot;Start interaction: point ID = {0}, slice view = {1}&amp;quot;.format(movingMarkupIndex, sliceView))&lt;br /&gt;
&lt;br /&gt;
def onMarkupEndInteraction(caller, event):&lt;br /&gt;
    markupsNode = caller&lt;br /&gt;
    sliceView = markupsNode.GetAttribute('Markups.MovingInSliceView')&lt;br /&gt;
    movingMarkupIndex = markupsNode.GetDisplayNode().GetActiveControlPoint()&lt;br /&gt;
    logging.info(&amp;quot;End interaction: point ID = {0}, slice view = {1}&amp;quot;.format(movingMarkupIndex, sliceView))&lt;br /&gt;
&lt;br /&gt;
markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;)&lt;br /&gt;
markupsNode.CreateDefaultDisplayNodes()&lt;br /&gt;
markupsNode.AddFiducial(0,0,0)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointModifiedEvent, onMarkupChanged)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointStartInteractionEvent, onMarkupStartInteraction)&lt;br /&gt;
markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointEndInteractionEvent, onMarkupEndInteraction)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get a notification if a transform is modified==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onTransformNodeModified(transformNode, unusedArg2=None, unusedArg3=None):&lt;br /&gt;
  transformMatrix = vtk.vtkMatrix4x4()&lt;br /&gt;
  transformNode.GetMatrixTransformToWorld(transformMatrix)&lt;br /&gt;
  print(&amp;quot;Position: [{0}, {1}, {2}]&amp;quot;.format(transformMatrix.GetElement(0,3), transformMatrix.GetElement(1,3), transformMatrix.GetElement(2,3)))&lt;br /&gt;
&lt;br /&gt;
transformNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLTransformNode&amp;quot;)&lt;br /&gt;
transformNode.AddObserver(slicer.vtkMRMLTransformNode.TransformModifiedEvent, onTransformNodeModified)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a context menu when a markup point is clicked in a slice or 3D view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Example actions to perform&lt;br /&gt;
&lt;br /&gt;
def action1():&lt;br /&gt;
  print('Action1 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
def action2():&lt;br /&gt;
  print('Action2 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
def action3():&lt;br /&gt;
  print('Action3 on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
&lt;br /&gt;
# Clicked markup index is saved here to let the action&lt;br /&gt;
# know which markup needs to be manipulated.&lt;br /&gt;
slicer.clickedMarkupIndex = -1&lt;br /&gt;
  &lt;br /&gt;
# Create a simple menu&lt;br /&gt;
&lt;br /&gt;
menu = qt.QMenu()&lt;br /&gt;
a1 = qt.QAction(&amp;quot;Test&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a1.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a1)&lt;br /&gt;
a2 = qt.QAction(&amp;quot;Action&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a2.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a2)&lt;br /&gt;
a3 = qt.QAction(&amp;quot;Here&amp;quot;, slicer.util.mainWindow())&lt;br /&gt;
a3.connect('triggered()', action1)&lt;br /&gt;
menu.addAction(a3)&lt;br /&gt;
&lt;br /&gt;
# Add observer to a markup fiducial list&lt;br /&gt;
&lt;br /&gt;
@vtk.calldata_type(vtk.VTK_INT)&lt;br /&gt;
def markupClickedCallback(caller, eventId, callData):&lt;br /&gt;
  slicer.clickedMarkupIndex = callData&lt;br /&gt;
  print('Open menu on markup '+str(slicer.clickedMarkupIndex))&lt;br /&gt;
  menu.move(qt.QCursor.pos())&lt;br /&gt;
  menu.show()&lt;br /&gt;
&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
observerTag = markupsNode.AddObserver(slicer.vtkMRMLMarkupsNode.PointClickedEvent, markupClickedCallback)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Write markup positions to JSON file==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
markupNode = getNode('F')&lt;br /&gt;
outputFileName = 'c:/tmp/test.json'&lt;br /&gt;
&lt;br /&gt;
# Get markup positions&lt;br /&gt;
data = []&lt;br /&gt;
for fidIndex in range(markupNode.GetNumberOfFiducials()):&lt;br /&gt;
  coords=[0,0,0]&lt;br /&gt;
  markupNode.GetNthFiducialPosition(fidIndex,coords)&lt;br /&gt;
  data.append({'label': markupNode.GetNthFiducialLabel(), 'position': coords})&lt;br /&gt;
&lt;br /&gt;
import json&lt;br /&gt;
with open(outputFileName, 'w') as outfile:&lt;br /&gt;
  json.dump(data, outfile)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Write annotation ROI to JSON file==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
roiNode = getNode('R')&lt;br /&gt;
outputFileName = &amp;quot;c:/tmp/test.json&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Get annotation ROI data&lt;br /&gt;
center = [0,0,0]&lt;br /&gt;
radius = [0,0,0]&lt;br /&gt;
roiNode.GetControlPointWorldCoordinates(0, center)&lt;br /&gt;
roiNode.GetControlPointWorldCoordinates(1, radius)&lt;br /&gt;
data = {'center': radius, 'radius': radius}&lt;br /&gt;
&lt;br /&gt;
# Write to json file&lt;br /&gt;
import json&lt;br /&gt;
with open(outputFileName, 'w') as outfile:&lt;br /&gt;
  json.dump(data, outfile)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a simple surface mesh as a model node==&lt;br /&gt;
&lt;br /&gt;
This example shows how to display a simple surface mesh (a box, created by a VTK source filter) as a model node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Create and set up polydata source&lt;br /&gt;
box = vtk.vtkCubeSource()&lt;br /&gt;
box.SetXLength(30)&lt;br /&gt;
box.SetYLength(20)&lt;br /&gt;
box.SetZLength(15)&lt;br /&gt;
box.SetCenter(10,20,5)&lt;br /&gt;
&lt;br /&gt;
# Create a model node that displays output of the source&lt;br /&gt;
boxNode = slicer.modules.models.logic().AddModel(box.GetOutputPort())&lt;br /&gt;
&lt;br /&gt;
# Adjust display properties&lt;br /&gt;
boxNode.GetDisplayNode().SetColor(1,0,0)&lt;br /&gt;
boxNode.GetDisplayNode().SetOpacity(0.8)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Add a texture mapped plane to the scene as a model==&lt;br /&gt;
Note that model textures are not exposed in the GUI and are not saved in the scene&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# use dummy image data here&lt;br /&gt;
e = vtk.vtkImageEllipsoidSource()&lt;br /&gt;
&lt;br /&gt;
scene = slicer.mrmlScene&lt;br /&gt;
&lt;br /&gt;
# Create model node&lt;br /&gt;
model = slicer.vtkMRMLModelNode()&lt;br /&gt;
model.SetScene(scene)&lt;br /&gt;
model.SetName(scene.GenerateUniqueName(&amp;quot;2DImageModel&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
planeSource = vtk.vtkPlaneSource()&lt;br /&gt;
model.SetAndObservePolyData(planeSource.GetOutput())&lt;br /&gt;
&lt;br /&gt;
# Create display node&lt;br /&gt;
modelDisplay = slicer.vtkMRMLModelDisplayNode()&lt;br /&gt;
modelDisplay.SetColor(1,1,0) # yellow&lt;br /&gt;
modelDisplay.SetBackfaceCulling(0)&lt;br /&gt;
modelDisplay.SetScene(scene)&lt;br /&gt;
scene.AddNode(modelDisplay)&lt;br /&gt;
model.SetAndObserveDisplayNodeID(modelDisplay.GetID())&lt;br /&gt;
&lt;br /&gt;
# Add to scene&lt;br /&gt;
modelDisplay.SetAndObserveTextureImageData(e.GetOutput())&lt;br /&gt;
scene.AddNode(model) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
transform = slicer.vtkMRMLLinearTransformNode()&lt;br /&gt;
scene.AddNode(transform) &lt;br /&gt;
model.SetAndObserveTransformNodeID(transform.GetID())&lt;br /&gt;
&lt;br /&gt;
vTransform = vtk.vtkTransform()&lt;br /&gt;
vTransform.Scale(50,50,50)&lt;br /&gt;
vTransform.RotateX(30)&lt;br /&gt;
transform.SetAndObserveMatrixTransformToParent(vTransform.GetMatrix())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get scalar values at surface of a model==&lt;br /&gt;
&lt;br /&gt;
The following script allows getting selected scalar value at a selected position of a model. Position can be selected by moving the mouse while holding down Shift key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelNode = getNode('sphere')&lt;br /&gt;
modelPointValues = modelNode.GetPolyData().GetPointData().GetArray(&amp;quot;Normals&amp;quot;)&lt;br /&gt;
markupsNode = slicer.mrmlScene.GetFirstNodeByName('F')&lt;br /&gt;
&lt;br /&gt;
if not markupsNode:&lt;br /&gt;
  markupsNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLMarkupsFiducialNode&amp;quot;,&amp;quot;F&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
pointsLocator = vtk.vtkPointLocator() # could try using vtk.vtkStaticPointLocator() if need to optimize&lt;br /&gt;
pointsLocator.SetDataSet(modelNode.GetPolyData())&lt;br /&gt;
pointsLocator.BuildLocator()&lt;br /&gt;
&lt;br /&gt;
def onMouseMoved(observer,eventid):  &lt;br /&gt;
  ras=[0,0,0]&lt;br /&gt;
  crosshairNode.GetCursorPositionRAS(ras)&lt;br /&gt;
  if markupsNode.GetNumberOfFiducials() == 0:&lt;br /&gt;
    markupsNode.AddFiducial(*ras)&lt;br /&gt;
  else:&lt;br /&gt;
    markupsNode.SetNthFiducialPosition(0,*ras)&lt;br /&gt;
  closestPointId = pointsLocator.FindClosestPoint(ras)&lt;br /&gt;
  closestPointValue = modelPointValues.GetTuple(closestPointId)&lt;br /&gt;
  print(&amp;quot;RAS = &amp;quot; + repr(ras) + &amp;quot;    value = &amp;quot; + repr(closestPointValue))&lt;br /&gt;
&lt;br /&gt;
crosshairNode=slicer.util.getNode('Crosshair') &lt;br /&gt;
observationId = crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, onMouseMoved)&lt;br /&gt;
&lt;br /&gt;
# To stop printing of values run this:&lt;br /&gt;
# crosshairNode.RemoveObserver(observationId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Select cells of a using markups fiducial points==&lt;br /&gt;
&lt;br /&gt;
The following script selects cells of a model node that are closest to positions of markups fiducial points.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get input nodes&lt;br /&gt;
modelNode = slicer.util.getNode('Segment_1') # select cells in this model&lt;br /&gt;
markupsNode = slicer.util.getNode('F') # points will be selected at positions specified by this markups fiducial node&lt;br /&gt;
&lt;br /&gt;
# Create scalar array that will store selection state&lt;br /&gt;
cellScalars = modelNode.GetMesh().GetCellData()&lt;br /&gt;
selectionArray = cellScalars.GetArray('selection')&lt;br /&gt;
if not selectionArray:&lt;br /&gt;
    selectionArray = vtk.vtkIntArray()&lt;br /&gt;
    selectionArray.SetName('selection')&lt;br /&gt;
    selectionArray.SetNumberOfValues(modelNode.GetMesh().GetNumberOfCells())&lt;br /&gt;
    selectionArray.Fill(0)&lt;br /&gt;
    cellScalars.AddArray(selectionArray)&lt;br /&gt;
&lt;br /&gt;
# Set up coloring by selection array&lt;br /&gt;
modelNode.GetDisplayNode().SetActiveScalar(&amp;quot;selection&amp;quot;, vtk.vtkAssignAttribute.CELL_DATA)&lt;br /&gt;
modelNode.GetDisplayNode().SetAndObserveColorNodeID(&amp;quot;vtkMRMLColorTableNodeWarm1&amp;quot;)&lt;br /&gt;
modelNode.GetDisplayNode().SetScalarVisibility(True)&lt;br /&gt;
&lt;br /&gt;
# Initialize cell locator&lt;br /&gt;
cell = vtk.vtkCellLocator()&lt;br /&gt;
cell.SetDataSet(modelNode.GetMesh())&lt;br /&gt;
cell.BuildLocator()&lt;br /&gt;
&lt;br /&gt;
def onPointsModified(observer=None, eventid=None):&lt;br /&gt;
    global markupsNode, selectionArray&lt;br /&gt;
    selectionArray.Fill(0) # set all cells to non-selected by default&lt;br /&gt;
    markupPoints = slicer.util.arrayFromMarkupsControlPoints(markupsNode)&lt;br /&gt;
    closestPoint = [0.0, 0.0, 0.0]&lt;br /&gt;
    cellObj = vtk.vtkGenericCell()&lt;br /&gt;
    cellId = vtk.mutable(0)&lt;br /&gt;
    subId = vtk.mutable(0)&lt;br /&gt;
    dist2 = vtk.mutable(0.0)&lt;br /&gt;
    for markupPoint in markupPoints:&lt;br /&gt;
        cell.FindClosestPoint(markupPoint, closestPoint, cellObj, cellId, subId, dist2)&lt;br /&gt;
        closestCell = cellId.get()&lt;br /&gt;
        if closestCell &amp;gt;=0:&lt;br /&gt;
            selectionArray.SetValue(closestCell, 100) # set selected cell's scalar value to non-zero&lt;br /&gt;
    selectionArray.Modified()&lt;br /&gt;
&lt;br /&gt;
# Initial update&lt;br /&gt;
onPointsModified()&lt;br /&gt;
# Automatic update each time when a markup point is modified&lt;br /&gt;
markupsNodeObserverTag = markupsNode.AddObserver(slicer.vtkMRMLMarkupsFiducialNode.PointModifiedEvent, onPointsModified)&lt;br /&gt;
&lt;br /&gt;
# To stop updating selection, run this:&lt;br /&gt;
# markupsNode.RemoveObserver(markupsNodeObserverTag)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export entire scene as VRML==&lt;br /&gt;
&lt;br /&gt;
Save all surface meshes displayed in the scene (models, markups, etc). Solid colors and coloring by scalar is preserved. Textures are not supported.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exporter = vtk.vtkVRMLExporter()&lt;br /&gt;
exporter.SetRenderWindow(slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow())&lt;br /&gt;
exporter.SetFileName('C:/tmp/something.wrl')&lt;br /&gt;
exporter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export model to Blender, including color by scalar==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelNode = getNode(&amp;quot;Model&amp;quot;)&lt;br /&gt;
plyFilePath = &amp;quot;c:/tmp/model.ply&amp;quot;&lt;br /&gt;
&lt;br /&gt;
modelDisplayNode = modelNode.GetDisplayNode()&lt;br /&gt;
triangles = vtk.vtkTriangleFilter()&lt;br /&gt;
triangles.SetInputConnection(modelDisplayNode.GetOutputPolyDataConnection())&lt;br /&gt;
&lt;br /&gt;
plyWriter = vtk.vtkPLYWriter()&lt;br /&gt;
plyWriter.SetInputConnection(triangles.GetOutputPort())&lt;br /&gt;
lut = vtk.vtkLookupTable()&lt;br /&gt;
lut.DeepCopy(modelDisplayNode.GetColorNode().GetLookupTable())&lt;br /&gt;
lut.SetRange(modelDisplayNode.GetScalarRange())&lt;br /&gt;
plyWriter.SetLookupTable(lut)&lt;br /&gt;
plyWriter.SetArrayName(modelDisplayNode.GetActiveScalarName())&lt;br /&gt;
&lt;br /&gt;
plyWriter.SetFileName(plyFilePath)&lt;br /&gt;
plyWriter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Export a tract (FiberBundle) to Blender, including color==&lt;br /&gt;
&amp;lt;div id=&amp;quot;Export_a_fiber_tracts_to_Blender.2C_including_color&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
Note: an interactive version of this script is now included in the [http://dmri.slicer.org/ SlicerDMRI extension] ([https://github.com/SlicerDMRI/SlicerDMRI/tree/master/Modules/Scripted/TractographyExportPLY module code]). &lt;br /&gt;
After installing SlicerDMRI, go to ''Modules -&amp;gt; Diffusion -&amp;gt; Import and Export -&amp;gt; Export tractography to PLY (mesh)''.&lt;br /&gt;
&lt;br /&gt;
The example below shows how to export a tractography &amp;quot;FiberBundleNode&amp;quot; to a PLY file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lineDisplayNode = getNode(&amp;quot;*LineDisplay*&amp;quot;)&lt;br /&gt;
plyFilePath = &amp;quot;/tmp/fibers.ply&amp;quot;&lt;br /&gt;
&lt;br /&gt;
tuber = vtk.vtkTubeFilter()&lt;br /&gt;
tuber.SetInputData(lineDisplayNode.GetOutputPolyData())&lt;br /&gt;
tuber.Update()&lt;br /&gt;
tubes = tuber.GetOutputDataObject(0)&lt;br /&gt;
scalars = tubes.GetPointData().GetArray(0)&lt;br /&gt;
scalars.SetName(&amp;quot;scalars&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
triangles = vtk.vtkTriangleFilter()&lt;br /&gt;
triangles.SetInputData(tubes)&lt;br /&gt;
triangles.Update()&lt;br /&gt;
&lt;br /&gt;
colorNode = lineDisplayNode.GetColorNode()&lt;br /&gt;
lookupTable = vtk.vtkLookupTable()&lt;br /&gt;
lookupTable.DeepCopy(colorNode.GetLookupTable())&lt;br /&gt;
lookupTable.SetTableRange(0,1)&lt;br /&gt;
&lt;br /&gt;
plyWriter = vtk.vtkPLYWriter()&lt;br /&gt;
plyWriter.SetInputData(triangles.GetOutput())&lt;br /&gt;
plyWriter.SetLookupTable(lookupTable)&lt;br /&gt;
plyWriter.SetArrayName(&amp;quot;scalars&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
plyWriter.SetFileName(plyFilePath)&lt;br /&gt;
plyWriter.Write()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Iterate over tract (FiberBundle) streamline points==&lt;br /&gt;
&lt;br /&gt;
This example shows how to access the points in each line of a FiberBundle as a numpy array (view).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from vtk.util.numpy_support import vtk_to_numpy&lt;br /&gt;
&lt;br /&gt;
fb = getNode(&amp;quot;FiberBundle_F&amp;quot;) # &amp;lt;- fill in node ID here&lt;br /&gt;
&lt;br /&gt;
# get point data as 1d array&lt;br /&gt;
points = slicer.util.arrayFromModelPoints(fb)&lt;br /&gt;
&lt;br /&gt;
# get line cell ids as 1d array&lt;br /&gt;
line_ids = vtk_to_numpy(fb.GetPolyData().GetLines().GetData())&lt;br /&gt;
&lt;br /&gt;
# VTK cell ids are stored as&lt;br /&gt;
#   [ N0 c0_id0 ... c0_id0&lt;br /&gt;
#     N1 c1_id0 ... c1_idN1 ]&lt;br /&gt;
# so we need to&lt;br /&gt;
# - read point count for each line (cell)&lt;br /&gt;
# - grab the ids in that range from `line_ids` array defined above&lt;br /&gt;
# - index the `points` array by those ids&lt;br /&gt;
cur_idx = 1&lt;br /&gt;
for _ in range(pd.GetLines().GetNumberOfCells()):&lt;br /&gt;
    # - read point count for this line (cell)&lt;br /&gt;
    count = lines[cur_idx - 1]&lt;br /&gt;
&lt;br /&gt;
    # - grab the ids in that range from `lines`&lt;br /&gt;
    index_array = line_ids[ cur_idx : cur_idx + count]&lt;br /&gt;
    # update to the next range &lt;br /&gt;
    cur_idx += count + 1&lt;br /&gt;
&lt;br /&gt;
    # - index the point array by those ids&lt;br /&gt;
    line_points = points[index_array]&lt;br /&gt;
&lt;br /&gt;
    # do work here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Clone a node==&lt;br /&gt;
&lt;br /&gt;
This example shows how to make a copy of any node that appears in Subject Hierarchy (in Data module).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a node from SampleData that we will clone&lt;br /&gt;
import SampleData&lt;br /&gt;
nodeToClone = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
&lt;br /&gt;
# Clone the node&lt;br /&gt;
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
itemIDToClone = shNode.GetItemByDataNode(nodeToClone)&lt;br /&gt;
clonedItemID = slicer.modules.subjecthierarchy.logic().CloneSubjectHierarchyItem(shNode, itemIDToClone)&lt;br /&gt;
clonedNode = shNode.GetItemDataNode(clonedItemID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Clone a volume==&lt;br /&gt;
This example shows how to clone the MRHead sample volume, including its pixel data and display settings.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sourceVolumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
volumesLogic = slicer.modules.volumes.logic()&lt;br /&gt;
clonedVolumeNode = volumesLogic.CloneVolume(slicer.mrmlScene, sourceVolumeNode, 'Cloned volume')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create a new volume==&lt;br /&gt;
This example shows how to create a new empty volume.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nodeName = &amp;quot;MyNewVolume&amp;quot;&lt;br /&gt;
imageSize = [512, 512, 512]&lt;br /&gt;
voxelType=vtk.VTK_UNSIGNED_CHAR&lt;br /&gt;
imageOrigin = [0.0, 0.0, 0.0]&lt;br /&gt;
imageSpacing = [1.0, 1.0, 1.0]&lt;br /&gt;
imageDirections = [[1,0,0], [0,1,0], [0,0,1]]&lt;br /&gt;
fillVoxelValue = 0&lt;br /&gt;
&lt;br /&gt;
# Create an empty image volume, filled with fillVoxelValue&lt;br /&gt;
imageData = vtk.vtkImageData()&lt;br /&gt;
imageData.SetDimensions(imageSize)&lt;br /&gt;
imageData.AllocateScalars(voxelType, 1)&lt;br /&gt;
imageData.GetPointData().GetScalars().Fill(fillVoxelValue)&lt;br /&gt;
# Create volume node&lt;br /&gt;
volumeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;, nodeName)&lt;br /&gt;
volumeNode.SetOrigin(imageOrigin)&lt;br /&gt;
volumeNode.SetSpacing(imageSpacing)&lt;br /&gt;
volumeNode.SetIJKToRASDirections(imageDirections)&lt;br /&gt;
volumeNode.SetAndObserveImageData(imageData)&lt;br /&gt;
volumeNode.CreateDefaultDisplayNodes()&lt;br /&gt;
volumeNode.CreateDefaultStorageNode()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get value of a volume at specific voxel coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get voxel value of &amp;quot;volumeNode&amp;quot; at &amp;quot;ijk&amp;quot; volume voxel coordinates.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
ijk = [20,40,30]  # volume voxel coordinates&lt;br /&gt;
&lt;br /&gt;
voxels = slicer.util.arrayFromVolume(volumeNode)  # get voxels as a numpy array&lt;br /&gt;
voxelValue = voxels[ijk[2], ijk[1], ijk[0]]  # note that numpy array index order is kji (not ijk)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Modify voxels in a volume==&lt;br /&gt;
&lt;br /&gt;
Typically the fastest and simplest way of modifying voxels is by using numpy operators. Voxels can be retrieved in a numpy array using the `array` method and modified using standard numpy methods. For example, threshold a volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nodeName = 'MRHead'&lt;br /&gt;
thresholdValue = 100&lt;br /&gt;
voxelArray = array(nodeName) # get voxels as numpy array&lt;br /&gt;
voxelArray[voxelArray &amp;lt; thresholdValue] = 0 # modify voxel values&lt;br /&gt;
getNode(nodeName).Modified() # at the end of all processing, notify Slicer that the image modification is completed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to change voxels values of the MRHead sample volume.&lt;br /&gt;
The values will be computed by function f(r,a,s,) = (r-10)*(r-10)+(a+15)*(a+15)+s*s.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode=slicer.util.getNode('MRHead')&lt;br /&gt;
ijkToRas = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetIJKToRASMatrix(ijkToRas)&lt;br /&gt;
imageData=volumeNode.GetImageData()&lt;br /&gt;
extent = imageData.GetExtent()&lt;br /&gt;
for k in range(extent[4], extent[5]+1):&lt;br /&gt;
  for j in range(extent[2], extent[3]+1):&lt;br /&gt;
    for i in range(extent[0], extent[1]+1):&lt;br /&gt;
      position_Ijk=[i, j, k, 1]&lt;br /&gt;
      position_Ras=ijkToRas.MultiplyPoint(position_Ijk)&lt;br /&gt;
      r=position_Ras[0]&lt;br /&gt;
      a=position_Ras[1]&lt;br /&gt;
      s=position_Ras[2]      &lt;br /&gt;
      functionValue=(r-10)*(r-10)+(a+15)*(a+15)+s*s&lt;br /&gt;
      imageData.SetScalarComponentFromDouble(i,j,k,0,functionValue)&lt;br /&gt;
imageData.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get volume voxel coordinates from markup fiducial RAS coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get voxel coordinate of a volume corresponding to a markup fiducial point position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Inputs&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
markupsIndex = 0&lt;br /&gt;
&lt;br /&gt;
# Get point coordinate in RAS&lt;br /&gt;
point_Ras = [0, 0, 0, 1]&lt;br /&gt;
markupsNode.GetNthFiducialWorldCoordinates(markupsIndex, point_Ras)&lt;br /&gt;
&lt;br /&gt;
# If volume node is transformed, apply that transform to get volume's RAS coordinates&lt;br /&gt;
transformRasToVolumeRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(None, volumeNode.GetParentTransformNode(), transformRasToVolumeRas)&lt;br /&gt;
point_VolumeRas = transformRasToVolumeRas.TransformPoint(point_Ras[0:3])&lt;br /&gt;
&lt;br /&gt;
# Get voxel coordinates from physical coordinates&lt;br /&gt;
volumeRasToIjk = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetRASToIJKMatrix(volumeRasToIjk)&lt;br /&gt;
point_Ijk = [0, 0, 0, 1]&lt;br /&gt;
volumeRasToIjk.MultiplyPoint(np.append(point_VolumeRas,1.0), point_Ijk)&lt;br /&gt;
point_Ijk = [ int(round(c)) for c in point_Ijk[0:3] ]&lt;br /&gt;
&lt;br /&gt;
# Print output&lt;br /&gt;
print(point_Ijk)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get markup fiducial RAS coordinates from volume voxel coordinates==&lt;br /&gt;
&lt;br /&gt;
This example shows how to get position of maximum intensity voxel of a volume (determined by numpy, in IJK coordinates) in RAS coordinates so that it can be marked with a markup fiducial.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Inputs&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
markupsNode = getNode('F')&lt;br /&gt;
&lt;br /&gt;
# Get voxel position in IJK coordinate system&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeArray = slicer.util.arrayFromVolume(volumeNode)&lt;br /&gt;
# Get position of highest voxel value&lt;br /&gt;
point_Kji = np.where(volumeArray == volumeArray.max())&lt;br /&gt;
point_Ijk = [point_Kji[2][0], point_Kji[1][0], point_Kji[0][0]]&lt;br /&gt;
&lt;br /&gt;
# Get physical coordinates from voxel coordinates&lt;br /&gt;
volumeIjkToRas = vtk.vtkMatrix4x4()&lt;br /&gt;
volumeNode.GetIJKToRASMatrix(volumeIjkToRas)&lt;br /&gt;
point_VolumeRas = [0, 0, 0, 1]&lt;br /&gt;
volumeIjkToRas.MultiplyPoint(np.append(point_Ijk,1.0), point_VolumeRas)&lt;br /&gt;
&lt;br /&gt;
# If volume node is transformed, apply that transform to get volume's RAS coordinates&lt;br /&gt;
transformVolumeRasToRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(volumeNode.GetParentTransformNode(), None, transformVolumeRasToRas)&lt;br /&gt;
point_Ras = transformVolumeRasToRas.TransformPoint(point_VolumeRas[0:3])&lt;br /&gt;
&lt;br /&gt;
# Add a markup at the computed position and print its coordinates&lt;br /&gt;
markupsNode.AddFiducial(point_Ras[0], point_Ras[1], point_Ras[2], &amp;quot;max&amp;quot;)&lt;br /&gt;
print(point_Ras)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get the values of all voxels for a label value==&lt;br /&gt;
&lt;br /&gt;
If you have a background image called ‘Volume’ and a mask called ‘Volume-label’ created with the Editor you could do something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import numpy&lt;br /&gt;
volume = array(‘Volume’)&lt;br /&gt;
label = array(‘Volume-label’)&lt;br /&gt;
points  = numpy.where( label == 1 )  # or use another label number depending on what you segmented&lt;br /&gt;
values  = volume[points] # this will be a list of the label values&lt;br /&gt;
values.mean() # should match the mean value of LabelStatistics calculation as a double-check&lt;br /&gt;
numpy.savetxt(‘values.txt’, values)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Access values in a DTI tensor volume==&lt;br /&gt;
This example shows how to access individual tensors at the voxel level.&lt;br /&gt;
&lt;br /&gt;
First load your DWI volume and estimate tensors to produce a DTI volume called ‘Output DTI Volume’&lt;br /&gt;
&lt;br /&gt;
Then open the python window: View-&amp;gt;Python interactor&lt;br /&gt;
&lt;br /&gt;
Use this command to access tensors through numpy:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tensors = array('Output DTI Volume')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Type the following code into the Python window to access all tensor components using vtk commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode=slicer.util.getNode('Output DTI Volume')&lt;br /&gt;
imageData=volumeNode.GetImageData()&lt;br /&gt;
tensors = imageData.GetPointData().GetTensors()&lt;br /&gt;
extent = imageData.GetExtent()&lt;br /&gt;
idx = 0&lt;br /&gt;
for k in range(extent[4], extent[5]+1):&lt;br /&gt;
  for j in range(extent[2], extent[3]+1):&lt;br /&gt;
    for i in range(extent[0], extent[1]+1):&lt;br /&gt;
      tensors.GetTuple9(idx)&lt;br /&gt;
      idx += 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change window/level (brightness/contrast) or colormap of a volume==&lt;br /&gt;
This example shows how to change window/level of the MRHead sample volume.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = getNode('MRHead')&lt;br /&gt;
displayNode = volumeNode.GetDisplayNode()&lt;br /&gt;
displayNode.AutoWindowLevelOff()&lt;br /&gt;
displayNode.SetWindow(50)&lt;br /&gt;
displayNode.SetLevel(100)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change color mapping from grayscale to rainbow:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
displayNode.SetAndObserveColorNodeID('vtkMRMLColorTableNodeRainbow')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Make mouse left-click and drag on the image adjust window/level==&lt;br /&gt;
&lt;br /&gt;
In older Slicer versions, by default, left-click and drag in a slice view adjusted window/level of the displayed image. Window/level adjustment is now a new mouse mode that can be activated by clicking on its toolbar button or running this code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.app.applicationLogic().GetInteractionNode().SetCurrentInteractionMode(slicer.vtkMRMLInteractionNode.AdjustWindowLevel)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Create custom color table==&lt;br /&gt;
This example shows how to create a new color table, for example with inverted color range from the default Ocean color table.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
invertedocean = slicer.vtkMRMLColorTableNode()&lt;br /&gt;
invertedocean.SetTypeToUser()&lt;br /&gt;
invertedocean.SetNumberOfColors(256)&lt;br /&gt;
invertedocean.SetName(&amp;quot;InvertedOcean&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
for i in range(0,255):&lt;br /&gt;
    invertedocean.SetColor(i, 0.0, 1 - (i+1e-16)/255.0, 1.0, 1.0)&lt;br /&gt;
&lt;br /&gt;
slicer.mrmlScene.AddNode(invertedocean)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Manipulate a Slice View==&lt;br /&gt;
&lt;br /&gt;
===Change slice offset===&lt;br /&gt;
&lt;br /&gt;
Equivalent to moving the slider in slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
red = layoutManager.sliceWidget('Red')&lt;br /&gt;
redLogic = red.sliceLogic()&lt;br /&gt;
# Print current slice offset position&lt;br /&gt;
print(redLogic.GetSliceOffset())&lt;br /&gt;
# Change slice position&lt;br /&gt;
redLogic.SetSliceOffset(20)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Change slice orientation===&lt;br /&gt;
&lt;br /&gt;
Get 'Red' slice node and rotate around X and Y axes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.app.layoutManager().sliceWidget('Red').mrmlSliceNode()&lt;br /&gt;
sliceToRas = sliceNode.GetSliceToRAS()&lt;br /&gt;
transform=vtk.vtkTransform()&lt;br /&gt;
transform.SetMatrix(SliceToRAS)&lt;br /&gt;
transform.RotateX(20)&lt;br /&gt;
transform.RotateY(15)&lt;br /&gt;
sliceToRas.DeepCopy(transform.GetMatrix())&lt;br /&gt;
sliceNode.UpdateMatrices()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show slice views in 3D window===&lt;br /&gt;
&lt;br /&gt;
Equivalent to clicking 'eye' icon in the slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  controller = layoutManager.sliceWidget(sliceViewName).sliceController()&lt;br /&gt;
  controller.setSliceVisible(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Reset field of view to show background volume maximized===&lt;br /&gt;
&lt;br /&gt;
Equivalent to click small rectangle button (&amp;quot;Adjust the slice viewer's field of view...&amp;quot;) in the slice view controller.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.resetSliceViews()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Rotate slice views to volume plane===&lt;br /&gt;
&lt;br /&gt;
Aligns slice views to volume axes, shows original image acquisition planes in slice views.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('MRHead')&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  layoutManager.sliceWidget(sliceViewName).mrmlSliceNode().RotateToVolumePlane(volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Iterate over current visible slice views, and set foreground and background images===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=mrVolume, foreground=ctVolume)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Internally, this method performs something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
     compositeNode = layoutManager.sliceWidget(sliceViewName).sliceLogic().GetSliceCompositeNode()&lt;br /&gt;
     # setup background volume&lt;br /&gt;
     compositeNode.SetBackgroundVolumeID(mrVolume.GetID())&lt;br /&gt;
     # setup foreground volume&lt;br /&gt;
     compositeNode.SetForegroundVolumeID(ctVolume.GetID())&lt;br /&gt;
     # change opacity&lt;br /&gt;
     compositeNode.SetForegroundOpacity(0.3)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a volume in slice views==&lt;br /&gt;
&lt;br /&gt;
Recommended:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Show volume in all visible views where volume selection propagation is enabled:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
volumeNode = slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
applicationLogic = slicer.app.applicationLogic()&lt;br /&gt;
selectionNode = applicationLogic.GetSelectionNode()&lt;br /&gt;
selectionNode.SetSecondaryVolumeID(volumeNode.GetID())&lt;br /&gt;
applicationLogic.PropagateForegroundVolumeSelection(0) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Show volume in selected views:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n =  slicer.util.getNode('YourVolumeNode')&lt;br /&gt;
for color in ['Red', 'Yellow', 'Green']:&lt;br /&gt;
    slicer.app.layoutManager().sliceWidget(color).sliceLogic().GetSliceCompositeNode().SetForegroundVolumeID(n.GetID())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change opacity of foreground volume in slice views==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.setSliceViewerLayers(foregroundOpacity=0.4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
Change opacity in a selected view&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
sliceLogic = lm.sliceWidget('Red').sliceLogic()&lt;br /&gt;
compositeNode = sliceLogic.GetSliceCompositeNode()&lt;br /&gt;
compositeNode.SetForegroundOpacity(0.4)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Fit slice plane to markup fiducials==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID(&amp;quot;vtkMRMLSliceNodeRed&amp;quot;)&lt;br /&gt;
markupsNode = slicer.mrmlScene.GetFirstNodeByName(&amp;quot;F&amp;quot;)&lt;br /&gt;
# Get markup point positions as numpy arrays&lt;br /&gt;
import numpy as np&lt;br /&gt;
p1 = np.array([0,0,0])&lt;br /&gt;
p2 = np.array([0,0,0])&lt;br /&gt;
p3 = np.array([0,0,0])&lt;br /&gt;
markupsNode.GetNthFiducialPosition(0, p1)&lt;br /&gt;
markupsNode.GetNthFiducialPosition(1, p2)&lt;br /&gt;
markupsNode.GetNthFiducialPosition(2, p3)&lt;br /&gt;
# Get plane axis directions&lt;br /&gt;
n = np.cross(p2-p1, p2-p3) # plane normal direction&lt;br /&gt;
n = n/np.linalg.norm(n)&lt;br /&gt;
t = np.cross([0, 0, 1], n) # plane transverse direction&lt;br /&gt;
t = t/np.linalg.norm(t)&lt;br /&gt;
# Set slice plane orientation and position&lt;br /&gt;
sliceNode.SetSliceToRASByNTP(n[0], n[1], n[2], t[0], t[1], t[2], p1[0], p1[1], p1[2], 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save a series of images from a Slice View==&lt;br /&gt;
&lt;br /&gt;
You can use ScreenCapture module to capture series of images. To do it programmatically, save the following into a file such as '/tmp/record.py' and then in the slicer python console type &amp;quot;execfile('/tmp/record.py')&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = 'Green'&lt;br /&gt;
imagePathPattern = '/tmp/image-%03d.png'&lt;br /&gt;
steps = 10&lt;br /&gt;
&lt;br /&gt;
widget = slicer.app.layoutManager().sliceWidget(layoutName)&lt;br /&gt;
view = widget.sliceView()&lt;br /&gt;
logic = widget.sliceLogic()&lt;br /&gt;
bounds = [0,]*6&lt;br /&gt;
logic.GetSliceBounds(bounds)&lt;br /&gt;
&lt;br /&gt;
for step in range(steps):&lt;br /&gt;
    offset = bounds[4] + step/(1.*steps) * (bounds[5]-bounds[4])&lt;br /&gt;
    logic.SetSliceOffset(offset)&lt;br /&gt;
    view.forceRender()&lt;br /&gt;
    image = qt.QPixmap.grabWidget(view).toImage()&lt;br /&gt;
    image.save(imagePathPattern % step)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save the scene into a new directory==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Create a new directory where the scene will be saved into&lt;br /&gt;
import time&lt;br /&gt;
sceneSaveDirectory = slicer.app.temporaryPath + &amp;quot;/saved-scene-&amp;quot; + time.strftime(&amp;quot;%Y%m%d-%H%M%S&amp;quot;)&lt;br /&gt;
if not os.access(sceneSaveDirectory, os.F_OK):&lt;br /&gt;
  os.makedirs(sceneSaveDirectory)&lt;br /&gt;
&lt;br /&gt;
# Save the scene&lt;br /&gt;
if slicer.app.applicationLogic().SaveSceneToSlicerDataBundleDirectory(sceneSaveDirectory, None):&lt;br /&gt;
  logging.info(&amp;quot;Scene saved to: {0}&amp;quot;.format(sceneSaveDirectory))&lt;br /&gt;
else:&lt;br /&gt;
  logging.error(&amp;quot;Scene saving failed&amp;quot;) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save the scene into a single MRB file==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Generate file name&lt;br /&gt;
import time&lt;br /&gt;
sceneSaveFilename = slicer.app.temporaryPath + &amp;quot;/saved-scene-&amp;quot; + time.strftime(&amp;quot;%Y%m%d-%H%M%S&amp;quot;) + &amp;quot;.mrb&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Save scene&lt;br /&gt;
if slicer.util.saveScene(sceneSaveFilename):&lt;br /&gt;
  logging.info(&amp;quot;Scene saved to: {0}&amp;quot;.format(sceneSaveFilename))&lt;br /&gt;
else:&lt;br /&gt;
  logging.error(&amp;quot;Scene saving failed&amp;quot;) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Save a node to file==&lt;br /&gt;
&lt;br /&gt;
Save a transform node to file (should work with any other node type, if file extension is set to a supported one):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myNode = getNode(&amp;quot;LinearTransform_3&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
myStorageNode = myNode.CreateDefaultStorageNode()&lt;br /&gt;
myStorageNode.SetFileName(&amp;quot;c:/tmp/something.tfm&amp;quot;)&lt;br /&gt;
myStorageNode.WriteData(myNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Center the 3D View on the Scene==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
threeDWidget = layoutManager.threeDWidget(0)&lt;br /&gt;
threeDView = threeDWidget.threeDView()&lt;br /&gt;
threeDView.resetFocalPoint()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Rotate the 3D View==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
threeDWidget = layoutManager.threeDWidget(0)&lt;br /&gt;
threeDView = threeDWidget.threeDView()&lt;br /&gt;
threeDView.yaw()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Display text in a 3D view or slice view==&lt;br /&gt;
&lt;br /&gt;
The easiest way to show information overlaid on a viewer is to use corner annotations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
view=slicer.app.layoutManager().threeDWidget(0).threeDView()&lt;br /&gt;
# Set text to &amp;quot;Something&amp;quot;&lt;br /&gt;
view.cornerAnnotation().SetText(vtk.vtkCornerAnnotation.UpperRight,&amp;quot;Something&amp;quot;)&lt;br /&gt;
# Set color to red&lt;br /&gt;
view.cornerAnnotation().GetTextProperty().SetColor(1,0,0)&lt;br /&gt;
# Update the view&lt;br /&gt;
view.forceRender()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide slice view annotations (DataProbe)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Disable slice annotations immediately&lt;br /&gt;
slicer.modules.DataProbeInstance.infoWidget.sliceAnnotations.sliceViewAnnotationsEnabled=False&lt;br /&gt;
slicer.modules.DataProbeInstance.infoWidget.sliceAnnotations.updateSliceViewFromGUI()&lt;br /&gt;
# Disable slice annotations persistently (after Slicer restarts)&lt;br /&gt;
settings = qt.QSettings()&lt;br /&gt;
settings.setValue('DataProbe/sliceViewAnnotations.enabled', 0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Turning off interpolation==&lt;br /&gt;
&lt;br /&gt;
You can turn off interpolation for newly loaded volumes with this script from Steve Pieper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def NoInterpolate(caller,event):&lt;br /&gt;
  for node in slicer.util.getNodes('*').values():&lt;br /&gt;
    if node.IsA('vtkMRMLScalarVolumeDisplayNode'):&lt;br /&gt;
      node.SetInterpolate(0)&lt;br /&gt;
	&lt;br /&gt;
slicer.mrmlScene.AddObserver(slicer.mrmlScene.NodeAddedEvent, NoInterpolate)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The below link explains how to put this in your startup script.&lt;br /&gt;
&lt;br /&gt;
http://www.na-mic.org/Wiki/index.php/AHM2012-Slicer-Python#Refining_the_code_and_UI_with_slicerrc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Customize viewer layout==&lt;br /&gt;
&lt;br /&gt;
Show a custom layout of a 3D view on top of the red slice view:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
customLayout = &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;layout type=&amp;quot;vertical&amp;quot; split=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;&lt;br /&gt;
   &amp;lt;view class=&amp;quot;vtkMRMLViewNode&amp;quot; singletontag=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;property name=&amp;quot;viewlabel&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;1&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;/view&amp;gt;&lt;br /&gt;
  &amp;lt;/item&amp;gt;&lt;br /&gt;
  &amp;lt;item&amp;gt;&lt;br /&gt;
   &amp;lt;view class=&amp;quot;vtkMRMLSliceNode&amp;quot; singletontag=&amp;quot;Red&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;orientation&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;Axial&amp;lt;/property&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;viewlabel&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;R&amp;lt;/property&amp;gt;&lt;br /&gt;
    &amp;lt;property name=&amp;quot;viewcolor&amp;quot; action=&amp;quot;default&amp;quot;&amp;gt;#F34A33&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;/view&amp;gt;&lt;br /&gt;
  &amp;lt;/item&amp;gt;&lt;br /&gt;
&amp;lt;/layout&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Built-in layout IDs are all below 100, so you can choose any large random number&lt;br /&gt;
# for your custom layout ID.&lt;br /&gt;
customLayoutId=501&lt;br /&gt;
&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
layoutManager.layoutLogic().GetLayoutNode().AddLayoutDescription(customLayoutId, customLayout)                                         &lt;br /&gt;
&lt;br /&gt;
# Switch to the new custom layout &lt;br /&gt;
layoutManager.setLayout(customLayoutId)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See description of standard layouts (that can be used as examples) here:&lt;br /&gt;
https://github.com/Slicer/Slicer/blob/master/Libs/MRML/Logic/vtkMRMLLayoutLogic.cxx&lt;br /&gt;
&lt;br /&gt;
You can use this code snippet to add a button to the layout selector toolbar:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Add button to layout selector toolbar for this custom layout&lt;br /&gt;
viewToolBar = mainWindow().findChild('QToolBar', 'ViewToolBar')&lt;br /&gt;
layoutMenu = viewToolBar.widgetForAction(viewToolBar.actions()[0]).menu()&lt;br /&gt;
layoutSwitchActionParent = layoutMenu  # use `layoutMenu` to add inside layout list, use `viewToolBar` to add next the standard layout list&lt;br /&gt;
layoutSwitchAction = layoutSwitchActionParent.addAction(&amp;quot;My view&amp;quot;) # add inside layout list&lt;br /&gt;
layoutSwitchAction.setData(layoutId)&lt;br /&gt;
layoutSwitchAction.setIcon(qt.QIcon(':Icons/Go.png'))&lt;br /&gt;
layoutSwitchAction.setToolTip('3D and slice view')&lt;br /&gt;
layoutSwitchAction.connect('triggered()', lambda layoutId = customLayoutId: slicer.app.layoutManager().setLayout(layoutId))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Customize keyboard shortcuts==&lt;br /&gt;
&lt;br /&gt;
Keyboard shortcuts can be specified for activating any Slicer feature by adding a couple of lines to your &lt;br /&gt;
[[Documentation/{{documentation/version}}/Developers/Python_scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F|.slicerrc file]].&lt;br /&gt;
&lt;br /&gt;
For example, this script registers ''Ctrl+b'', ''Ctrl+n'', ''Ctrl+m'', ''Ctrl+,'' keyboard shortcuts to switch between red, yellow, green, and 4-up view layouts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
shortcuts = [&lt;br /&gt;
    ('Ctrl+b', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpRedSliceView)),&lt;br /&gt;
    ('Ctrl+n', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpYellowSliceView)),&lt;br /&gt;
    ('Ctrl+m', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutOneUpGreenSliceView)),&lt;br /&gt;
    ('Ctrl+,', lambda: slicer.app.layoutManager().setLayout(slicer.vtkMRMLLayoutNode.SlicerLayoutFourUpView))&lt;br /&gt;
    ]&lt;br /&gt;
&lt;br /&gt;
for (shortcutKey, callback) in shortcuts:&lt;br /&gt;
    shortcut = qt.QShortcut(slicer.util.mainWindow())&lt;br /&gt;
    shortcut.setKey(qt.QKeySequence(shortcutKey))&lt;br /&gt;
    shortcut.connect( 'activated()', callback)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disable certain user interactions in slice views==&lt;br /&gt;
&lt;br /&gt;
For example, disable slice browsing using mouse wheel and keyboard shortcuts in the red slice viewer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
interactorStyle = slicer.app.layoutManager().sliceWidget('Red').sliceView().sliceViewInteractorStyle()&lt;br /&gt;
interactorStyle.SetActionEnabled(interactorStyle.BrowseSlice, False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hide all slice view controllers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in lm.sliceViewNames():&lt;br /&gt;
  lm.sliceWidget(sliceViewName).sliceController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hide all 3D view controllers:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for viewIndex in range(slicer.app.layoutManager().threeDViewCount):&lt;br /&gt;
  lm.threeDWidget(0).threeDController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change default slice view orientation==&lt;br /&gt;
&lt;br /&gt;
You can left-right &amp;quot;flip&amp;quot; slice view orientation presets (show patient left side on left/right side of the screen) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Axial slice axes:&lt;br /&gt;
#  1 0 0&lt;br /&gt;
#  0 1 0&lt;br /&gt;
#  0 0 1&lt;br /&gt;
axialSliceToRas=vtk.vtkMatrix3x3()&lt;br /&gt;
&lt;br /&gt;
# Coronal slice axes:&lt;br /&gt;
#  1 0 0 &lt;br /&gt;
#  0 0 -1&lt;br /&gt;
#  0 1 0&lt;br /&gt;
coronalSliceToRas=vtk.vtkMatrix3x3()&lt;br /&gt;
coronalSliceToRas.SetElement(1,1, 0)&lt;br /&gt;
coronalSliceToRas.SetElement(1,2, -1)&lt;br /&gt;
coronalSliceToRas.SetElement(2,1, 1)&lt;br /&gt;
coronalSliceToRas.SetElement(2,2, 0)&lt;br /&gt;
&lt;br /&gt;
# Replace orientation presets in all existing slice nodes and in the default slice node&lt;br /&gt;
sliceNodes = slicer.util.getNodesByClass('vtkMRMLSliceNode')&lt;br /&gt;
sliceNodes.append(slicer.mrmlScene.GetDefaultNodeByClass('vtkMRMLSliceNode'))&lt;br /&gt;
for sliceNode in sliceNodes:&lt;br /&gt;
  orientationPresetName = sliceNode.GetOrientation()&lt;br /&gt;
  sliceNode.RemoveSliceOrientationPreset(&amp;quot;Axial&amp;quot;)&lt;br /&gt;
  sliceNode.AddSliceOrientationPreset(&amp;quot;Axial&amp;quot;, axialSliceToRas)&lt;br /&gt;
  sliceNode.RemoveSliceOrientationPreset(&amp;quot;Coronal&amp;quot;)&lt;br /&gt;
  sliceNode.AddSliceOrientationPreset(&amp;quot;Coronal&amp;quot;, coronalSliceToRas)&lt;br /&gt;
  sliceNode.SetOrientation(orientationPresetName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Set all slice views linked by default==&lt;br /&gt;
&lt;br /&gt;
You can make slice views linked by default (when application starts or the scene is cleared) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Set linked slice views  in all existing slice composite nodes and in the default node&lt;br /&gt;
sliceCompositeNodes = slicer.util.getNodesByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
defaultSliceCompositeNode = slicer.mrmlScene.GetDefaultNodeByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
if not defaultSliceCompositeNode:&lt;br /&gt;
  defaultSliceCompositeNode = slicer.mrmlScene.CreateNodeByClass('vtkMRMLSliceCompositeNode')&lt;br /&gt;
  slicer.mrmlScene.AddDefaultNode(defaultSliceCompositeNode)&lt;br /&gt;
sliceCompositeNodes.append(defaultSliceCompositeNode)&lt;br /&gt;
for sliceCompositeNode in sliceCompositeNodes:&lt;br /&gt;
  sliceCompositeNode.SetLinkedControl(True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set crosshair jump mode to centered by default==&lt;br /&gt;
&lt;br /&gt;
You can change default slice jump mode (when application starts or the scene is cleared) by copy-pasting the script below to your [[Documentation/{{documentation/version}}/Developers/FAQ/Python_Scripting#How_to_systematically_execute_custom_python_code_at_startup_.3F| .slicerrc.py file]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
crosshair=slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLCrosshairNode&amp;quot;)&lt;br /&gt;
crosshair.SetCrosshairBehavior(crosshair.CenteredJumpSlice)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Set up custom units in slice view ruler==&lt;br /&gt;
&lt;br /&gt;
For microscopy or micro-CT images you may want to switch unit to micrometer instead of the default mm. To do that, 1. change the unit in Application settings / Units and 2. update ruler display settings using the script below (it can be copied to your Application startup script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lm = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in lm.sliceViewNames():&lt;br /&gt;
  sliceView = lm.sliceWidget(sliceViewName).sliceView()&lt;br /&gt;
  displayableManagerCollection = vtk.vtkCollection()&lt;br /&gt;
  sliceView.getDisplayableManagers(displayableManagerCollection)&lt;br /&gt;
  for dmIndex in range(displayableManagerCollection.GetNumberOfItems()):&lt;br /&gt;
    displayableManager = displayableManagerCollection.GetItemAsObject(dmIndex)&lt;br /&gt;
    if not displayableManager.IsA(&amp;quot;vtkMRMLRulerDisplayableManager&amp;quot;):&lt;br /&gt;
      continue&lt;br /&gt;
    displayableManager.RemoveAllRulerScalePresets()&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.001, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.010, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.100, 5, 2, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   0.500, 5, 1, &amp;quot;nm&amp;quot;, 1000.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   1.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(   5.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(  10.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(  50.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset( 100.0,   5, 2, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset( 500.0,   5, 1, &amp;quot;um&amp;quot;,    1.0)&lt;br /&gt;
    displayableManager.AddRulerScalePreset(1000.0,   5, 2, &amp;quot;mm&amp;quot;,    0.001)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a slice view outside the view layout==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = &amp;quot;TestSlice&amp;quot;&lt;br /&gt;
layoutLabel = &amp;quot;TS&amp;quot;&lt;br /&gt;
# ownerNode manages this view instead of the layout manager (it can be any node in the scene)&lt;br /&gt;
viewOwnerNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScriptedModuleNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create MRML nodes&lt;br /&gt;
viewNode = slicer.vtkMRMLSliceNode()&lt;br /&gt;
viewNode.SetName(layoutName)&lt;br /&gt;
viewNode.SetLayoutName(layoutName)&lt;br /&gt;
viewNode.SetLayoutLabel(layoutLabel)&lt;br /&gt;
viewNode.SetLayoutColor(1, 1, 0)&lt;br /&gt;
viewNode.SetAndObserveParentLayoutNodeID(viewOwnerNode.GetID())&lt;br /&gt;
viewNode = slicer.mrmlScene.AddNode(viewNode)&lt;br /&gt;
sliceCompositeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLSliceCompositeNode&amp;quot;)&lt;br /&gt;
sliceCompositeNode.SetLayoutName(layoutName)&lt;br /&gt;
&lt;br /&gt;
# Create widget&lt;br /&gt;
viewWidget = slicer.qMRMLSliceWidget()&lt;br /&gt;
viewWidget.sliceViewName = layoutName&lt;br /&gt;
viewWidget.sliceViewLabel = layoutLabel&lt;br /&gt;
c = viewNode.GetLayoutColor()&lt;br /&gt;
viewWidget.sliceViewColor = qt.QColor.fromRgbF(c[0],c[1],c[2])&lt;br /&gt;
viewWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
viewWidget.setMRMLSliceNode(viewNode)&lt;br /&gt;
viewWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Show a 3D view outside the view layout==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutName = &amp;quot;Test3DView&amp;quot;&lt;br /&gt;
layoutLabel = &amp;quot;T3&amp;quot;&lt;br /&gt;
# ownerNode manages this view instead of the layout manager (it can be any node in the scene)&lt;br /&gt;
viewOwnerNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScriptedModuleNode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create MRML node&lt;br /&gt;
viewNode = slicer.vtkMRMLViewNode()&lt;br /&gt;
viewNode.SetName(layoutName)&lt;br /&gt;
viewNode.SetLayoutName(layoutName)&lt;br /&gt;
viewNode.SetLayoutLabel(layoutLabel)&lt;br /&gt;
viewNode.SetLayoutColor(1, 1, 0)&lt;br /&gt;
viewNode.SetAndObserveParentLayoutNodeID(viewOwnerNode.GetID())&lt;br /&gt;
viewNode = slicer.mrmlScene.AddNode(viewNode)&lt;br /&gt;
&lt;br /&gt;
# Create widget&lt;br /&gt;
viewWidget = slicer.qMRMLThreeDWidget()&lt;br /&gt;
viewWidget.viewLabel = layoutLabel&lt;br /&gt;
viewWidget.viewColor = qt.QColor.fromRgbF(c[0],c[1],c[2])&lt;br /&gt;
viewWidget.setMRMLScene(slicer.mrmlScene)&lt;br /&gt;
viewWidget.setMRMLViewNode(viewNode)&lt;br /&gt;
viewWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get displayable manager of a certain type for a certain view==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
modelDisplayableManager = None&lt;br /&gt;
threeDViewWidget = slicer.app.layoutManager().threeDWidget(0)&lt;br /&gt;
managers = vtk.vtkCollection()&lt;br /&gt;
threeDViewWidget.getDisplayableManagers(managers)&lt;br /&gt;
for i in range(managers.GetNumberOfItems()):&lt;br /&gt;
  obj = managers.GetItemAsObject(i)&lt;br /&gt;
  if obj.IsA('vtkMRMLModelDisplayableManager'):&lt;br /&gt;
    modelDisplayableManager = obj&lt;br /&gt;
    break&lt;br /&gt;
if modelDisplayableManager is None:&lt;br /&gt;
  logging.error('Failed to find the model displayable manager')&lt;br /&gt;
  return&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running an ITK filter in Python using SimpleITK==&lt;br /&gt;
Open the &amp;quot;Sample Data&amp;quot; module and download &amp;quot;MR Head&amp;quot;, then paste the following snippet in Python interactor:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import SampleData&lt;br /&gt;
import SimpleITK as sitk&lt;br /&gt;
import sitkUtils&lt;br /&gt;
&lt;br /&gt;
# Get input volume node&lt;br /&gt;
inputVolumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
# Create new volume node for output&lt;br /&gt;
outputVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLScalarVolumeNode', 'MRHeadFiltered')&lt;br /&gt;
&lt;br /&gt;
# Run processing&lt;br /&gt;
inputImage = sitkUtils.PullVolumeFromSlicer(inputVolumeNode)&lt;br /&gt;
filter = sitk.SignedMaurerDistanceMapImageFilter()&lt;br /&gt;
outputImage = filter.Execute(inputImage)&lt;br /&gt;
sitkUtils.PushVolumeToSlicer(outputImage, outputVolumeNode)&lt;br /&gt;
&lt;br /&gt;
# Show processing result&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=outputVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information:&lt;br /&gt;
&lt;br /&gt;
*See the SimpleITK documentation for SimpleITK examples: http://www.itk.org/SimpleITKDoxygen/html/examples.html&lt;br /&gt;
*sitkUtils in Slicer is used for pushing and pulling images from Slicer to SimpleITK: https://github.com/Slicer/Slicer/blob/master/Base/Python/sitkUtils.py&lt;br /&gt;
&lt;br /&gt;
==Get current mouse coordinates in a slice view==&lt;br /&gt;
&lt;br /&gt;
You can get 3D (RAS) coordinates of the current mouse cursor from the crosshair singleton node as shown in the example below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def onMouseMoved(observer,eventid):  &lt;br /&gt;
  ras=[0,0,0]&lt;br /&gt;
  crosshairNode.GetCursorPositionRAS(ras)&lt;br /&gt;
  print(ras)&lt;br /&gt;
&lt;br /&gt;
crosshairNode=slicer.util.getNode('Crosshair') &lt;br /&gt;
crosshairNode.AddObserver(slicer.vtkMRMLCrosshairNode.CursorPositionModifiedEvent, onMouseMoved)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get DataProbe text==&lt;br /&gt;
&lt;br /&gt;
You can get the mouse location in pixel coordinates along with the pixel value at the mouse by hitting the '.' (period) key in a slice view after pasting in the following code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def printDataProbe():&lt;br /&gt;
  infoWidget = slicer.modules.DataProbeInstance.infoWidget&lt;br /&gt;
  for layer in ('B', 'F', 'L'):&lt;br /&gt;
    print(infoWidget.layerNames[layer].text, infoWidget.layerIJKs[layer].text, infoWidget.layerValues[layer].text)&lt;br /&gt;
&lt;br /&gt;
s = qt.QShortcut(qt.QKeySequence('.'), mainWindow())&lt;br /&gt;
s.connect('activated()', printDataProbe)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get reformatted image from a slice viewer as numpy array==&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show thick slab reconstructed from 3 slices:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNodeID = 'vtkMRMLSliceNodeRed'&lt;br /&gt;
&lt;br /&gt;
# Get image data from slice view&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID(sliceNodeID)&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslicedImage = vtk.vtkImageData()&lt;br /&gt;
reslicedImage.DeepCopy(reslice.GetOutput())&lt;br /&gt;
&lt;br /&gt;
# Create new volume node using resliced image&lt;br /&gt;
volumeNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;)&lt;br /&gt;
volumeNode.SetIJKToRASMatrix(sliceNode.GetXYToRAS())&lt;br /&gt;
volumeNode.SetAndObserveImageData(reslicedImage)&lt;br /&gt;
volumeNode.CreateDefaultDisplayNodes()&lt;br /&gt;
volumeNode.CreateDefaultStorageNode()&lt;br /&gt;
&lt;br /&gt;
# Get voxels as a numpy array&lt;br /&gt;
voxels = slicer.util.arrayFromVolume(volumeNode)&lt;br /&gt;
print voxels.shape&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combine multiple volumes into one==&lt;br /&gt;
&lt;br /&gt;
This example combines two volumes into a new one by subtracting one from the other.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import SampleData&lt;br /&gt;
[input1Volume, input2Volume] = SampleData.SampleDataLogic().downloadDentalSurgery()&lt;br /&gt;
&lt;br /&gt;
import slicer.util&lt;br /&gt;
a = slicer.util.arrayFromVolume(input1Volume)&lt;br /&gt;
b = slicer.util.arrayFromVolume(input2Volume)&lt;br /&gt;
&lt;br /&gt;
# 'a' and 'b' are numpy arrays,&lt;br /&gt;
# they can be combined using any numpy array operations&lt;br /&gt;
# to produce the result array 'c'&lt;br /&gt;
c = b-a&lt;br /&gt;
&lt;br /&gt;
volumeNode = slicer.modules.volumes.logic().CloneVolume(input1Volume, &amp;quot;Difference&amp;quot;)&lt;br /&gt;
slicer.util.updateVolumeFromArray(volumeNode, c)&lt;br /&gt;
setSliceViewerLayers(background=volumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Thick slab reconstruction and maximum/minimum intensity volume projections==&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show thick slab reconstructed from 3 slices:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslice.SetSlabModeToMean()&lt;br /&gt;
reslice.SetSlabNumberOfSlices(10) # mean of 10 slices will computed&lt;br /&gt;
reslice.SetSlabSliceSpacingFraction(0.3) # spacing between each slice is 0.3 pixel (total 10 * 0.3 = 3 pixel neighborhood)&lt;br /&gt;
sliceNode.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set up 'red' slice viewer to show maximum intensity projection (MIP):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceNode = slicer.mrmlScene.GetNodeByID('vtkMRMLSliceNodeRed')&lt;br /&gt;
appLogic = slicer.app.applicationLogic()&lt;br /&gt;
sliceLogic = appLogic.GetSliceLogic(sliceNode)&lt;br /&gt;
sliceLayerLogic = sliceLogic.GetBackgroundLayer()&lt;br /&gt;
reslice = sliceLayerLogic.GetReslice()&lt;br /&gt;
reslice.SetSlabModeToMax()&lt;br /&gt;
reslice.SetSlabNumberOfSlices(600) # use a large number of slices (600) to cover the entire volume&lt;br /&gt;
reslice.SetSlabSliceSpacingFraction(0.5) # spacing between slices are 0.5 pixel (supersampling is useful to reduce interpolation artifacts)&lt;br /&gt;
sliceNode.Modified()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The projected image is available in a ''vtkImageData'' object by calling ''reslice.GetOutput()''.&lt;br /&gt;
&lt;br /&gt;
==Change default file type for nodes (that have never been saved yet)==&lt;br /&gt;
Default node can be specified that will be used as a basis of all new storage nodes. This can be used for setting default file extension. For example, change file format to STL for model nodes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
defaultModelStorageNode = slicer.vtkMRMLModelStorageNode()&lt;br /&gt;
defaultModelStorageNode.SetDefaultWriteFileExtension('stl')&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultModelStorageNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To permanently change default file extension on your computer, copy-paste the code above into your application startup script (you can find its location in menu: Edit / Application settings / General / Application startup script).&lt;br /&gt;
&lt;br /&gt;
==Change file type for saving for all volumes (with already existing storage nodes)==&lt;br /&gt;
&lt;br /&gt;
If it is not necessary to preserve file paths then the simplest is to configure default storage node (as shown in the example above), then delete all existing storage nodes. When save dialog is opened, default storage nodes will be recreated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Delete existing model storage nodes so that they will be recreated with default settings&lt;br /&gt;
existingModelStorageNodes = slicer.util.getNodesByClass('vtkMRMLModelStorageNode')&lt;br /&gt;
for modelStorageNode in existingModelStorageNodes:&lt;br /&gt;
  slicer.mrmlScene.RemoveNode(modelStorageNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To update existing storage nodes to use new file extension (but keep all other parameters unchanged) you can use this approach (example is for volume storage):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
requiredFileExtension = '.nia'&lt;br /&gt;
originalFileExtension = '.nrrd'&lt;br /&gt;
volumeNodes = slicer.util.getNodesByClass('vtkMRMLScalarVolumeNode')&lt;br /&gt;
for volumeNode in volumeNodes:&lt;br /&gt;
  volumeStorageNode = volumeNode.GetStorageNode()&lt;br /&gt;
  if not volumeStorageNode:&lt;br /&gt;
    volumeNode.AddDefaultStorageNode()&lt;br /&gt;
    volumeStorageNode = volumeNode.GetStorageNode()&lt;br /&gt;
    volumeStorageNode.SetFileName(volumeNode.GetName()+requiredFileExtension)&lt;br /&gt;
  else:&lt;br /&gt;
    volumeStorageNode.SetFileName(volumeStorageNode.GetFileName().replace(originalFileExtension, requiredFileExtension))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To set all volume nodes to save uncompressed by default (add this to .slicerrc.py so it takes effect for the whole session):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#set the default volume storage to not compress by default&lt;br /&gt;
defaultVolumeStorageNode = slicer.vtkMRMLVolumeArchetypeStorageNode()&lt;br /&gt;
defaultVolumeStorageNode.SetUseCompression(0)&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)&lt;br /&gt;
logging.info(&amp;quot;Volume nodes will be stored uncompressed by default&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same thing as above, but applied to all  segmentations instead of volumes:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#set the default volume storage to not compress by default&lt;br /&gt;
defaultVolumeStorageNode = slicer.vtkMRMLSegmentationStorageNode()&lt;br /&gt;
defaultVolumeStorageNode.SetUseCompression(0)&lt;br /&gt;
slicer.mrmlScene.AddDefaultNode(defaultVolumeStorageNode)&lt;br /&gt;
logging.info(&amp;quot;Segmentation nodes will be stored uncompressed &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sequences==&lt;br /&gt;
&lt;br /&gt;
===Concatenate all sequences in the scene into a new sequence===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get all sequence nodes in the scene&lt;br /&gt;
sequenceNodes = slicer.util.getNodesByClass('vtkMRMLSequenceNode')&lt;br /&gt;
mergedSequenceNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSequenceNode', 'Merged sequence')&lt;br /&gt;
&lt;br /&gt;
# Merge all sequence nodes into a new sequence node&lt;br /&gt;
mergedIndexValue = 0&lt;br /&gt;
for sequenceNode in sequenceNodes:&lt;br /&gt;
    for itemIndex in range(sequenceNode.GetNumberOfDataNodes()):&lt;br /&gt;
        dataNode = sequenceNode.GetNthDataNode(itemIndex)&lt;br /&gt;
        mergedSequenceNode.SetDataNodeAtValue(dataNode, str(mergedIndexValue))&lt;br /&gt;
        mergedIndexValue += 1&lt;br /&gt;
    # Delete the sequence node we copied the data from, to prevent sharing of the same&lt;br /&gt;
    # node by multiple sequences&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(sequenceNode)&lt;br /&gt;
&lt;br /&gt;
# Create a sequence browser node for the new merged sequence&lt;br /&gt;
mergedSequenceBrowserNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSequenceBrowserNode', 'Merged')&lt;br /&gt;
mergedSequenceBrowserNode.AddSynchronizedSequenceNode(mergedSequenceNode)&lt;br /&gt;
slicer.modules.sequencebrowser.setToolBarActiveBrowserNode(mergedSequenceBrowserNode)&lt;br /&gt;
# Show proxy node in slice viewers&lt;br /&gt;
mergedProxyNode = mergedSequenceBrowserNode.GetProxyNode(mergedSequenceNode)&lt;br /&gt;
slicer.util.setSliceViewerLayers(background=mergedProxyNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Segmentations==&lt;br /&gt;
&lt;br /&gt;
===Create a segmentation from a labelmap volume and display in 3D===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
labelmapVolumeNode = getNode('label')&lt;br /&gt;
seg = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLSegmentationNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ImportLabelmapToSegmentationNode(labelmapVolumeNode, seg)&lt;br /&gt;
seg.CreateClosedSurfaceRepresentation()&lt;br /&gt;
slicer.mrmlScene.RemoveNode(labelmapVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line is optional. It removes the original labelmap volume so that the same information is not shown twice.&lt;br /&gt;
&lt;br /&gt;
===Export labelmap node from segmentation node===&lt;br /&gt;
&lt;br /&gt;
Export smallest possible labelmap:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportAllSegmentsToLabelmapNode(seg, labelmapVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Export labelmap that matches geometry of a chosen reference volume:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportVisibleSegmentsToLabelmapNode(segmentationNode, labelmapVolumeNode, referenceVolumeNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Export by pressing Ctrl+Shift+s key:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
outputPath = &amp;quot;c:/tmp&amp;quot;&lt;br /&gt;
&lt;br /&gt;
def exportLabelmap():&lt;br /&gt;
    segmentationNode = slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLSegmentationNode&amp;quot;)&lt;br /&gt;
    referenceVolumeNode = slicer.mrmlScene.GetFirstNodeByClass(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;)&lt;br /&gt;
    labelmapVolumeNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLLabelMapVolumeNode')&lt;br /&gt;
    slicer.modules.segmentations.logic().ExportVisibleSegmentsToLabelmapNode(segmentationNode, labelmapVolumeNode, referenceVolumeNode)&lt;br /&gt;
    filepath = outputPath + &amp;quot;/&amp;quot; + referenceVolumeNode.GetName()+&amp;quot;-label.nrrd&amp;quot;&lt;br /&gt;
    slicer.util.saveNode(labelmapVolumeNode, filepath)&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(labelmapVolumeNode.GetDisplayNode().GetColorNode())&lt;br /&gt;
    slicer.mrmlScene.RemoveNode(labelmapVolumeNode)&lt;br /&gt;
    slicer.util.delayDisplay(&amp;quot;Segmentation saved to &amp;quot;+filepath)&lt;br /&gt;
&lt;br /&gt;
shortcut = qt.QShortcut(slicer.util.mainWindow())&lt;br /&gt;
shortcut.setKey(qt.QKeySequence('Ctrl+Shift+s'))&lt;br /&gt;
shortcut.connect( 'activated()', exportLabelmap)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Export model nodes from segmentation node===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seg = getNode('Segmentation')&lt;br /&gt;
exportedModelsNode = slicer.mrmlScene.AddNewNodeByClass('vtkMRMLModelHierarchyNode')&lt;br /&gt;
slicer.modules.segmentations.logic().ExportAllSegmentsToModelHierarchy(seg, exportedModelsNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Show a segmentation in 3D===&lt;br /&gt;
Segmentation can only be shown in 3D if closed surface representation (or other 3D-displayable representation) is available. To create closed surface representation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentation.CreateClosedSurfaceRepresentation()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Get a representation of a segment===&lt;br /&gt;
Access binary labelmap stored in a segmentation node (without exporting it to a volume node) - if it does not exist, it will return None:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
image = segmentationNode.GetBinaryLabelmapRepresentation(segmentID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Get closed surface, if it does not exist, it will return None:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
polydata = segmentationNode.GetClosedSurfaceRepresentation(segmentID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Get binary labelmap representation. If it does not exist then it will be created for that single segment. Applies parent transforms by default (if not desired, another argument needs to be added to the end: false):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
outputOrientedImageData = vtkSegmentationCore.vtkOrientedImageData()&lt;br /&gt;
slicer.vtkSlicerSegmentationsModuleLogic.GetSegmentBinaryLabelmapRepresentation(segmentationNode, segmentID, outputOrientedImageData)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Same as above, for closed surface representation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
outputPolyData = vtk.vtkPolyData()&lt;br /&gt;
slicer.vtkSlicerSegmentationsModuleLogic.GetSegmentClosedSurfaceRepresentation(segmentationNode, segmentID, outputPolyData)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Convert all segments using default path and conversion parameters===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentationNode.CreateBinaryLabelmapRepresentation()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Convert all segments using custom path or conversion parameters===&lt;br /&gt;
Change reference image geometry parameter based on an existing referenceImageData image:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
referenceGeometry = vtkSegmentationCore.vtkSegmentationConverter.SerializeImageGeometry(referenceImageData)&lt;br /&gt;
segmentation.SetConversionParameter(vtkSegmentationCore.vtkSegmentationConverter.GetReferenceImageGeometryParameterName(), referenceGeometry)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Re-convert using a modified conversion parameter===&lt;br /&gt;
Changing smoothing factor for closed surface generation:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import vtkSegmentationCorePython as vtkSegmentationCore&lt;br /&gt;
segmentation = getNode('Segmentation').GetSegmentation()&lt;br /&gt;
&lt;br /&gt;
# Turn of surface smoothing&lt;br /&gt;
segmentation.SetConversionParameter('Smoothing factor','0.0')&lt;br /&gt;
&lt;br /&gt;
# Recreate representation using modified parameters (and default conversion path)&lt;br /&gt;
segmentation.RemoveRepresentation(vtkSegmentationCore.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())&lt;br /&gt;
segmentation.CreateRepresentation(vtkSegmentationCore.vtkSegmentationConverter.GetSegmentationClosedSurfaceRepresentationName())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Get centroid of a segment in world (RAS) coordinates===&lt;br /&gt;
&lt;br /&gt;
This example shows how to get centroid of a segment in world coordinates and show that position in all slice views.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
segmentationNode = getNode('Segmentation')&lt;br /&gt;
segmentId = 'Segment_1'&lt;br /&gt;
&lt;br /&gt;
# Get array voxel coordinates&lt;br /&gt;
import numpy as np&lt;br /&gt;
seg=arrayFromSegment(segmentation_node, segmentId)&lt;br /&gt;
# numpy array has voxel coordinates in reverse order (KJI instead of IJK)&lt;br /&gt;
# and the array is cropped to minimum size in the segmentation&lt;br /&gt;
mean_KjiCropped = [coords.mean() for coords in np.nonzero(seg)]&lt;br /&gt;
&lt;br /&gt;
# Get segmentation voxel coordinates&lt;br /&gt;
segImage = segmentationNode.GetBinaryLabelmapRepresentation(segmentId)&lt;br /&gt;
segImageExtent = segImage.GetExtent()&lt;br /&gt;
# origin of the array in voxel coordinates is determined by the start extent&lt;br /&gt;
mean_Ijk = [mean_KjiCropped[2], mean_KjiCropped[1], mean_KjiCropped[0]] + np.array([segImageExtent[0], segImageExtent[2], segImageExtent[4]])&lt;br /&gt;
&lt;br /&gt;
# Get segmentation physical coordinates&lt;br /&gt;
ijkToWorld = vtk.vtkMatrix4x4()&lt;br /&gt;
segImage.GetImageToWorldMatrix(ijkToWorld)&lt;br /&gt;
mean_World = [0, 0, 0, 1]&lt;br /&gt;
ijkToRas.MultiplyPoint(np.append(mean_Ijk,1.0), mean_World)&lt;br /&gt;
mean_World = mean_World[0:3]&lt;br /&gt;
&lt;br /&gt;
# If segmentation node is transformed, apply that transform to get RAS coordinates&lt;br /&gt;
transformWorldToRas = vtk.vtkGeneralTransform()&lt;br /&gt;
slicer.vtkMRMLTransformNode.GetTransformBetweenNodes(segmentationNode.GetParentTransformNode(), None, transformWorldToRas)&lt;br /&gt;
mean_Ras = transformWorldToRas.TransformPoint(mean_World)&lt;br /&gt;
&lt;br /&gt;
# Show mean position value and jump to it in all slice viewers&lt;br /&gt;
print(mean_Ras)&lt;br /&gt;
slicer.modules.markups.logic().JumpSlicesToLocation(mean_Ras[0], mean_Ras[1], mean_Ras[2], True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How to run segment editor effects from a script===&lt;br /&gt;
&lt;br /&gt;
Editor effects are complex because they need to handle changing master volumes, undo/redo, masking operations, etc. Therefore, instead of using a segment editor effect, it is simpler to run the underlying filters directly from script.&lt;br /&gt;
&lt;br /&gt;
This example demonstrates how to use Segment editor effects (without GUI, using qMRMLSegmentEditorWidget):&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/2d5a5b73645f65a5eb6f8d5f97abf31b brain tumor segmentation using grow from seeds effect]&lt;br /&gt;
*[https://gist.github.com/lassoan/1673b25d8e7913cbc245b4f09ed853f9 skin surface extraction using thresholding and smoothing]&lt;br /&gt;
*[https://gist.github.com/lassoan/2f5071c562108dac8efe277c78f2620f mask a volume with segments and compute histogram for each region]&lt;br /&gt;
*[https://gist.github.com/lassoan/5ad51c89521d3cd9c5faf65767506b37 create fat/muscle/bone segment by thresholding and report volume of each segment]&lt;br /&gt;
&lt;br /&gt;
This example shows how to perform operations on segmentations using VTK filters:&lt;br /&gt;
&lt;br /&gt;
*[https://gist.github.com/lassoan/7c94c334653010696b2bf96abc0ac8e7 brain tumor segmentation using grow from seeds effect]&lt;br /&gt;
&lt;br /&gt;
==Accessing views, renderers, and cameras==&lt;br /&gt;
&lt;br /&gt;
Iterate through all 3D views in current layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for threeDViewIndex in range(layoutManager.threeDViewCount) :&lt;br /&gt;
  view = layoutManager.threeDWidget(threeDViewIndex).threeDView()&lt;br /&gt;
  threeDViewNode = view.mrmlViewNode()&lt;br /&gt;
  cameraNode = slicer.modules.cameras.logic().GetViewActiveCameraNode(threeDViewNode)&lt;br /&gt;
  print('View node for 3D widget ' + str(threeDViewIndex))&lt;br /&gt;
  print('  Name: ' + threeDViewNode .GetName())&lt;br /&gt;
  print('  ID: ' + threeDViewNode .GetID())&lt;br /&gt;
  print('  Camera ID: ' + cameraNode.GetID())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Iterate through all slice views in current layout:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
layoutManager = slicer.app.layoutManager()&lt;br /&gt;
for sliceViewName in layoutManager.sliceViewNames():&lt;br /&gt;
  view = layoutManager.sliceWidget(sliceViewName).sliceView()&lt;br /&gt;
  sliceNode = view.mrmlSliceNode()&lt;br /&gt;
  sliceLogic = slicer.app.applicationLogic().GetSliceLogic(sliceNode)&lt;br /&gt;
  compositeNode = sliceLogic.GetSliceCompositeNode()&lt;br /&gt;
  print('Slice view ' + str(sliceViewName))&lt;br /&gt;
  print('  Name: ' + sliceNode.GetName())&lt;br /&gt;
  print('  ID: ' + sliceNode.GetID())&lt;br /&gt;
  print('  Background volume: {0}'.format(compositeNode.GetBackgroundVolumeID()))&lt;br /&gt;
  print('  Foreground volume: {0} (opacity: {1})'.format(compositeNode.GetForegroundVolumeID(), compositeNode.GetForegroundOpacity()))&lt;br /&gt;
  print('  Label volume: {0} (opacity: {1})'.format(compositeNode.GetLabelVolumeID(), compositeNode.GetLabelOpacity()))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For low-level manipulation of views, it is possible to access VTK render windows, renderers and cameras of views in the current layout.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = view.renderWindow()&lt;br /&gt;
renderers = renderWindow.GetRenderers()&lt;br /&gt;
renderer = renderers.GetItemAsObject(0)&lt;br /&gt;
camera = cameraNode.GetCamera()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide view controller bars==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.app.layoutManager().threeDWidget(0).threeDController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().sliceWidget('Red').sliceController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().plotWidget(0).plotController().setVisible(False)&lt;br /&gt;
slicer.app.layoutManager().tableWidget(0).tableController().setVisible(False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Customize widgets in view controller bars==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sliceController = slicer.app.layoutManager().sliceWidget(&amp;quot;Red&amp;quot;).sliceController()&lt;br /&gt;
&lt;br /&gt;
# hide what is not needed&lt;br /&gt;
sliceController.pinButton().hide()&lt;br /&gt;
#sliceController.viewLabel().hide()&lt;br /&gt;
sliceController.fitToWindowToolButton().hide()&lt;br /&gt;
sliceController.sliceOffsetSlider().hide()&lt;br /&gt;
&lt;br /&gt;
# add custom widgets&lt;br /&gt;
myButton = qt.QPushButton(&amp;quot;My custom button&amp;quot;)&lt;br /&gt;
sliceController.barLayout().addWidget(b)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Change 3D view background color==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
renderWindow = slicer.app.layoutManager().threeDWidget(0).threeDView().renderWindow()&lt;br /&gt;
renderer = renderWindow.GetRenderers().GetFirstRenderer()&lt;br /&gt;
renderer.SetBackground(1,0,0)&lt;br /&gt;
renderer.SetBackground2(1,0,0)&lt;br /&gt;
renderWindow.Render()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hide Slicer logo from main window (to increase space)==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
slicer.util.findChild(slicer.util.mainWindow(), 'LogoLabel').visible = False&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Subject hierarchy== &lt;br /&gt;
====Get the pseudo-singleton subject hierarchy node====&lt;br /&gt;
It manages the whole hierarchy and provides functions to access and manipulate&lt;br /&gt;
  shNode = slicer.mrmlScene.GetSubjectHierarchyNode()&lt;br /&gt;
&lt;br /&gt;
====Create subject hierarchy item====&lt;br /&gt;
  # If it is for a data node, it is automatically created, but the create function can be used to set parent:&lt;br /&gt;
  shNode.CreateItem(parentItemID, dataNode)&lt;br /&gt;
  # If it is a hierarchy item without a data node, then the create function must be used:&lt;br /&gt;
  shNode.CreateSubjectItem(parentItemID, name)&lt;br /&gt;
  shNode.CreateFolderItem(parentItemID, name)&lt;br /&gt;
  shNode.CreateHierarchyItem(parentItemID, name, level) # Advanced method to set level attribute manually (usually subject, study, or folder, but it can be a virtual branch for example)&lt;br /&gt;
&lt;br /&gt;
====Get subject hierarchy item====&lt;br /&gt;
Items in subject hierarchy are uniquely identified by integer IDs&lt;br /&gt;
  # Get scene item ID first because it is the root item:&lt;br /&gt;
  sceneItemID = shNode.GetSceneItemID()&lt;br /&gt;
  # Get direct child by name&lt;br /&gt;
  subjectItemID = shNode.GetItemChildWithName(sceneItemID, 'Subject_1')&lt;br /&gt;
  # Get item for data node&lt;br /&gt;
  itemID = shNode.GetItemByDataNode(dataNode)&lt;br /&gt;
  # Get item by UID (such as DICOM)&lt;br /&gt;
  itemID = shNode.GetItemByUID(slicer.vtkMRMLSubjectHierarchyConstants.GetDICOMUIDName(), seriesInstanceUid)&lt;br /&gt;
  itemID = shNode.GetItemByUIDList(slicer.vtkMRMLSubjectHierarchyConstants.GetDICOMInstanceUIDName(), instanceUID)&lt;br /&gt;
  # Invalid item ID for checking validity of a given ID (most functions return the invalid ID when item is not found)&lt;br /&gt;
  invalidItemID = slicer.vtkMRMLSubjectHierarchyNode.GetInvalidItemID()&lt;br /&gt;
&lt;br /&gt;
====Traverse children of a subject hierarchy item====&lt;br /&gt;
  children = vtk.vtkIdList()&lt;br /&gt;
  shNode.GetItemChildren(parent, children)&lt;br /&gt;
  for i in range(children.GetNumberOfIds()):&lt;br /&gt;
    child = children.GetId(i)&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
====Manipulate subject hierarchy item====&lt;br /&gt;
Instead of node operations on the individual subject hierarchy nodes, item operations are performed on the one subject hierarchy node.&lt;br /&gt;
  # Set item name&lt;br /&gt;
  shNode.SetItemName(itemID, 'NewName')&lt;br /&gt;
  # Set item parent (reparent)&lt;br /&gt;
  shNode.SetItemParent(itemID, newParentItemID)&lt;br /&gt;
  # Set visibility of data node associated to an item&lt;br /&gt;
  shNode.SetItemDisplayVisibility(itemID, 1)&lt;br /&gt;
  # Set visibility of whole branch&lt;br /&gt;
  # Note: Folder-type items (fodler, subject, study, etc.) create their own display nodes when show/hiding from UI.&lt;br /&gt;
  #       The displayable managers use SH information to determine visibility of an item, so no need to show/hide individual leaf nodes any more.&lt;br /&gt;
  #       Once the folder display node is created, it can be shown hidden simply using shNode.SetItemDisplayVisibility&lt;br /&gt;
  # From python, this is how to trigger creating a folder display node&lt;br /&gt;
  pluginHandler = slicer.qSlicerSubjectHierarchyPluginHandler().instance()&lt;br /&gt;
  folderPlugin = pluginHandler.pluginByName('Folder')&lt;br /&gt;
  folderPlugin.setDisplayVisibility(folderItemID, 1)&lt;br /&gt;
&lt;br /&gt;
====Filter items in TreeView or ComboBox====&lt;br /&gt;
Displayed items can be filtered using ''setAttributeFilter'' method. An example of the usage can be found in the  [https://github.com/Slicer/Slicer/blob/e66e3b08e35384526528e6ae678e9ec9f079f286/Applications/SlicerApp/Testing/Python/SubjectHierarchyGenericSelfTest.py#L352-L360 unit test]. Modified version here:&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 5&lt;br /&gt;
    shTreeView.setAttributeFilter('DICOM.Modality') # Nodes must have this attribute&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 3&lt;br /&gt;
    shTreeView.setAttributeFilter('DICOM.Modality','CT') # Have attribute and equal 'CT'&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 1&lt;br /&gt;
    shTreeView.removeAttributeFilter()&lt;br /&gt;
    print(shTreeView.displayedItemCount()) # 5&lt;br /&gt;
&lt;br /&gt;
===Listen to subject hierarchy item events===&lt;br /&gt;
The subject hierarchy node sends the node item id as calldata. Item IDs are vtkIdType, which are NOT vtkObjects. You need to use vtk.calldata_type(vtk.VTK_LONG) (otherwise the application crashes).&lt;br /&gt;
  &lt;br /&gt;
  class MyListenerClass(VTKObservationMixin):&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
      VTKObservationMixin.__init__(self)&lt;br /&gt;
      &lt;br /&gt;
      shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)&lt;br /&gt;
      self.addObserver(shNode, shNode.SubjectHierarchyItemModifiedEvent, self.shItemModifiedEvent)&lt;br /&gt;
     &lt;br /&gt;
    @vtk.calldata_type(vtk.VTK_LONG) &lt;br /&gt;
    def shItemModifiedEvent(self, caller, eventId, callData):&lt;br /&gt;
      print(&amp;quot;SH Node modified&amp;quot;)&lt;br /&gt;
      print(&amp;quot;SH item ID: {0}&amp;quot;.format(callData))&lt;br /&gt;
&lt;br /&gt;
==Plotting==&lt;br /&gt;
&lt;br /&gt;
===Slicer plots displayed in view layout===&lt;br /&gt;
&lt;br /&gt;
Create histogram plot of a volume and show it embedded in the view layout. More information: https://www.slicer.org/wiki/Documentation/Nightly/Developers/Plots&lt;br /&gt;
&lt;br /&gt;
====Using &amp;lt;code&amp;gt;slicer.util.plot&amp;lt;/code&amp;gt; utility function====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a volume from SampleData and compute its histogram&lt;br /&gt;
import SampleData&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
chartNode = slicer.util.plot(histogram, xColumnIndex = 1)&lt;br /&gt;
chartNode.SetYAxisRangeAuto(False)&lt;br /&gt;
chartNode.SetYAxisRange(0, 4e5)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:SlicerPlot.png]]&lt;br /&gt;
&lt;br /&gt;
====Using MRML classes only====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Get a volume from SampleData&lt;br /&gt;
import SampleData&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
&lt;br /&gt;
# Compute histogram values&lt;br /&gt;
import numpy as np&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
# Save results to a new table node&lt;br /&gt;
tableNode=slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLTableNode&amp;quot;)&lt;br /&gt;
updateTableFromArray(tableNode, histogram)&lt;br /&gt;
tableNode.GetTable().GetColumn(0).SetName(&amp;quot;Count&amp;quot;)&lt;br /&gt;
tableNode.GetTable().GetColumn(1).SetName(&amp;quot;Intensity&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Create plot&lt;br /&gt;
plotSeriesNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLPlotSeriesNode&amp;quot;, volumeNode.GetName() + ' histogram')&lt;br /&gt;
plotSeriesNode.SetAndObserveTableNodeID(tableNode.GetID())&lt;br /&gt;
plotSeriesNode.SetXColumnName(&amp;quot;Intensity&amp;quot;)&lt;br /&gt;
plotSeriesNode.SetYColumnName(&amp;quot;Count&amp;quot;)&lt;br /&gt;
plotSeriesNode.SetPlotType(plotSeriesNode.PlotTypeScatterBar)&lt;br /&gt;
plotSeriesNode.SetColor(0, 0.6, 1.0)&lt;br /&gt;
&lt;br /&gt;
# Create chart and add plot&lt;br /&gt;
plotChartNode = slicer.mrmlScene.AddNewNodeByClass(&amp;quot;vtkMRMLPlotChartNode&amp;quot;)&lt;br /&gt;
plotChartNode.AddAndObservePlotSeriesNodeID(plotSeriesNode.GetID())&lt;br /&gt;
plotChartNode.YAxisRangeAutoOff()&lt;br /&gt;
plotChartNode.SetYAxisRange(0, 500000)&lt;br /&gt;
&lt;br /&gt;
# Show plot in layout&lt;br /&gt;
slicer.modules.plots.logic().ShowChartInLayout(plotChartNode)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using matplotlib===&lt;br /&gt;
&lt;br /&gt;
Matplotlib may be used from within Slicer, but the default Tk backend locks up and crashes Slicer. However, Matplotlib may still be used through other backends. More details can be found on the [http://matplotlib.sourceforge.net/ MatPlotLib] pages.&lt;br /&gt;
&lt;br /&gt;
====Non-interactive plot====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
matplotlib.use('Agg')&lt;br /&gt;
from pylab import *&lt;br /&gt;
&lt;br /&gt;
t1 = arange(0.0, 5.0, 0.1)&lt;br /&gt;
t2 = arange(0.0, 5.0, 0.02)&lt;br /&gt;
t3 = arange(0.0, 2.0, 0.01) &lt;br /&gt;
&lt;br /&gt;
subplot(211)&lt;br /&gt;
plot(t1, cos(2*pi*t1)*exp(-t1), 'bo', t2, cos(2*pi*t2)*exp(-t2), 'k')&lt;br /&gt;
grid(True)&lt;br /&gt;
title('A tale of 2 subplots')&lt;br /&gt;
ylabel('Damped')&lt;br /&gt;
&lt;br /&gt;
subplot(212)&lt;br /&gt;
plot(t3, cos(2*pi*t3), 'r--')&lt;br /&gt;
grid(True)&lt;br /&gt;
xlabel('time (s)')&lt;br /&gt;
ylabel('Undamped')&lt;br /&gt;
savefig('MatplotlibExample.png')&lt;br /&gt;
&lt;br /&gt;
# Static image view&lt;br /&gt;
pm = qt.QPixmap(&amp;quot;MatplotlibExample.png&amp;quot;)&lt;br /&gt;
imageWidget = qt.QLabel()&lt;br /&gt;
imageWidget.setPixmap(pm)&lt;br /&gt;
imageWidget.setScaledContents(True)&lt;br /&gt;
imageWidget.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:MatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Plot in Slicer Jupyter notebook====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
matplotlib.use('Agg')&lt;br /&gt;
from pylab import *&lt;br /&gt;
&lt;br /&gt;
t1 = arange(0.0, 5.0, 0.1)&lt;br /&gt;
t2 = arange(0.0, 5.0, 0.02)&lt;br /&gt;
t3 = arange(0.0, 2.0, 0.01) &lt;br /&gt;
&lt;br /&gt;
subplot(211)&lt;br /&gt;
plot(t1, cos(2*pi*t1)*exp(-t1), 'bo', t2, cos(2*pi*t2)*exp(-t2), 'k')&lt;br /&gt;
grid(True)&lt;br /&gt;
title('A tale of 2 subplots')&lt;br /&gt;
ylabel('Damped')&lt;br /&gt;
&lt;br /&gt;
subplot(212)&lt;br /&gt;
plot(t3, cos(2*pi*t3), 'r--')&lt;br /&gt;
grid(True)&lt;br /&gt;
xlabel('time (s)')&lt;br /&gt;
ylabel('Undamped')&lt;br /&gt;
savefig('MatplotlibExample.png')&lt;br /&gt;
display(filename='MatplotlibExample.png', type=&amp;quot;image/png&amp;quot;, binary=True)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:JupyterNotebookMatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
====Interactive plot using wxWidgets GUI toolkit====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  import matplotlib&lt;br /&gt;
  import wx&lt;br /&gt;
except ModuleNotFoundError:&lt;br /&gt;
  pip_install('matplotlib wxPython')&lt;br /&gt;
  import matplotlib&lt;br /&gt;
&lt;br /&gt;
# Get a volume from SampleData and compute its histogram&lt;br /&gt;
import SampleData&lt;br /&gt;
import numpy as np&lt;br /&gt;
volumeNode = SampleData.SampleDataLogic().downloadMRHead()&lt;br /&gt;
histogram = np.histogram(arrayFromVolume(volumeNode), bins=50)&lt;br /&gt;
&lt;br /&gt;
# Set matplotlib to use WXAgg backend&lt;br /&gt;
import matplotlib&lt;br /&gt;
matplotlib.use('WXAgg')&lt;br /&gt;
&lt;br /&gt;
# Show an interactive plot&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
fig, ax = plt.subplots()&lt;br /&gt;
ax.plot(histogram[1][1:], histogram[0].astype(float))&lt;br /&gt;
ax.grid(True)&lt;br /&gt;
ax.set_ylim((0, 4e5))&lt;br /&gt;
plt.show(block=False)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:InteractiveMatplotlibExample.png]]&lt;br /&gt;
&lt;br /&gt;
==Execute external applications==&lt;br /&gt;
&lt;br /&gt;
How to run external applications from Slicer.&lt;br /&gt;
&lt;br /&gt;
===Run process in default environment===&lt;br /&gt;
&lt;br /&gt;
When a process is launched from Slicer then by default Slicer's ITK, VTK, Qt, etc. libraries are used. If an external application has its own version of these libraries, then the application is expected to crash. To prevent crashing, the application must be run in the environment where Slicer started up (without all Slicer-specific library paths). This startup environment can be retrieved using ''slicer.util.startupEnvironment()''.&lt;br /&gt;
&lt;br /&gt;
Example: run Python3 script from Slicer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
command_to_execute = [&amp;quot;/usr/bin/python3&amp;quot;, &amp;quot;-c&amp;quot;, &amp;quot;print('hola')&amp;quot;]&lt;br /&gt;
from subprocess import check_output&lt;br /&gt;
check_output(&lt;br /&gt;
  command_to_execute, &lt;br /&gt;
  env=slicer.util.startupEnvironment()&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'hola\n'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On some systems, ''shell=True'' must be specified as well.&lt;br /&gt;
&lt;br /&gt;
==Manage extensions==&lt;br /&gt;
&lt;br /&gt;
===Download and install extension===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
extensionName = 'SlicerIGT'&lt;br /&gt;
em = slicer.app.extensionsManagerModel()&lt;br /&gt;
if not em.isExtensionInstalled(extensionName):&lt;br /&gt;
    extensionMetaData = em.retrieveExtensionMetadataByName(extensionName)&lt;br /&gt;
    url = em.serverUrl().toString()+'/download/item/'+extensionMetaData['item_id']&lt;br /&gt;
    extensionPackageFilename = slicer.app.temporaryPath+'/'+extensionMetaData['md5']&lt;br /&gt;
    slicer.util.downloadFile(url, extensionPackageFilename)&lt;br /&gt;
    em.installExtension(extensionPackageFilename)&lt;br /&gt;
    slicer.util.restart()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/DICOMRWVMPlugin&amp;diff=61304</id>
		<title>Documentation/Nightly/Modules/DICOMRWVMPlugin</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Modules/DICOMRWVMPlugin&amp;diff=61304"/>
		<updated>2019-07-19T16:50:38Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
The UIowa [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin  QIN] PET DICOM Extension was funded in part by [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin/iowa Quantitative Imaging to Assess Response in Cancer Therapy Trials] NIH grant U01-CA140206 and [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)] NIH grant U24 CA180918. &amp;lt;br&amp;gt;&lt;br /&gt;
Authors: Ethan Ulrich (University of Iowa), Andrey Fedorov ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributors: Markus van Tol (University of Iowa), Christian Bauer (University of Iowa), Reinhard Beichel (University of Iowa), John Buatti (University of Iowa)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: &amp;lt;email&amp;gt;qin@iibi.uiowa.edu&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|uiowa}}|{{collaborator|longname|uiowa}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
The DICOM RWVM Plugin extends the DICOM module to support parsing and loading of DICOM series associated with Real World Value Mapping (RWVM) objects.&amp;lt;br&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DICOM_Browser_RWVM_Plugin.png|thumb|800px|DICOM Browser with RWVM Plugin selected]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Dependencies}}&lt;br /&gt;
*[[Documentation/{{documentation/version}}/Modules/DICOM|DICOM Module]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-developerinfo}}&lt;br /&gt;
* Source code: https://github.com/QIICR/Slicer-PETDICOMExtension/tree/master/DICOMRWVMPlugin&lt;br /&gt;
* Instructions on performing SUV conversion in batch mode: https://discourse.slicer.org/t/pet-suv-factor-and-rescale-slope/7355/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.10/Modules/DICOMRWVMPlugin&amp;diff=61303</id>
		<title>Documentation/4.10/Modules/DICOMRWVMPlugin</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Modules/DICOMRWVMPlugin&amp;diff=61303"/>
		<updated>2019-07-19T16:50:21Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
The UIowa [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin  QIN] PET DICOM Extension was funded in part by [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin/iowa Quantitative Imaging to Assess Response in Cancer Therapy Trials] NIH grant U01-CA140206 and [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)] NIH grant U24 CA180918. &amp;lt;br&amp;gt;&lt;br /&gt;
Authors: Ethan Ulrich (University of Iowa), Andrey Fedorov ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributors: Markus van Tol (University of Iowa), Christian Bauer (University of Iowa), Reinhard Beichel (University of Iowa), John Buatti (University of Iowa)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: &amp;lt;email&amp;gt;qin@iibi.uiowa.edu&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|uiowa}}|{{collaborator|longname|uiowa}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
The DICOM RWVM Plugin extends the DICOM module to support parsing and loading of DICOM series associated with Real World Value Mapping (RWVM) objects.&amp;lt;br&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:DICOM_Browser_RWVM_Plugin.png|thumb|800px|DICOM Browser with RWVM Plugin selected]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Dependencies}}&lt;br /&gt;
*[[Documentation/{{documentation/version}}/Modules/DICOM|DICOM Module]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-developerinfo}}&lt;br /&gt;
* Source code: https://github.com/QIICR/Slicer-PETDICOMExtension/tree/master/DICOMRWVMPlugin&lt;br /&gt;
* Instructions on performing SUV conversion in batch mode: https://discourse.slicer.org/t/pet-suv-factor-and-rescale-slope/7355/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/SlicerExtension&amp;diff=61266</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/SlicerExtension</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/SlicerExtension&amp;diff=61266"/>
		<updated>2019-06-27T21:00:07Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Slicer 5.0: Python2 to Python3 (EditorEffect imports) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Slicer Extension updates==&lt;br /&gt;
&lt;br /&gt;
===Slicer 5.0: ITKv4 to ITKv5===&lt;br /&gt;
&lt;br /&gt;
To remove support for ITKv4 and only support ITKv5. See [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Transition_from_ITK4_to_ITK5]], it includes&lt;br /&gt;
the following sections:&lt;br /&gt;
* [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Upgrading_to_ITKv5_or_keep_using_ITKv4_GenerateThreadedData|Upgrading to ITKv5 or keep using ITKv4 GenerateThreadedData]]&lt;br /&gt;
* [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#itkMultiThreader_refactor|itkMultiThreader refactor]]&lt;br /&gt;
* [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#SimpleFastMutexLock.2C_FastMutexLock_and_MutexLock_are_deprecated|SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated]]&lt;br /&gt;
&lt;br /&gt;
If completely removing support for ITKv4 and only supporting ITKv5 is not possible.  It is possible to conditionally include the ITKv4 code.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if ITK_VERSION_MAJOR &amp;gt;= 5&lt;br /&gt;
  itk::ITK_THREAD_RETURN_TYPE&lt;br /&gt;
#else&lt;br /&gt;
  ITK_THREAD_RETURN_TYPE&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example of commits:&lt;br /&gt;
* ResampleDTIlogEuclidean&lt;br /&gt;
** [https://github.com/NIRALUser/ResampleDTIlogEuclidean/commit/f779bf775aad3c4e1493ed8fa722b32623ac9561 ResampleDTIlogEuclidean@f779bf7]  COMP: Use std::mutex instead of deprecated ITK implementation&lt;br /&gt;
** [https://github.com/NIRALUser/ResampleDTIlogEuclidean/commit/ed5093b15d0ded34db08978c6c5933c36e40b803 ResampleDTIlogEuclidean@ed5093b] BUG: ITKv5: Fix tests updating ITK filters to use ITKv5 dynamic multi-threading&lt;br /&gt;
* PETTumorSegmentation&lt;br /&gt;
** [https://github.com/QIICR/PETTumorSegmentation/pull/18/commits/4aead376ed1d909310d43496dd349e8f3b8c8210 PETTumorSegmentation PR#18] BUG: Add support for ITKv5 dynamic multithreader &lt;br /&gt;
** [https://github.com/QIICR/PETTumorSegmentation/pull/18/commits/814a689501ab06d70d3ee3d561c14674e724a0d2 PETTumorSegmentation PR#18] COMP: Support ITKv5 refactored threading models&lt;br /&gt;
&lt;br /&gt;
===Slicer 5.0: Python2 to Python3===&lt;br /&gt;
&lt;br /&gt;
Depending on the complexity of the extension, two approaches shall be considered:&lt;br /&gt;
* code base common to Slicer 4.10 and Slicer 5.0. This means backward compatibility with the latest release is maintained.&lt;br /&gt;
* specific branch for each Slicer version (e.g &amp;lt;tt&amp;gt;master-4.10&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;master&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example of commits'''&lt;br /&gt;
&lt;br /&gt;
* [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28079 Slicer r28079] STYLE: Update python classes to follow new-style&lt;br /&gt;
* [https://github.com/fedorov/MultiVolumeImporter/commit/f9917b237c3bc3255e3c7677dc9af351dc2325e1 MultiVolumeImporter@f9917b2] STYLE: Apply lib2to3.fixes.fix_idioms to support python3&lt;br /&gt;
* [https://github.com/fedorov/MultiVolumeImporter/commit/3edd1bc593f178f11aa92d9baa62685bc96ac540 MultiVolumeImporter@3edd1bc] ENH: Support for Python3 &lt;br /&gt;
* [https://github.com/slicersalt/ShapeVariationAnalyzer/commit/42343774c44dc78b8560fc0a9e33e3a6018cb6e1 ShapeVariationAnalyzer@4234377] STYLE: Update python scripts for python 3.x&lt;br /&gt;
* [https://github.com/QIICR/PETTumorSegmentation/pull/18/commits/b298ab8e672e1ab52ae6b189a34d9930ccac19ba PETTumorSegmentation PR#18] BUG: Add support for Python 3 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 1'''&lt;br /&gt;
&lt;br /&gt;
Understanding the scope of changes needed to support Python 3 can be done by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;installing future package (see https://python-future.org/)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Slicer_DIR=/path/to/Slicer-SuperBuild/Slicer-build&lt;br /&gt;
${Slicer_DIR}/../python-install/bin/PythonSlicer -m pip install future&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;applying all fixes&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  for f in `find ./ -name &amp;quot;*.py&amp;quot;`; do \&lt;br /&gt;
    ${Slicer_DIR}/../python-install/bin/PythonSlicer \&lt;br /&gt;
      --launch futurize --nobackups --write $f; \&lt;br /&gt;
  done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;{{note}} Alternatively the &amp;lt;tt&amp;gt;future&amp;lt;/tt&amp;gt; package could be installed in a regular python environment and used from there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  for f in `find ./ -name &amp;quot;*.py&amp;quot;`; do \&lt;br /&gt;
    futurize --nobackups --write $f; \&lt;br /&gt;
  done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This first step will apply the following transformations:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lib2to3.fixes.fix_apply&lt;br /&gt;
lib2to3.fixes.fix_dict&lt;br /&gt;
lib2to3.fixes.fix_except&lt;br /&gt;
lib2to3.fixes.fix_exec&lt;br /&gt;
lib2to3.fixes.fix_exitfunc&lt;br /&gt;
lib2to3.fixes.fix_filter&lt;br /&gt;
lib2to3.fixes.fix_funcattrs&lt;br /&gt;
lib2to3.fixes.fix_getcwdu&lt;br /&gt;
lib2to3.fixes.fix_has_key&lt;br /&gt;
lib2to3.fixes.fix_input&lt;br /&gt;
lib2to3.fixes.fix_intern&lt;br /&gt;
lib2to3.fixes.fix_isinstance&lt;br /&gt;
lib2to3.fixes.fix_itertools&lt;br /&gt;
lib2to3.fixes.fix_itertools_imports&lt;br /&gt;
lib2to3.fixes.fix_long&lt;br /&gt;
lib2to3.fixes.fix_map&lt;br /&gt;
lib2to3.fixes.fix_methodattrs&lt;br /&gt;
lib2to3.fixes.fix_ne&lt;br /&gt;
lib2to3.fixes.fix_next&lt;br /&gt;
lib2to3.fixes.fix_nonzero&lt;br /&gt;
lib2to3.fixes.fix_numliterals&lt;br /&gt;
lib2to3.fixes.fix_operator&lt;br /&gt;
lib2to3.fixes.fix_paren&lt;br /&gt;
lib2to3.fixes.fix_raw_input&lt;br /&gt;
lib2to3.fixes.fix_reduce&lt;br /&gt;
lib2to3.fixes.fix_renamesSlicer migration guide describes how to update the code. See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/SlicerExtension#Slicer_5.0:_Python2_to_Python3&lt;br /&gt;
lib2to3.fixes.fix_repr&lt;br /&gt;
lib2to3.fixes.fix_standarderror&lt;br /&gt;
lib2to3.fixes.fix_sys_exc&lt;br /&gt;
lib2to3.fixes.fix_throw&lt;br /&gt;
lib2to3.fixes.fix_tuple_params&lt;br /&gt;
lib2to3.fixes.fix_types&lt;br /&gt;
lib2to3.fixes.fix_xreadlines&lt;br /&gt;
lib2to3.fixes.fix_zip&lt;br /&gt;
libfuturize.fixes.fix_absolute_import&lt;br /&gt;
libfuturize.fixes.fix_basestring&lt;br /&gt;
libfuturize.fixes.fix_cmp&lt;br /&gt;
libfuturize.fixes.fix_division_safe&lt;br /&gt;
libfuturize.fixes.fix_execfile&lt;br /&gt;
libfuturize.fixes.fix_future_builtins&lt;br /&gt;
libfuturize.fixes.fix_future_standard_library&lt;br /&gt;
libfuturize.fixes.fix_future_standard_library_urllib&lt;br /&gt;
libfuturize.fixes.fix_metaclass&lt;br /&gt;
libfuturize.fixes.fix_next_call&lt;br /&gt;
libfuturize.fixes.fix_object&lt;br /&gt;
libfuturize.fixes.fix_print_with_import&lt;br /&gt;
libfuturize.fixes.fix_raise&lt;br /&gt;
libfuturize.fixes.fix_unicode_keep_u&lt;br /&gt;
libfuturize.fixes.fix_xrange_with_import&lt;br /&gt;
libpasteurize.fixes.fix_newstyle&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
expect these two:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lib2to3.fixes.fix_idioms&lt;br /&gt;
lib2to3.fixes.fix_ws_comma&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;{{note}} If the number of changes is large, you should consider applying each fixes independently.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2'''&lt;br /&gt;
&lt;br /&gt;
Not all changes applied automatically should be integrated. Most of the changes introducing imports from the &amp;lt;tt&amp;gt;future&amp;lt;/tt&amp;gt; python package can simply be removed or removed after making use of &amp;lt;tt&amp;gt;try/except&amp;lt;/tt&amp;gt; or check of &amp;lt;tt&amp;gt;sys.version_info[0]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Systematic conversion of keys, values or items from dictionaries do not need to be systematically converted from &amp;lt;tt&amp;gt;dict_keys&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;dict_values&amp;lt;/tt&amp;gt;/&amp;lt;tt&amp;gt;dict_items&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;list&amp;lt;/tt&amp;gt;. For example, this Slicer [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28077 r28077] reverted some of the automatic changes applied by the future CLI.&lt;br /&gt;
&lt;br /&gt;
* Unless python classes implement the object functions &amp;lt;tt&amp;gt;next&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;__unicode__&amp;lt;/tt&amp;gt; specific to Python 2, nothing specific should be done and &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;from builtins import object&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; can be removed. Automatic removal of imports can also be automated doing:&lt;br /&gt;
&lt;br /&gt;
  for f in `find ./ -name &amp;quot;*.py&amp;quot;`; do \&lt;br /&gt;
    sed -i '/from builtins import object/ d' $f; \&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
* Unless there are performances issue associated with using &amp;lt;tt&amp;gt;range&amp;lt;/tt&amp;gt; in Python 2, the &amp;lt;tt&amp;gt;&amp;lt;b&amp;gt;from builtins import range&amp;lt;/b&amp;gt;&amp;lt;/tt&amp;gt; can be removed:&lt;br /&gt;
&lt;br /&gt;
  for f in `find ./ -name &amp;quot;*.py&amp;quot;`; do \&lt;br /&gt;
    sed -i '/from builtins import range/ d' $f; \&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
* If there are performance issue with using &amp;lt;tt&amp;gt;range&amp;lt;/tt&amp;gt; in Python 2, the following could also be done:&lt;br /&gt;
&lt;br /&gt;
  import sys&lt;br /&gt;
  if sys.version_info[0] == 2:&lt;br /&gt;
    range = xrange&lt;br /&gt;
&lt;br /&gt;
* Use of aliases can also be avoided by removing&lt;br /&gt;
&lt;br /&gt;
  from future import standard_library&lt;br /&gt;
  standard_library.install_aliases()&lt;br /&gt;
&lt;br /&gt;
and instead doing something like this:&lt;br /&gt;
&lt;br /&gt;
  try:&lt;br /&gt;
    import queue&lt;br /&gt;
  except ImportError:&lt;br /&gt;
    import Queue as queue&lt;br /&gt;
&lt;br /&gt;
For a complete list aliases, see https://python-future.org/reference.html#module-future.standard_library&lt;br /&gt;
&lt;br /&gt;
* Use of &amp;lt;tt&amp;gt;old_div()&amp;lt;/tt&amp;gt; function can generally be avoided by using &amp;lt;tt&amp;gt;int()&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Step 3'''&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;lib2to3.fixes.fix_idioms&amp;lt;/tt&amp;gt; transformation should explicitly be applied:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  for f in `find ./ -name &amp;quot;*.py&amp;quot;`; do \&lt;br /&gt;
    ${Slicer_DIR}/../python-install/bin/PythonSlicer \&lt;br /&gt;
      --launch futurize -f lib2to3.fixes.fix_idioms --nobackups --write $f; \&lt;br /&gt;
  done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 5.0: Python2 to Python3 (EditorEffect imports)===&lt;br /&gt;
&lt;br /&gt;
'''Error:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    from EditorLib import EditorLib&lt;br /&gt;
ImportError: cannot import name 'EditorLib'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Import of Editor classes should be updated. For example, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Utilities/Templates/Modules/ScriptedEditorEffect/TemplateKeyEffect.py?r1=28122&amp;amp;r2=28121&amp;amp;pathrev=28122 r28122].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import EditorLib&lt;br /&gt;
from EditorLib.EditOptions import HelpButton&lt;br /&gt;
from EditorLib.EditOptions import EditOptions&lt;br /&gt;
from EditorLib import EditUtil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TemplateKeyEffectOptions(EditorLib.LabelEffectOptions):&lt;br /&gt;
  [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import EditorLib&lt;br /&gt;
from EditorLib import EditOptions, HelpButton&lt;br /&gt;
from EditorLib import EditUtil&lt;br /&gt;
from EditorLib import LabelEffectOptions, LabelEffectTool, LabelEffectLogic, LabelEffect&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TemplateKeyEffectOptions(LabelEffectOptions):&lt;br /&gt;
  [...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Explicit include of ExternalProject module not needed anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26984 r26984], calling &amp;lt;tt&amp;gt;find_package(Slicer REQUIRED)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;include(${Slicer_USE_FILE})&amp;lt;/tt&amp;gt; ensure the &amp;lt;tt&amp;gt;ExternalProject&amp;lt;/tt&amp;gt; CMake module is included.&lt;br /&gt;
&lt;br /&gt;
Note that &amp;lt;tt&amp;gt;ExternalProjectDependency&amp;lt;/tt&amp;gt; CMake module is also included.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Explicit passing of CMAKE_OSX_* variables not needed anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26983 r26983], calling &amp;lt;tt&amp;gt;find_package(Slicer REQUIRED)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;include(${Slicer_USE_FILE})&amp;lt;/tt&amp;gt; initializes &amp;lt;tt&amp;gt;CMAKE_OSX_*&amp;lt;/tt&amp;gt; variables and ensures the variables &amp;lt;tt&amp;gt;CMAKE_OSX_ARCHITECTURES&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;CMAKE_OSX_SYSROOT&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CMAKE_OSX_DEPLOYMENT_TARGET&amp;lt;/tt&amp;gt; are passed to all external projects when configuring SuperBuild based extension.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Explicit initialization of CMAKE_BUILD_TYPE not needed anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26978 r26978], calling &amp;lt;tt&amp;gt;find_package(Slicer REQUIRED)&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;include(${Slicer_USE_FILE})&amp;lt;/tt&amp;gt; initializes &amp;lt;tt&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/tt&amp;gt; and ensures the variables &amp;lt;tt&amp;gt;CMAKE_BUILD_TYPE&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;CMAKE_CONFIGURATION_TYPES&amp;lt;/tt&amp;gt; are passed to all external projects when configuring SuperBuild based extension.&lt;br /&gt;
&lt;br /&gt;
The module &amp;lt;tt&amp;gt;SlicerInitializeBuildType&amp;lt;/tt&amp;gt; is automatically included in &amp;lt;tt&amp;gt;UseSlicer&amp;lt;/tt&amp;gt; CMake module.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Subversion not required anymore===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27060 r27060], Subversion is not required anymore.&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Support EP_GIT_PROTOCOL and use of ExternalProject_SetIfNotDefined for setting GIT_REPOSITORY, GIT_TAG and alike===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26957 r26957], extension may use the following convention to define &amp;lt;tt&amp;gt;GIT_REPOSITORY&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GIT_TAG&amp;lt;/tt&amp;gt;, this allows developer to override the value before the first configuration by setting the corresponding environment variable, or by explicitly configuring the project with that variable.&lt;br /&gt;
&lt;br /&gt;
The option &amp;lt;tt&amp;gt;EP_GIT_PROTOCOL&amp;lt;/tt&amp;gt; is also already set in &amp;lt;tt&amp;gt;ExternalProjectDependency&amp;lt;/tt&amp;gt; module included by Slicer and its value is updated based on the &amp;lt;tt&amp;gt;&amp;amp;lt;SUPERBUILD_TOPLEVEL_PROJECT&amp;amp;gt;_USE_GIT_PROTOCOL&amp;lt;/tt&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  ExternalProject_SetIfNotDefined(&lt;br /&gt;
    ${CMAKE_PROJECT_NAME}_${proj}_GIT_REPOSITORY&lt;br /&gt;
    &amp;quot;${EP_GIT_PROTOCOL}://github.com/jcfr/shape4D.git&amp;quot;&lt;br /&gt;
    QUIET&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
  ExternalProject_SetIfNotDefined(&lt;br /&gt;
    ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG&lt;br /&gt;
    &amp;quot;12fef84ca2a56feffc59d8159bdadd2ce4a4138e&amp;quot; # slicersalt-2018-01-22-c74c766a4c&lt;br /&gt;
    QUIET&lt;br /&gt;
    )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
* https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#variable:EP_GIT_PROTOCOL&lt;br /&gt;
* https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#function:ExternalProject_SetIfNotDefined&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Use ExternalProject_AlwaysConfigure to force reconfigure of inner project===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26551 r26551], the function &amp;lt;tt&amp;gt;ExternalProject_AlwaysConfigure&amp;lt;/tt&amp;gt; may be used to ensure the inner project is always reconfigured.&lt;br /&gt;
&lt;br /&gt;
Using the `BUILD_ALWAYS` option supported by &amp;lt;tt&amp;gt;ExternalProject_Add&amp;lt;/tt&amp;gt; will not have the intended effect.&lt;br /&gt;
&lt;br /&gt;
See https://cmake-artichoke.readthedocs.io/en/latest/ExternalProjectDependency.html#function:ExternalProject_AlwaysConfigure&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Specifying external projects to install in SuperBuild extension===&lt;br /&gt;
&lt;br /&gt;
Following [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27267 r27267] and [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=27232 r27232], the following should be used to ensure&lt;br /&gt;
the extension can also be bundled into a Slicer custom application. When bundled, the variable &amp;lt;tt&amp;gt;${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS&amp;lt;/tt&amp;gt; is then used to update the application's list of project to install.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS)&lt;br /&gt;
#list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${Foo_DIR};Foo;RuntimeLibraries;/&amp;quot;)&lt;br /&gt;
set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}&amp;quot; CACHE STRING &amp;quot;List of external projects to install&amp;quot; FORCE)&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/&amp;quot;)&lt;br /&gt;
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS &amp;quot;${${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS}&amp;quot;)&lt;br /&gt;
include(${Slicer_EXTENSION_GENERATE_CONFIG})&lt;br /&gt;
include(${Slicer_EXTENSION_CPACK})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Generating (Extension)Config.cmake===&lt;br /&gt;
&lt;br /&gt;
Initially introduced in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=25944 r25944], and later improved in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=25991 r25991], including &amp;lt;tt&amp;gt;${Slicer_EXTENSION_GENERATE_CONFIG}&amp;lt;/tt&amp;gt; ensure a config is generated and allow an extension to import targets from another extension by using &amp;lt;tt&amp;gt;find_package(ExtensionName REQUIRED)&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
include(${Slicer_EXTENSION_GENERATE_CONFIG})&lt;br /&gt;
include(${Slicer_EXTENSION_CPACK})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.9: Initializing &amp;lt;projectName&amp;gt;_BUILD_SLICER_EXTENSION option: Standalone vs Slicer extension build===&lt;br /&gt;
&lt;br /&gt;
The following snippet allows to automatically initialize &amp;lt;tt&amp;gt;&amp;lt;projectName&amp;gt;_BUILD_SLICER_EXTENSION&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;ON&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;Slicer_DIR&amp;lt;/tt&amp;gt; is defined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
# Standalone vs Slicer extension option&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
# This option should be named after the project name, it corresponds to the&lt;br /&gt;
# option set to ON when the project is build by the Slicer Extension build&lt;br /&gt;
# system.&lt;br /&gt;
&lt;br /&gt;
set(_default OFF)&lt;br /&gt;
set(_reason &amp;quot;${PROJECT_NAME}_BUILD_SLICER_EXTENSION is ON&amp;quot;)&lt;br /&gt;
if(NOT DEFINED ${PROJECT_NAME}_BUILD_SLICER_EXTENSION AND DEFINED Slicer_DIR)&lt;br /&gt;
  set(_default ON)&lt;br /&gt;
  set(_reason &amp;quot;Slicer_DIR is SET&amp;quot;)&lt;br /&gt;
endif()&lt;br /&gt;
&lt;br /&gt;
option(${PROJECT_NAME}_BUILD_SLICER_EXTENSION &amp;quot;Build as a Slicer Extension&amp;quot; ${_default})&lt;br /&gt;
&lt;br /&gt;
set(_msg &amp;quot;Checking if building as a Slicer extension&amp;quot;)&lt;br /&gt;
message(STATUS ${_msg})&lt;br /&gt;
if(${PROJECT_NAME}_BUILD_SLICER_EXTENSION)&lt;br /&gt;
  message(STATUS &amp;quot;${_msg} - yes (${_reason})&amp;quot;)&lt;br /&gt;
else()&lt;br /&gt;
  message(STATUS &amp;quot;${_msg} - no (${PROJECT_NAME}_BUILD_SLICER_EXTENSION is OFF)&amp;quot;)&lt;br /&gt;
endif()&lt;br /&gt;
mark_as_superbuild(${PROJECT_NAME}_BUILD_SLICER_EXTENSION:BOOL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=New_users&amp;diff=61145</id>
		<title>New users</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=New_users&amp;diff=61145"/>
		<updated>2019-05-15T02:57:15Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__ &lt;br /&gt;
&lt;br /&gt;
==Welcome to 3D Slicer==&lt;br /&gt;
[[File:WelcomeToSlicer-2016-05-31.jpg|thumb|200x200px]]&lt;br /&gt;
&lt;br /&gt;
Welcome to the 3D Slicer community. Here you will learn the basics of using Slicer including installing 3D Slicer, the basics of the main application GUI, how to use Slicer and where to find tutorials and more information.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot; style=&amp;quot;font-size: 150%;&amp;quot;&lt;br /&gt;
!The [https://discourse.slicer.org/ 3D Slicer Discourse forum] &lt;br /&gt;
is a place for you to ask any questions regarding Slicer and its usage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===What is Slicer ?===&lt;br /&gt;
{{:Documentation/{{documentation/currentversion}}/Slicer}}&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
3D Slicer is an open-source package that can be used on Mac, Linux and Windows. In order to run 3D Slicer your computer must have the graphics capabilities and memory to hold the original image data and process results. A 64-bit system is required. Click [[Documentation/{{documentation/currentversion}}/SlicerApplication/HardwareConfiguration|here]] more information.&lt;br /&gt;
[[File:Screen_Shot_2016-06-01_at_1.21.15_PM.png|thumb|600px]]&lt;br /&gt;
&lt;br /&gt;
===Installing 3D Slicer===&lt;br /&gt;
To install Slicer, click [http://download.slicer.org here]&lt;br /&gt;
&lt;br /&gt;
The Nightly version of 3D Slicer is updated nightly as groups of developers make changes. The Stable version of 3D Slicer is not updated nightly and is more rigorously tested.&lt;br /&gt;
&lt;br /&gt;
Once downloaded, follow the instructions to complete installation.&lt;br /&gt;
&lt;br /&gt;
===Further Documentation===&lt;br /&gt;
If you're interested in extending your knowledge, access the [[Documentation/{{documentation/currentversion}}|User Manual]]. See also the [http://slicer-users.65878.n3.nabble.com archives of the users mailing list] . The archive is searchable so most answers to questions can be found there.&lt;br /&gt;
&lt;br /&gt;
If you're a developer looking for more information, access the [[Documentation/Nightly/Developers|Developer Manual]]. See also [http://slicer-devel.65872.n3.nabble.com archives of the developer's mailing list] . Similar to the Users Mailing List archive, it is searchable.&lt;br /&gt;
&lt;br /&gt;
==Main Application GUI==&lt;br /&gt;
3D Slicer is built on a modular architecture. The Main Application GUI is divided into six components: the Application Menu Bar, the Application Toolbar, the Module GUI Panel, the Data Probe Panel, the 2D Slice Viewers, and the 3D Viewer. This section will introduce you to the basic functions on the main application's GUI. If you require detailed information, visit this [[Documentation/{{documentation/currentversion}}/SlicerApplication/MainApplicationGUI|page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open 3D Slicer and load your own data or download sample data to explore. Go ahead and click around the user interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=450px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
File:LoadingData-16-06-06.png&lt;br /&gt;
File:SampleData-06-06.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the Welcome panel, you can load your own data or download sample data. Sample data is often useful for exploring the features of 3D Slicer if you don't have data of your own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=350px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
File:SliceViewOptions-2016-06-01.png&lt;br /&gt;
File:ModuleExtensionAccess-2016-06-01.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the push pin in the top left corner of each of the Slice Viewers or the 3D Viewer to see more options. In the Slice Viewers, the horizontal bar can be used to scroll through slices or select a slice. You can explore the various options using your loaded data or downloaded sample data.&lt;br /&gt;
&lt;br /&gt;
[[File:TutorialPreview-2016-05-31.png|313x313px|right]]&lt;br /&gt;
==Tutorials==&lt;br /&gt;
The 3D Slicer documentation has an abundance of tutorials to help you familiarize yourself with the basics of 3D Slicer and with specific&lt;br /&gt;
modules.&lt;br /&gt;
&lt;br /&gt;
Try the [[Documentation/{{documentation/currentversion}}/Training#Slicer_Welcome_Tutorial|Welcome Tutorial]] and the [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Data_Loading_and_3D_Visualization|Data Loading and 3D Visualization Tutorial]] to learn the basics of using 3D Slicer.&lt;br /&gt;
*To learn about using Slicer for 3D Printing, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Printing|this tutorial]]. &lt;br /&gt;
*To learn about Neurosurgical Planning with Slicer, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Neurosurgical_Planning_Tutorial|this tutorial]].&lt;br /&gt;
*To learn about DTI, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Diffusion_Tensor_Imaging_Tutorial|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
For more tutorials, visit the [[Documentation/{{documentation/currentversion}}/Training|Tutorial page]] to see a comprehensive list. Additionally, visit our [https://www.youtube.com/channel/UC11x1iQ7ydSIFYw4L6wveXg?view_as=public YouTube page] for video tutorials.&lt;br /&gt;
&lt;br /&gt;
If you would like to see a list of example cases with data sets and steps to achieve the same result, visit the [[Documentation/{{documentation/currentversion}}/Registration/RegistrationLibrary|Registration Library]]&lt;br /&gt;
&lt;br /&gt;
==Modules==&lt;br /&gt;
3D Slicer has an abundance of modules to allow it's variety of functionalities. Refer to the [[Documentation/{{documentation/currentversion}}#Modules_by_category|documentation page]] for a comprehensive list of modules. Each module has it's own documentation page that has information about the module and may include a tutorial. 3D Slicer has more than 10 core modules that are displayed in the top section of the Modules drop down menu.&lt;br /&gt;
&lt;br /&gt;
===Core Modules===&lt;br /&gt;
'''Welcome''': The default module when 3D Slicer is started. The panel features options for loading data and customizing 3D Slicer. Below those options are drop-down boxes that contain essential information for using 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
'''[[Documentation/{{documentation/currentversion}}/Modules/Annotations|Annotations]]: '''Allows the creation and editing of annotations or supplementary information. Currently, rulers and regions of interest (ROIs) are supported. See the [[Documentation/{{documentation/currentversion}}/Modules/Markups|Markups Module]] for fiducials.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Markups|'''Markups''']]: Allows the creation and editing of markups associated with a scene. Currently, lists of fiducially are supported as markups.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Data|'''Data''']]: Lists the objects currently in the scene and allows basic operations such as search, rename, delete and move.&lt;br /&gt;
&lt;br /&gt;
'''DataStore''': Allows users to download and upload data sets.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/DICOM|'''DICOM''']]: Integrates [http://dicom.nema.org DICOM] support from [http://commontk.org CTK] and [http://dicom.offis.de DCMTK].&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Editor|'''Editor''']]: Allows manual segmentation of volumes.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Models|'''Models''']]''':''' Loads and adjusts display parameters of models. Allows the user to change the appearance of and organize 3D surface models.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/SceneViews|'''Scene Views''']]: Tool for organizing multiple 'live views' of the data in the scene. The user can create any number of views and control parameters&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/SubjectHierarchy|'''Subject Hierarchy''']]''':''' The SubjectHierarchy module acts as a central data-organizing point in Slicer. Subject hierarchy nodes provide features for the underlying data nodes, including cloning, bulk transforming, bulk show/hide, type-specific features, and basic node operations such as delete or rename.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Transforms|'''Transforms''']]''': '''This module is used for creating and editing transformation matrices. You can establish these relations by moving nodes from the Transformable list to the Transformed list or by dragging the nodes under the Transformation nodes in the Data module.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/VolumeRendering|'''Volume Rendering''']]''':''' Provides interactive visualization of 3D image data.&lt;br /&gt;
&lt;br /&gt;
'''[[Documentation/{{documentation/currentversion}}/Modules/Volumes|Volumes]]: '''Used for changing the appearance of various volume types.&lt;br /&gt;
&lt;br /&gt;
[[File:Extension Manager.png|thumb|350x350px]]&lt;br /&gt;
&lt;br /&gt;
==Extensions==&lt;br /&gt;
3D Slicer supports plug-ins that are called extensions. An extension could be seen as a delivery package bundling together one or more Slicer modules. After installing an extension, the associated modules will be presented to the user as built-in ones. Extensions can be downloaded from the extension manager to selectively install features that are useful for the end-user.&lt;br /&gt;
* For details about downloading extensions, see the [[Documentation/{{documentation/currentversion}}/SlicerApplication/ExtensionsManager|Extension Manager page]].&lt;br /&gt;
* Click [[Documentation/{{documentation/currentversion}}/ModuleExtensionListing/Extensions_by_category|here]] for a full list of extensions. The links on the page will provide documentation for each extension.&lt;br /&gt;
* See the [[Documentation/{{documentation/currentversion}}/Announcements#Slicer_Extensions Announcements|page]] for descriptions of the latest 3D Slicer extensions.&lt;br /&gt;
* Slicer is extensible. If you are a programmer who wants to add functionality to Slicer, click [[Documentation/{{documentation/currentversion}}/Developers/Tutorials/BuildTestPackageDistributeExtensions|here]].&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Diffusion Tensor Imaging&lt;br /&gt;
! Neurosurgical Planning&lt;br /&gt;
|-&lt;br /&gt;
|[[ File:Slicer4DTI Tutorial.png|thumb|350px|centre]]&lt;br /&gt;
|[[File:NeurosurgicalPlanningTutorial.png|thumb|360px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Diffusion_Tensor_Imaging_Tutorial|Diffusion Tensor Imaging Tutorial]] course guides through the basics of loading Diffusion Weighted images in Slicer, estimating tensors and generating fiber tracts.&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Neurosurgical_Planning_Tutorial|Neurosurgical Planning Tutorial]] course guides through the generation of fiber tracts in the vicinity of a tumor.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! Visualization of DICOM Images for Radiology Applications&lt;br /&gt;
! Quantitative Imaging&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Slicer4RSNA_2.png|thumb|400px|centre]]&lt;br /&gt;
|[[File:QuantitaiveImaging_tutorial.png|thumb|350px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Visualization_of_DICOM_images_for_Radiology_Applications|3D Visualization of DICOM Images for Radiology Applications Tutorial]] guides through 3D data loading and visualization of DICOM images for radiology applications.&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Quantitative_Imaging_tutorial|Quantitative Imaging Tutorial]] guides through the use of 3D Slicer for quanitifying small volumetric changes in slow-growing tumors and for calculating Standardized Uptake Value (SUV) from PET/CT data.&lt;br /&gt;
|-&lt;br /&gt;
! Surgical Navigation&lt;br /&gt;
! Radiation Therapy&lt;br /&gt;
|-&lt;br /&gt;
|[[File:SlicerIGTLogo250x250.png|thumb|300px|centre]]&lt;br /&gt;
|[[File:SlicerRTUseCaseImage.png|thumb|354px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;|The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_IGT|Slicer IGT tutorials]] are designed for end-users interested in using Slicer for real-time navigated procedures. &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#SlicerRT|SlicerRT tutorial]] demonstrates how to perform a radiation therapy research workflow using the SlicerRT extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:center;width: 540px&amp;quot; |Image Registration&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:center;width: 540px&amp;quot; |3D Printing&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Registration_Slicer4.png|thumb|340px|centre]]&lt;br /&gt;
|[[File:3DPrinting_tutorial.png|thumb|390px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Image_Registration|Image Registration Tutorial]] show how to perform intra- and inter-subject registration within 3D Slicer.&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |&lt;br /&gt;
The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Printing|3D Printing tutorial]] shows how to prepare 3D Slicer Data for 3D printing.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=60616</id>
		<title>Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=60616"/>
		<updated>2018-12-05T16:37:31Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Step-by-step: How to create, publish, distribute and maintain an extension ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To learn what is an extension, see [[Documentation/Nightly/Developers/FAQ#What_is_an_extension_.3F|here]]&lt;br /&gt;
&lt;br /&gt;
== Step-by-step: How to create, publish, distribute and maintain an extension ? ==&lt;br /&gt;
&lt;br /&gt;
* Scan through the [[Documentation/{{documentation/version}}/FAQ/Extensions|user]] and [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions|developer]] extension FAQs&lt;br /&gt;
* Inform a community about your plans on the [https://discourse.slicer.org Slicer forum] to get information about potential parallel efforts (other developers may already work on a similar idea and you could join or build on each other's work), past efforts (related tools might have been available in earlier Slicer versions or in other software that you may reuse), and get early feedback from prospective users. You may also seek advice on the name of your extension and how to organize features into modules. All these can save you a lot of time in the long term.&lt;br /&gt;
* Optional (required if developing loadable or CLI [[Documentation/{{documentation/version}}/Developers/Modules|module types]]): [[Documentation/{{documentation/version}}/Developers/Build_Instructions|Build Slicer application]] in &amp;lt;code&amp;gt;Release&amp;lt;/code&amp;gt;. Not needed if you only develop Python modules.&lt;br /&gt;
* Use the Extension Wizard module in Slicer to create an extension that will contain your module(s). Learn more about ExtensionWizard capabilities [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|here]]. To learn about extension description file format see [[Documentation/{{documentation/version}}/Developers/Extensions/DescriptionFile|here]]&lt;br /&gt;
* Upload source code of your extension to a publicly available repository. It is recommended to start the repository name with &amp;quot;Slicer&amp;quot; (to make Slicer extensions easier to identify) followed by your extension name (for example, &amp;quot;Sequences&amp;quot; extension is stored in &amp;quot;SlicerSequences&amp;quot; repository). However, this is not a mandatory requirement. If you have a compelling reason not to use Slicer prefix, please make a note while making the pull request.&lt;br /&gt;
** GitHub is recommended (due to large user community, free public project hosting): join [https://github.com/join Github] and [https://help.github.com/articles/set-up-git#set-up-git setup Git]&lt;br /&gt;
** Extension Wizard command-line interface can upload source code of your extension to GitHub:&lt;br /&gt;
{{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Implement your extension. &amp;lt;code&amp;gt;Hack, hack, hack :)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Create documentation page for your extension&lt;br /&gt;
** It is recommended to put documentation in a README.md file in your repository use the Slicer wiki: [[Documentation/{{documentation/version}}/Developers/Tutorials/DocumentExtension#Extension_page|Create a documentation page for your extension]].&lt;br /&gt;
* Optional (only needed, if you want to upload test data to MIDAS or troubleshoot extension upload problems): [[Documentation/{{documentation/version}}/Developers/Tutorials/ObtainExtensionServerApiKey|Create an account on the extension server and obtain an API Key]]. You will then use your midas login and api key to substitute &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-LOGIN&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-APIKEY&amp;gt;&amp;lt;/code&amp;gt; in the examples. Go to [http://slicer.kitware.com/midas3/community/23 NA-MIC community] and click on &amp;lt;code&amp;gt;Join community&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
* Optional (required for loadable and CLI modules): [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions#How_to_build_an_extension_.3F|Build your extension]]&lt;br /&gt;
* Test your extension:&lt;br /&gt;
** If you have built your extension then build the PACKAGE target to create a package file that you can install from the Extension Manager by clicking the small tool icon in the top-right corner.&lt;br /&gt;
** If you have not built your extension then set up your extension manually: [[Documentation/{{documentation/version}}/Developers/FAQ#How_to_manually_install_an_extension.3F|Build your extension]]&lt;br /&gt;
* If you consider your extension is ready for distribution, contribute it to the ExtensionsIndex:&lt;br /&gt;
** Fork ExtensionIndex repository on GitHub by clicking ''Fork'' button on https://github.com/Slicer/ExtensionsIndex page&lt;br /&gt;
** Add your .s4ext file to your forked repository: it can be done using a git client or simply by clicking ''Upload files'' button&lt;br /&gt;
** Create a pull request: by clicking ''Create pull request'' button&lt;br /&gt;
** Note: the [[Documentation/Nightly/Developers/ExtensionWizard|Extension Wizard]] can automate this by the following command:&lt;br /&gt;
&lt;br /&gt;
  {{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --contribute ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Wait for your pull request to be merged. Respond to comments posted on the pull request. Reviewers will check the followings:&lt;br /&gt;
** Extension has a reasonable name (not too general, not too narrow, suggests what the extension is for)&lt;br /&gt;
** Repository name is Slicer&amp;lt;ExtensionName&amp;gt;&lt;br /&gt;
** Extension description summarizes in 1-2 sentences what the extension is usable (should be understandable for non-experts)&lt;br /&gt;
** Extension URL and revision (scmurl, scmrevision) is correct, consider using a branch name (master, release, …) instead of a specific git has to avoid re-submitting pull request whenever the extension is updated&lt;br /&gt;
** Extension icon URL is correct&lt;br /&gt;
** Screenshot URLs (screenshoturls) are correct, contains at least one&lt;br /&gt;
** Homepage URL points to valid webpage containing the followings:&lt;br /&gt;
*** Extension name&lt;br /&gt;
*** Short description: 1-2 sentences, which summarizes what the extension is usable for&lt;br /&gt;
*** At least one nice, informative image, that illustrates what the extension can do. It may be a screenshot.&lt;br /&gt;
*** Description of contained modules: at least one sentence for each module&lt;br /&gt;
*** Tutorial: step-by-step description of at least the most typical use case, include a few screenshots, provide download links to sample input data set&lt;br /&gt;
* Next day after your pull request is merged, check on the [https://www.slicer.org/wiki/Documentation/Nightly/Developers dashboard] if your extension is built successfully on all platforms.&lt;br /&gt;
&lt;br /&gt;
=== Continuous Integration ===&lt;br /&gt;
&lt;br /&gt;
If you shared your extension by using the ExtensionWizard, make sure you know about the Slicer testing dashboard: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;mw-code&amp;quot;&amp;gt; [[{{tool|logo|cdash}}|x25px]] http://slicer.cdash.org/index.php?project=Slicer4&amp;amp;display=project&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The dashboard will attempt to check out the source code of your extension, build, test and package it on Linux, MacOSX and Windows platforms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To find your extension, use the following link replacing &amp;lt;code&amp;gt;Slicer-MyExtension&amp;lt;/code&amp;gt; with the name of your extension:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://slicer.cdash.org/index.php?project=Slicer4&amp;amp;filtercount=1&amp;amp;showfilters=1&amp;amp;field1=buildname&amp;amp;compare1=63&amp;amp;value1=Slicer-MyExtension&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, here is the link to check the status of the &amp;lt;code&amp;gt;SlicerDMRI&amp;lt;/code&amp;gt; extension:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;mw-code&amp;quot;&amp;gt;http://slicer.cdash.org/index.php?project=Slicer4&amp;amp;filtercount=1&amp;amp;showfilters=1&amp;amp;field1=buildname&amp;amp;compare1=63&amp;amp;value1=SlicerDMRI&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see red in any of the columns for your extension, click on the hyperlinked number of errors to see the details.&lt;br /&gt;
&lt;br /&gt;
Always check the dashboard after you first introduce your extension, or after you make any changes to the code!&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Training/UserContributions&amp;diff=59136</id>
		<title>Documentation/Nightly/Training/UserContributions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Training/UserContributions&amp;diff=59136"/>
		<updated>2018-06-26T20:51:58Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
== Demonstration videos on YouTube ==&lt;br /&gt;
&lt;br /&gt;
=== Slicer3: How to load data and make models ? ===&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
* [http://www.youtube.com/watch?v=GNsWRnm7gQw&amp;amp;context=C42d9859ADvjVQa1PpcFPhXz87xj_xyVq19zSUexfAbEm8Iz3DYEk= Narrated screencast video] showing how to load data and make models.&lt;br /&gt;
* Author: John Muschelli&lt;br /&gt;
* Dataset: NA&lt;br /&gt;
* Based on Slicer 3&lt;br /&gt;
|align=&amp;quot;right&amp;quot;|&lt;br /&gt;
&amp;lt;!-- [[Image:TUTORIAL-IMAGE-HERE.png|right|150px|]] --&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Prostate segmentation using Segment Editor===&lt;br /&gt;
&lt;br /&gt;
* https://www.slicer.org/w/images/0/0f/SlicerProstate_Workflow6.26.2018.pdf&lt;br /&gt;
* Author: Nicole Wake, NYU Langone&lt;br /&gt;
* Based on Slicer 4&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:SlicerProstate_Workflow6.26.2018.pdf&amp;diff=59135</id>
		<title>File:SlicerProstate Workflow6.26.2018.pdf</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:SlicerProstate_Workflow6.26.2018.pdf&amp;diff=59135"/>
		<updated>2018-06-26T20:50:33Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=59130</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=59130"/>
		<updated>2018-06-25T18:40:35Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* MacOSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout)&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.7-rc02&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 4.8.6. &amp;lt;small&amp;gt;See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Linux|here]]. See some history [http://na-mic.org/Mantis/view.php?id=3325#bugnotes here] (Note that any version &amp;gt;= Qt 4.7.4 can be used only for Ubuntu &amp;lt; 12.04)&amp;lt;/small&amp;gt;&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.8.2-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
===== Qt =====&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 14.04 and above''': Qt 4 == 4.8.7 MUST be used.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/jcfr/qt-easy-build&lt;br /&gt;
&lt;br /&gt;
or on ubuntu 16.04 and 16.10, you can also install qt4.8.7 with:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
or if that fails (due to libqt4-core and libqt4-gui packages not found):&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4 libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 12.04, 12.10, 13.04 and 13.10''': Qt 4 &amp;gt;= 4.8.5 MUST be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/Support   # This is where we will build Qt and dependent libraries&lt;br /&gt;
 &lt;br /&gt;
# Keep track of our working directory&lt;br /&gt;
cwd=$(pwd)&lt;br /&gt;
&lt;br /&gt;
# This will download, then build zlib and openssl in the current folder&lt;br /&gt;
rm -f get-and-build-openssl-for-slicer.sh&lt;br /&gt;
wget https://gist.githubusercontent.com/jcfr/9513568/raw/004d4af8829c95690da2af51eaa3f0c64b7c4e02/get-and-build-openssl-for-slicer.sh&lt;br /&gt;
chmod u+x get-and-build-openssl-for-slicer.sh &lt;br /&gt;
./get-and-build-openssl-for-slicer.sh &lt;br /&gt;
&lt;br /&gt;
# This will download Qt source in the current folder&lt;br /&gt;
wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
echo &amp;quot;2edbe4d6c2eff33ef91732602f3518eb  qt-everywhere-opensource-src-4.8.6.tar.gz&amp;quot; &amp;gt; qt-everywhere-opensource-src-4.8.6.tar.gz.md5&lt;br /&gt;
md5sum -c qt-everywhere-opensource-src-4.8.6.tar.gz.md5&lt;br /&gt;
&lt;br /&gt;
# This will configure and build Qt in RELEASE against the zlib and openssl previously built&lt;br /&gt;
tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
mkdir qt-everywhere-opensource-release-build-4.8.6&lt;br /&gt;
cd qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6    \&lt;br /&gt;
                   -release \&lt;br /&gt;
                   -opensource -confirm-license \&lt;br /&gt;
                   -no-qt3support \&lt;br /&gt;
                   -webkit \&lt;br /&gt;
                   -nomake examples -nomake demos \&lt;br /&gt;
                   -openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e \&lt;br /&gt;
&amp;amp;&amp;amp; make -j7 &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details, consider reading the FAQ entry: [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_Qt_4_.3E.3D_4.8.5_should_be_used_on_Ubuntu_12.04_and_above_.3F|Why Qt 4 &amp;gt;= 4.8.5 should be used on Ubuntu 12.04 and above ?]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.7-rc02 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.0.1 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}For convenience, you could update the PATH variable so that ''git'' can be automatically discovered when configuring Slicer. If not, you will have to specify the GIT_EXECUTABLE at configure time.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;. If using TortoiseSVN (versions that support command line tools), make sure you install Command line tools (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt: See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5, as of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** CMake &amp;gt;= 3.3.1&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** For Debug mode, disable &amp;lt;code&amp;gt;Slicer_USE_SimpleITK&amp;lt;/code&amp;gt; in CMake.&lt;br /&gt;
&lt;br /&gt;
'''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure to install [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)]&lt;br /&gt;
&lt;br /&gt;
* VS2008 (deprecated)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* VS2010 (experimental, may not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
&amp;lt;!-- JC: This links shouldn't be here: 1) Since this the developer section, it's assumed Visual Studio is installed. 2) The Dll are distributed within Slicer package --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *** Optional: &amp;quot;Microsoft Visual C++ 2010 SP1 Redistributable Package&amp;quot;. Click [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x64] download, or [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x86] download.  [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 x86 (32bit) for VS 2008] --&amp;gt;&lt;br /&gt;
* VS2012 (experimental)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* Cygwin (untested)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=59129</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=59129"/>
		<updated>2018-06-25T18:39:56Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* MacOSX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout)&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.7-rc02&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 4.8.6. &amp;lt;small&amp;gt;See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Linux|here]]. See some history [http://na-mic.org/Mantis/view.php?id=3325#bugnotes here] (Note that any version &amp;gt;= Qt 4.7.4 can be used only for Ubuntu &amp;lt; 12.04)&amp;lt;/small&amp;gt;&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.8.2-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
===== Qt =====&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 14.04 and above''': Qt 4 == 4.8.7 MUST be used.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/jcfr/qt-easy-build&lt;br /&gt;
&lt;br /&gt;
or on ubuntu 16.04 and 16.10, you can also install qt4.8.7 with:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
or if that fails (due to libqt4-core and libqt4-gui packages not found):&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4 libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 12.04, 12.10, 13.04 and 13.10''': Qt 4 &amp;gt;= 4.8.5 MUST be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/Support   # This is where we will build Qt and dependent libraries&lt;br /&gt;
 &lt;br /&gt;
# Keep track of our working directory&lt;br /&gt;
cwd=$(pwd)&lt;br /&gt;
&lt;br /&gt;
# This will download, then build zlib and openssl in the current folder&lt;br /&gt;
rm -f get-and-build-openssl-for-slicer.sh&lt;br /&gt;
wget https://gist.githubusercontent.com/jcfr/9513568/raw/004d4af8829c95690da2af51eaa3f0c64b7c4e02/get-and-build-openssl-for-slicer.sh&lt;br /&gt;
chmod u+x get-and-build-openssl-for-slicer.sh &lt;br /&gt;
./get-and-build-openssl-for-slicer.sh &lt;br /&gt;
&lt;br /&gt;
# This will download Qt source in the current folder&lt;br /&gt;
wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
echo &amp;quot;2edbe4d6c2eff33ef91732602f3518eb  qt-everywhere-opensource-src-4.8.6.tar.gz&amp;quot; &amp;gt; qt-everywhere-opensource-src-4.8.6.tar.gz.md5&lt;br /&gt;
md5sum -c qt-everywhere-opensource-src-4.8.6.tar.gz.md5&lt;br /&gt;
&lt;br /&gt;
# This will configure and build Qt in RELEASE against the zlib and openssl previously built&lt;br /&gt;
tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
mkdir qt-everywhere-opensource-release-build-4.8.6&lt;br /&gt;
cd qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6    \&lt;br /&gt;
                   -release \&lt;br /&gt;
                   -opensource -confirm-license \&lt;br /&gt;
                   -no-qt3support \&lt;br /&gt;
                   -webkit \&lt;br /&gt;
                   -nomake examples -nomake demos \&lt;br /&gt;
                   -openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e \&lt;br /&gt;
&amp;amp;&amp;amp; make -j7 &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details, consider reading the FAQ entry: [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_Qt_4_.3E.3D_4.8.5_should_be_used_on_Ubuntu_12.04_and_above_.3F|Why Qt 4 &amp;gt;= 4.8.5 should be used on Ubuntu 12.04 and above ?]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.7-rc02 is recommended.&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.0.1 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}For convenience, you could update the PATH variable so that ''git'' can be automatically discovered when configuring Slicer. If not, you will have to specify the GIT_EXECUTABLE at configure time.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;. If using TortoiseSVN (versions that support command line tools), make sure you install Command line tools (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt: See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5, as of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** CMake &amp;gt;= 3.3.1&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** For Debug mode, disable &amp;lt;code&amp;gt;Slicer_USE_SimpleITK&amp;lt;/code&amp;gt; in CMake.&lt;br /&gt;
&lt;br /&gt;
'''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure to install [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)]&lt;br /&gt;
&lt;br /&gt;
* VS2008 (deprecated)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* VS2010 (experimental, may not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
&amp;lt;!-- JC: This links shouldn't be here: 1) Since this the developer section, it's assumed Visual Studio is installed. 2) The Dll are distributed within Slicer package --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *** Optional: &amp;quot;Microsoft Visual C++ 2010 SP1 Redistributable Package&amp;quot;. Click [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x64] download, or [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x86] download.  [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 x86 (32bit) for VS 2008] --&amp;gt;&lt;br /&gt;
* VS2012 (experimental)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* Cygwin (untested)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions&amp;diff=59128</id>
		<title>Documentation/Nightly/Developers/Build Instructions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions&amp;diff=59128"/>
		<updated>2018-06-25T18:38:43Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Common errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
{{:{{FULLPAGENAME}}/Prerequisites}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/CheckoutSourceCode}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/Configure}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/Compile}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/Run}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/Test}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/Package}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
== DEBUG Slicer ==&lt;br /&gt;
&lt;br /&gt;
To be able to debug Slicer application, you are expected to build it with Debug symbols in a clean directory.&lt;br /&gt;
&lt;br /&gt;
{|width = &amp;quot;100%&amp;quot;&lt;br /&gt;
! width=&amp;quot;50%&amp;quot; style=&amp;quot;border-bottom: 1px solid darkgrey;font-size: 75%;&amp;quot;| Linux or MacOSX&lt;br /&gt;
! width=&amp;quot;50%&amp;quot; style=&amp;quot;border-bottom: 1px solid darkgrey;font-size: 75%;&amp;quot;| Windows (Visual Studio)&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
Configure Slicer using &amp;lt;code&amp;gt;-DCMAKE_BUILD_TYPE:STRING=Debug&amp;lt;/code&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
Selecting &amp;lt;code&amp;gt;Debug&amp;lt;/code&amp;gt; configuration in Visual Studio.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|width = &amp;quot;100%&amp;quot;&lt;br /&gt;
! width=&amp;quot;50%&amp;quot; style=&amp;quot;border-bottom: 1px solid darkgrey;font-size: 75%;&amp;quot;| Linux or MacOSX&lt;br /&gt;
! width=&amp;quot;50%&amp;quot; style=&amp;quot;border-bottom: 1px solid darkgrey;font-size: 75%;&amp;quot;| Windows (Visual Studio)&lt;br /&gt;
|-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{wip}} TBD&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; |&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Press &amp;quot;Win-R,&amp;quot; type &amp;quot;cmd&amp;quot; and press &amp;quot;Enter&amp;quot; to open a Command Prompt session.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Start Visual Studio with Slicer environment:&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;pre&amp;gt;&amp;amp;gt; cd \path\to\Slicer-SuperBuild\Slicer-build&lt;br /&gt;
&amp;amp;gt; Slicer.exe --VisualStudio Slicer.sln&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common errors ==&lt;br /&gt;
&lt;br /&gt;
=== CMake complains during configuration ===&lt;br /&gt;
CMake may not directly show what's wrong; try to look for log files of the form BUILD/CMakeFiles/*.log (where BUILD is your build directory) to glean further information.&lt;br /&gt;
&lt;br /&gt;
=== A tool returned an error code from &amp;quot;Generating vtksysProcessFwd9xEnc.c&amp;quot; ===&lt;br /&gt;
 The application has failed to start because its side-by-side configuration is incorrect.&lt;br /&gt;
 Please see the application event log or use the command-line sxstrace.exe tool for more detail.&lt;br /&gt;
 Project : error PRJ0019: A tool returned an error code from &amp;quot;Generating&lt;br /&gt;
 vtksysProcessFwd9xEnc.c&amp;quot;&lt;br /&gt;
'''Suggested solution: [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites#Windows|Install SP1 of Visual Studio]]'''&lt;br /&gt;
&lt;br /&gt;
See also:&lt;br /&gt;
&lt;br /&gt;
* [http://www.kitware.com/blog/home/post/4|&amp;quot;Deploying on Windows with DLL Manifest Issues&amp;quot;] (Bill Hoffman, Kitware blog).&lt;br /&gt;
* [https://stackoverflow.com/questions/13217174/how-to-properly-setup-vs2008-for-x64-programing/13222870#13222870| How to create a custom installer to correct a missing WinSXS manifest entry] (StackOverflow).&lt;br /&gt;
&lt;br /&gt;
=== error: ‘class QList&amp;lt;QString&amp;gt;’ has no member named ‘reserve’ ===&lt;br /&gt;
 /nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qdatastream.h: In function ‘QDataStream&amp;amp; operator&amp;gt;&amp;gt;(QDataStream&amp;amp;, QList&amp;lt;T&amp;gt;&amp;amp;) [with T = QString]’:&lt;br /&gt;
 /nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qstringlist.h:247:   instantiated from here&lt;br /&gt;
 /nfs/Users/blowekamp/QtSDK/Desktop/Qt/474/gcc/include/QtCore/qdatastream.h:246: error: ‘class QList&amp;lt;QString&amp;gt;’ has no member named ‘reserve’&lt;br /&gt;
You have multiple Qt versions installed on your machine. Try removing the Qt version installed on the system.&lt;br /&gt;
&lt;br /&gt;
=== libarchive.so: undefined reference to `SHA256_Update' ===&lt;br /&gt;
&lt;br /&gt;
 Linking CXX executable ../../../../../bin/MRMLLogicCxxTests&lt;br /&gt;
 /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Update'&lt;br /&gt;
 /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Final'&lt;br /&gt;
 /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `SHA256_Init'&lt;br /&gt;
 /home/benjaminlong/work/slicer/Slicer-SuperBuild-Debug/LibArchive-install/lib/libarchive.so: undefined reference to `MD5_Init'&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
 cd Slicer-SuperBuild&lt;br /&gt;
 rm -rf LibArchive-*&lt;br /&gt;
 make -j4&lt;br /&gt;
&lt;br /&gt;
Details:&lt;br /&gt;
* http://na-mic.org/Mantis/view.php?id=1616&lt;br /&gt;
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=18923&lt;br /&gt;
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=18969&lt;br /&gt;
&lt;br /&gt;
=== No rule to make target `/usr/lib/x86_64-linux-gnu/libGL.so' ===&lt;br /&gt;
See http://techtidings.blogspot.com/2012/01/problem-with-libglso-on-64-bit-ubuntu.html&lt;br /&gt;
&lt;br /&gt;
=== X11 Window errors at start time ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
X Error: BadWindow (invalid Window parameter) 3&lt;br /&gt;
  Extension:    137 (Uknown extension)&lt;br /&gt;
  Minor opcode: 4 (Unknown request)&lt;br /&gt;
  Resource id:  0x4200199&lt;br /&gt;
X Error: BadWindow (invalid Window parameter) 3&lt;br /&gt;
  Extension:    137 (Uknown extension)&lt;br /&gt;
  Minor opcode: 4 (Unknown request)&lt;br /&gt;
  Resource id:  0x42001a6&lt;br /&gt;
X Error: BadWindow (invalid Window parameter) 3&lt;br /&gt;
  Extension:    137 (Uknown extension)&lt;br /&gt;
  Minor opcode: 4 (Unknown request)&lt;br /&gt;
  Resource id:  0x42001b3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution: &lt;br /&gt;
* Reinstall Nvidia drivers (that also rewrite the xorg.conf file).&lt;br /&gt;
&lt;br /&gt;
=== error C2061: syntax error : identifier 'ssize_t' ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
4&amp;gt;1&amp;gt;Compiling...&lt;br /&gt;
4&amp;gt;1&amp;gt;version.c&lt;br /&gt;
4&amp;gt;1&amp;gt;c:\chene\winbin64\slicer4\cmcurl\urldata.h(585) : error C2061: syntax error : identifier 'ssize_t'&lt;br /&gt;
4&amp;gt;1&amp;gt;c:\chene\winbin64\slicer4\cmcurl\urldata.h(593) : error C2365: 'fread' : redefinition; previous definition was 'function'&lt;br /&gt;
4&amp;gt;1&amp;gt;        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(248) : see declaration of 'fread'&lt;br /&gt;
4&amp;gt;1&amp;gt;c:\chene\winbin64\slicer4\cmcurl\urldata.h(610) : error C2059: syntax error : '}'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* See [[#A_tool_returned_an_error_code_from_.22Performing_configure_step_for_....22]]&lt;br /&gt;
&lt;br /&gt;
=== ld: framework not found QtWebKit ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
Linking CXX shared library libPythonQt.dylib&lt;br /&gt;
ld: framework not found QtWebKit&lt;br /&gt;
clang: error: linker command failed with exit code 1 (use -v to see invocation)&lt;br /&gt;
make[8]: *** [libPythonQt.dylib] Error 1&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See Slicer issue [http://na-mic.org/Mantis/view.php?id=2860 #2860]&lt;br /&gt;
&lt;br /&gt;
Workaround:&lt;br /&gt;
* See http://public.kitware.com/Bug/view.php?id=13765#c31824&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
* Use a [http://www.cmake.org/files/dev/?C=M;O=D recent nightly build of CMake]. It includes patch [http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cc676c3a cc676c3a]. Note also that the coming version of CMake 2.8.11 will work as expected.&lt;br /&gt;
&lt;br /&gt;
=== On MacOSX 10.8, CMake hangs forever ===&lt;br /&gt;
&lt;br /&gt;
Issue: http://www.na-mic.org/Bug/view.php?id=2957&lt;br /&gt;
&lt;br /&gt;
Solution: Use CMake build &amp;gt;= 2.8.10.20130220-g53b279. See http://www.cmake.org/files/dev/cmake-2.8.10.20130220-g53b279-Darwin-universal.tar.gz&lt;br /&gt;
&lt;br /&gt;
Details:&lt;br /&gt;
&lt;br /&gt;
CMake folks (Thanks Brad King :)) fixed an issue that was preventing the most recent nightly from being used to successfully compile Slicer. The fix has been tested and is known to work. Tomorrow nightly build of CMake and by extension the coming release of CMake 2.8.11 will work.&lt;br /&gt;
&lt;br /&gt;
If you are curious about the details, check the commit message:&lt;br /&gt;
&lt;br /&gt;
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df09e57 [^]&lt;br /&gt;
&lt;br /&gt;
The associated CMake test have also been updated: &lt;br /&gt;
&lt;br /&gt;
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bff3d9ce [^]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== On MacOSX 10.8/10.9 with XQuartz, 'X11/Xlib.h' file not found ===&lt;br /&gt;
&lt;br /&gt;
Issue: http://www.na-mic.org/Bug/view.php?id=3405&lt;br /&gt;
&lt;br /&gt;
Workaround: Build with -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF&lt;br /&gt;
&lt;br /&gt;
Tcl is required only for EMSegment module.&lt;br /&gt;
&lt;br /&gt;
Details: See http://www.na-mic.org/Bug/view.php?id=3405&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== svn: E175002: Unable to connect to a repository at URL XXX ===&lt;br /&gt;
&lt;br /&gt;
Issue: Cisco AnyConnect is installed with the &amp;quot;Web Security&amp;quot; option checked (default), which blocks Subversion checkouts even when inactive!&lt;br /&gt;
&lt;br /&gt;
Solution:  Uninstall and reinstall Cisco AnyConnect, deselecting the &amp;quot;Web Security&amp;quot; feature during install&lt;br /&gt;
&lt;br /&gt;
[[File:CiscoAnyConnectInstallOptions.png]]&lt;br /&gt;
&lt;br /&gt;
=== My antivirus software reports that files in my build directory are infected ===&lt;br /&gt;
&lt;br /&gt;
Although usually antivirus software does not interfere with the build process, it is recommended to disable antivirus and search indexing for build directories to improve performance and minimize the chance of concurrent file access problems.&lt;br /&gt;
&lt;br /&gt;
=== Visual Studio compiler crashes ===&lt;br /&gt;
&lt;br /&gt;
* If you use Visual Studio 2008, make sure Visual Studio 2008 service pack 1 is installed&lt;br /&gt;
* Build Slicer in a short directory, for example source code in C:\S4, binary directory C:\S4D or C:\S4R&lt;br /&gt;
&lt;br /&gt;
=== 'QSslSocket' : is not a class or namespace name ===&lt;br /&gt;
&lt;br /&gt;
This error message occurs if Slicer is configured to use SSL but Qt is built without SSL support.&lt;br /&gt;
&lt;br /&gt;
Either set Slicer_USE_PYTHONQT_WITH_OPENSSL to OFF when configuring Slicer build in CMake, or build Qt with SSL support.&lt;br /&gt;
&lt;br /&gt;
=== error: Missing Qt module QTWEBKIT ===&lt;br /&gt;
&lt;br /&gt;
 CMake Error at CMake/SlicerBlockFindQtAndCheckVersion.cmake:43 (message):&lt;br /&gt;
  error: Missing Qt module QTWEBKIT&lt;br /&gt;
 Call Stack (most recent call first):&lt;br /&gt;
  CMake/SlicerBlockFindQtAndCheckVersion.cmake:88 (__SlicerBlockFindQtAndCheckVersion_find_qt)&lt;br /&gt;
  CMakeLists.txt:607 (include)&lt;br /&gt;
&lt;br /&gt;
Solution:&lt;br /&gt;
 sudo apt-get -y install libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
Details:&lt;br /&gt;
* http://slicer-devel.65872.n3.nabble.com/Re-slicer-devel-Digest-Vol-143-Issue-39-td4037122.html&lt;br /&gt;
&lt;br /&gt;
=== error when starting Slicer: NameError: name 'getSlicerRCFileName' is not defined ===&lt;br /&gt;
&lt;br /&gt;
./Slicer&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;&amp;lt;string&amp;gt;&amp;quot;, line 7, in &amp;lt;module&amp;gt;&lt;br /&gt;
  File &amp;quot;/home/fbudin/Devel/Slicer-SuperBuild-Release/Slicer-build/bin/Python/slicer/slicerqt.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;&lt;br /&gt;
    import vtk&lt;br /&gt;
  File &amp;quot;/home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/Wrapping/Python/vtk/__init__.py&amp;quot;, line 41, in &amp;lt;module&amp;gt;&lt;br /&gt;
    from .vtkCommonKit import *&lt;br /&gt;
  File &amp;quot;/home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/Wrapping/Python/vtk/vtkCommonKit.py&amp;quot;, line 9, in &amp;lt;module&amp;gt;&lt;br /&gt;
    from vtkCommonKitPython import *&lt;br /&gt;
ImportError: /home/fbudin/Devel/Slicer-SuperBuild-Release/VTKv7-build/lib/./libvtkCommonKitPython27D-7.1.so.1: undefined symbol: PyUnicodeUCS2_DecodeUTF8&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;&amp;lt;string&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;br /&gt;
NameError: name 'getSlicerRCFileName' is not defined&lt;br /&gt;
Number of registered modules: 138&lt;br /&gt;
error: [/home/fbudin/Devel/Slicer-SuperBuild-Release/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.&lt;br /&gt;
&lt;br /&gt;
Solution and details [http://na-mic.org/Mantis/view.php?id=3574 here]&lt;br /&gt;
&lt;br /&gt;
=== macOS: error while configuring PCRE: &amp;quot;cannot run C compiled program&amp;quot; ===&lt;br /&gt;
If the XCode command line tools are not properly set up on OS X, PCRE could fail to build in the Superbuild process with the errors like below:&lt;br /&gt;
 configure: error: in `/Users/fedorov/local/Slicer4-Debug/PCRE-build':&lt;br /&gt;
 configure: error: cannot run C compiled programs.&lt;br /&gt;
&lt;br /&gt;
To install XCode command line tools, use the following command from the terminal:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
&lt;br /&gt;
== Quick Build on Debian ==&lt;br /&gt;
 sudo aptitude update&lt;br /&gt;
 sudo aptitude install subversion git gcc g++ make cmake-curses-gui libqt4-dev&lt;br /&gt;
 svn co http://svn.slicer.org/Slicer4/trunk Slicer&lt;br /&gt;
 mkdir Slicer-SuperBuild-Debug&lt;br /&gt;
 cd Slicer-SuperBuild-Debug&lt;br /&gt;
 cmake ../Slicer&lt;br /&gt;
 make -j5&lt;br /&gt;
 &lt;br /&gt;
 # runtime dependency:&lt;br /&gt;
 sudo aptitude install python-tk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quick Build on Fedora 20 ==&lt;br /&gt;
&lt;br /&gt;
Thanks to Bill Lorensen, you will find below the instruction to quickly build Slicer on Fedora 20:&lt;br /&gt;
&lt;br /&gt;
 yum groupinstall &amp;quot;C Development Tools&amp;quot;&lt;br /&gt;
 yum install git-core&lt;br /&gt;
 yum install svn&lt;br /&gt;
 yum install libX11-devel&lt;br /&gt;
 yum install libXt-devel&lt;br /&gt;
 yum install mesa-libGL-devel&lt;br /&gt;
 yum install mesa-libGLU-devel&lt;br /&gt;
 yum install cmake&lt;br /&gt;
 yum install tcl-devel&lt;br /&gt;
 yum install python-devel&lt;br /&gt;
 yum install qt-devel&lt;br /&gt;
 yum install qt-webkit-devel&lt;br /&gt;
&lt;br /&gt;
 svn co http://svn.slicer.org/Slicer4/trunk Slicer&lt;br /&gt;
 mkdir Slicer-SuperBuild-Debug&lt;br /&gt;
 cd Slicer-SuperBuild-Debug&lt;br /&gt;
 cmake ../Slicer&lt;br /&gt;
 make -j5&lt;br /&gt;
&lt;br /&gt;
Reference: http://slicer-devel.65872.n3.nabble.com/Fedora-20-Slicer-Experience-tt4030845.html&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59116</id>
		<title>Documentation/Nightly/FAQ/DICOM</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59116"/>
		<updated>2018-06-19T18:52:29Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;__TOC__&lt;br /&gt;
={{#titleparts: {{PAGENAME}} | | -1 }}=&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
{{#ifeq: {{#titleparts: {{PAGENAME}} | 3 }} | Documentation/{{documentation/version}}/Developers | | ='''User FAQ: {{{1}}}'''=}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What is DICOM anyway?==&lt;br /&gt;
&lt;br /&gt;
Digital Imaging and Communications in Medicine (DICOM) is the standard for the communication and management of medical imaging information and related data (see Wikipedia article [https://en.wikipedia.org/wiki/DICOM here]). Among other things, DICOM defines format of objects for communicating images and image-related data. In most cases, imaging equipment (CT and MR scanners) used in the hospitals will generate images saved as DICOM objects.&lt;br /&gt;
&lt;br /&gt;
DICOM organizes data following the hierarchy of &lt;br /&gt;
* '''Patient''' ... can have 1 or more&lt;br /&gt;
** '''Study''' (single imaging exam encounter) ... can have 1 or more&lt;br /&gt;
*** '''Series''' (single image acquisition, most often corresponding to a single image volume) ... can have 1 or more&lt;br /&gt;
**** '''Instance''' (most often, each Series will contain multiple Instances, with each Instance corresponding to a single slice of the image)&lt;br /&gt;
&lt;br /&gt;
As a result of imaging exam, imaging equipment generates DICOM files, where each file corresponds to one Instance, and is tagged with the information that allows to determine the Series, Study and Patient information to put it into the proper location in the hierarchy.&lt;br /&gt;
&lt;br /&gt;
There is a variety of DICOM objects defined by the standard. Most common object types are those that store the image volumes produced by the CT and MR scanners. Those objects most often will have multiple files (instances) for each series. Image processing tasks most often are concerned with analyzing the image ''volume'', which most often corresponds to a single Series. The first step working with such data is to load that volume into 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
==How do I know if the files I have are stored using DICOM format? How do I get started?==&lt;br /&gt;
&lt;br /&gt;
DICOM files do not need to have a specific file extension, and it may not be straightforward to answer this question easily. However, if you have a dataset produced by a clinical scanner, it is most likely in the DICOM format. If you suspect your data might be in DICOM format, it might be easiest to try to load it as DICOM:&lt;br /&gt;
&lt;br /&gt;
1) drag and drop the directory with your data into Slicer window. You will get a prompt &amp;quot;Select a reader to use for your data? Load directory into DICOM database.&amp;quot; Accept that selection. You will see a progress update as the content of that directory is being indexed. If the directory contained DICOM data, and import succeeded, at the completion you will see the message of how many Patient/Study/Series/Instance items were successfully imported.&lt;br /&gt;
&lt;br /&gt;
2) Once import is completed, you will see the window of the DICOM Browser listing all Patients/Studies/Series currently indexed. You can next select individual items from the DICOM Browser window and load them.&lt;br /&gt;
&lt;br /&gt;
3) Once you load the data into Slicer using DICOM Browser, you can switch to the &amp;quot;Data&amp;quot; module to examine the content that was imported.&lt;br /&gt;
&lt;br /&gt;
== When I click on &amp;quot;Load selection to slicer&amp;quot; I get an error message &amp;quot;Could not load ... as a scalar volume&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
There's a chance you could be running out of memory when loading the data. Make sure you use a 64-bit version of Slicer. The 32-bit Windows version has constrained memory and often does not work with clinical CT studies. &lt;br /&gt;
&lt;br /&gt;
Another potential cause of loading failure is corruption of the DICOM files by incorrect anonymization. Patient name, patient ID, and series instance UID fields should not be empty or missing (the anonymizer should replace them by other valid strings). Try to load the original, non-anonymized sequence and/or change your anonymization procedure.&lt;br /&gt;
&lt;br /&gt;
If none of the above helps then check the Slicer error logs and report the error on the [https://discourse.slicer.org Slicer forum]. If you share the data (e.g., upload it to Dropbox and add the link to the error report) then Slicer developers can reproduce and fix the problem faster.&lt;br /&gt;
&lt;br /&gt;
== I try to import a directory of DICOM files, but nothing shows up in the browser ==&lt;br /&gt;
&lt;br /&gt;
DICOM is a complex way to represent data, and often scanners and other software will generate 'non-standard' files that claim to be DICOM but really aren't compliant with the specification.  In addition, the specification itself has many variations and special formats that Slicer is not able to understand.  Slicer is used most often with CT and MR DICOM objects, so these will typically work.&lt;br /&gt;
&lt;br /&gt;
If you have trouble importing DICOM data here are some steps to try:&lt;br /&gt;
* Make sure you are following the [[Documentation/{{documentation/version}}/Modules/DICOM|DICOM]] module documentation.&lt;br /&gt;
* Try using the latest nightly build of Slicer.&lt;br /&gt;
* Try import using different DICOM readers: in Application settings / DICOM / DICOMScalarVolumePlugin / DICOM reader approach: switch from DCMTK to GDCM (or GDCM to DCMTK), restart Slicer, and attempt to load the data set again.&lt;br /&gt;
* Try the [https://github.com/lassoan/SlicerDicomPatcher DICOM Patcher]  module&lt;br /&gt;
* Review the [[Documentation/{{documentation/version}}/SlicerApplication/ErrorLog|Error Log]] for information.&lt;br /&gt;
* Try loading the data by selecting one of the files in the [[Documentation/{{documentation/version}}/SlicerApplication/LoadingData|Add Data Dialog]].  ''Note: be sure to turn on Show Options and then turn off the Single File option in order to load the selected series as a volume'' &lt;br /&gt;
* If you are still unable to load the data, you may need to find a utility that converts the data into something Slicer can read.  Sometimes tools like [http://surfer.nmr.mgh.harvard.edu/ FreeSurfer], [http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/ FSL] or [http://www.mccauslandcenter.sc.edu/mricro/mricron/dcm2nii.html MRIcron] can understand special formats that Slicer does not handle natively.  These systems typically export [http://nifti.nimh.nih.gov/nifti-1/ NIfTI] files that slicer can read.&lt;br /&gt;
* If you are sure that the DICOM files do not contain patient confidential information, you may post a sample dataset on a web site and ask for help from [https://discourse.slicer.org Slicer forum].  ''Please be careful not to accidentally reveal private health information''.  If you want to remove identifiers from the DICOM files you may want to look at [http://www.dclunie.com/pixelmed/software/webstart/DicomCleanerUsage.html DicomCleaner] or [http://mircwiki.rsna.org/index.php?title=CTP-The_RSNA_Clinical_Trial_Processor the RSNA Clinical Trial Processor] software.&lt;br /&gt;
* Try moving the data and the database directory to a path that includes only US English characters (ASCII) to avoid possible parsing errors.&lt;br /&gt;
&lt;br /&gt;
== Something is displayed, but it is not what I expected ==&lt;br /&gt;
&lt;br /&gt;
When you load a study from DICOM, it may contain several data sets and by default Slicer may not show the data set that you are most interested in. Go to Data module / Subject hierarchy section and click the &amp;quot;eye&amp;quot; icons to show/hide loaded data sets. You may need to click on the small rectangle icon (&amp;quot;Adjust the slice viewer's field of view...&amp;quot;) on the left side of the slice selection slider after you show a volume.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59110</id>
		<title>Documentation/Nightly/FAQ/DICOM</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59110"/>
		<updated>2018-06-15T15:34:09Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* How do I know if the files I have are stored using DICOM format? How do I proceed? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;__TOC__&lt;br /&gt;
={{#titleparts: {{PAGENAME}} | | -1 }}=&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
{{#ifeq: {{#titleparts: {{PAGENAME}} | 3 }} | Documentation/{{documentation/version}}/Developers | | ='''User FAQ: {{{1}}}'''=}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What is DICOM anyway?==&lt;br /&gt;
&lt;br /&gt;
Digital Imaging and Communications in Medicine (DICOM) is the standard for the communication and management of medical imaging information and related data (see Wikipedia article [https://en.wikipedia.org/wiki/DICOM here]). Among other things, DICOM defines format of objects for communicating images and image-related data. In most cases, imaging equipment (CT and MR scanners) used in the hospitals will generate images saved as DICOM objects.&lt;br /&gt;
&lt;br /&gt;
DICOM organizes data following the hierarchy of &lt;br /&gt;
* '''Patient''' ... can have 1 or more&lt;br /&gt;
** '''Study''' (single imaging exam encounter) ... can have 1 or more&lt;br /&gt;
*** '''Series''' (single image acquisition, most often corresponding to a single image volume) ... can have 1 or more&lt;br /&gt;
**** '''Instance''' (most often, each Series will contain multiple Instances, with each Instance corresponding to a single slice of the image)&lt;br /&gt;
&lt;br /&gt;
As a result of imaging exam, imaging equipment generates DICOM files, where each file corresponds to one Instance, and is tagged with the information that allows to determine the Series, Study and Patient information to put it into the proper location in the hierarchy.&lt;br /&gt;
&lt;br /&gt;
There is a variety of DICOM objects defined by the standard. Most common object types are those that store the image volumes produced by the CT and MR scanners. Those objects most often will have multiple files (instances) for each series. Image processing tasks most often are concerned with analyzing the image _volume_, which most often corresponds to a single Series. The first step working with such data is to load that volume into 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
==How do I know if the files I have are stored using DICOM format? How do I get started?==&lt;br /&gt;
&lt;br /&gt;
DICOM files do not need to have a specific file extension, and it may not be straightforward to answer this question easily. However, if you have a dataset produced by a clinical scanner, it is most likely in the DICOM format. If you suspect your data might be in DICOM format, it might be easiest to try to load it as DICOM:&lt;br /&gt;
&lt;br /&gt;
1) drag and drop the directory with your data into Slicer window. You will get a prompt &amp;quot;Select a reader to use for your data? Load directory into DICOM database.&amp;quot; Accept that selection. You will see a progress update as the content of that directory is being indexed. If the directory contained DICOM data, and import succeeded, at the completion you will see the message of how many Patient/Study/Series/Instance items were successfully imported.&lt;br /&gt;
&lt;br /&gt;
Once import is completed, you will see the window of the DICOM Browser listing all Patients/Studies/Series currently indexed. You can next select individual items from the DICOM Browser window and load them.&lt;br /&gt;
&lt;br /&gt;
Once you load the data into Slicer using DICOM Browser, you can switch to the &amp;quot;Data&amp;quot; module to examine the content that was imported.&lt;br /&gt;
&lt;br /&gt;
== When I click on &amp;quot;Load selection to slicer&amp;quot; I get an error message &amp;quot;Could not load ... as a scalar volume&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
There's a chance you could be running out of memory when loading the data. Make sure you use a 64-bit version of Slicer. The 32-bit Windows version has constrained memory and often does not work with clinical CT studies. &lt;br /&gt;
&lt;br /&gt;
Another potential cause of loading failure is corruption of the DICOM files by incorrect anonymization. Patient name, patient ID, and series instance UID fields should not be empty or missing (the anonymizer should replace them by other valid strings). Try to load the original, non-anonymized sequence and/or change your anonymization procedure.&lt;br /&gt;
&lt;br /&gt;
If none of the above helps then check the Slicer error logs and report the error on the [https://discourse.slicer.org Slicer forum]. If you share the data (e.g., upload it to Dropbox and add the link to the error report) then Slicer developers can reproduce and fix the problem faster.&lt;br /&gt;
&lt;br /&gt;
== I try to import a directory of DICOM files, but nothing shows up in the browser ==&lt;br /&gt;
&lt;br /&gt;
DICOM is a complex way to represent data, and often scanners and other software will generate 'non-standard' files that claim to be DICOM but really aren't compliant with the specification.  In addition, the specification itself has many variations and special formats that Slicer is not able to understand.  Slicer is used most often with CT and MR DICOM objects, so these will typically work.&lt;br /&gt;
&lt;br /&gt;
If you have trouble importing DICOM data here are some steps to try:&lt;br /&gt;
* Make sure you are following the [[Documentation/{{documentation/version}}/Modules/DICOM|DICOM]] module documentation.&lt;br /&gt;
* Try using the latest nightly build of Slicer.&lt;br /&gt;
* Try import using different DICOM readers: in Application settings / DICOM / DICOMScalarVolumePlugin / DICOM reader approach: switch from DCMTK to GDCM (or GDCM to DCMTK), restart Slicer, and attempt to load the data set again.&lt;br /&gt;
* Try the [https://github.com/lassoan/SlicerDicomPatcher DICOM Patcher]  module&lt;br /&gt;
* Review the [[Documentation/{{documentation/version}}/SlicerApplication/ErrorLog|Error Log]] for information.&lt;br /&gt;
* Try loading the data by selecting one of the files in the [[Documentation/{{documentation/version}}/SlicerApplication/LoadingData|Add Data Dialog]].  ''Note: be sure to turn on Show Options and then turn off the Single File option in order to load the selected series as a volume'' &lt;br /&gt;
* If you are still unable to load the data, you may need to find a utility that converts the data into something Slicer can read.  Sometimes tools like [http://surfer.nmr.mgh.harvard.edu/ FreeSurfer], [http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/ FSL] or [http://www.mccauslandcenter.sc.edu/mricro/mricron/dcm2nii.html MRIcron] can understand special formats that Slicer does not handle natively.  These systems typically export [http://nifti.nimh.nih.gov/nifti-1/ NIfTI] files that slicer can read.&lt;br /&gt;
* If you are sure that the DICOM files do not contain patient confidential information, you may post a sample dataset on a web site and ask for help from [https://discourse.slicer.org Slicer forum].  ''Please be careful not to accidentally reveal private health information''.  If you want to remove identifiers from the DICOM files you may want to look at [http://www.dclunie.com/pixelmed/software/webstart/DicomCleanerUsage.html DicomCleaner] or [http://mircwiki.rsna.org/index.php?title=CTP-The_RSNA_Clinical_Trial_Processor the RSNA Clinical Trial Processor] software.&lt;br /&gt;
* Try moving the data and the database directory to a path that includes only US English characters (ASCII) to avoid possible parsing errors.&lt;br /&gt;
&lt;br /&gt;
== Something is displayed, but it is not what I expected ==&lt;br /&gt;
&lt;br /&gt;
When you load a study from DICOM, it may contain several data sets and by default Slicer may not show the data set that you are most interested in. Go to Data module / Subject hierarchy section and click the &amp;quot;eye&amp;quot; icons to show/hide loaded data sets. You may need to click on the small rectangle icon (&amp;quot;Adjust the slice viewer's field of view...&amp;quot;) on the left side of the slice selection slider after you show a volume.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59109</id>
		<title>Documentation/Nightly/FAQ/DICOM</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/FAQ/DICOM&amp;diff=59109"/>
		<updated>2018-06-15T15:33:55Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;__TOC__&lt;br /&gt;
={{#titleparts: {{PAGENAME}} | | -1 }}=&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
{{#ifeq: {{#titleparts: {{PAGENAME}} | 3 }} | Documentation/{{documentation/version}}/Developers | | ='''User FAQ: {{{1}}}'''=}}&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What is DICOM anyway?==&lt;br /&gt;
&lt;br /&gt;
Digital Imaging and Communications in Medicine (DICOM) is the standard for the communication and management of medical imaging information and related data (see Wikipedia article [https://en.wikipedia.org/wiki/DICOM here]). Among other things, DICOM defines format of objects for communicating images and image-related data. In most cases, imaging equipment (CT and MR scanners) used in the hospitals will generate images saved as DICOM objects.&lt;br /&gt;
&lt;br /&gt;
DICOM organizes data following the hierarchy of &lt;br /&gt;
* '''Patient''' ... can have 1 or more&lt;br /&gt;
** '''Study''' (single imaging exam encounter) ... can have 1 or more&lt;br /&gt;
*** '''Series''' (single image acquisition, most often corresponding to a single image volume) ... can have 1 or more&lt;br /&gt;
**** '''Instance''' (most often, each Series will contain multiple Instances, with each Instance corresponding to a single slice of the image)&lt;br /&gt;
&lt;br /&gt;
As a result of imaging exam, imaging equipment generates DICOM files, where each file corresponds to one Instance, and is tagged with the information that allows to determine the Series, Study and Patient information to put it into the proper location in the hierarchy.&lt;br /&gt;
&lt;br /&gt;
There is a variety of DICOM objects defined by the standard. Most common object types are those that store the image volumes produced by the CT and MR scanners. Those objects most often will have multiple files (instances) for each series. Image processing tasks most often are concerned with analyzing the image _volume_, which most often corresponds to a single Series. The first step working with such data is to load that volume into 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
==How do I know if the files I have are stored using DICOM format? How do I proceed?==&lt;br /&gt;
&lt;br /&gt;
DICOM files do not need to have a specific file extension, and it may not be straightforward to answer this question easily. However, if you have a dataset produced by a clinical scanner, it is most likely in the DICOM format. If you suspect your data might be in DICOM format, it might be easiest to try to load it as DICOM:&lt;br /&gt;
&lt;br /&gt;
1) drag and drop the directory with your data into Slicer window. You will get a prompt &amp;quot;Select a reader to use for your data? Load directory into DICOM database.&amp;quot; Accept that selection. You will see a progress update as the content of that directory is being indexed. If the directory contained DICOM data, and import succeeded, at the completion you will see the message of how many Patient/Study/Series/Instance items were successfully imported.&lt;br /&gt;
&lt;br /&gt;
Once import is completed, you will see the window of the DICOM Browser listing all Patients/Studies/Series currently indexed. You can next select individual items from the DICOM Browser window and load them.&lt;br /&gt;
&lt;br /&gt;
Once you load the data into Slicer using DICOM Browser, you can switch to the &amp;quot;Data&amp;quot; module to examine the content that was imported.&lt;br /&gt;
&lt;br /&gt;
== When I click on &amp;quot;Load selection to slicer&amp;quot; I get an error message &amp;quot;Could not load ... as a scalar volume&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
There's a chance you could be running out of memory when loading the data. Make sure you use a 64-bit version of Slicer. The 32-bit Windows version has constrained memory and often does not work with clinical CT studies. &lt;br /&gt;
&lt;br /&gt;
Another potential cause of loading failure is corruption of the DICOM files by incorrect anonymization. Patient name, patient ID, and series instance UID fields should not be empty or missing (the anonymizer should replace them by other valid strings). Try to load the original, non-anonymized sequence and/or change your anonymization procedure.&lt;br /&gt;
&lt;br /&gt;
If none of the above helps then check the Slicer error logs and report the error on the [https://discourse.slicer.org Slicer forum]. If you share the data (e.g., upload it to Dropbox and add the link to the error report) then Slicer developers can reproduce and fix the problem faster.&lt;br /&gt;
&lt;br /&gt;
== I try to import a directory of DICOM files, but nothing shows up in the browser ==&lt;br /&gt;
&lt;br /&gt;
DICOM is a complex way to represent data, and often scanners and other software will generate 'non-standard' files that claim to be DICOM but really aren't compliant with the specification.  In addition, the specification itself has many variations and special formats that Slicer is not able to understand.  Slicer is used most often with CT and MR DICOM objects, so these will typically work.&lt;br /&gt;
&lt;br /&gt;
If you have trouble importing DICOM data here are some steps to try:&lt;br /&gt;
* Make sure you are following the [[Documentation/{{documentation/version}}/Modules/DICOM|DICOM]] module documentation.&lt;br /&gt;
* Try using the latest nightly build of Slicer.&lt;br /&gt;
* Try import using different DICOM readers: in Application settings / DICOM / DICOMScalarVolumePlugin / DICOM reader approach: switch from DCMTK to GDCM (or GDCM to DCMTK), restart Slicer, and attempt to load the data set again.&lt;br /&gt;
* Try the [https://github.com/lassoan/SlicerDicomPatcher DICOM Patcher]  module&lt;br /&gt;
* Review the [[Documentation/{{documentation/version}}/SlicerApplication/ErrorLog|Error Log]] for information.&lt;br /&gt;
* Try loading the data by selecting one of the files in the [[Documentation/{{documentation/version}}/SlicerApplication/LoadingData|Add Data Dialog]].  ''Note: be sure to turn on Show Options and then turn off the Single File option in order to load the selected series as a volume'' &lt;br /&gt;
* If you are still unable to load the data, you may need to find a utility that converts the data into something Slicer can read.  Sometimes tools like [http://surfer.nmr.mgh.harvard.edu/ FreeSurfer], [http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/ FSL] or [http://www.mccauslandcenter.sc.edu/mricro/mricron/dcm2nii.html MRIcron] can understand special formats that Slicer does not handle natively.  These systems typically export [http://nifti.nimh.nih.gov/nifti-1/ NIfTI] files that slicer can read.&lt;br /&gt;
* If you are sure that the DICOM files do not contain patient confidential information, you may post a sample dataset on a web site and ask for help from [https://discourse.slicer.org Slicer forum].  ''Please be careful not to accidentally reveal private health information''.  If you want to remove identifiers from the DICOM files you may want to look at [http://www.dclunie.com/pixelmed/software/webstart/DicomCleanerUsage.html DicomCleaner] or [http://mircwiki.rsna.org/index.php?title=CTP-The_RSNA_Clinical_Trial_Processor the RSNA Clinical Trial Processor] software.&lt;br /&gt;
* Try moving the data and the database directory to a path that includes only US English characters (ASCII) to avoid possible parsing errors.&lt;br /&gt;
&lt;br /&gt;
== Something is displayed, but it is not what I expected ==&lt;br /&gt;
&lt;br /&gt;
When you load a study from DICOM, it may contain several data sets and by default Slicer may not show the data set that you are most interested in. Go to Data module / Subject hierarchy section and click the &amp;quot;eye&amp;quot; icons to show/hide loaded data sets. You may need to click on the small rectangle icon (&amp;quot;Adjust the slice viewer's field of view...&amp;quot;) on the left side of the slice selection slider after you show a volume.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=58704</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=58704"/>
		<updated>2018-03-02T16:08:00Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* PREREQUISITES */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout)&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.7-rc02&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 4.8.6. &amp;lt;small&amp;gt;See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Linux|here]]. See some history [http://na-mic.org/Mantis/view.php?id=3325#bugnotes here] (Note that any version &amp;gt;= Qt 4.7.4 can be used only for Ubuntu &amp;lt; 12.04)&amp;lt;/small&amp;gt;&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.8.2-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
===== Qt =====&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 14.04 and above''': Qt 4 == 4.8.7 MUST be used.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/jcfr/qt-easy-build&lt;br /&gt;
&lt;br /&gt;
or on ubuntu 16.04 and 16.10, you can also install qt4.8.7 with:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
or if that fails (due to libqt4-core and libqt4-gui packages not found):&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4 libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 12.04, 12.10, 13.04 and 13.10''': Qt 4 &amp;gt;= 4.8.5 MUST be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/Support   # This is where we will build Qt and dependent libraries&lt;br /&gt;
 &lt;br /&gt;
# Keep track of our working directory&lt;br /&gt;
cwd=$(pwd)&lt;br /&gt;
&lt;br /&gt;
# This will download, then build zlib and openssl in the current folder&lt;br /&gt;
rm -f get-and-build-openssl-for-slicer.sh&lt;br /&gt;
wget https://gist.githubusercontent.com/jcfr/9513568/raw/21f4e4cabca5ad03435ecc17ab546dab5e2c1a2f/get-and-build-openssl-for-slicer.sh&lt;br /&gt;
chmod u+x get-and-build-openssl-for-slicer.sh &lt;br /&gt;
./get-and-build-openssl-for-slicer.sh &lt;br /&gt;
&lt;br /&gt;
# This will download Qt source in the current folder&lt;br /&gt;
wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
md5=`md5sum ./qt-everywhere-opensource-src-4.8.6.tar.gz | awk '{ print $1 }'` &amp;amp;&amp;amp;&lt;br /&gt;
[ $md5 == &amp;quot;2edbe4d6c2eff33ef91732602f3518eb&amp;quot; ] || echo &amp;quot;MD5 mismatch. Problem downloading Qt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This will configure and build Qt in RELEASE against the zlib and openssl previously built&lt;br /&gt;
tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
mkdir qt-everywhere-opensource-release-build-4.8.6&lt;br /&gt;
cd qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6    \&lt;br /&gt;
                   -release \&lt;br /&gt;
                   -opensource -confirm-license \&lt;br /&gt;
                   -no-qt3support \&lt;br /&gt;
                   -webkit \&lt;br /&gt;
                   -nomake examples -nomake demos \&lt;br /&gt;
                   -openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e \&lt;br /&gt;
&amp;amp;&amp;amp; make -j7 &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details, consider reading the FAQ entry: [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_Qt_4_.3E.3D_4.8.5_should_be_used_on_Ubuntu_12.04_and_above_.3F|Why Qt 4 &amp;gt;= 4.8.5 should be used on Ubuntu 12.04 and above ?]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.7-rc02 is recommended.&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.0.1 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}For convenience, you could update the PATH variable so that ''git'' can be automatically discovered when configuring Slicer. If not, you will have to specify the GIT_EXECUTABLE at configure time.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;. If using TortoiseSVN (versions that support command line tools), make sure you install Command line tools (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt: See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5, as of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** CMake &amp;gt;= 3.3.1&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** For Debug mode, disable &amp;lt;code&amp;gt;Slicer_USE_SimpleITK&amp;lt;/code&amp;gt; in CMake.&lt;br /&gt;
&lt;br /&gt;
'''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure to install [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)]&lt;br /&gt;
&lt;br /&gt;
* VS2008 (deprecated)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* VS2010 (experimental, may not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
&amp;lt;!-- JC: This links shouldn't be here: 1) Since this the developer section, it's assumed Visual Studio is installed. 2) The Dll are distributed within Slicer package --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *** Optional: &amp;quot;Microsoft Visual C++ 2010 SP1 Redistributable Package&amp;quot;. Click [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x64] download, or [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x86] download.  [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 x86 (32bit) for VS 2008] --&amp;gt;&lt;br /&gt;
* VS2012 (experimental)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* Cygwin (untested)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Extensions/DescriptionFile&amp;diff=55023</id>
		<title>Documentation/Nightly/Developers/Extensions/DescriptionFile</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Extensions/DescriptionFile&amp;diff=55023"/>
		<updated>2017-09-28T15:32:46Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
= Extension description file =&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An extension description file is a text file with &amp;lt;code&amp;gt;s4ext&amp;lt;/code&amp;gt; extension allowing to specify metadata associated with an [[Documentation/{{documentation/version}}/Extensions/Description|extension]].&lt;br /&gt;
&lt;br /&gt;
* A metadata is specified using a keyword followed by at least one spaces and the associated value.&lt;br /&gt;
* Multiline value are not supported.&lt;br /&gt;
* Empty line are ignored&lt;br /&gt;
* Line starting with a &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; will be considered as comment.&lt;br /&gt;
&lt;br /&gt;
This file is generated by the build system in the extension build tree. It can also be generated by the [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|ExtensionWizard]] using the extension metadata reported in the extension &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the Extension manager ignores many fields of the extension description file and instead uses information specified in &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt;. Therefore, when making any changes to the extension description, it has to be done in the &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; file as well.&lt;br /&gt;
&lt;br /&gt;
For the superbuild-based extensions, it is critical that the build_subdirectory is initialized to the inner build location in s4ext. The value of this variable in &amp;lt;code&amp;gt;CMakeLists.txt&amp;lt;/code&amp;gt; is not used in all places by the dashboard scripts.&lt;br /&gt;
&lt;br /&gt;
The following code block illustrates how comments, metadata and associated value can be specified:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This is a comment&lt;br /&gt;
metadataname This is the value associated with 'metadataname'&lt;br /&gt;
&lt;br /&gt;
# This is an other comment&lt;br /&gt;
anothermetadata This is the value associated with 'anothermetadata'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Supported metadata ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;alternate&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Mandatory&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;scm&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Source code management system: &amp;lt;code&amp;gt;git&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;[[File:Yes_check.png|16px]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;scmurl&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Read-only url used to checkout the extension source code&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;[[File:Yes_check.png|16px]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;svnusername&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Allow to specify username associated with &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt; checkout&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;svnpassword&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Allow to specify password associated with &amp;lt;code&amp;gt;svn&amp;lt;/code&amp;gt; checkout&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;scmrevision&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Revision allowing to checkout the expected source code&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;[[File:Yes_check.png|16px]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;depends&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;List of extensions required to build this extension. Specify &amp;lt;code&amp;gt;&amp;quot;NA&amp;quot;&amp;lt;/code&amp;gt; if there are no dependency.&amp;lt;br&amp;gt;Extension names should be separated by a single space. For example: &amp;lt;code&amp;gt;extensionA extensionB&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;build_subdirectory&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Name of the inner build directory in case of superbuild based extension. Default to &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;homepage&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Url of the web page describing the extension. See note [1] reported below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;[[File:Yes_check.png|16px]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;contributors&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Extension contributor specified as &amp;lt;br&amp;gt;&amp;lt;code&amp;gt;Firstname1 Lastname1 ([SubOrg1, ]Org1), Firstname2 Lastname2 ([SubOrg2, ]Org2)&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;category&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Extension category&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;[[File:Yes_check.png|16px]]&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;iconurl&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Url to an icon (png, size 128x128 pixels). See note [1] reported below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;One line describing what is the purpose of the extension&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;screenshoturls&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Space separated list of urls to images. See note [1] reported below.&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;enabled&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; - Specify if the extension should be enabled after its installation. Default is &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[1] Parameter like &amp;lt;code&amp;gt;&amp;amp;foo=bar&amp;lt;/code&amp;gt; are not supported. Use a url shortener.&lt;br /&gt;
&lt;br /&gt;
== Partially supported metadata ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table class=&amp;quot;alternate&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Description&amp;lt;/th&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;code&amp;gt;status&amp;lt;/code&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Give people an idea what to expect from this code&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=New_users&amp;diff=54908</id>
		<title>New users</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=New_users&amp;diff=54908"/>
		<updated>2017-09-02T19:27:14Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Welcome to 3D Slicer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__ &lt;br /&gt;
&lt;br /&gt;
==Welcome to 3D Slicer==&lt;br /&gt;
[[File:WelcomeToSlicer-2016-05-31.jpg|thumb|200x200px]]&lt;br /&gt;
&lt;br /&gt;
Welcome to the 3D Slicer community. Here you will learn the basics of using Slicer including installing 3D Slicer, the basics of the main application GUI, how to use Slicer and where to find tutorials and more information.&lt;br /&gt;
&lt;br /&gt;
{|class = &amp;quot;wikitable&amp;quot; style=&amp;quot;font-size: 150%;&amp;quot;&lt;br /&gt;
!The [https://discourse.slicer.org/ 3D Slicer Discourse forum] &lt;br /&gt;
is a place for you to ask any questions regarding Slicer and its usage.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===What is Slicer ?===&lt;br /&gt;
{{:Documentation/{{documentation/currentversion}}/Slicer}}&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
3D Slicer is an open-source package that can be used on Mac, Linux and Windows. In order to run 3D Slicer your computer must have the graphics capabilities and memory to hold the original image data and process results. A 64-bit system is required. Click [[Documentation/{{documentation/currentversion}}/SlicerApplication/HardwareConfiguration|here]] more information.&lt;br /&gt;
[[File:Screen_Shot_2016-06-01_at_1.21.15_PM.png|thumb|600px]]&lt;br /&gt;
&lt;br /&gt;
===Installing 3D Slicer===&lt;br /&gt;
To install Slicer, click [http://download.slicer.org here]&lt;br /&gt;
&lt;br /&gt;
The Nightly version of 3D Slicer is updated nightly as groups of developers make changes. The Stable version of 3D Slicer is not updated nightly and is more rigorously tested.&lt;br /&gt;
&lt;br /&gt;
Once downloaded, follow the instructions to complete installation.&lt;br /&gt;
&lt;br /&gt;
===Further Documentation===&lt;br /&gt;
If you're interested in extending your knowledge, access the [[Documentation/{{documentation/currentversion}}|User Manual]]. See also the [http://slicer-users.65878.n3.nabble.com archives of the users mailing list] . The archive is searchable so most answers to questions can be found there.&lt;br /&gt;
&lt;br /&gt;
If you're a developer looking for more information, access the [[Documentation/Nightly/Developers|Developer Manual]]. See also [http://slicer-devel.65872.n3.nabble.com archives of the developer's mailing list] . Similar to the Users Mailing List archive, it is searchable.&lt;br /&gt;
&lt;br /&gt;
==Main Application GUI==&lt;br /&gt;
3D Slicer is built on a modular architecture. The Main Application GUI is divided into six components: the Application Menu Bar, the Application Toolbar, the Module GUI Panel, the Data Probe Panel, the 2D Slice Viewers, and the 3D Viewer. This section will introduce you to the basic functions on the main application's GUI. If you require detailed information, visit this [[Documentation/{{documentation/currentversion}}/SlicerApplication/MainApplicationGUI|page]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Open 3D Slicer and load your own data or download sample data to explore. Go ahead and click around the user interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400px heights=450px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
File:LoadingData-16-06-06.png&lt;br /&gt;
File:SampleData-06-06.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the Welcome panel, you can load your own data or download sample data. Sample data is often useful for exploring the features of 3D Slicer if you don't have data of your own.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=500px heights=350px class=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
File:SliceViewOptions-2016-06-01.png&lt;br /&gt;
File:ModuleExtensionAccess-2016-06-01.png&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Click on the push pin in the top left corner of each of the Slice Viewers or the 3D Viewer to see more options. In the Slice Viewers, the horizontal bar can be used to scroll through slices or select a slice. You can explore the various options using your loaded data or downloaded sample data.&lt;br /&gt;
&lt;br /&gt;
[[File:TutorialPreview-2016-05-31.png|313x313px|right]]&lt;br /&gt;
==Tutorials==&lt;br /&gt;
The 3D Slicer documentation has an abundance of tutorials to help you familiarize yourself with the basics of 3D Slicer and with specific&lt;br /&gt;
modules.&lt;br /&gt;
&lt;br /&gt;
Try the [[Documentation/{{documentation/currentversion}}/Training#Slicer_Welcome_Tutorial|Welcome Tutorial]] and the [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Data_Loading_and_3D_Visualization|Data Loading and 3D Visualization Tutorial]] to learn the basics of using 3D Slicer.&lt;br /&gt;
*To learn about using Slicer for 3D Printing, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Printing|this tutorial]]. &lt;br /&gt;
*To learn about Neurosurgical Planning with Slicer, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Neurosurgical_Planning_Tutorial|this tutorial]].&lt;br /&gt;
*To learn about DTI, visit [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Diffusion_Tensor_Imaging_Tutorial|this tutorial]].&lt;br /&gt;
&lt;br /&gt;
For more tutorials, visit the [[Documentation/{{documentation/currentversion}}/Training|Tutorial page]] to see a comprehensive list. Additionally, visit our [https://www.youtube.com/channel/UC11x1iQ7ydSIFYw4L6wveXg?view_as=public YouTube page] for video tutorials.&lt;br /&gt;
&lt;br /&gt;
If you would like to see a list of example cases with data sets and steps to achieve the same result, visit the [[Documentation/{{documentation/currentversion}}/Registration/RegistrationLibrary|Registration Library]]&lt;br /&gt;
&lt;br /&gt;
==Modules==&lt;br /&gt;
3D Slicer has an abundance of modules to allow it's variety of functionalities. Refer to the [[Documentation/{{documentation/currentversion}}#Modules_by_category|documentation page]] for a comprehensive list of modules. Each module has it's own documentation page that has information about the module and may include a tutorial. 3D Slicer has more than 10 core modules that are displayed in the top section of the Modules drop down menu.&lt;br /&gt;
&lt;br /&gt;
===Core Modules===&lt;br /&gt;
'''Welcome''': The default module when 3D Slicer is started. The panel features options for loading data and customizing 3D Slicer. Below those options are drop-down boxes that contain essential information for using 3D Slicer.&lt;br /&gt;
&lt;br /&gt;
'''[[Documentation/{{documentation/currentversion}}/Modules/Annotations|Annotations]]: '''Allows the creation and editing of annotations or supplementary information. Currently, rulers and regions of interest (ROIs) are supported. See the [[Documentation/{{documentation/currentversion}}/Modules/Markups|Markups Module]] for fiducials.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Markups|'''Markups''']]: Allows the creation and editing of markups associated with a scene. Currently, lists of fiducially are supported as markups.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Data|'''Data''']]: Lists the objects currently in the scene and allows basic operations such as search, rename, delete and move.&lt;br /&gt;
&lt;br /&gt;
'''DataStore''': Allows users to download and upload data sets.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/DICOM|'''DICOM''']]: Integrates [http://dicom.nema.org DICOM] support from [http://commontk.org CTK] and [http://dicom.offis.de DCMTK].&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Editor|'''Editor''']]: Allows manual segmentation of volumes.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Models|'''Models''']]''':''' Loads and adjusts display parameters of models. Allows the user to change the appearance of and organize 3D surface models.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/SceneViews|'''Scene Views''']]: Tool for organizing multiple 'live views' of the data in the scene. The user can create any number of views and control parameters&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/SubjectHierarchy|'''Subject Hierarchy''']]''':''' The SubjectHierarchy module acts as a central data-organizing point in Slicer. Subject hierarchy nodes provide features for the underlying data nodes, including cloning, bulk transforming, bulk show/hide, type-specific features, and basic node operations such as delete or rename.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/Transforms|'''Transforms''']]''': '''This module is used for creating and editing transformation matrices. You can establish these relations by moving nodes from the Transformable list to the Transformed list or by dragging the nodes under the Transformation nodes in the Data module.&lt;br /&gt;
&lt;br /&gt;
[[Documentation/{{documentation/currentversion}}/Modules/VolumeRendering|'''Volume Rendering''']]''':''' Provides interactive visualization of 3D image data.&lt;br /&gt;
&lt;br /&gt;
'''[[Documentation/{{documentation/currentversion}}/Modules/Volumes|Volumes]]: '''Used for changing the appearance of various volume types.&lt;br /&gt;
&lt;br /&gt;
[[File:Extension Manager.png|thumb|350x350px]]&lt;br /&gt;
&lt;br /&gt;
==Extensions==&lt;br /&gt;
3D Slicer supports plug-ins that are called extensions. An extension could be seen as a delivery package bundling together one or more Slicer modules. After installing an extension, the associated modules will be presented to the user as built-in ones. Extensions can be downloaded from the extension manager to selectively install features that are useful for the end-user.&lt;br /&gt;
* For details about downloading extensions, see the [[[Documentation/{{documentation/currentversion}}/SlicerApplication/ExtensionsManager|Extension Manager page]].&lt;br /&gt;
* Click [[Documentation/{{documentation/currentversion}}/ModuleExtensionListing/Extensions_by_category|here]] for a full list of extensions. The links on the page will provide documentation for each extension.&lt;br /&gt;
* See the [[Documentation/{{documentation/currentversion}}/Announcements#Slicer_Extensions Announcements|page]] for descriptions of the latest 3D Slicer extensions.&lt;br /&gt;
* Slicer is extensible. If you are a programmer who wants to add functionality to Slicer, click [[Documentation/{{documentation/currentversion}}/Developers/Tutorials/BuildTestPackageDistributeExtensions|here]].&lt;br /&gt;
&lt;br /&gt;
==Use Cases==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Diffusion Tensor Imaging&lt;br /&gt;
! Neurosurgical Planning&lt;br /&gt;
|-&lt;br /&gt;
|[[ File:Slicer4DTI Tutorial.png|thumb|350px|centre]]&lt;br /&gt;
|[[File:NeurosurgicalPlanningTutorial.png|thumb|360px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Diffusion_Tensor_Imaging_Tutorial|Diffusion Tensor Imaging Tutorial]] course guides through the basics of loading Diffusion Weighted images in Slicer, estimating tensors and generating fiber tracts.&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Neurosurgical_Planning_Tutorial|Neurosurgical Planning Tutorial]] course guides through the generation of fiber tracts in the vicinity of a tumor.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! Visualization of DICOM Images for Radiology Applications&lt;br /&gt;
! Quantitative Imaging&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Slicer4RSNA_2.png|thumb|400px|centre]]&lt;br /&gt;
|[[File:QuantitaiveImaging_tutorial.png|thumb|350px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Visualization_of_DICOM_images_for_Radiology_Applications|3D Visualization of DICOM Images for Radiology Applications Tutorial]] guides through 3D data loading and visualization of DICOM images for radiology applications.&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Quantitative_Imaging_tutorial|Quantitative Imaging Tutorial]] guides through the use of 3D Slicer for quanitifying small volumetric changes in slow-growing tumors and for calculating Standardized Uptake Value (SUV) from PET/CT data.&lt;br /&gt;
|-&lt;br /&gt;
! Surgical Navigation&lt;br /&gt;
! Radiation Therapy&lt;br /&gt;
|-&lt;br /&gt;
|[[File:SlicerIGTLogo250x250.png|thumb|300px|centre]]&lt;br /&gt;
|[[File:SlicerRTUseCaseImage.png|thumb|354px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;|The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_IGT|Slicer IGT tutorials]] are designed for end-users interested in using Slicer for real-time navigated procedures. &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#SlicerRT|SlicerRT tutorial]] demonstrates how to perform a radiation therapy research workflow using the SlicerRT extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:center;width: 540px&amp;quot; |Image Registration&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;text-align:center;width: 540px&amp;quot; |3D Printing&lt;br /&gt;
|-&lt;br /&gt;
|[[File:Registration_Slicer4.png|thumb|340px|centre]]&lt;br /&gt;
|[[File:3DPrinting_tutorial.png|thumb|390px|centre]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_Image_Registration|Image Registration Tutorial]] show how to perform intra- and inter-subject registration within 3D Slicer.&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot; |&lt;br /&gt;
The [[Documentation/{{documentation/currentversion}}/Training#Slicer4_3D_Printing|3D Printing tutorial]] shows how to prepare 3D Slicer Data for 3D printing.&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/DCMQI&amp;diff=54907</id>
		<title>Documentation/Nightly/Extensions/DCMQI</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/DCMQI&amp;diff=54907"/>
		<updated>2017-09-01T14:25:17Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/DCMQI|dcmqi]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work was supported by the [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)] project via the NIH-National Cancer Institute Grant U24 CA180918.&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Andrey Fedorov ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor1: Christian Herz ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor2: Jean-Christophe Fillion-Robin ({{collaborator|name|kitware}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, &amp;lt;email&amp;gt;andrey.fedorov@gmail.com&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|kitware}}|{{collaborator|longname|kitware}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Extension Description}}&lt;br /&gt;
[[File:dcmqi-logo.png|x200px]]&lt;br /&gt;
&lt;br /&gt;
This extension contains the [https://github.com/QIICR/dcmqi#readme DICOM for Quantitative Imaging (dcmqi)] library that provides tools and API for conversions of the quantitative image analysis results (segmentations, measurements, parametric maps) into DICOM format and back.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&lt;br /&gt;
Usage overview and documentation for the dcmqi library are available at https://github.com/QIICR/dcmqi#introduction&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Panels and their use}}&lt;br /&gt;
&lt;br /&gt;
The dcmqi extension doesn't provide a GUI, it's intended to be used at the library level by other modules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Similar Extensions}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)]&lt;br /&gt;
* Herz C, Fillion-Robin JC, Onken M, Riesmeier J, Lasso A, Pinter C, Fichtinger G, Pieper S, Clunie D, Kikinis R, Fedorov A. (2017) dcmqi: an open source library for standardized communication of quantitative image analysis results using DICOM. Cancer Research (in press) [[https://www.dropbox.com/s/qbj0n8an30upmk7/Herz2017-CancerResearch.pdf?raw=1 PDF]]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Libraries]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/SlicerExecutionModel&amp;diff=54388</id>
		<title>Documentation/Nightly/Developers/SlicerExecutionModel</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/SlicerExecutionModel&amp;diff=54388"/>
		<updated>2017-08-15T21:16:32Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* XML Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The Slicer Execution Model is designed to improve the acceptance and productivity of Slicer application developers. The Execution Model provides a simple mechanism for incorporating command line programs as Slicer modules. These command line modules are self-describing, emitting an XML description of its command line arguments. Slicer uses this XML description to construct a GUI for the module.&lt;br /&gt;
&lt;br /&gt;
=== Types of Slicer Plugins ===&lt;br /&gt;
&lt;br /&gt;
There are various types of plugins that Slicer supports as command line modules. This variety allows a breadth of integration choices to balance performance and flexibility.&lt;br /&gt;
&lt;br /&gt;
==== Shared object plugins (dll, so) with global symbols ====&lt;br /&gt;
&lt;br /&gt;
Shared object plugins with global symbols integrate into Slicer tighter than the Executable plugins.  Shared object plugins with global symbols can transfer data directly to/from a MRML scene using standard itk::ImageFileReader and itk::ImageFileWriter (and the ImageIO class provided with Slicer, itk::MRMLIDImageIO).  Communicating directly with the MRML scene avoids the overhead of reading and writing images to disk.  Slicer looks for a standard entry point to execute the module called ModuleEntryPoint defined as&lt;br /&gt;
&lt;br /&gt;
 int ModuleEntryPoint(int argc, char* argv[]);&lt;br /&gt;
&lt;br /&gt;
Slicer also looks for the global symbols XMLModuleDescription, ModuleLogoImage, ModuleLogoWidth, ModuleLogoHeight, ModuleLogoPixelSize, and ModuleLogoLength.  These global symbols provide the xml module description and data for the module logo. The data types for these symbols are&lt;br /&gt;
&lt;br /&gt;
          char *XMLModuleDescription;&lt;br /&gt;
 unsigned char *ModuleLogoImage;&lt;br /&gt;
           int  ModuleLogoWidth;&lt;br /&gt;
           int  ModuleLogoHeight;&lt;br /&gt;
           int  ModuleLogoPixelSize;&lt;br /&gt;
 unsigned long  ModuleLogoLength;&lt;br /&gt;
&lt;br /&gt;
These global symbols are accessed during module discovery. The ModuleLogoImage, ModuleLogoWidth, ModuleLogoHeight, ModuleLogoPixelSize, and ModuleLogoLength are optional.&lt;br /&gt;
&lt;br /&gt;
=====Controlling what symbols are exported from a shared library module=====&lt;br /&gt;
&lt;br /&gt;
Shared Object Modules are loaded into Slicer using standard &amp;quot;dlopen&amp;quot; style calls. The ModuleEntryPoint is located within the shared library and cached for later use. The ModuleEntryPoint, however, may not be the only function accessible to Slicer within the shared library. To protect against symbol clash at runtime, all functions and variables accessible within file scope of the shared library should be put in an anonymous namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Use an anonymous namespace to keep class types and function names&lt;br /&gt;
// from colliding when module is used as shared object module.  Every&lt;br /&gt;
// thing should be in an anonymous namespace except for the module&lt;br /&gt;
// entry point, e.g. main() or ModuleEntryPoint()&lt;br /&gt;
//&lt;br /&gt;
namespace {&lt;br /&gt;
    // functions like DoIt() should be put in the anonymous namespace&lt;br /&gt;
    template&amp;lt;class T&amp;gt; int DoIt( int argc, char * argv[], const T&amp;amp; targ)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
} // end of anonymous namespace&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[] )&lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Shared object plugins (dll, so) with entry points ====&lt;br /&gt;
&lt;br /&gt;
Shared object plugins with entry points integrate into Slicer tighter than the Executable plugins. Shared object plugins with entry points can transfer data directly to/from a MRML scene using standard itk::ImageFileReader and itk::ImageFileWriter (and the ImageIO class provided with Slicer, itk::MRMLIDImageIO). Communicating directly with the MRML scene avoids the overhead of reading and writing images to disk. Slicer looks for standard entry points for executing the module as well as for querying the module for its xml description and logos. The entry points are defined as&lt;br /&gt;
&lt;br /&gt;
           int  ModuleEntryPoint(int argc, char* argv[]);&lt;br /&gt;
          char *GetXMLModuleDescription();&lt;br /&gt;
 unsigned char *GetModuleLogo()(int *width, int *height, int *pixel_size, unsigned long *bufferLength);&lt;br /&gt;
&lt;br /&gt;
GetXMLModuleDescription() and GetModuleLogo() are accessed during module discovery. GetModuleLogo() is optional.&lt;br /&gt;
&lt;br /&gt;
==== Executable plugins with global symbols ====&lt;br /&gt;
&lt;br /&gt;
Executable plugins with global symbols allow for a single executable to be developed that can be integrated into Slicer 3 or run standalone on a cluster. Plugins of this type are opened but not executed at module discovery time.  Slicer 3 looks for the global symbols XMLModuleDescription, ModuleLogoImage, ModuleLogoWidth, ModuleLogoHeight, ModuleLogoPixelSize, and ModuleLogoLength.  The data types for these symbols are&lt;br /&gt;
 &lt;br /&gt;
          char *XMLModuleDescription;&lt;br /&gt;
 unsigned char *ModuleLogoImage;&lt;br /&gt;
           int  ModuleLogoWidth;&lt;br /&gt;
           int  ModuleLogoHeight;&lt;br /&gt;
           int  ModuleLogoPixelSize;&lt;br /&gt;
 unsigned long  ModuleLogoLength;&lt;br /&gt;
&lt;br /&gt;
These global symbols are access during module discovery. ModuleLogoImage, ModuleLogoWidth, ModuleLogoHeight, ModuleLogoPixelSize, ModuleLogoLength are optional.&lt;br /&gt;
&lt;br /&gt;
==== Executable plugins (exe) with command line options ====&lt;br /&gt;
&lt;br /&gt;
Executable plugins with command line options are the most flexible type of plugin. This approach allows for legacy applications to be integrated into Slicer using a wrapper around the legacy application.  Plugins of this type are executed at module discovery time, passing in the command line argument &amp;quot;--xml&amp;quot;. The plugin responds to the &amp;quot;--xml&amp;quot; query by emitting the xml description of the module. The plugin is also executed at module discovery time with a &amp;quot;--logo&amp;quot; command line argument. The plugin responds to the &amp;quot;--logo&amp;quot; query by emitting a logo description. &lt;br /&gt;
&lt;br /&gt;
This type of plugin allows for legacy applications to be integrated into Slicer. A developer can provide Slicer with a small executable or shell script that responds to the &amp;quot;--xml&amp;quot; and &amp;quot;--logo&amp;quot; command line arguments needed for Slicer 3 integration and otherwise spawns the legacy executable passing down any command line arguments.&lt;br /&gt;
&lt;br /&gt;
 &amp;gt; module.exe --xml&lt;br /&gt;
 &amp;gt; module.exe --logo&lt;br /&gt;
&lt;br /&gt;
==== Script plugins with Python ====&lt;br /&gt;
&lt;br /&gt;
Python scripts are found using the discovery mechanisms for the other plugins. Since Python plugins are fundamentally different from the shared and executable plugins, they are documented on their own [[Documentation/Nightly/Developers/SlicerExecutionModel/Python|page]].&lt;br /&gt;
&lt;br /&gt;
=== Calling Command Line Modules from Other Code ===&lt;br /&gt;
&lt;br /&gt;
In addition to the automated GUI that shows up in the Slicer user interface, the Execution Model can be used to encapsulate functionality that is invoked by other parts of the program.  For instance, the Editor Module can invoke the Model Maker Module to build models.  By invoking a command line module in this way, you get the advantage of background processing with progress reporting.  See [[Documentation/Nightly/Developers/SlicerExecutionModel/Programmatic Invocation|this page]] for more details.&lt;br /&gt;
&lt;br /&gt;
=== Architecture === &lt;br /&gt;
[[Image:ExecutionModelPlugins.png|600px|Plugin architecture]]&lt;br /&gt;
[[Image:CommandLineModule.png|400px|Module architecture]]&lt;br /&gt;
[[Image:ModuleFactory.png|400px|Module factory ]]&lt;br /&gt;
[[Image:Class_parser_state_coll_graph.png|400px|Module description]]&lt;br /&gt;
&lt;br /&gt;
== Module Description ==&lt;br /&gt;
&lt;br /&gt;
Modules are described using XML. The XML is used to generate the C++ command line code and the GUI for the application.&lt;br /&gt;
&lt;br /&gt;
=== XML Schema ===&lt;br /&gt;
&lt;br /&gt;
At a minimum, each module description must contain:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;executable&amp;gt;&lt;br /&gt;
 &amp;lt;title&amp;gt;A title&amp;lt;/title&amp;gt;&lt;br /&gt;
 &amp;lt;description&amp;gt;A description&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
   At least one parameter&lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &amp;lt;/executable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the following descriptions of each XML tag, CLP means command line processing and GUI means graphical user interface. Unless otherwise specified, tags are optional.&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;executable&amp;gt; (required)&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;category&amp;gt;&lt;br /&gt;
:: Classifies the executable (e.g. Filtering, Segmentation). Category can be a ''dot'' separated string. Multiple categories can be given and should be separated by a ''semicolon''.&lt;br /&gt;
:: ''for CLP'', not used.&lt;br /&gt;
:: ''for GUI'', used on the menu selector to group executables. ''Dot'' separated strings can be used to generate sub-menus. ''Semicolon'' separated strings can be used to create multiple categories.&lt;br /&gt;
;; &amp;lt;/category&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;title&amp;gt; (required)&lt;br /&gt;
:: A word or two describing the executable (e.g. Median Filter, Anisotropic Diffusion&lt;br /&gt;
:: ''for CLP'', not used.&lt;br /&gt;
:: ''for GUI'', used to label the frame containing the GUI for the executable. Also, GUI names for volumes use this label as a prefix.&lt;br /&gt;
;; &amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;description&amp;gt; (required)&lt;br /&gt;
:: A long description of the executable. Any double quotes will be converted to single quotes.&lt;br /&gt;
:: ''for CLP'', appears at the end of the --help.&lt;br /&gt;
:: ''for GUI'', appears in the help frame.&lt;br /&gt;
;; &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;version&amp;gt;&lt;br /&gt;
:: The version of the command line executable. A suggested format is:&lt;br /&gt;
::: ''major''.''minor''.''patch''.''build''.''status''&lt;br /&gt;
::: where status is&lt;br /&gt;
:::: vc: version controlled (pre-alpha), build can be a serial revision number, if any (like svn might have).&lt;br /&gt;
:::: a: alpha&lt;br /&gt;
:::: b: beta&lt;br /&gt;
:::: rc: release candidate&lt;br /&gt;
:::: fcs: first customer ship&lt;br /&gt;
:: ''for CLP'', reported in response to --version.&lt;br /&gt;
:: ''for GUI'', not used.&lt;br /&gt;
;; &amp;lt;/version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;documentation-url&amp;gt;&lt;br /&gt;
:: The location of extended documentation for the executable, (e.g. http://www.na-mic.org/foo.html).&lt;br /&gt;
;; &amp;lt;/documentation-url&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;license&amp;gt;&lt;br /&gt;
:: The type of license or a url containing the license, (e.g. Berkeley, Apache, http://www.slicer.org/copyright/copyright.txt).&lt;br /&gt;
:: ''for CLP'', not used.&lt;br /&gt;
:: ''for GUI'', may show up in the Help or About section.&lt;br /&gt;
;; &amp;lt;/license&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;contributor&amp;gt;&lt;br /&gt;
:: The author(s) of the command line executable (e.g. Pieper, Jim Miller).&lt;br /&gt;
:: for ''CLP'', appears as part of --help&lt;br /&gt;
:: for ''GUI'', may show up in the Help or About section.&lt;br /&gt;
;; &amp;lt;/contributor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;acknowledgements&amp;gt;&lt;br /&gt;
:: Acknowledgements for funding agency, employer, colleague, (e.g. 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).&lt;br /&gt;
:: for ''CLP'', appears as part of --help&lt;br /&gt;
:: for ''GUI'', may show up in the Help of About section.&lt;br /&gt;
;; &amp;lt;/acknowledgements&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;; &amp;lt;parameters [advanced=&amp;quot;true|''false''&amp;quot;]&amp;gt; (required for each group of parameters)&lt;br /&gt;
:: Starts a group of parameters.&lt;br /&gt;
:: for ''CLP'', not used.&lt;br /&gt;
:: for ''GUI'', defines a widget (in tk, a frame) that contains other widgets. If ''advanced'' is true, the frame will be closed initially.&lt;br /&gt;
&lt;br /&gt;
;;; &amp;lt;label&amp;gt; (required)&lt;br /&gt;
::: A short string that summarizes a parameter group, (e.g. I/O, Diffusion)&lt;br /&gt;
::: for ''CLP'', not used.&lt;br /&gt;
::: for ''GUI'', used to label the frame.&lt;br /&gt;
;;; &amp;lt;/label&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;; &amp;lt;description&amp;gt; (required)&lt;br /&gt;
::: A short description of the parameter group, (e.g. Input/Output Parameters, Anitostropic Diffusion Parameters). Any double quotes will be converted to single quotes.&lt;br /&gt;
::: ''for CLP'', not used.&lt;br /&gt;
::: ''for GUI'', used in balloon help for the frame containing the parameter group.&lt;br /&gt;
;;; &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;; &amp;lt;integer&amp;gt; | &amp;lt;float&amp;gt; | &amp;lt;double&amp;gt; | &amp;lt;boolean&amp;gt; | &amp;lt;string&amp;gt; | &amp;lt;integer-vector&amp;gt; | &amp;lt;float-vector&amp;gt; | &amp;lt;double-vector&amp;gt; | &amp;lt;string-vector&amp;gt; | &amp;lt;integer-enumeration&amp;gt; | &amp;lt;float-enumeration&amp;gt; | &amp;lt;double-enumeration&amp;gt; | &amp;lt;string-enumeration&amp;gt; | &amp;lt;file&amp;gt; | &amp;lt;directory&amp;gt; | &amp;lt;image [type=&amp;quot;''scalar''|''label''|''tensor''|''diffusion-weighted''|''vector''|''model''&amp;quot;] [reference=&amp;quot;...&amp;quot;] &amp;gt; | &amp;lt;geometry [type=&amp;quot;''fiberbundle''|''model''&amp;quot;] [reference=&amp;quot;...&amp;quot;]&amp;gt; | &amp;lt;point [multiple=&amp;quot;''true''|''false''&amp;quot;] [coordinateSystem=&amp;quot;''lps''|''ras''|''ijk''&amp;quot;]&amp;gt; | &amp;lt;pointfile [multiple=&amp;quot;''true''|''false''&amp;quot;] [coordinateSystem=&amp;quot;''lps''|''ras''|''ijk''&amp;quot;]&amp;gt; | &amp;lt;region [multiple=&amp;quot;''true''|''false''&amp;quot;] [coordinateSystem=&amp;quot;''lps''|''ras''|''ijk''&amp;quot;]&amp;gt; | &amp;amp;lt;table [type=&amp;quot;''color''&amp;quot;] [fileExtensions=&amp;quot;''.tsv''|''.csv''|''.txt''|''.ctbl''&amp;quot;]&amp;gt; | &amp;lt;transform [type=&amp;quot;''linear''|''nonlinear''|''bspline''&amp;quot;] [reference=&amp;quot;...&amp;quot;] fileExtensions=&amp;quot;.tfm,.h5,.hdf5,.mat,.txt&amp;quot;&amp;gt;&lt;br /&gt;
::: The type of the parameter. &lt;br /&gt;
:::: The scalar types ('''integer''', '''float''', etc.) correspond to the usual programming language types. &lt;br /&gt;
:::: The '''-vector''' types are represented by comma separated values of the scalar type. &lt;br /&gt;
:::: The '''-enumeration''' types use the '''&amp;lt;element&amp;gt;''' tag to enumerate choices of the scalar type. &lt;br /&gt;
:::: '''&amp;lt;image&amp;gt;''' is a special type that indicates that the parameter is a file name that specifies images. &lt;br /&gt;
:::: If the attribute ''multiple'' is &amp;quot;true&amp;quot;, multiple arguments are allowed for '''scalar''', '''file''', '''directory''', '''image''', '''geometry''', '''point''', '''pointfile''' and '''region''' parameters. BUG: the automatically built GUI will not support selecting multiple volumes for the '''image''' argument, but they can be passed on the command line. If the parameter has a ''flag'' or ''longflag'', then the flag may be specified multiple times on the command line. The resulting C++ variable will be a std::vector of the scalar type. If the multiple parameter does not have a flag, then multiple arguments can appear on the command line. However, a multiple parameter with no flags must be the last parameter specified.&lt;br /&gt;
:::: The attribute ''coordinateSystem'' is allowed for the parameters '''point''', '''pointfile''' and '''region'''. &lt;br /&gt;
:::: The attribute ''fileExtensions'' is allowed for '''file''', '''pointfile''', '''image''', '''transform''' and '''geometry'''. fileExtensions can contain a list of comma separated file extensions for optional use by the GUI.&lt;br /&gt;
:::: Transform types: If not specified then any transform is accepted (linear, non-linar, composite, ...). By specifying a type, accepted transforms can be limited to 'linear' = any linear transform; 'non-linear' = grid, displacement field; 'bspline' = b-spline transform.&lt;br /&gt;
:::: The attribute ''reference'' can mean different things based on the parameter type. If  the parameter is a transform and the reference is transformable, then the transform hierarchy of the reference is manipulated such that the reference is under the transform. If the parameter is an image or a model, then the parameter is placed in subject hierarchy at the same level as the reference. If the parameter is an image, reference will be used to initialize lookup table of the output image.&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;name&amp;gt; (required if longflag is not specified)&lt;br /&gt;
:::: The name of a command line argument. If name is not specified, longflag will be used (e.g. conductance, numberOfIterations). The name must be usable as a C++ variable. For example, it CANNOT have spaces or special characters and must start with a letter.&lt;br /&gt;
:::: ''for CLP'', the name of the C++ variable.&lt;br /&gt;
:::: ''for GUI'', used internally.&lt;br /&gt;
;;;; &amp;lt;/name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;description&amp;gt; (required)&lt;br /&gt;
:::: A brief description of the parameter. Any double quotes will be converted to single quotes.&lt;br /&gt;
:::: ''for CLP'', describes the parameter for --usage and --help.&lt;br /&gt;
:::: ''for GUI'', describes the parameter when the cursor is placed over the widget for the parameter (balloon help).&lt;br /&gt;
;;;; &amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;label&amp;gt; (required)&lt;br /&gt;
:::: A label for parameter (e.g. Dicom Directory, Conductance).&lt;br /&gt;
:::: ''for'' CLP, not used.&lt;br /&gt;
:::: ''for'' GUI, the label for the parameter widget.&lt;br /&gt;
;;;; &amp;lt;/label&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;default&amp;gt;&lt;br /&gt;
:::: A default value for the parameter. The default must be a type that is compatible with the parameter type. The vector parameters are specified as comma separated values of the atomic parameter type.&lt;br /&gt;
:::: ''for CLP'', contains the default for the parameter unless the parameter is a ''boolean''. The default for ''boolean'' parameters is always set to ''false''.&lt;br /&gt;
:::: ''for GUI'', contains the default for the parameter.&lt;br /&gt;
;;;; &amp;lt;/default&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;flag [alias=&amp;quot;a,b&amp;quot;] [deprecatedalias=&amp;quot;c,d&amp;quot;]&amp;gt; (not required if longflag is present)&lt;br /&gt;
:::: A single character command line flag (e.g. s, W). Can provide &amp;quot;alias&amp;quot;'s (comma separated) if different flags can be used to activate the same parameter.  Can provide &amp;quot;deprecatedalias&amp;quot;'s (comma separated) if different flags can be used to set the same parameter but the user should be notified of which &amp;quot;updated&amp;quot; flag to use. Parameters with flags are considered &amp;quot;optional&amp;quot; and do not have be specified or assigned.  Parameters with flags allow one to override a default behavior.&lt;br /&gt;
:::: ''for CLP'', used as the short flag on the command line.&lt;br /&gt;
:::: ''for GUI'', used when running the module.&lt;br /&gt;
;;;; &amp;lt;/flag&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;longflag [alias=&amp;quot;foo,bar&amp;quot;] [deprecatedalias=&amp;quot;garf&amp;quot;]&amp;gt; (not required if flag is present)&lt;br /&gt;
:::: A command line flag (e.g. spacing, Watcher). Can provide &amp;quot;alias&amp;quot;'s (comma separated) if different long flags can be used to activate the same parameter.  Can provide &amp;quot;deprecatedalias&amp;quot;'s (comma separated) if different long flags can be used to set the same parameter but the user should be notified of which &amp;quot;updated&amp;quot; long flag to use. Parameters with flags are considered &amp;quot;optional&amp;quot; and do not have be specified or assigned.  Parameters with flags allow one to override a default behavior.&lt;br /&gt;
:::: Note: apparently you can't use hyphens in the longflag, so things like --my-option are not allows.  -gcs&lt;br /&gt;
:::: ''for CLP'', used as the long flag on the command line.&lt;br /&gt;
:::: ''for GUI'', used when running the module.&lt;br /&gt;
;;;; &amp;lt;/longflag&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;constraints&amp;gt;&lt;br /&gt;
:::: Encloses constraints on the value of a non-vector, non-enumerated parameter.&lt;br /&gt;
:::: ''for CLP'', not used.&lt;br /&gt;
:::: ''for GUI'', if present, a slider will be created using the minimum, maximum and step specified.&lt;br /&gt;
&lt;br /&gt;
;;;;; &amp;lt;minimum&amp;gt;&lt;br /&gt;
::::: The minimum allowed value for the parameter. If not specified, the minimum is the smallest possible value for the parameter type.&lt;br /&gt;
;;;;; &amp;lt;/minimum&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;;; &amp;lt;maximum&amp;gt;&lt;br /&gt;
::::: The maximum allowed value for the parameter. If not specified, the maximum is the largest possible value for the parameter type.&lt;br /&gt;
;;;;; &amp;lt;/maximum&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;;; &amp;lt;step&amp;gt;&lt;br /&gt;
::::: The increment for the parameter.&lt;br /&gt;
;;;;; &amp;lt;/step&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;/constraints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;channel&amp;gt; (required for file, pointfile, directory and image parameters)&lt;br /&gt;
:::: Specifies whether the parameter is an input or output parameter.&lt;br /&gt;
:::: ''for CLP'', not used.&lt;br /&gt;
:::: ''for GUI'', selects the proper widget for file handling.&lt;br /&gt;
;;;; &amp;lt;/channel&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;index&amp;gt; (required if there are no flags specified)&lt;br /&gt;
:::: An integer starting at 0, that specifies a command line argument that has no flags.&lt;br /&gt;
:::: Note: if you use index for, say, an image, the user must enter some input value into the GUI.  If the user does not fill in a value, the plugin is not run at all.  However, slicer will &amp;quot;seem&amp;quot; to run it, and no error message is given.  -gcs&lt;br /&gt;
:::: ''for CLP'', specifies the order of an argument that has no flags.&lt;br /&gt;
:::: ''for GUI'', used when running the module.&lt;br /&gt;
;;;; &amp;lt;/index&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;enumeration&amp;gt; (required for enumeration parameters)&lt;br /&gt;
:::: Encloses elements for the parameter. The parameter is restricted one and only one element.&lt;br /&gt;
:::: ''for CLP'', not used.&lt;br /&gt;
:::: ''for GUI'', defines a radio button with choices.&lt;br /&gt;
&lt;br /&gt;
;;;;; &amp;lt;element&amp;gt;&lt;br /&gt;
::::: Defines the choice. Must be of the proper type for a parameter.&lt;br /&gt;
::::: ''for CLP'', not used.&lt;br /&gt;
::::: ''for GUI'', used as the label for the raido button.&lt;br /&gt;
;;;;; &amp;lt;/element&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;;; &amp;lt;/enumeration&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;;; &amp;lt;/integer&amp;gt; | &amp;lt;/float&amp;gt; | &amp;lt;/double&amp;gt; | &amp;lt;/boolean&amp;gt; | &amp;lt;/string&amp;gt; | &amp;lt;/integer-vector&amp;gt; | &amp;lt;/float-vector&amp;gt; | &amp;lt;/double-vector&amp;gt; | &amp;lt;/string-vector&amp;gt; | &amp;lt;/integer-enumeration&amp;gt; | &amp;lt;/float-enumeration&amp;gt; | &amp;lt;/double-enumeration&amp;gt; | &amp;lt;/string-enumeration&amp;gt; | &amp;lt;/file&amp;gt; | &amp;lt;/directory&amp;gt; | &amp;lt;/image&amp;gt; | &amp;lt;/geometry&amp;gt; | &amp;lt;/point&amp;gt; | &amp;lt;/pointfile&amp;gt; | &amp;lt;/region&amp;gt; | &amp;amp;lt;/table&amp;gt; | &amp;lt;/transform&amp;gt;&lt;br /&gt;
;; &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;/executable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Slicer GUI Generation ==&lt;br /&gt;
&lt;br /&gt;
Slicer generates GUI's for each executable discovered during the startup process. Slicer searches directories stored in the Slicer Module Path. This path is set from the Slicer application in View-&amp;gt;Application Settings-&amp;gt;Modules-&amp;gt;Additional module paths. Slicer attempts to run every executable in the prescribed directories and look for a valid XML file in response to a &amp;quot;--xml&amp;quot; command line.&lt;br /&gt;
&lt;br /&gt;
Here are a few representative examples.&lt;br /&gt;
&lt;br /&gt;
=== A tour of the Execution Model XML ===&lt;br /&gt;
&lt;br /&gt;
This example is a sampler of the parameters available in the Execution Model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;span&amp;gt;[[Image:ExectionModelTourGUI.png|[[Image:ExectionModelTourGUI.png]]]]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;executable&amp;gt;&lt;br /&gt;
   &amp;lt;category&amp;gt;Tours&amp;lt;/category&amp;gt;&lt;br /&gt;
   &amp;lt;title&amp;gt;Execution Model Tour&amp;lt;/title&amp;gt;&lt;br /&gt;
   &amp;lt;description&amp;gt;&lt;br /&gt;
   Shows one of each type of parameter.&lt;br /&gt;
   &amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;documentation-url&amp;gt;&amp;lt;/documentation-url&amp;gt;&lt;br /&gt;
   &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
   &amp;lt;contributor&amp;gt;Daniel Blezek&amp;lt;/contributor&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Scalar Parameters&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;&lt;br /&gt;
     Variations on scalar parameters&lt;br /&gt;
     &amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;integer&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;integerVariable&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;flag&amp;gt;i&amp;lt;/flag&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;integer&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;&lt;br /&gt;
       An integer without constraints&lt;br /&gt;
       &amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Integer Parameter&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;30&amp;lt;/default&amp;gt;&lt;br /&gt;
     &amp;lt;/integer&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Scalar Parameters With Constraints&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Variations on scalar parameters&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;double&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;doubleVariable&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;flag&amp;gt;d&amp;lt;/flag&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;double&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;An double with constraints&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Double Parameter&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;30&amp;lt;/default&amp;gt;&lt;br /&gt;
       &amp;lt;constraints&amp;gt;&lt;br /&gt;
         &amp;lt;minimum&amp;gt;0&amp;lt;/minimum&amp;gt;&lt;br /&gt;
         &amp;lt;maximum&amp;gt;1.e3&amp;lt;/maximum&amp;gt;&lt;br /&gt;
         &amp;lt;step&amp;gt;0&amp;lt;/step&amp;gt;&lt;br /&gt;
       &amp;lt;/constraints&amp;gt;&lt;br /&gt;
     &amp;lt;/double&amp;gt;&lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Vector Parameters&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Variations on vector parameters&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;float-vector&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;floatVector&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;flag&amp;gt;f&amp;lt;/flag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;A vector of floats&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Float Vector Parameter&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;1.3,2,-14&amp;lt;/default&amp;gt;&lt;br /&gt;
     &amp;lt;/float-vector&amp;gt;&lt;br /&gt;
     &amp;lt;string-vector&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;stringVector&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;string_vector&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;A vector of strings&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;String Vector Parameter&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;&amp;quot;foo&amp;quot;,bar,&amp;quot;foobar&amp;quot;&amp;lt;/default&amp;gt;&lt;br /&gt;
     &amp;lt;/string-vector&amp;gt;&lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Enumeration Parameters&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Variations on enumeration parameters&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;string-enumeration&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;stringChoice&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;flag&amp;gt;e&amp;lt;/flag&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;enumeration&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;An enumeration of strings&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;String Enumeration Parameter&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;foo&amp;lt;/default&amp;gt;&lt;br /&gt;
       &amp;lt;element&amp;gt;foo&amp;lt;/element&amp;gt;&lt;br /&gt;
       &amp;lt;element&amp;gt;&amp;quot;foobar&amp;quot;&amp;lt;/element&amp;gt;&lt;br /&gt;
       &amp;lt;element&amp;gt;foofoo&amp;lt;/element&amp;gt;&lt;br /&gt;
     &amp;lt;/string-enumeration&amp;gt;&lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &amp;lt;/executable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Module with an integer-vector, one input image and one output image ===&lt;br /&gt;
&lt;br /&gt;
Here is the XML that describes the MedianImageFilter. The image on the right shows the generated Slicer 3 GUI. The help frame has been expanded by the user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;span&amp;gt;[[Image:MedianFilterGUI.png|[[Image:MedianFilterGUI.png]]]]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;executable&amp;gt;&lt;br /&gt;
  &amp;lt;category&amp;gt;&lt;br /&gt;
  Filtering.Denoising&lt;br /&gt;
  &amp;lt;/category&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;&lt;br /&gt;
  Median Filter&lt;br /&gt;
  &amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;description&amp;gt;&lt;br /&gt;
The MedianImageFilter is commonly used as a robust approach for&lt;br /&gt;
noise reduction. This filter is particularly efficient against&lt;br /&gt;
&amp;quot;salt-and-pepper&amp;quot; noise. In other words, it is robust to the presence&lt;br /&gt;
of gray-level outliers. MedianImageFilter computes the value of each output&lt;br /&gt;
pixel as the statistical median of the neighborhood of values around the&lt;br /&gt;
corresponding input pixel.&lt;br /&gt;
  &amp;lt;/description&amp;gt;&lt;br /&gt;
  &amp;lt;version&amp;gt;0.1.0.$Revision: 2085 $(alpha)&amp;lt;/version&amp;gt;&lt;br /&gt;
  &amp;lt;documentation-url&amp;gt;&amp;lt;/documentation-url&amp;gt;&lt;br /&gt;
  &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
  &amp;lt;contributor&amp;gt;Bill Lorensen&amp;lt;/contributor&amp;gt;&lt;br /&gt;
  &amp;lt;acknowledgements&amp;gt;This command module was derived from&lt;br /&gt;
Insight/Examples/Filtering/MedianImageFilter (copyright) Insight Software Consortium&lt;br /&gt;
  &amp;lt;/acknowledgements&amp;gt;&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;label&amp;gt;Median Filter Parameters&amp;lt;/label&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;Parameters for the median filter&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;integer-vector&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;neighborhood&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;longflag&amp;gt;--neighborhood&amp;lt;/longflag&amp;gt;&lt;br /&gt;
      &amp;lt;description&amp;gt;The size of the neighborhood in each dimension&amp;lt;/description&amp;gt;&lt;br /&gt;
      &amp;lt;label&amp;gt;Neighborhood Size&amp;lt;/label&amp;gt;&lt;br /&gt;
      &amp;lt;default&amp;gt;1,1,1&amp;lt;/default&amp;gt;&lt;br /&gt;
    &amp;lt;/integer-vector&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;parameters&amp;gt;&lt;br /&gt;
    &amp;lt;label&amp;gt;IO&amp;lt;/label&amp;gt;&lt;br /&gt;
    &amp;lt;description&amp;gt;Input/output parameters&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;image&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;inputVolume&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;label&amp;gt;Input Volume&amp;lt;/label&amp;gt;&lt;br /&gt;
      &amp;lt;channel&amp;gt;input&amp;lt;/channel&amp;gt;&lt;br /&gt;
      &amp;lt;index&amp;gt;0&amp;lt;/index&amp;gt;&lt;br /&gt;
      &amp;lt;description&amp;gt;Input volume to be filtered&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/image&amp;gt;&lt;br /&gt;
    &amp;lt;image&amp;gt;&lt;br /&gt;
      &amp;lt;name&amp;gt;outputVolume&amp;lt;/name&amp;gt;&lt;br /&gt;
      &amp;lt;label&amp;gt;Output Volume&amp;lt;/label&amp;gt;&lt;br /&gt;
      &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
      &amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;&lt;br /&gt;
      &amp;lt;description&amp;gt;Output filtered&amp;lt;/description&amp;gt;&lt;br /&gt;
    &amp;lt;/image&amp;gt;&lt;br /&gt;
  &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/executable&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Module with a multiple scalars, one Input image and one output image ===&lt;br /&gt;
&lt;br /&gt;
A module with&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;span&amp;gt;[[Image:AnisotropicDiffusionFilterGUI.png|[[Image:AnisotropicDiffusionFilterGUI.png]]]]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;executable&amp;gt;&lt;br /&gt;
   &amp;lt;category&amp;gt;filtering&amp;lt;/category&amp;gt;&lt;br /&gt;
   &amp;lt;title&amp;gt;Anisotropic Diffusion&amp;lt;/title&amp;gt;&lt;br /&gt;
   &amp;lt;description&amp;gt;&lt;br /&gt;
   Runs anisotropic diffusion on a volume&lt;br /&gt;
   &amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;version&amp;gt;1.0&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;documentation-url&amp;gt;&amp;lt;/documentation-url&amp;gt;&lt;br /&gt;
   &amp;lt;license&amp;gt;&amp;lt;/license&amp;gt;&lt;br /&gt;
   &amp;lt;contributor&amp;gt;Bill Lorensen&amp;lt;/contributor&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;&lt;br /&gt;
     Anisotropic Diffusion Parameters&lt;br /&gt;
     &amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;&lt;br /&gt;
     Parameters for the anisotropic&lt;br /&gt;
     diffusion algorithm&lt;br /&gt;
     &amp;lt;/description&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;double&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;conductance&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;conductance&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;Conductance&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Conductance&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;1&amp;lt;/default&amp;gt;&lt;br /&gt;
       &amp;lt;constraints&amp;gt;&lt;br /&gt;
         &amp;lt;minimum&amp;gt;0&amp;lt;/minimum&amp;gt;&lt;br /&gt;
         &amp;lt;maximum&amp;gt;10&amp;lt;/maximum&amp;gt;&lt;br /&gt;
         &amp;lt;step&amp;gt;.01&amp;lt;/step&amp;gt;&lt;br /&gt;
       &amp;lt;/constraints&amp;gt;&lt;br /&gt;
     &amp;lt;/double&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;double&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;timeStep&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;timeStep&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;Time Step&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Time Step&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;0.0625&amp;lt;/default&amp;gt;&lt;br /&gt;
       &amp;lt;constraints&amp;gt;&lt;br /&gt;
         &amp;lt;minimum&amp;gt;.001&amp;lt;/minimum&amp;gt;&lt;br /&gt;
         &amp;lt;maximum&amp;gt;1&amp;lt;/maximum&amp;gt;&lt;br /&gt;
         &amp;lt;step&amp;gt;.001&amp;lt;/step&amp;gt;&lt;br /&gt;
       &amp;lt;/constraints&amp;gt;&lt;br /&gt;
     &amp;lt;/double&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;integer&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;numberOfIterations&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;longflag&amp;gt;iterations&amp;lt;/longflag&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;Number of iterations&amp;lt;/description&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Iterations&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;default&amp;gt;1&amp;lt;/default&amp;gt;&lt;br /&gt;
       &amp;lt;constraints&amp;gt;&lt;br /&gt;
         &amp;lt;minimum&amp;gt;1&amp;lt;/minimum&amp;gt;&lt;br /&gt;
         &amp;lt;maximum&amp;gt;30&amp;lt;/maximum&amp;gt;&lt;br /&gt;
         &amp;lt;step&amp;gt;1&amp;lt;/step&amp;gt;&lt;br /&gt;
       &amp;lt;/constraints&amp;gt;&lt;br /&gt;
     &amp;lt;/integer&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
   &amp;lt;parameters&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;IO&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Input/output parameters&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;image&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;inputVolume&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Input Volume&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;channel&amp;gt;input&amp;lt;/channel&amp;gt;&lt;br /&gt;
       &amp;lt;index&amp;gt;0&amp;lt;/index&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;Input volume to be filtered&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;/image&amp;gt;&lt;br /&gt;
     &amp;lt;image&amp;gt;&lt;br /&gt;
       &amp;lt;name&amp;gt;outputVolume&amp;lt;/name&amp;gt;&lt;br /&gt;
       &amp;lt;label&amp;gt;Output Volume&amp;lt;/label&amp;gt;&lt;br /&gt;
       &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
       &amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;&lt;br /&gt;
       &amp;lt;description&amp;gt;Output filtered&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;/image&amp;gt;&lt;br /&gt;
   &amp;lt;/parameters&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/executable&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Module with output text presented in GUI ===&lt;br /&gt;
&lt;br /&gt;
Slicer auto generates GUI to display output from the command line module after execution is complete.&lt;br /&gt;
The flag [--returnparameterfile &amp;lt;file name&amp;gt;] is used to provide a name of a file that the module uses to store key=value pairs that are displayed in the Slicer GUI. The keys are described in the command line module xml schema using the output channel.&lt;br /&gt;
&lt;br /&gt;
This example demonstrates a portion of an XML schema containing  1 string-enumeration input and 7 string outputs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;floatright&amp;quot;&amp;gt;&amp;lt;span&amp;gt;[[Image:RadnosticsBetaOsteoporosisAnalysisGUI.png|[[Image:RadnosticsBetaOsteoporosisAnalysisGUI.png]]]]&amp;lt;/span&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;parameters&amp;gt;&lt;br /&gt;
   &amp;lt;label&amp;gt;Radnostics Beta Osteoporosis Analysis&amp;lt;/label&amp;gt;&lt;br /&gt;
   &amp;lt;string-enumeration&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;Osteoporosis&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;longflag&amp;gt;--osteoporosis&amp;lt;/longflag&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;After Segmentation Perform Osteoporosis Analysis&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Osteoporosis Analysis will provide a Radnostics Osteoporosis score for the patient.&amp;lt;/description&amp;gt;&lt;br /&gt;
     &amp;lt;default&amp;gt;yes&amp;lt;/default&amp;gt;&lt;br /&gt;
     &amp;lt;element&amp;gt;yes&amp;lt;/element&amp;gt;&lt;br /&gt;
     &amp;lt;element&amp;gt;no&amp;lt;/element&amp;gt;&lt;br /&gt;
   &amp;lt;/string-enumeration&amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;PatientGender&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Gender&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Patient Gender&amp;lt;/description&amp;gt;		  &lt;br /&gt;
     &amp;lt;default&amp;gt;na&amp;lt;/default&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;		&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;PatientAge&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Age&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Patient Age&amp;lt;/description&amp;gt;		  &lt;br /&gt;
     &amp;lt;default&amp;gt;na&amp;lt;/default&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;		&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;RadnosticsOsteoporosisScore&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;Radnostics Osteoporosis Score&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Radnostics Osteoporosis Score&amp;lt;/description&amp;gt;		  &lt;br /&gt;
     &amp;lt;default&amp;gt;na&amp;lt;/default&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;		&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;OsteoporosisComment1&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;*&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Comment 1&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;OsteoporosisComment2&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;*&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Comment 2&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;OsteoporosisComment3&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;*&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Comment 3&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;string&amp;gt;&lt;br /&gt;
     &amp;lt;name&amp;gt;OsteoporosisComment4&amp;lt;/name&amp;gt;&lt;br /&gt;
     &amp;lt;channel&amp;gt;output&amp;lt;/channel&amp;gt;&lt;br /&gt;
     &amp;lt;label&amp;gt;*&amp;lt;/label&amp;gt;&lt;br /&gt;
     &amp;lt;description&amp;gt;Comment 4&amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/parameters&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 The command line module outputs key=value pairs to the file supplied by –-returnparameterfile as shown below:&lt;br /&gt;
    PatientGender = F &lt;br /&gt;
    PatientAge = 059Y&lt;br /&gt;
    RadnosticsOsteoporosisScore = 8 (high)&lt;br /&gt;
    OsteoporosisComment1 = vertebra label 58 has biconcave fracture&lt;br /&gt;
    OsteoporosisComment2 = vertebra label 56 has mean density of 120 HU&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Command Line Parsing ==&lt;br /&gt;
&lt;br /&gt;
The Slicer Execution Model has support for parsing executable command lines. The C++ code to parse the command line arguments is generated automatically from the same XML description that generates the GUI. ''GenerateCLP,'' located in ''SlicerExecutionModel/GenerateCLP'' reads the XML Module Description and creates an include file ''&amp;quot;Executable&amp;quot;CLP.h'' in the build tree. The executable includes this header file and accesses the code with the macro PARSE_ARGS.&lt;br /&gt;
&lt;br /&gt;
GenerateCLP provides the following to the executable:&lt;br /&gt;
&lt;br /&gt;
# A brief usage command if required arguments are missing&lt;br /&gt;
# A full help command if ''-h'' or ''--help'' is specified on the command line&lt;br /&gt;
# A copy of the xml description if ''--xml'' is specified on the command line&lt;br /&gt;
# An echo of the command line parameters and their values if ''--echo'' is specified&lt;br /&gt;
&lt;br /&gt;
GenerateCLP provides the following source code:&lt;br /&gt;
&lt;br /&gt;
# A C++ declaration of the proper type for each parameter assigning the default value if specified by the XML&lt;br /&gt;
# For ''-vector'' parameters, a ''std::vector'' containing the proper C++ type fo the parameter. The generated code parses the comma separated strings to generate the ''std::vector''&lt;br /&gt;
&lt;br /&gt;
=== Using GenerateCLP ===&lt;br /&gt;
&lt;br /&gt;
GenerateCLP is normally used via CMake where it is implemented as a CUSTOM_COMMAND. To use GenerateCLP from CMake, you must first include the GenerateCLP package from your CMakeLists.txt file, which will make some macros available to you:&lt;br /&gt;
&lt;br /&gt;
  find_package(SlicerExecutionModel REQUIRED)&lt;br /&gt;
  include(${SlicerExecutionModel_USE_FILE})&lt;br /&gt;
&lt;br /&gt;
Note that the HelloSlicer command line module example provides a good starting point and can be used as a skeleton to build your own. It can be found in the [http://na-mic.org/ViewVC/index.cgi/trunk/Modules/CommandLineModule/Testing/HelloSlicer/?sortby=file#dirlist Modules/CommandLineModule/Testing/HelloSlicer] subdirectory.&lt;br /&gt;
&lt;br /&gt;
For each executable, include the following, replacing '''MyFilter''' with the name of your C++ source:&lt;br /&gt;
&lt;br /&gt;
  set('''MyFilter'''_SOURCE '''MyFilter'''.cxx)&lt;br /&gt;
  GENERATECLP('''MyFilter'''_SOURCE '''MyFilter'''.xml)&lt;br /&gt;
&lt;br /&gt;
To generate a stand-alone executable add the lines:&lt;br /&gt;
&lt;br /&gt;
  add_executable('''MyFilter''' ${'''MyFilter'''_SOURCE})&lt;br /&gt;
  target_link_libraries('''MyFilter''' ${ITK_LIBRARIES})&lt;br /&gt;
&lt;br /&gt;
Slicer expects modules and plugins to be stored in a specific subdirectory, so that they can be discovered and loaded at run-time. To make sure your CLP module is built in said subdirectory, add the line:&lt;br /&gt;
&lt;br /&gt;
  SEMMacroBuildCLI(&lt;br /&gt;
    NAME '''MyFilter'''&lt;br /&gt;
    LOGO_HEADER ${Slicer_SOURCE_DIR}/Resources/NAMICLogo.h&lt;br /&gt;
    ADDITIONAL_SRCS&lt;br /&gt;
      '''MyFilter'''.cxx&lt;br /&gt;
    TARGET_LIBRARIES ModuleDescriptionParser ${ITK_LIBRARIES} vtkTeem MRMLCore SlicerBaseCLI ${VTK_LIBRARIES}&lt;br /&gt;
    INCLUDE_DIRECTORIES&lt;br /&gt;
      ${vtkTeem_INCLUDE_DIRS}&lt;br /&gt;
      ${MRMLCore_INCLUDE_DIRS}&lt;br /&gt;
      ${vtkITK_INCLUDE_DIRS}&lt;br /&gt;
      ${SlicerBaseCLI_SOURCE_DIR} ${SlicerBaseCLI_BINARY_DIR}&lt;br /&gt;
    )&lt;br /&gt;
&lt;br /&gt;
The add_executable target creates a stand-alone executable that can be run from a command line. The add_library target creates a shared library that is discovered at Slicer 3 startup.&lt;br /&gt;
&lt;br /&gt;
Although this example linked to ITK libraries, other libraries can be specified.&lt;br /&gt;
&lt;br /&gt;
=== Short Example ===&lt;br /&gt;
&lt;br /&gt;
This example uses the XML for the [http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation#Module_with_an_integer-vector.2C_one_input_image_and_one_output_image|Median Image Filter example].&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note:''' The program '''MUST NOT''' write anything to stdout before the ''PARSE_ARGS'' statement. If something is written, the plugin discovery mechanism will not recognize the program as a plugin.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#include &amp;quot;MedianImageFilterCLP.h&amp;quot;&lt;br /&gt;
 int main (int argc, char * argv[])&lt;br /&gt;
  {&lt;br /&gt;
  PARSE_ARGS;&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; &amp;quot;The size of the neighborhood is: &amp;quot; &amp;lt;&amp;lt; neighborhood.size()&lt;br /&gt;
    &amp;lt;&amp;lt; &amp;quot; and the first element of the neighborhood is: &amp;quot; &amp;lt;&amp;lt; neighborhood[0]&lt;br /&gt;
    &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; &amp;quot;The input volume is: &amp;quot; &amp;lt;&amp;lt; inputVolume &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; &amp;quot;The output volume is: &amp;quot; &amp;lt;&amp;lt; outputVolume &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
  return EXIT_SUCCESS;&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the output --help:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
USAGE: &lt;br /&gt;
&lt;br /&gt;
   ./MedianImageFilter  [--processinformationaddress &amp;lt;std::string&amp;gt;] [--xml]&lt;br /&gt;
                        [--echo] [--neighborhood &amp;lt;std::vector&amp;lt;int&amp;gt;&amp;gt;] [--]&lt;br /&gt;
                        [--version] [-h] &amp;lt;std::string&amp;gt; &amp;lt;std::string&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Where: &lt;br /&gt;
&lt;br /&gt;
   --processinformationaddress &amp;lt;std::string&amp;gt;&lt;br /&gt;
     Address of a structure to store process information (progress, abort,&lt;br /&gt;
     etc.). (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --xml&lt;br /&gt;
     Produce xml description of command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --echo&lt;br /&gt;
     Echo the command line arguments (default: 0)&lt;br /&gt;
&lt;br /&gt;
   --neighborhood &amp;lt;std::vector&amp;lt;int&amp;gt;&amp;gt;&lt;br /&gt;
     The size of the neighborhood in each dimension (default: 1,1,1)&lt;br /&gt;
&lt;br /&gt;
   --,  --ignore_rest&lt;br /&gt;
     Ignores the rest of the labeled arguments following this flag.&lt;br /&gt;
&lt;br /&gt;
   --version&lt;br /&gt;
     Displays version information and exits.&lt;br /&gt;
&lt;br /&gt;
   -h,  --help&lt;br /&gt;
     Displays usage information and exits.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;std::string&amp;gt;&lt;br /&gt;
     (required)  Input volume to be filtered&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;std::string&amp;gt;&lt;br /&gt;
     (required)  Output filtered&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   The MedianImageFilter is commonly used as a robust approach for noise&lt;br /&gt;
   reduction. This filter is particularly efficient against&lt;br /&gt;
   'salt-and-pepper' noise. In other words, it is robust to the presence of&lt;br /&gt;
   gray-level outliers. MedianImageFilter computes the value of each output&lt;br /&gt;
   pixel as the statistical median of the neighborhood of values around the&lt;br /&gt;
   corresponding input pixel.&lt;br /&gt;
&lt;br /&gt;
   Author(s): Bill Lorensen&lt;br /&gt;
&lt;br /&gt;
   Acknowledgements: This command module was derived from&lt;br /&gt;
   Insight/Examples/Filtering/MedianImageFilter (copyright) Insight&lt;br /&gt;
   Software Consortium&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Parameters and C++ code ===&lt;br /&gt;
&lt;br /&gt;
This table shows how parameters are defined in the C++ code and how they are specified on the command line.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
! XML&lt;br /&gt;
! C++ Declaration&lt;br /&gt;
! Command Line&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;integer&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;count&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;flag&amp;gt;c&amp;lt;/flag&amp;gt; &amp;lt;/integer&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
int count;&lt;br /&gt;
|&lt;br /&gt;
''prog'' -c 10&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;float&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;stepSize&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;default&amp;gt;.0625&amp;lt;/default&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;longflag&amp;gt;stepSize&amp;lt;/longflag&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/float&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
float stepSize=.0625;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --stepSize .003&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;integer multiple=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;iterations&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;flag&amp;gt;i&amp;lt;/flag&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;default&amp;gt;100&amp;lt;/default&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/integer&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::vector&amp;lt;int&amp;gt; iterations;&amp;lt;br /&amp;gt; iterations.push_back(100);&amp;lt;br /&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
''prog'' -i 20 -i 30 -i 100&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;float-vector&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;variation&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;flag&amp;gt;v&amp;lt;/flag&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;default&amp;gt;1,2,3&amp;lt;/default&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/float-vector&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::vector&amp;lt;float&amp;gt; variation; iterations.push_back(1);&amp;lt;br /&amp;gt; iterations.push_back(2);&amp;lt;br /&amp;gt; iterations.push_back(3);&amp;lt;br /&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
''prog'' -v 10,20,3&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;string-vector&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;sites&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;longflag&amp;gt;sites&amp;lt;/longflag&amp;gt; &amp;lt;/string-vector&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::vector&amp;lt;std::string&amp;gt; sites;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --sites BWH,GE,Kitware,UNC,MIT,UTAH,GT&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;string-enumeration&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;leaders&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;default&amp;gt;Bill&amp;lt;/default&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;element&amp;gt;Ron&amp;lt;/element&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;element&amp;gt;Bill&amp;lt;/element&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;element&amp;gt;Steve&amp;lt;/element&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/string-enumeration&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::string leaders = &amp;quot;Bill&amp;quot;;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --leaders Ron&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;boolean&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;debugSwitch&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;flag&amp;gt;d&amp;lt;/flag&amp;gt; &amp;lt;default&amp;gt;true&amp;lt;/default&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/boolean&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
bool debugSwitch = true;&lt;br /&gt;
|&lt;br /&gt;
''prog'' -d&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;file&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;longflag&amp;gt;file1&amp;lt;/longflag&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;file&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::string file1;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --file1 mytext.txt&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;image&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;image&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;index&amp;gt;0&amp;lt;/index&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/image&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::string image;&lt;br /&gt;
|&lt;br /&gt;
''prog'' c:/lorensen/Data/ct.nrrd&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;file multiple=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;args&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;index&amp;gt;1&amp;lt;/index&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;/file&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::vector&amp;lt;std::string&amp;gt; args;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --otherFlags file1 file2 ... filen&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;point multiple=&amp;quot;true&amp;quot; coordinateSystem=&amp;quot;ras&amp;quot;&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;name&amp;gt;seed&amp;lt;/name&amp;gt;&amp;lt;br /&amp;gt; &amp;lt;longflag&amp;gt;--seed&amp;lt;/longflag&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
std::vector&amp;lt;std::vector&amp;lt;float&amp;gt; &amp;gt; seed;&lt;br /&gt;
|&lt;br /&gt;
''prog'' --seed 10,100,23 --seed 5,240,17&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Accessing Module Information at Runtime ==&lt;br /&gt;
&lt;br /&gt;
All of the information contained in the XML description of a module can be accessed at run-time by the command line program. The ''ModuleDescriptionParser'' class library can parse an XML module description and populate a ''ModuleDescription'' instance.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Module Description Parser Class Library&lt;br /&gt;
#include &amp;quot;ModuleDescriptionParser.h&amp;quot;&lt;br /&gt;
#include &amp;quot;ModuleDescription.h&amp;quot;&lt;br /&gt;
#include &amp;quot;ModuleParameterGroup.h&amp;quot;&lt;br /&gt;
#include &amp;quot;ModuleParameter.h&amp;quot;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
// Create a module and a parser&lt;br /&gt;
    ModuleDescription module;&lt;br /&gt;
    ModuleDescriptionParser parser;&lt;br /&gt;
// Parse the XML&lt;br /&gt;
    if (parser.Parse(GetXMLModuleDescription(), module))&lt;br /&gt;
      {&lt;br /&gt;
      std::cerr &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot;: One or more XML errors detected.&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
      return EXIT_FAILURE;&lt;br /&gt;
      }&lt;br /&gt;
// Access the module description information&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;Module Description Information&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tCategory is: &amp;quot; &amp;lt;&amp;lt; module.GetCategory() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tTitle is: &amp;quot; &amp;lt;&amp;lt; module.GetTitle() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tDescription is: &amp;quot; &amp;lt;&amp;lt; module.GetDescription() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tVersion is: &amp;quot; &amp;lt;&amp;lt; module.GetVersion() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tDocumentationURL is: &amp;quot; &amp;lt;&amp;lt; module.GetDocumentationURL() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tLicense is: &amp;quot; &amp;lt;&amp;lt; module.GetLicense() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;\tContributor is: &amp;quot; &amp;lt;&amp;lt; module.GetContributor() &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''GetXMLModuleDescription'' is automatically generated by ''GenerateCLP''. Information about parameter groups and parameters is also available [[Accessing_Module_Information_at_Runtime|here]].&lt;br /&gt;
&lt;br /&gt;
The ''CMakeLists.txt'' file that creates the command line module should point to the ''ModuleDescriptionParser'' library.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
target_link_libraries(${CLP}&lt;br /&gt;
    ModuleDescriptionParser&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Error Handling ==&lt;br /&gt;
&lt;br /&gt;
GenerateCLP attempts to do error checking so that the generated C++ code will compile. These errors will show up as custom command errors during the build process.&lt;br /&gt;
&lt;br /&gt;
* XML Errors&lt;br /&gt;
** ''mismatched tag at line xx'' : The closing tag (a tag with &amp;lt;/ &amp;gt;) does not have a matching opening tag.&lt;br /&gt;
** ''not well-formed (invalid token) at line xx'' : Probably a blank in the token name.&lt;br /&gt;
* ModuleDescriptionParser Errors&lt;br /&gt;
** ''&amp;lt;executable&amp;gt; must be the outer most tag''&lt;br /&gt;
** ''&amp;lt;executable&amp;gt; was found inside another tag''&lt;br /&gt;
** ''&amp;lt;parameters&amp;gt; can only be inside &amp;lt;executable&amp;gt;''&lt;br /&gt;
** ''&amp;lt;xxx&amp;gt; can only be used inside &amp;lt;parameters&amp;gt;''&lt;br /&gt;
** ''&amp;lt;flag&amp;gt; can only contain one character''&lt;br /&gt;
** ''&amp;lt;longname&amp;gt; can only contain letters, numbers and underscores and must start with an _ or letter''&lt;br /&gt;
** ''&amp;lt;name&amp;gt; can only contain letters, numbers and underscores and must start with an _ or letter''&lt;br /&gt;
&lt;br /&gt;
* ModuleDescriptionParser Warnings&lt;br /&gt;
** ''&amp;lt;xxx&amp;gt; is an unknown parameter tag'' : Probably a misspelled parameter type.&lt;br /&gt;
&lt;br /&gt;
* Compiler Errors&lt;br /&gt;
** The generated C++ code may have syntax errors if invalid defaults are specified. These will show up during the C++ compilation.&lt;br /&gt;
&lt;br /&gt;
== Interfacing Legacy Executables ==&lt;br /&gt;
&lt;br /&gt;
GenerateCLP is only provided as a convenience. Users can use the same XML Module Description to interface C++, shell scripts, tcl programs and even Matlab.&lt;br /&gt;
&lt;br /&gt;
Example: [http://www.slicer.org/slicerWiki/index.php/Slicer3:FiberTrackingIntegration FiberTracking Integration]&lt;br /&gt;
&lt;br /&gt;
== Showing Progress in an Application ==&lt;br /&gt;
&lt;br /&gt;
Programs can communicate progress to the user in two ways. If the program is running an a stand-alone executable, it communicates with a simple XML syntax. If the program is loaded at run-time as a plugin library, it communicates through a C structure.&lt;br /&gt;
&lt;br /&gt;
The XML syntax is:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;filter-start&amp;gt;&lt;br /&gt;
  &amp;lt;filter-name&amp;gt;&lt;br /&gt;
  ''name of program section or algorithm''&lt;br /&gt;
  &amp;lt;/filter-name&amp;gt;&lt;br /&gt;
  &amp;lt;filter-comment&amp;gt;&lt;br /&gt;
  ''description of program section or algorithm''&lt;br /&gt;
  &amp;lt;/filter-comment&amp;gt;&lt;br /&gt;
 &amp;lt;/filter-start&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;filter-progress&amp;gt;&lt;br /&gt;
 ''floating number from 0 to 1''&lt;br /&gt;
 &amp;lt;/filter-progress&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;filter-end&amp;gt;&lt;br /&gt;
  &amp;lt;filter-name&amp;gt;&lt;br /&gt;
  ''name of program section or algorithm''&lt;br /&gt;
  &amp;lt;/filter-name&amp;gt;&lt;br /&gt;
  &amp;lt;filter-time&amp;gt;&lt;br /&gt;
  ''execution time''&lt;br /&gt;
  &amp;lt;/filter-time&amp;gt;&lt;br /&gt;
 &amp;lt;/filter-end&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The C structure that library plugins use is:&lt;br /&gt;
&lt;br /&gt;
 extern &amp;quot;C&amp;quot; {&lt;br /&gt;
  struct ModuleProcessInformation&lt;br /&gt;
  {&lt;br /&gt;
    /** Inputs from calling application to the module **/&lt;br /&gt;
    unsigned char Abort;&lt;br /&gt;
    /** Outputs from the module to the calling application **/&lt;br /&gt;
    float Progress;&lt;br /&gt;
    char  ProgressMessage[1024];&lt;br /&gt;
    void (*ProgressCallbackFunction)(void *);&lt;br /&gt;
    void *ProgressCallbackClientData;&lt;br /&gt;
    double ElapsedTime;&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Details on how to use this mechanism are illustrated in [https://github.com/Slicer/Slicer/blob/master/Base/CLI/itkPluginFilterWatcher.h itkPluginFilterWatcher.h].&lt;br /&gt;
&lt;br /&gt;
For vtk and itk execution model programs, two classes are available that make it simple to add progress. The classes, ''vtkPluginFilterWatcher'' and ''itk::PluginFilterWatcher'' use the vtk and itk command/observer mechanism to report progress.&lt;br /&gt;
&lt;br /&gt;
vtkPluginFilterWatcher (vtkAlgorithm *'''filter''', const char* '''comment''', ModuleProcessInformation *'''inf''', double '''fraction''', double '''start''') &amp;lt;br /&amp;gt; itk::PluginFilterWatcher (itk::ProcessObject '''filter''', const char* '''comment''', ModuleProcessInformation *'''inf''', double '''fraction''', double '''start''')&lt;br /&gt;
&lt;br /&gt;
: where:&lt;br /&gt;
;; filter &lt;br /&gt;
:: is the vtkAlgorithm or itk::ProcessObject to be watched.&lt;br /&gt;
;; comment &lt;br /&gt;
:: is a string that describes the algorithm.&lt;br /&gt;
;; inf &lt;br /&gt;
:: is an optional pointer to a structure that is used to communicate with the invoking program when the called program is used as a library plugin. If the pointer is 0, this prgram will not report progress if it is run as a library plugin. Default is 0.&lt;br /&gt;
;; fraction &lt;br /&gt;
:: is the fraction (0-1) of progress that will be reported by this watcher. This is used when multiple filters are run and each filter represents a proportion of the total progress. Default is 1.&lt;br /&gt;
;; start &lt;br /&gt;
:: is the offset (0-1) of the progress for this filter. This is added to the progress of the filter. The reported progress of the watched filter is ''start + fraction * filter_progress''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt; The following example produces progress for a simple vtk program. The variable CLPProcessInformation is automatically declared and set in the program's ''program''CLP.h file.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#include &amp;quot;vtkPluginFilterWatcher.h&amp;quot;&lt;br /&gt;
 ...&lt;br /&gt;
  vtkMarchingCubes *cubes = vtkMarchingCubes::New();&lt;br /&gt;
    cubes-&amp;gt;SetInput(reader-&amp;gt;GetOutput());&lt;br /&gt;
  vtkPluginFilterWatcher watchCubes(cubes, &amp;quot;Generate Isosurface&amp;quot;, CLPProcessInformation, .5, 0.0);&lt;br /&gt;
  vtkDecimatePro *decimate = vtkDecimatePro::New();&lt;br /&gt;
    decimate-&amp;gt;SetInput(cubes-&amp;gt;GetOutput());&lt;br /&gt;
  vtkPluginFilterWatcher watchDecimate(decimate, &amp;quot;Reduce Triangle Count&amp;quot;, CLPProcessInformation, .5, 0.5);&lt;br /&gt;
  decimate-&amp;gt;Update();&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example produces progress for a simple itk program:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;#include &amp;quot;itkPluginFilterWatcher.h&lt;br /&gt;
 ...&lt;br /&gt;
 typedef itk::MedianImageFilter&amp;lt;ImageType,ImageType&amp;gt; FilterType;&lt;br /&gt;
 FilterType::Pointer median  = FilterType::New();&lt;br /&gt;
 itk::PluginFilterWatcher watchMedian(median, &amp;quot;Denoise Image&amp;quot;, CLPProcessInformation);&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding Module Logos to Slicer ==&lt;br /&gt;
Slicer plugins, both libraries and executables, can specify plugin-specific logos. These appear in Slicer when a module is selected. The logos are specified in a .h header file. The KWWidget utility, KWConvertImageToHeader, converts a .png file into a .h header file containing the encoded image and additional information such as width, height and pixel size. [[Documentation-3.5#Requirements_for_Modules|See here for additional information.]]&lt;br /&gt;
&lt;br /&gt;
For Slicer, execution model plugin logos are stored in Modules/CLI/Resources. The corresponding image in .png format should be stored in Modules/CLI/ImageData. Othere plugins, created outside the Slicer tree, should store the logo and image in a similar location.&lt;br /&gt;
&lt;br /&gt;
To add a logo to a plugin:&lt;br /&gt;
* Create a png image of the logo. The height of the logo should not exceed 40 pixels.&lt;br /&gt;
* Convert the logo to the KWWidget icon format as follows. '''NOTE:''' the prefix of the image and header file must be the same for a plugin logo.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd Modules/CLI&lt;br /&gt;
KWConvertImageToHeader --base64 --zlib Resources/ITKLogo.h ImageData/ITKLogo.png&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Add the logo to the SEMMacroBuildCLImacro in the CMakeLists.txt file for the plugin using LOGO_HEADER parameter.&lt;br /&gt;
&lt;br /&gt;
=== Runtime specification of filter types ===&lt;br /&gt;
&lt;br /&gt;
ITK filters are templated over the images they process. The following code snippet shows how an execution model program can select the image types for filters based on the input images.&lt;br /&gt;
&lt;br /&gt;
First, include the utilites for plugin's:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;itkPluginUtilities.h&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, turn your main program into a templated procedure called ''DoIt'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
template&amp;lt;class T&amp;gt; int DoIt( int argc, char * argv[], T )&lt;br /&gt;
{&lt;br /&gt;
  PARSE_ARGS;&lt;br /&gt;
&lt;br /&gt;
  typedef itk::Image&amp;lt; T, 3 &amp;gt;   InputImageType;&lt;br /&gt;
  typedef itk::Image&amp;lt; T, 3 &amp;gt;   OutputImageType;&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then, create a main program that gets the native component type from one of the input file. Here that input file is ''inputVolume'':&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int main( int argc, char * argv[] )&lt;br /&gt;
{&lt;br /&gt;
  &lt;br /&gt;
  PARSE_ARGS;&lt;br /&gt;
&lt;br /&gt;
  itk::ImageIOBase::IOPixelType pixelType;&lt;br /&gt;
  itk::ImageIOBase::IOComponentType componentType;&lt;br /&gt;
&lt;br /&gt;
  try&lt;br /&gt;
    {&lt;br /&gt;
    itk::GetImageType (inputVolume, pixelType, componentType);&lt;br /&gt;
&lt;br /&gt;
    // This filter handles all types&lt;br /&gt;
    &lt;br /&gt;
    switch (componentType)&lt;br /&gt;
      {&lt;br /&gt;
      case itk::ImageIOBase::UCHAR:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;unsigned char&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::CHAR:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;char&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::USHORT:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;unsigned short&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::SHORT:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;short&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::UINT:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;unsigned int&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::INT:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;int&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::ULONG:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;unsigned long&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::LONG:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;long&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::FLOAT:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;float&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::DOUBLE:&lt;br /&gt;
        return DoIt( argc, argv, static_cast&amp;lt;double&amp;gt;(0));&lt;br /&gt;
        break;&lt;br /&gt;
      case itk::ImageIOBase::UNKNOWNCOMPONENTTYPE:&lt;br /&gt;
      default:&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; &amp;quot;unknown component type&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
        break;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  catch( itk::ExceptionObject &amp;amp;excep)&lt;br /&gt;
    {&lt;br /&gt;
    std::cerr &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot;: exception caught !&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    std::cerr &amp;lt;&amp;lt; excep &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return EXIT_FAILURE;&lt;br /&gt;
    }&lt;br /&gt;
  return EXIT_SUCCESS;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Behind the Scenes ==&lt;br /&gt;
&lt;br /&gt;
A primary goal of the execution model is to relieve developers from developing GUI code and command line parsing code. This section describes the major components of the execution model implementation.&lt;br /&gt;
&lt;br /&gt;
=== Command Line Processing ===&lt;br /&gt;
&lt;br /&gt;
Command line processing parses command line arguments and populates internal program variables. Every Unix (and windows) program can receive an argument list through its main entry point. All C and C++ programmers are familiar with the ''int main (int argc, char *[] argv)'' entry point in their programs. Most computer languages including scripting languages provide a similar mechanism to retrieve command line arguments. Simple command line processing directly accesses the strings defined in argv.&lt;br /&gt;
&lt;br /&gt;
This snippet shows simple commmand line processing:&lt;br /&gt;
&lt;br /&gt;
 int main (int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
   if (argc &amp;lt; 2)&lt;br /&gt;
     {&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; &amp;quot;Usage: &amp;quot; &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot; filename&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return -1;&lt;br /&gt;
     }&lt;br /&gt;
   std::cout &amp;lt;&amp;lt; &amp;quot;The File is &amp;quot; &amp;lt;&amp;lt; argv[1] &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
   return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The simple approach works great for a small number of arguments. But larger numbers of arguments of varying types quickly make the processing code more complex and subject to error, both in coding and usage.&lt;br /&gt;
&lt;br /&gt;
 int main (int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
   if (argc &amp;lt; 5)&lt;br /&gt;
     {&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; &amp;quot;Usage: &amp;quot; &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot; iterations epsilon inputfile outputfile &amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return -1;&lt;br /&gt;
     }&lt;br /&gt;
   std::string inputfile(argv[3]);&lt;br /&gt;
   std::string outputfile(argv[4]);&lt;br /&gt;
   unsigned int iterations = atoi(argv[1]);&lt;br /&gt;
   float epsilon = atof(argv[2]);&lt;br /&gt;
 ...&lt;br /&gt;
   return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Adding flags (or options) to the command line makes the program easier to use but places a larger burden on the program developer. Each developer must ''invent'' a command line argument syntax and implement code to parse the command line. Even a simple example of this is too long to include in this description. This code snippet looks for just two command line arguments.&lt;br /&gt;
&lt;br /&gt;
 int main (int argc, char *argv[])&lt;br /&gt;
 {&lt;br /&gt;
   if (argc &amp;lt; 3)&lt;br /&gt;
     {&lt;br /&gt;
     std::cout &amp;lt;&amp;lt; &amp;quot;Usage: &amp;quot; &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot; [-i iterations] [-e epsilon] inputfile outputfile &amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
     return -1;&lt;br /&gt;
     }&lt;br /&gt;
   std::string inputfile;&lt;br /&gt;
   std::string outputfile;&lt;br /&gt;
   unsigned int iterations = 10; /* a default */&lt;br /&gt;
   float epsilon = .001; /* a defualt */&lt;br /&gt;
   ++argc; /* skip program name */&lt;br /&gt;
   while (argc &amp;gt; 0)&lt;br /&gt;
     {&lt;br /&gt;
     if (strcmp(argv[argc], &amp;quot;-i&amp;quot;)&lt;br /&gt;
      {&lt;br /&gt;
      iterations = atoi(argv[argc+1]);&lt;br /&gt;
      argc+=2;&lt;br /&gt;
      continue;&lt;br /&gt;
 &lt;br /&gt;
    else if (strcmp(argv[argc], &amp;quot;-e&amp;quot;)&lt;br /&gt;
      {&lt;br /&gt;
      epsilon = atof(argv[argc+1]);&lt;br /&gt;
      argc+=2;&lt;br /&gt;
      continue;&lt;br /&gt;
    ...&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
The code gets longer and longer as more options are added and must be rewritten every time a new programs is open.&lt;br /&gt;
&lt;br /&gt;
To solve this complexity issue, people have developed command line argument libraries. There are dozens, if not hundreds, of command line processing tools. For Slicer3 we looked at argument processors in vxl, nrrd, meta, kwsys and tclap. Each has its strengths and weaknesses. We chose [http://tclap.sourceforge.net/ The Templatized C++ Command Line Parser Library], '''TCLAP'''. '''TCLAP''' is implemented in ''include'' files and does not require a separate library build. As you will see later, the particular command line processing tool is, for the most part, transparent to the Slicer3 developer or user.&lt;br /&gt;
&lt;br /&gt;
But even these libraries require some work to use.&lt;br /&gt;
&lt;br /&gt;
==== TCLAP ====&lt;br /&gt;
&lt;br /&gt;
This example uses '''TCLAP''' to process a command line with 10 possible entries:&lt;br /&gt;
&lt;br /&gt;
 int main ( int argc, char* argv[] ) {&lt;br /&gt;
  //&lt;br /&gt;
  // Define default values&lt;br /&gt;
  int HistogramBins      = 30;&lt;br /&gt;
  int RandomSeed         = 1234567;&lt;br /&gt;
  int SpatialSamples     = 10000;&lt;br /&gt;
  float TranslationScale = 100.0;&lt;br /&gt;
  int Iterations         = 200;&lt;br /&gt;
  int SplineOrder        = 3;&lt;br /&gt;
  double MinimumStepSize = 0.00001;&lt;br /&gt;
  double MaximumStepSize = 0.005;&lt;br /&gt;
  bool PrintTransform    = false;&lt;br /&gt;
  string fixedImageFileName;&lt;br /&gt;
  string movingImageFileName;&lt;br /&gt;
  string resampledImageFileName;&lt;br /&gt;
  //&lt;br /&gt;
  // Setup command line parsing&lt;br /&gt;
  try&lt;br /&gt;
    {&lt;br /&gt;
    TCLAP::CmdLine cl ( &amp;quot;Register2d&amp;quot;, ' ', &amp;quot;$Revision: 1.1 $&amp;quot; );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;int&amp;gt;    HistogramBinsArg    ( &amp;quot;b&amp;quot;, &amp;quot;histogrambins&amp;quot;,    &amp;quot;Number of histogram bins&amp;quot;, false, 30, &amp;quot;integer&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;int&amp;gt;    IterationsArg       ( &amp;quot;i&amp;quot;, &amp;quot;iterations&amp;quot;,       &amp;quot;Number of Iterations&amp;quot;, false, Iterations, &amp;quot;int&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;double&amp;gt; MinimumStepSizeArg  ( &amp;quot;m&amp;quot;, &amp;quot;minstepsize&amp;quot;,      &amp;quot;Minimum Step Size&amp;quot;, false, MinimumStepSize, &amp;quot;double&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;double&amp;gt; MaximumStepSizeArg  ( &amp;quot;x&amp;quot;, &amp;quot;maxstepsize&amp;quot;,      &amp;quot;Maximum Step Size&amp;quot;, false, MaximumStepSize, &amp;quot;double&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;int&amp;gt;    RandomSeedArg       ( &amp;quot;r&amp;quot;, &amp;quot;randomseed&amp;quot;,       &amp;quot;Random Seed&amp;quot;, false, RandomSeed, &amp;quot;int&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;int&amp;gt;    SpatialSamplesArg   ( &amp;quot;s&amp;quot;, &amp;quot;spatialsamples&amp;quot;,   &amp;quot;Number of spatial samples&amp;quot;, false, SpatialSamples, &amp;quot;int&amp;quot;, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;int&amp;gt;    SplineOrderArg      ( &amp;quot;o&amp;quot;, &amp;quot;splineorder&amp;quot;,      &amp;quot;Order of spline for registration&amp;quot;, false, SplineOrder, &amp;quot;int&amp;quot;, cl );&lt;br /&gt;
    TCLAP::SwitchArg        PrintTransformArg   ( &amp;quot;p&amp;quot;, &amp;quot;printtransform&amp;quot;,   &amp;quot;Print the final transform&amp;quot;, PrintTransform, cl );&lt;br /&gt;
    TCLAP::ValueArg&amp;lt;float&amp;gt;  TranslationScaleArg ( &amp;quot;t&amp;quot;, &amp;quot;translationscale&amp;quot;, &amp;quot;Translation scale&amp;quot;, false, TranslationScale, &amp;quot;float&amp;quot;, cl );&lt;br /&gt;
    TCLAP::UnlabeledValueArg&amp;lt;string&amp;gt; FixedImageArg ( &amp;quot;fixed&amp;quot;, &amp;quot;Fixed image filename&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;string&amp;quot;, cl );&lt;br /&gt;
    TCLAP::UnlabeledValueArg&amp;lt;string&amp;gt; MovingImageArg ( &amp;quot;moving&amp;quot;, &amp;quot;Moving image filename&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;string&amp;quot;, cl );&lt;br /&gt;
    TCLAP::UnlabeledValueArg&amp;lt;string&amp;gt; ResampledImageArg ( &amp;quot;resampled&amp;quot;, &amp;quot;Resampled image filename&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;string&amp;quot;, cl );&lt;br /&gt;
    //&lt;br /&gt;
    // Parse the command line&lt;br /&gt;
    cl.parse ( argc, argv );&lt;br /&gt;
    //&lt;br /&gt;
    // Access the variables&lt;br /&gt;
    HistogramBins          = HistogramBinsArg.getValue();&lt;br /&gt;
    Iterations             = IterationsArg.getValue();&lt;br /&gt;
    MinimumStepSize        = MinimumStepSizeArg.getValue();&lt;br /&gt;
    MaximumStepSize        = MaximumStepSizeArg.getValue();&lt;br /&gt;
    RandomSeed             = RandomSeedArg.getValue();&lt;br /&gt;
    SpatialSamples         = SpatialSamplesArg.getValue();&lt;br /&gt;
    TranslationScale       = TranslationScaleArg.getValue();&lt;br /&gt;
    PrintTransform         = PrintTransformArg.getValue();&lt;br /&gt;
    fixedImageFileName     = FixedImageArg.getValue();&lt;br /&gt;
    movingImageFileName    = MovingImageArg.getValue();&lt;br /&gt;
    resampledImageFileName = ResampledImageArg.getValue();&lt;br /&gt;
    }&lt;br /&gt;
  catch ( ArgException e )&lt;br /&gt;
    {&lt;br /&gt;
    cerr &amp;lt;&amp;lt; &amp;quot;error: &amp;quot; &amp;lt;&amp;lt; e.error() &amp;lt;&amp;lt; &amp;quot; for arg &amp;quot; &amp;lt;&amp;lt; e.argId() &amp;lt;&amp;lt; endl;&lt;br /&gt;
    exit ( EXIT_FAILURE );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
You do get a lot for your investment here. Good error handling and help.&lt;br /&gt;
&lt;br /&gt;
=== Module Description Parser ===&lt;br /&gt;
The XML parsing is done by the [https://github.com/Slicer/SlicerExecutionModel/tree/master/ModuleDescriptionParser ModuleDescriptionParser] class library. ''GenerateCLP'' and Slicer3 use this class library to parse the module XML descriptions. The class ''ModuleDescriptionParser'' has one method, '''Parse''', that converts the XML description into an object model. The resulting object model has one ''ModuleDescription'', one or more ''ModuleParameterGroup'' each of which has one or more ''ModuleParameter''. Each instance has access methods to retrieve information from the XML.&lt;br /&gt;
* '''ModuleDescriptionParser''' - parser for command line module XML description.&lt;br /&gt;
*: ''Parse(std::string xml, ModuleDescription module)'' - parse an xml string and populate a ModuleDescription.&lt;br /&gt;
* '''ModuleDescription''' - contains information about a module &lt;br /&gt;
*: const std::string ''GetCategory()'' : returns the contents of '''&amp;lt;category&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetTitle()'' : returns the contents of '''&amp;lt;title&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetDescription()'' : returns the contents of '''&amp;lt;description&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetVersion()'' : returns the contents of '''&amp;lt;version&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetDocumentationURL()'' : returns the contents of '''&amp;lt;documentationURL&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetLicense()'' : returns the contents of '''&amp;lt;license&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetContributor()'' : returns the contents of '''&amp;lt;contributor&amp;gt;'''.&lt;br /&gt;
*: const std::vector&amp;lt;ModuleParameterGroup&amp;gt;&amp;amp; ''GetParameterGroups()'' : returns a vector of parameter groups.&lt;br /&gt;
* '''ModuleParameterGroup''' - contains ModuleParameters for each parameter group.&lt;br /&gt;
*: const std::string ''GetLabel'' - returns the contents of '''&amp;lt;label&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetDescription()'' - returns the contents of the parameter group's '''&amp;lt;description&amp;gt;'''.&lt;br /&gt;
*: const std::string ''GetAdvanced()'' - returns advanced attribute. Either &amp;quot;true&amp;quot; of &amp;quot;false&amp;quot;.&lt;br /&gt;
* '''ModuleParameter''' - contains information for a parameter.&lt;br /&gt;
*:GetTag() - returns the parameter's tag, e.g. '''&amp;lt;integer&amp;gt;, &amp;lt;image&amp;gt;''', etc.&lt;br /&gt;
*:GetName() - returns the parameter's '''&amp;lt;name&amp;gt;'''.&lt;br /&gt;
*:GetLongFlag() -  returns the parameter's '''&amp;lt;longflag&amp;gt;'''.&lt;br /&gt;
*:GetLabel() -  returns the parameter's '''&amp;lt;label&amp;gt;'''.&lt;br /&gt;
*:GetMaximum() -  returns the parameter's '''&amp;lt;maximum&amp;gt;''' constraint.&lt;br /&gt;
*:GetMinimum() -  returns the parameter's '''&amp;lt;minimum&amp;gt;''' constraint.&lt;br /&gt;
*:GetStep() -  returns the parameter's '''&amp;lt;step&amp;gt;'''.&lt;br /&gt;
*:GetDescription() -  returns the parameter's '''&amp;lt;description&amp;gt;'''.&lt;br /&gt;
*:GetChannel() -  returns the parameter's '''&amp;lt;channel&amp;gt;'''.&lt;br /&gt;
*:GetIndex() -  returns the parameter's '''&amp;lt;index&amp;gt;'''.&lt;br /&gt;
*:GetDefault() -  returns the parameter's '''&amp;lt;default&amp;gt;'''.&lt;br /&gt;
*:GetFlag() -  returns the parameter's '''&amp;lt;flag&amp;gt;'''.&lt;br /&gt;
*:GetMultiple() -  returns the parameter's multiple attribute, either &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;.&lt;br /&gt;
*:GetCoordinateSystem() -  returns the parameter's coordinate system attribute, one of &amp;quot;lps&amp;quot;, &amp;quot;ras&amp;quot;, or &amp;quot;ijk&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
= Adding a new parameter type =&lt;br /&gt;
&lt;br /&gt;
Adding a ''new parameter type'' to the execution model involves several modifications:&lt;br /&gt;
&lt;br /&gt;
# A new XML tag needs to be defined to represent the new parameter type.&lt;br /&gt;
# ModuleDescriptionParser needs to be modified to parse the new parameter tag type and specify how the command line processing code generation is going to represent the parameter type&lt;br /&gt;
# CommandLineModuleGUI needs to be modified to construct the appropriate GUI element for the parameter type&lt;br /&gt;
# CommandLineModuleLogic needs to be modified to put the parameter type onto the command line and request outputs parameter types be loaded back into Slicer and the MRML tree.&lt;br /&gt;
# SlicerApplicationLogic needs to be modified to ingest any output parameter types back into Slicer and the MRML tree.&lt;br /&gt;
# Additional modification are needed if the parameter is to be passed directly from the MRML tree without using the filesystem.&lt;br /&gt;
# Updating the documentation.&lt;br /&gt;
&lt;br /&gt;
Simple parameter types can be passed directly on the command line.  For instance, scalars, small lists, positions, etc. Complicated parameter types are passed to the module via '''abstract files'''. In some cases, these parameters are actually passed as files, where Slicer reads/write the data to the filesystem.  In other cases, the parameters are passed as '''abstract files''' which are really references to within the Slicer memory model but appear to the Command Line Module as being a file.  The Command Line Module is written using standard ITK ImageFileReader/ImageFileWriter classes but the ITK ImageIO factory mechanism is used to direct the ImageFileReader/ImageFileWriter to talk directly to the Slicer MRML tree instead of to the filesystem.&lt;br /&gt;
&lt;br /&gt;
== XML tag ==&lt;br /&gt;
&lt;br /&gt;
This is by far the easiest of the tasks involved in adding a new parameter type but it should not approached hastily. The XML description of a module is designed to be application agnostic. As such, parameter types should be described abstractly or generically.  For instance, '''&amp;lt;geometry&amp;gt;''' tag corresponds to the Slicer model node, the '''&amp;lt;point&amp;gt;''' tag corresponds to the Slicer fiducial node, etc.&lt;br /&gt;
&lt;br /&gt;
Once the tag name is defined, you need to decide whether the parameter type could or should support the attributes '''multiple''', '''coordinateSystem''', or '''fileExtensions''' or perhaps a new attribute type.&lt;br /&gt;
&lt;br /&gt;
== Modifying ModuleDescriptionParser ==&lt;br /&gt;
&lt;br /&gt;
SlicerExecutionModel/ModuleDescriptionParser/ModuleDescriptionParser.cxx contains the code to parse the XML description of a module and represent that module description in C++ data structures.  To add a new parameter type, this code needs to be modified.&lt;br /&gt;
&lt;br /&gt;
Two routines need to be modified in ModuleDescriptionParser, ''startElement()'' and ''endElement()''. For ''startElement()'', a new case block needs to be added for the parameter type.  You can start by copying the case block for a similar parameter type. This case block is responsible for processing all the attributes for the tag and managing and reporting any errors. The case block may define the '''CPPType''', the ''ArgType''', and the '''StringToType''' needed for the code generation of the command line parsing. The '''CPPType''' is used by in the generated command line processing code to represent the parameter.  This may be a simple C++ type or an STL container. The '''ArgType''' is the canonical type of each component of the parameter. The '''StringToType''' is the name of the method to use to convert the ASCII command line parameter to the final '''ArgType'''. The ''endElement()'' method merely needs a new case block to add the parameter to the description.&lt;br /&gt;
&lt;br /&gt;
ModuleDescriptionParser is fairly general, handling scalars, lists of scalars, and file types as parameter types. A parameter which does not fit these models will require considerable alterations to the ModuleDescriptionParser as well as the GenerateCLP.&lt;br /&gt;
&lt;br /&gt;
== Constructing a GUI for a new parameter type ==&lt;br /&gt;
&lt;br /&gt;
To have a GUI element appear in the module GUI for a new parameter type, Base\QTCLI\qSlicerCLIModuleUIHelper.cxx and Base\QTCLI\vtkSlicerCLIModuleLogic.cxx have to be modified. A new case block needs to be added to the '''BuildGUI()''' method for the new parameter type.  This case block is triggered off the XML tag for the parameter type. The case block is responsible for the constructing the appropriate GUI element for the parameter, complete with specifying the label and help text. The design is very simple.  A single widget is used for each parameter.  If a more complicated GUI is needed with multiple widgets, then perhaps a new widget is needed to encapsulated a set of widgets or a naming convention can be added to manage all the widgets associated with a parameter. The widgets for the parameters are stored in a map, indexed by the '''name''' of the parameter.&lt;br /&gt;
&lt;br /&gt;
The vtkCommandLineModuleGUI (and vtkCommandLineModuleLogic) are designed to operate very generically with sets of parameters. The aforementioned map of widgets indexed by parameter '''name''' is one such example.  The implementation of several of the methods in the vtkCommandLineModuleGUI (and vtkCommandLineModuleLogic) generically iterate over the widget map or over the parameter list. It is important to keep this in mind as new parameters are added.  The design goal is to minimize the number of ''special cases'' in the code.&lt;br /&gt;
&lt;br /&gt;
Note that there may be separate case blocks for '''input''' and '''output''' parameter types.&lt;br /&gt;
&lt;br /&gt;
== Communicating the new parameter to the Command Line Module ==&lt;br /&gt;
&lt;br /&gt;
To communicate the new parameter type to and from a Command Line Module, the '''ApplyTask()''' method Slicer3/Modules/CommandLineModule/vtkCommandLineModuleLogic.cxx needs to be modified. &lt;br /&gt;
&lt;br /&gt;
If the parameter type is communicated to the command line module as a file (as opposed to directly on the command line as a number or srting), then there are several blocks of code to construct a temporary file name, keep track of whether that node needs to be written to the filesystem before execution, read from the filesystem after the execution, and deleted after execution completes. These blocks may need to be modified based on your new parameter type.&lt;br /&gt;
&lt;br /&gt;
The command line is constructed in two passes.  First, a pass is made over the parameter list, building the portion of the command line for any parameters that have flags.  Note that whether a parameter has a flag or not is up to the discretion of the module author and is not defined by the parameter type.  Second, a pass is made to construction the portion of the command  line for the parameters that do not have flags. These parameters are ordered appropriately, then placed on the command line. For parameters with flags, this code emits the flag and the parameter value.  For the parameters without flags, this code emits just the parameter value.  You will need to edit both of these passes to emit your parameter type.  In most cases, this is simply a matter of grabbing the parameter value from the parameter and pushing it onto the command line.  But some parameter types do require translation to a string appropriate for the command line.&lt;br /&gt;
&lt;br /&gt;
== Output parameters from the Command Line Modules ==&lt;br /&gt;
&lt;br /&gt;
Any outputs from a Command Line Module that are communicated via files are queued to be read by the main application thread. Command Line Modules run in a separate execution thread from the main GUI.  This thread is not allowed to modify the Slicer GUI, so any results from the module that need to be read back into Slicer and displayed are queued for the main thread.&lt;br /&gt;
&lt;br /&gt;
The '''ProcessReadData()''' method of Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx pulls data from the queue to load back into Slicer and display. You may need to a case block for your new parameter type to construct the appropriate storage node and display node.&lt;br /&gt;
&lt;br /&gt;
== Communicating directly with the MRML tree ==&lt;br /&gt;
&lt;br /&gt;
Currently scalar image types can sent as parameters to shared object command line modules without going through the filesystem.  Slicer provides a new ITK ImageIO factory that can communicated directly with the Slicer MRML tree. This ImageIO factory is in Slicer/Libs/MRMLIDImageIO. This approach can be extended for other image types such as vector or tensor volumes.&lt;br /&gt;
&lt;br /&gt;
For other constructs such as models and transforms, we'll need to see if an existing factory mechanism can be leverage to communicate directly with the Slicer MRML tree. An alternative may be to construct bridges specific to interfacing from a command line module to the Slicer MRML tree.&lt;br /&gt;
&lt;br /&gt;
== Adding new image types ==&lt;br /&gt;
&lt;br /&gt;
The Command Line Module support scalar, vector, tensor, and diffusion weighted images. Adding a new image type to the Command Line Module requires modify the sections of the code outlined above to manage GUI for the module, to construct temporary file names, to write image to disk, and load them back into the MRML tree.  These blocks are easy to identify as case blocks on vtkMRMLScalarVolumeNode, vtkMRMLDiffusionTensorVolumeNode, etc. Note that the '''&amp;lt;image&amp;gt;''' tag supports a '''type''' attribute that can scalar, label, vector, tensor, or diffusion-weighted.  The case block for '''image''' in the '''startElement()''' method of ModuleDescriptionParser would need to be extended to recognize a new type of image.&lt;br /&gt;
&lt;br /&gt;
=FAQ=&lt;br /&gt;
&lt;br /&gt;
==What facilities are available for third party software to interface with the NA-MIC Kit?==&lt;br /&gt;
&lt;br /&gt;
NA-MIC has committed to developing and supporting a generic batch processing interface.  This is the Slicer3 Command Line Interface (CLI). The application programming interface (API) for CLI was worked out based on interactions with the community including input from those familiar with LONI, ITK, Python and Matlab software development practices.&lt;br /&gt;
&lt;br /&gt;
We believe this API already supports all the features required by to implement batch processing with BatchMake, the LONI Pipeline, and any other systems that we may want to work with in the future.  The [[Slicer3:Execution_Model_Documentation|Slicer3 Execution Model]] provides a simple XML-based descriptor for command line arguments for input/output volumes and related parameters.&lt;br /&gt;
&lt;br /&gt;
==Which Third Party software has currently been interfaced to the NA-MIC Kit using the CLI?==&lt;br /&gt;
&lt;br /&gt;
*Batchmake (Kitware)&lt;br /&gt;
*Python&lt;br /&gt;
*Matlab&lt;br /&gt;
&lt;br /&gt;
== How do I debug my command line module? ==&lt;br /&gt;
&lt;br /&gt;
See [http://www.slicer.org/slicerWiki/index.php/Slicer3:Execution_Model_Documentation:Debugging Debugging]&lt;br /&gt;
&lt;br /&gt;
== How do I specify a Logo? ==&lt;br /&gt;
&lt;br /&gt;
You need to create a logo.h file (embedding the zipped pixel data as base64 strings in a C source code).  There is a utility bundled with kwwidgets that accomplishes this.  From a Slicer3 build directory you can do something like this:&lt;br /&gt;
&lt;br /&gt;
 ./Slicer3 --launch ../Slicer3-lib/KWWidgets-build/bin/KWConvertImageToHeader --base64 --zlib ~/Desktop/bioimagesuite_logo_www.h ~/Desktop/bioimagesuite_logo_www.png&lt;br /&gt;
&lt;br /&gt;
The resulting .h header file can then be used as an argument to the 'generateclp' cmake macro like this:&lt;br /&gt;
&lt;br /&gt;
 generateclp(${CLP}_SOURCE ${CLP}.xml ${Slicer3_SOURCE_DIR}/Resources/bioimagesuite_logo_www.h)&lt;br /&gt;
&lt;br /&gt;
''Note: logos are limited in size: if your .h file contains a symbol like 'image_bioimagesuite_logo_www' it will work.  But if it has several symbols like 'image_bioimagesuite_logo_www_1' 'image_bioimagesuite_logo_www_2' etc then the logo was too large and needs to be downsampled for use.''&lt;br /&gt;
&lt;br /&gt;
== What do I do if I want to use the CLI outside of slicer? ==&lt;br /&gt;
&lt;br /&gt;
In general CLI executables will depend on shared libraries provided by Slicer (such as ITKCommon, etc).  To be sure your run-time environment resolves to the correct versions, you should always use a form like:&lt;br /&gt;
 ./Slicer3 --launch &amp;lt;CLI&amp;gt;&lt;br /&gt;
or, you can start a shell from which you can run multiple CLI modules.  Something like:&lt;br /&gt;
 ./Slicer3 --launch xterm &amp;amp;&lt;br /&gt;
&lt;br /&gt;
We do not suggest hard-coding the runtime paths into, for example, your .bashrc since this may interfere with other programs and can make it hard to use multiple versions of slicer on the same account.&lt;br /&gt;
&lt;br /&gt;
= Laundry List =&lt;br /&gt;
&lt;br /&gt;
Use this section to describe any features that are missing, not documented, or require additional work.&lt;br /&gt;
&lt;br /&gt;
* Comments from Hans Johnson, June 4, 2010:&lt;br /&gt;
** Enumerated types can only have about 3 characters in them, otherwise they don’t render in the slicer wizard at all.&lt;br /&gt;
** There is no way to unset an enumerated type, and the values are cached even after leaving the module.  If the default enumerated type is to be blank, and you select it, then you must restart slicer in order to make the blank option available again.&lt;br /&gt;
** There is no way to have conditional options.  For example if one flag is used, then other flag can not be used, so it should be disabled.&lt;br /&gt;
* Multiple images, transforms, etc. cannot be selected in the module user interface shown in Slicer (https://issues.slicer.org/view.php?id=4299)&lt;br /&gt;
* Documenting your module:&lt;br /&gt;
** a convenience script has been developed by Hans Johnson, which creates a wiki page describing the command line module by extracting the information from the xml description [[SEMToMediaWiki.py]]. TODO: extract the default values for the parameters to be included in the documentation&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Labs/ExtensionsMetadata&amp;diff=53843</id>
		<title>Documentation/Labs/ExtensionsMetadata</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Labs/ExtensionsMetadata&amp;diff=53843"/>
		<updated>2017-08-02T19:30:51Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: Created page with &amp;quot;=Background=  Currently, extension metadata is captured (and duplicated) primarily in two locations:  1. Top-level CMakeLists.txt in the extension repository 2. s4ext file in...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Background=&lt;br /&gt;
&lt;br /&gt;
Currently, extension metadata is captured (and duplicated) primarily in two locations:&lt;br /&gt;
&lt;br /&gt;
1. Top-level CMakeLists.txt in the extension repository&lt;br /&gt;
2. s4ext file in https://github.com/Slicer/ExtensionsIndex&lt;br /&gt;
&lt;br /&gt;
Notably, the content of s4ext file is used primarily for getting the extension repository and revision. The rest of the metadata is extracted from the CMakeLists.txt file (see [https://github.com/Slicer/ExtensionsIndex/pull/1425 this discussion].&lt;br /&gt;
&lt;br /&gt;
Specifically, the following items are currently captured (all items are unstructured free text, with no validation done or possible):&lt;br /&gt;
* source code manager info (scm type, url, revision, username/password - if applicable)&lt;br /&gt;
* dependencies&lt;br /&gt;
* homepage&lt;br /&gt;
* contributors (unstructured text)&lt;br /&gt;
* category&lt;br /&gt;
* iconurl&lt;br /&gt;
* status&lt;br /&gt;
* description&lt;br /&gt;
* screenshoturls&lt;br /&gt;
* enabled&lt;br /&gt;
&lt;br /&gt;
Importantly, the current approach has several deficiencies:&lt;br /&gt;
* the unstructured nature of the description, and replication of items between two places, leads to inconsistencies and confusion (based on a [https://discourse.slicer.org/t/poll-how-do-you-re-generate-s4ext-file-for-slicer-extensionsindex/381 small poll], many developers edit s4ext manually)&lt;br /&gt;
* the following items that are rather important are not currently included anywhere:&lt;br /&gt;
** funding information&lt;br /&gt;
** relevant citation that authors would want users to acknowledge&lt;br /&gt;
** license&lt;br /&gt;
&lt;br /&gt;
=Ideas=&lt;br /&gt;
&lt;br /&gt;
* We could consider using some version of codemeta https://github.com/codemeta/codemeta to describe Slicer extensions&lt;br /&gt;
* to reduce the redundancy, we could make all options in s4ext optional, except the scm information - see discussion in https://github.com/Slicer/ExtensionsIndex/pull/1442&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=53840</id>
		<title>Documentation/Labs</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=53840"/>
		<updated>2017-08-02T19:18:08Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the place where we will keep track of our experiments and projects.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= On-going =&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenGLFilters|OpenGLFilters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DeprecatedModules|DeprecatedModules extension]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FHSCompliantDirectoryStructure|FHS compliant directory structure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FiberTractMeasurementAndVisualization|Fiber Tract measurement and visualization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTKWidgets|VTK Widgets improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CLIInfrastructureCleanupAndRefactoring|CLI infrastructure cleanup and refactoring]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerConfigAndUseSlicerTweaks|SlicerConfig and UseSlicer Tweaks]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/UpgradingCompilerInfrastructure|Upgrading Compiler Infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ViewInfrastructureImprovements| View Infrastructure Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CDash Improvements|CDash Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerBridge|SlicerBridge]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[{{FULLPAGENAME}}/Display2dText|Display 2D text in viewers]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[{{FULLPAGENAME}}/CI-and-NightlyPackagesGeneration|Continuous Integration and Nightly packages build infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ParameterSerializer|Parameter Serializer support for CLIs]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Augmented Reality and Virtual Reality support|Augmented Reality and Virtual Reality support]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Infrastucture Status|Infrastucture Status]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Improving Slicer Packages Download Experience|Improving Slicer Packages Download experience]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK8|VTK8]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt5|Migration to Qt5]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenCV|Integration with OpenCV]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK-Orientation|Design: Addition of orientation to VTK data structures]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/CallingPythonMethodsFromCpp|Calling Python methods from Cpp]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPython|IPython]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Pip|Pip]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonCondaBuild|Python conda build]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Ninja|Ninja]]&lt;br /&gt;
&lt;br /&gt;
== Virtual Machines ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/GPU Virtualization|GPU Virtualization]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/DocumentationImprovments|Documentation Improvements (Wiki, website, ...)]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ModulesAndEvents|Intermediate documentation for developers]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPythonSlicerTutorials|IPython Slicer Tutorials]]&lt;br /&gt;
&lt;br /&gt;
== Source code management ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TransitionToGit|Transition to Git]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsFrameworkRoadmap|Extensions Framework Roadmap]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CustomSlicerGenerator|Custom Slicer Generator]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsMetadata|Improving Extensions Metadata]]&lt;br /&gt;
&lt;br /&gt;
== Functionalities ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Video Support|Video support]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FlyThroughNavigation|Fly-through Navigation]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/AutomaticUpdateAndInstallationFramework|Automatic Update and Installation Framework]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ApplicationUsageAnalytics|Application usage analytics]]&lt;br /&gt;
&lt;br /&gt;
= Completed =&lt;br /&gt;
&lt;br /&gt;
* [[Slicer4:Developers|Developer Projects]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/EasyExtensionContribution|Easy Extension Contribution]] - See [[Documentation/Nightly/Developers/ExtensionWizard|ExtensionWizard]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/StartupTimeImprovement|Slicer startup time improvement]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CMake-ified Python|CMake-ified Python]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21911 r21911], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21912 r21912], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21913 r21913]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NonlinearTransforms|Full support for non-linear transforms]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/ITKv4|ITKv4]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt484|Qt484]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK6|VTK6]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK7|VTK7]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/DevelopmentWithGit|Development with Git]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21863 r21863], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21867 r21867], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21869 r21869], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21879 r21879], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21891 r21891]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonObserverCallbacks|Python observer callbacks]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/VS2012|VS2012]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NUMPY171|Support for Numpy 1.7.1]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/SimpleFilters|Simple Filters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Editor|Editor]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials testing ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TutorialTesting/4.3-Release|4.3 Release]]&lt;br /&gt;
&lt;br /&gt;
== Debug ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/BRAINS_and_ITKv4_issue|BRAINS and ITKv4 issue]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Segmentations|Segmentations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/MultiDimensional Data Management|MultiDimensional Data Management]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DICOMExport|DICOM Export]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SliceViewAnnotations|Slice View Annotations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SubjectHierarchy|Subject hierarchy module and plugins]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/I18N|Internationalization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Units|Units]]&lt;br /&gt;
* [https://github.com/TubeTK/SlicerExecutionModel/wiki/SlicerExecutionModel-Parameter-Serialization SlicerExecutionModel Parameter Serialization]&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=CitingSlicer&amp;diff=53671</id>
		<title>CitingSlicer</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=CitingSlicer&amp;diff=53671"/>
		<updated>2017-07-28T16:33:19Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===3D Slicer as a Platform===&lt;br /&gt;
To acknowledge 3D Slicer as a platform, please cite the [http://www.slicer.org Slicer web site] and the following publications when publishing work that uses or incorporates 3D Slicer:&lt;br /&gt;
&lt;br /&gt;
* An overview of Slicer and it's history&lt;br /&gt;
** Kikinis R, Pieper SD, Vosburgh K (2014) [https://link.springer.com/chapter/10.1007/978-1-4614-7657-3_19 3D Slicer: a platform for subject-specific image analysis, visualization, and clinical support.] [https://link.springer.com/book/10.1007/978-1-4614-7657-3 Intraoperative Imaging Image-Guided Therapy], Ferenc A. Jolesz, Editor 3(19):277–289 ISBN: 978-1-4614-7656-6 (Print) 978-1-4614-7657-3 (Online)&lt;br /&gt;
&lt;br /&gt;
* Slicer 4&lt;br /&gt;
** Fedorov A., Beichel R., Kalpathy-Cramer J., Finet J., Fillion-Robin J-C., Pujol S., Bauer C., Jennings D., Fennessy F.M., Sonka M., Buatti J., Aylward S.R., Miller J.V., Pieper S., Kikinis R. [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3466397/ 3D Slicer as an Image Computing Platform for the Quantitative Imaging Network.] Magn Reson Imaging. 2012 Nov;30(9):1323-41. PMID: 22770690. PMCID: PMC3466397.&lt;br /&gt;
&lt;br /&gt;
* Slicer 3&lt;br /&gt;
**Pieper S, Lorensen B, Schroeder W, Kikinis R. [http://www.spl.harvard.edu/publications/item/view/68  The NA-MIC Kit: ITK, VTK, Pipelines, Grids and 3D Slicer as an Open Platform for the Medical Image Computing Community.] Proceedings of the 3rd IEEE International Symposium on Biomedical Imaging: From Nano to Macro 2006; 1:698-701.&lt;br /&gt;
**Pieper S, Halle M, Kikinis R. [http://www.spl.harvard.edu/publications/item/view/91 3D SLICER.] Proceedings of the 1st IEEE International Symposium on Biomedical Imaging: From Nano to Macro 2004; 1:632-635.&lt;br /&gt;
&lt;br /&gt;
* Slicer 2&lt;br /&gt;
** Gering D.T., Nabavi A., Kikinis R., Hata N., O'Donnell L., Grimson W.E.L., Jolesz F.A., Black P.M., Wells III W.M. [http://www.spl.harvard.edu/publications/item/view/156 An Integrated Visualization System for Surgical Planning and Guidance using Image Fusion and an Open MR.] J Magn Reson Imaging. 2001 Jun;13(6):967-75. PMID: 11382961. &lt;br /&gt;
**Gering D.T., Nabavi A., Kikinis R., Grimson W.E.L., Hata N., Everett P., Jolesz F.A., Wells III W.M. [http://www.spl.harvard.edu/publications/item/view/816 An Integrated Visualization System for Surgical Planning and Guidance using Image Fusion and Interventional Imaging.] Int Conf Med Image Comput Comput Assist Interv. 1999 Sep;2:809-19.&lt;br /&gt;
&lt;br /&gt;
===Individual Modules===&lt;br /&gt;
To acknowledge individual modules &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=&amp;quot;280px&amp;quot; heights=&amp;quot;280px&amp;quot; &amp;gt;&lt;br /&gt;
File:Acknowledgement-tab.png|Each module has an acknowledgment tab in the top section. Information about contributors and funding source can be found there.&lt;br /&gt;
File:Help-tab.png|Additional information (including information about the underlying publications) can be typically found on the manual pages accessible through the help tab in the top section&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=53639</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=53639"/>
		<updated>2017-07-27T21:40:18Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Mac OSX 10.12 (Sierra) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.7-rc02&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 4.8.6. &amp;lt;small&amp;gt;See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Linux|here]]. See some history [http://na-mic.org/Mantis/view.php?id=3325#bugnotes here] (Note that any version &amp;gt;= Qt 4.7.4 can be used only for Ubuntu &amp;lt; 12.04)&amp;lt;/small&amp;gt;&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.8.2-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.8.2-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
===== Qt =====&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 14.04 and above''': Qt 4 == 4.8.7 MUST be used.&lt;br /&gt;
&lt;br /&gt;
See https://github.com/jcfr/qt-easy-build&lt;br /&gt;
&lt;br /&gt;
or on ubuntu 16.04 and 16.10, you can also install qt4.8.7 with:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
or if that fails (due to libqt4-core and libqt4-gui packages not found):&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install qt4-dev-tools libqt4-dev libqtcore4 libqtgui4 libqtwebkit-dev&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu 12.04, 12.10, 13.04 and 13.10''': Qt 4 &amp;gt;= 4.8.5 MUST be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd ~/Support   # This is where we will build Qt and dependent libraries&lt;br /&gt;
 &lt;br /&gt;
# Keep track of our working directory&lt;br /&gt;
cwd=$(pwd)&lt;br /&gt;
&lt;br /&gt;
# This will download, then build zlib and openssl in the current folder&lt;br /&gt;
rm -f get-and-build-openssl-for-slicer.sh&lt;br /&gt;
wget https://gist.githubusercontent.com/jcfr/9513568/raw/21f4e4cabca5ad03435ecc17ab546dab5e2c1a2f/get-and-build-openssl-for-slicer.sh&lt;br /&gt;
chmod u+x get-and-build-openssl-for-slicer.sh &lt;br /&gt;
./get-and-build-openssl-for-slicer.sh &lt;br /&gt;
&lt;br /&gt;
# This will download Qt source in the current folder&lt;br /&gt;
wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
md5=`md5sum ./qt-everywhere-opensource-src-4.8.6.tar.gz | awk '{ print $1 }'` &amp;amp;&amp;amp;&lt;br /&gt;
[ $md5 == &amp;quot;2edbe4d6c2eff33ef91732602f3518eb&amp;quot; ] || echo &amp;quot;MD5 mismatch. Problem downloading Qt&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# This will configure and build Qt in RELEASE against the zlib and openssl previously built&lt;br /&gt;
tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz&lt;br /&gt;
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
mkdir qt-everywhere-opensource-release-build-4.8.6&lt;br /&gt;
cd qt-everywhere-opensource-release-src-4.8.6&lt;br /&gt;
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6    \&lt;br /&gt;
                   -release \&lt;br /&gt;
                   -opensource -confirm-license \&lt;br /&gt;
                   -no-qt3support \&lt;br /&gt;
                   -webkit \&lt;br /&gt;
                   -nomake examples -nomake demos \&lt;br /&gt;
                   -openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e \&lt;br /&gt;
&amp;amp;&amp;amp; make -j7 &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details, consider reading the FAQ entry: [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_Qt_4_.3E.3D_4.8.5_should_be_used_on_Ubuntu_12.04_and_above_.3F|Why Qt 4 &amp;gt;= 4.8.5 should be used on Ubuntu 12.04 and above ?]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.7-rc02 is recommended.&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.0.1 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}For convenience, you could update the PATH variable so that ''git'' can be automatically discovered when configuring Slicer. If not, you will have to specify the GIT_EXECUTABLE at configure time.&lt;br /&gt;
&lt;br /&gt;
* [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;. If using TortoiseSVN (versions that support command line tools), make sure you install Command line tools (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download.&lt;br /&gt;
&lt;br /&gt;
* Qt: See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5, as of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** CMake &amp;gt;= 3.3.1&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** For Debug mode, disable &amp;lt;code&amp;gt;Slicer_USE_SimpleITK&amp;lt;/code&amp;gt; in CMake.&lt;br /&gt;
&lt;br /&gt;
'''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
&lt;br /&gt;
* VS2008 (deprecated)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* VS2010 (experimental, may not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
&amp;lt;!-- JC: This links shouldn't be here: 1) Since this the developer section, it's assumed Visual Studio is installed. 2) The Dll are distributed within Slicer package --&amp;gt;&lt;br /&gt;
&amp;lt;!-- *** Optional: &amp;quot;Microsoft Visual C++ 2010 SP1 Redistributable Package&amp;quot;. Click [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x64] download, or [http://www.microsoft.com/download/en/details.aspx?id=13523 here for x86] download.  [http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=29 x86 (32bit) for VS 2008] --&amp;gt;&lt;br /&gt;
* VS2012 (experimental)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* Cygwin (untested)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.x/Acknowledgments&amp;diff=52531</id>
		<title>Documentation/4.x/Acknowledgments</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.x/Acknowledgments&amp;diff=52531"/>
		<updated>2017-06-24T03:24:46Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{documentation/acknowledgments-versionlist}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|__TOC__&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot; style=&amp;quot;width: 10%&amp;quot;|&lt;br /&gt;
| class=&amp;quot;toc&amp;quot; style=&amp;quot;padding: 15px&amp;quot; align=&amp;quot;left&amp;quot;|&amp;lt;h2&amp;gt; &amp;lt;span class=&amp;quot;mw-headline&amp;quot;&amp;gt;Citing Slicer&amp;lt;/span&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;
{{:{{FULLPAGENAME}}/CitingSlicer}}&lt;br /&gt;
|-&lt;br /&gt;
||&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Slicer is made possible through contributions from an international community of scientists from a multitude of fields, including engineering and biomedicine. The following sections give credit to some of the major contributors to the 3D Slicer core effort. Each 3D Slicer extension has a separate acknowledgements page with information specific to that extension.&lt;br /&gt;
&lt;br /&gt;
''Ongoing Slicer support depends on YOU''&lt;br /&gt;
* Please give [https://github.com/Slicer/Slicer the Slicer repository]  [https://help.github.com/articles/about-stars/ a star on github].  This is an easy way to show thanks and it can help us qualify for useful services that are only open to widely recognized open projects.&lt;br /&gt;
* Don't forget to cite our publications because that helps us get new grant funding.&lt;br /&gt;
* If you find Slicer is helpful like the community please get involved.  You don't need to be a programmer to help!&lt;br /&gt;
&lt;br /&gt;
==Major Contributors==&lt;br /&gt;
*Ron Kikinis: Principal Investigator&lt;br /&gt;
*Steve Pieper: Chief Architect&lt;br /&gt;
*Jean-Christophe Fillion-Robin: Lead Developer&lt;br /&gt;
*Nicole Aucoin&lt;br /&gt;
*Stephen Aylward&lt;br /&gt;
*Andrey Fedorov&lt;br /&gt;
*Noby Hata&lt;br /&gt;
*Hans Johnson&lt;br /&gt;
*Tina Kapur&lt;br /&gt;
*Andras Lasso&lt;br /&gt;
*Jim Miller&lt;br /&gt;
*Sonia Pujol: Director of Training&lt;br /&gt;
*Junichi Tokuda&lt;br /&gt;
*Lauren O'Donnell&lt;br /&gt;
&lt;br /&gt;
==Groups Contributing to the Core Engineering of Slicer in a Major Way==&lt;br /&gt;
*SPL: Ron Kikinis, Nicole Aucoin, Lauren O'Donnell, Andrey Fedorov, Isaiah Norton, Sonia Pujol, Noby Hata, Junichi Tokuda&lt;br /&gt;
*Isomics: Steve Pieper, Alex Yarmarkovich&lt;br /&gt;
*Kitware: Jean-Christophe Fillion-Robin, Julien Finet, Will Schroeder, Stephen Aylward&lt;br /&gt;
*U Iowa: Hans Johnson&lt;br /&gt;
*GE: Jim Miller&lt;br /&gt;
*Perk Lab, Queen's University: Andras Lasso, Tamas Ungi, Csaba Pinter, Gabor Fichtinger&lt;br /&gt;
&lt;br /&gt;
== Funding Sources ==&lt;br /&gt;
Many of the activities around the Slicer effort are made possible through funding from public and private sources. The National Institutes of Health of the USA is a major contributor through a variety of competetive grants and contracts.&lt;br /&gt;
=== Grants ===&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! '''Project Name''' || '''Grant Number and NIH Link''' || '''Title (and Project Page''') || '''Grant PIs''' || '''Start Date''' || '''End Date'''&lt;br /&gt;
|-&lt;br /&gt;
| PediatricValveModeling-SlicerHeart || NA || PediatricValveModeling || Matthew Jolley || 2015-08-15 || 2020-08-15&lt;br /&gt;
|-&lt;br /&gt;
| DiffusionMRI || [https://projectreporter.nih.gov/project_info_details.cfm?aid=8855115&amp;amp;icde=27026518 2P41EB015898] || Image Guided Therapy Center || Tempany, Clare M || 2004-04-01 || 2020-06-30&lt;br /&gt;
|-&lt;br /&gt;
| Shape || [https://projectreporter.nih.gov/project_info_description.cfm?aid=9123966&amp;amp;icde=31459429 1R01EB021391] || SHAPE ANALYSIS TOOLBOX FOR MEDICAL IMAGE COMPUTING PROJECTS || Paniagua, Beatriz || 2016-09-19 || 2020-06-30&lt;br /&gt;
|-&lt;br /&gt;
| National Center for Image Guided Therapy || [https://projectreporter.nih.gov/project_info_description.cfm?aid=9125821&amp;amp;icde=31485478 5P41EB015898] || Use of Slicer in a wide array of image-guided therapy research for prostate cancer, neurosurgery, and image naviation || Clare Tempany || 2004-04-01 || 2020-06-30&lt;br /&gt;
|-&lt;br /&gt;
| Slicer-Radiomics-U24 || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8875289&amp;amp;icde=27050248 U24CA194354] || Quantitative Radiomics System Decoding the Tumor Phenotype || Aerts, Hugo || 2015-04-01 || 2020-03-31&lt;br /&gt;
|-&lt;br /&gt;
| Slicer-Radiomics-U01 || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8799943&amp;amp;icde=27026470 1U01CA190234] || Genotype And Imaging Phenotype Biomarkers In Lung Cancer || Aerts, Hugo || 2015-01-01 || 2019-12-01&lt;br /&gt;
|-&lt;br /&gt;
| Tools to Analyze Morphology and Spatially Mapped Molecular Data  || [https://projectreporter.nih.gov/project_info_details.cfm?aid=9127923&amp;amp;icde=31460433  5U24CA180924] || TOOLS TO ANALYZE MORPHOLOGY AND SPATIALLY MAPPED MOLECULAR DATA || Joel Saltz || 2014-09-01 || 2019-08-31&lt;br /&gt;
|-&lt;br /&gt;
| NIRView (Dartmouth) || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8828624&amp;amp;icde=27036841 5R01CA184354] || Mri Fluorescence Tomography For Quantifying Tumor Receptor Concentration In Vivo || Davis, Scott C. || 2014-04-01 || 2019-02-28&lt;br /&gt;
|-&lt;br /&gt;
| CMF || [https://projectreporter.nih.gov/project_info_description.cfm?aid=9111256&amp;amp;icde=31459429  R21DE025306] || TEXTURAL BIOMARKERS OF ARTHRITIS FOR THE SUBCHONDRAL BONE IN THE TEMPOROMANDIBULAR JOINT || Paniagua, Beatriz || 2016-09-01 || 2018-08-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_SHAPEANALSS || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8462842&amp;amp;icde=27164806 1U01NS082086] || 4D Shape Analysis for Modeling Spatiotemporal Change Trajectories in Huntington’s || Gerig, Guido || 2012-09-28 || 2018-08-31&lt;br /&gt;
|-&lt;br /&gt;
| QIICR || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8911287&amp;amp;icde=27026906 U24 CA180918] || [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)] || Ron Kikinis, Andrey Fedorov || 2013-09-04 || 2018-08-31&lt;br /&gt;
|-&lt;br /&gt;
| SlicerDMRI Diffusion MRI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8971083&amp;amp;icde=27026834 1U01CA199459] || Open Source Diffusion MRI Technology For Brain Cancer Research || O'Donnell, Lauren Jean || 2015-09-22 || 2018-07-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_KIDS || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8900362&amp;amp;icde=27164764 5R01NS055903] || Growth and Development of the Striatum in Huntington's Disease || Nopoulos, Peggy || 2009-03-01 || 2018-07-31&lt;br /&gt;
|-&lt;br /&gt;
| DiffusionMRI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8890837&amp;amp;icde=27036647 5P41EB015902] || Neuroimaging Analysis Center (Nac) || Kikinis, Ron || 2013-08-01 || 2018-05-31&lt;br /&gt;
|-&lt;br /&gt;
| Neuroimage Analysis Center || [https://projectreporter.nih.gov/project_info_description.cfm?aid=9115586&amp;amp;icde=31485398 4P41EB015902] || Application of Slicer to image-guided neurosurgery and other applications through steered computaiton and image navigation databases || Ron Kikinis || 2013-08-01 || 2018-05-31&lt;br /&gt;
|-&lt;br /&gt;
| Craniosynostosis || [https://projectreporter.nih.gov/project_info_description.cfm?aid=9141675&amp;amp;icde=31459353 2R42HD081712] || IMAGE-GUIDED PLANNING SYSTEM FOR SKULL CORRECTION IN CHILDREN WITH CRANIOSYNOSTOSIS: PHASE II || Linguraru, Marius George || 2016-05-01 || 2018-04-30&lt;br /&gt;
|-&lt;br /&gt;
| DWI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8817256&amp;amp;icde=27036729 R01CA160902] || Advancement And Validation Of Prostate Diffusion And Spectroscopic Mri || Maier, Stephan E || 2012-04-01 || 2018-02-28&lt;br /&gt;
|-&lt;br /&gt;
| CMF || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8576556&amp;amp;icde=18353487 1R01DE024450] || Quantification Of 3D Bony Changes In Temporomandibular Joint Osteoarthritis || Cevidanes, Lucia || 2013-09-10 || 2017-08-31&lt;br /&gt;
|-&lt;br /&gt;
| PET/CT Calibration Phantom || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8979242&amp;amp;icde=27036988 2R42CA167907] || Calibrated Methods For Quantitative Pet/Ct Imaging Phase Ii || Kinahan, Paul E || 2012-05-01 || 2017-07-31&lt;br /&gt;
|-&lt;br /&gt;
| PET/CT Calibration Phantom || [https://projectreporter.nih.gov/project_info_details.cfm?aid=8979242&amp;amp;icde=32253397 2R42CA167907] || Calibrated Methods For Quantitative Pet/Ct Imaging Phase Ii || Kinahan, Paul E. || 2012-05-01 || 2017-07-01&lt;br /&gt;
|-&lt;br /&gt;
| HD_TRACKON || NA || TRACK-ON HD || Tabrizi, Sarah || 2012-01-01 || 2016-12-31&lt;br /&gt;
|-&lt;br /&gt;
| Slicer-RT || NA || Cancer Care Ontario Applied Cancer Research Unit, Canada || Gabor Fichtinger, PerkLab, Queen's University || 2011-01-01 || 2016-12-31&lt;br /&gt;
|-&lt;br /&gt;
| Slicer-RT || NA || [http://ocairo.technainstitute.com/ Ontario Consortium for Adaptive Interventions in Radiation Oncology, Canada] || David Jaffray, Princess Margaret Hospital, Toronto || 2011-01-01 || 2016-12-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_TRAJECTORY || NA || Developing a Robust Segmentation Pipeline That Allows for Consistent Trajectory Estimation of HD Gene Positive Individuals Across Multiple Longitudinal MRI Sites || Kim, Eun Young || 2014-11-01 || 2016-10-31&lt;br /&gt;
|-&lt;br /&gt;
| Craniosynostosis || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8778815&amp;amp;icde=27036063 IMAGE-GUIDED 1R41HD081712] || Image-Guided Planning System For Skull Correction In Children With Craniosynostos || Linguraru, Marius George || 2014-09-26 || 2016-08-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_PREDICT || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8338456&amp;amp;icde=27164778 5R01NS040068] || Neurobiological Predictors of Huntington's Disease (PREDICT-HD) || Paulsen, Jane || 2000-08-01 || 2016-08-31&lt;br /&gt;
|-&lt;br /&gt;
| PET-CT guided needle biopsy || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8863934&amp;amp;icde=27037113 3R42CA153488] || Improving Liver Lesion Biopsy In The Ct Suite Through Fusion With Pet Images || Cleary, Kevin R. || 2012-09-01 || 2016-08-01&lt;br /&gt;
|-&lt;br /&gt;
| OrthognathicTrac || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8710950&amp;amp;icde=27036891 1R43DE024334] || Real-Time Image Guidance For Improved Orthognathic Surgery || Enquobahrie, Andinet A. || 2014-08-05 || 2016-07-31&lt;br /&gt;
|-&lt;br /&gt;
| PediatricRadiologicDecisionSupport || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8272742&amp;amp;icde=13552329 1R01EB014947] || Mi2B2 Enabled Pediatric Radiological Decision Support || Murphy, Shawn N || 2012-08-01 || 2016-07-31&lt;br /&gt;
|-&lt;br /&gt;
| ProstateBRP || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8906771&amp;amp;icde=27026518 5R01CA111288 ] || Enabling Technologies For Mri-Guided Prostate Interventions || Tempany, Clare M. || 2004-12-01 || 2016-07-01&lt;br /&gt;
|-&lt;br /&gt;
| ProstateQIN || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8707214&amp;amp;icde=27026645 5U01CA151261] || Quantitative Mri Of Prostate Cancer As A Biomarker And Guide For Treatment || Fennessy, Fiona || 2010-09-01 || 2016-07-01&lt;br /&gt;
|-&lt;br /&gt;
| HD_GENETICS || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8596213&amp;amp;icde=27164895 1U01NS082074] || Imaging and Genetics in Huntington's Disease || Calhoun/Turner || 2013-07-01 || 2016-06-30&lt;br /&gt;
|-&lt;br /&gt;
| HD_PET || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8529927&amp;amp;icde=27164835 1U01NS083173] || Brain Network Imaging: A Novel Biomarker for Preclinical Huntington’s Disease || Feigin, Andrew || 2013-07-01 || 2016-06-30&lt;br /&gt;
|-&lt;br /&gt;
| TubeTK || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8384153&amp;amp;icde=27037397 1R01CA170665] || [http://tubetk.org Micro-Tumor Detection By Quantifying Tumor-Induced Vascular Abnormalities] || Dayton, Paul A. || 2012-09-01 || 2016-06-01&lt;br /&gt;
|-&lt;br /&gt;
| HD_WHITEMATTER || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8652000&amp;amp;icde=27164795 1U01NS083223] || Characterization of White Matter in Huntington’s Disease Using Diffusion MRI || Westin, Carl-Fredrik || 2014-01-01 || 2015-12-31&lt;br /&gt;
|-&lt;br /&gt;
| Slicer-RT || NA || Cancer Care Ontario Research Chair, Canada || Gabor Fichtinger, PerkLab, Queen's University || 2010-01-01 || 2015-12-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_FMRI_DWI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8462829&amp;amp;icde=27164863 1U01NS082083] || Functional Connectivity in Premanifest Huntington’s Disease || Rao, Stephen Mark || 2012-09-26 || 2015-08-31&lt;br /&gt;
|-&lt;br /&gt;
| Duke Prostate Registration || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8905274&amp;amp;icde=27036277 1R41CA196565] || Prostate Cancer Assessment Via Integrated 3D Arfi Elasticity Imaging And Multi-Parametric Mri || Palmeri, Mark L. &amp;amp; McCormick, Matthew M. || 2015-04-01 || 2015-04-01&lt;br /&gt;
|-&lt;br /&gt;
| TubeTK || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8472102&amp;amp;icde=27037328 1R43EB016621] || [http://tubetk.org In-Field Fast Procedure Support And Automation] || Aylward, Stephen R. || 2013-05-01 || 2015-04-01&lt;br /&gt;
|-&lt;br /&gt;
| TubeTK || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8453963&amp;amp;icde=27037364 1R41NS081792] || [http://tubetk.org Multimodality Image-Based Assessment System For Traumatic Brain Injury] || Aylward, Stephen R. || 2013-01-01 || 2014-12-01&lt;br /&gt;
|-&lt;br /&gt;
| PET-CT guided needle biopsy || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8390856&amp;amp;icde=27037039 2R42CA153488] || Improving Liver Lesion Biopsy In The Ct Suite Through Fusion With Pet Images || Cleary, Kevin R. || 2012-09-01 || 2014-08-01&lt;br /&gt;
|-&lt;br /&gt;
| TubeTK || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8252988&amp;amp;icde=27037450 1R43CA165621] || [http://tubetk.org Quantitative Ultrasound Analysis Of Vascular Morphology For Cancer Assessment] || Aylward, Stephen R || 2012-12-01 || 2014-08-01&lt;br /&gt;
|-&lt;br /&gt;
| HD_SUBCORTICAL_SHAPE || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8462830&amp;amp;icde=27164813 5U01NS082085] || Basal Ganglia Shape Analysis and Circuitry in Huntington's Disease || Miller, Michael &amp;amp; Ross, Christopher || 2012-09-26 || 2014-07-31&lt;br /&gt;
|-&lt;br /&gt;
| HD_DWI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8501010&amp;amp;icde=27164945 5U54EB005149] || National Alliance for Medical Image Computing || Kikinis, Ron || 2010-09-30 || 2014-06-30&lt;br /&gt;
|-&lt;br /&gt;
| HD_FMRI || [https://projectreporter.nih.gov/project_info_description.cfm?aid=8077226&amp;amp;icde=27164732 5R01NS054893] || Cognitive and Functional Brain Changes in Preclinical Huntington's Disease (HD) || Paulsen, Jane || 2007-05-15 || 2013-04-30&lt;br /&gt;
|-&lt;br /&gt;
| PET-CT guided needle biopsy || [https://projectreporter.nih.gov/project_info_description.cfm?aid=7999618&amp;amp;icde=27037084 1R41CA153488] || Improving Liver Lesion Biopsy In The Ct Suite Through Fusion With Pet Images || Cleary, Kevin R. || 2010-07-01 || 2012-06-01&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;small&amp;gt;For more information on how this table was created, see [[Documentation/Nightly/Acknowledgments/Grants|this page]].&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/CommercialPartners}} &lt;br /&gt;
&lt;br /&gt;
{{:{{FULLPAGENAME}}/CommercialProducts}}&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.x/Acknowledgments/CitingSlicer&amp;diff=51972</id>
		<title>Documentation/4.x/Acknowledgments/CitingSlicer</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.x/Acknowledgments/CitingSlicer&amp;diff=51972"/>
		<updated>2017-05-19T15:28:05Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To acknowledge 3D Slicer as a platform, please cite the Slicer web site (http://www.slicer.org) and the following publication:&lt;br /&gt;
&lt;br /&gt;
Fedorov A., Beichel R., Kalpathy-Cramer J., Finet J., Fillion-Robin J-C., Pujol S., Bauer C., Jennings D., Fennessy F., Sonka M., Buatti J., Aylward S.R., Miller J.V., Pieper S., Kikinis R. [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3466397 3D Slicer as an Image Computing Platform for the Quantitative Imaging Network]. Magnetic Resonance Imaging. 2012 Nov;30(9):1323-41. PMID: 22770690.&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:SlicerRadiomics-lung.png&amp;diff=51907</id>
		<title>File:SlicerRadiomics-lung.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:SlicerRadiomics-lung.png&amp;diff=51907"/>
		<updated>2017-05-14T18:24:40Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:RadiomicsExtension.png&amp;diff=51467</id>
		<title>File:RadiomicsExtension.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:RadiomicsExtension.png&amp;diff=51467"/>
		<updated>2017-04-28T20:46:38Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/Radiomics&amp;diff=51464</id>
		<title>Documentation/Nightly/Extensions/Radiomics</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/Radiomics&amp;diff=51464"/>
		<updated>2017-04-28T20:46:25Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/Radiomics|Radiomics]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is funded in part by the National Institutes of Health National Cancer Institute through the Informatics Technology for Cancer Research program grant U24 CA194354 (PI Hugo Aerts).&amp;lt;br&amp;gt;&lt;br /&gt;
Authors: Andrey Fedorov (SPL), Joost van  Griethuysen (NKI), Nicole Aucoin (SPL), Jean-Christophe Fillion-Robin (Kitware), Steve Pieper (Isomics), Hugo Aerts (DFCI)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: pyradiomics community https://groups.google.com/forum/#!forum/pyradiomics&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
[[Image:RadiomicsExtension.png|128px|left|]]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Radiomics provides a 3D Slicer interface to the [http://pyradiomics.readthedocs.io/en/latest/ pyradiomics library]. pyradiomics is an open-source python package for the extraction of Radiomics features from medical imaging. &lt;br /&gt;
&lt;br /&gt;
Usage instructions for SlicerRadiomics are available at https://github.com/Radiomics/SlicerRadiomics/blob/master/USAGE.md&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* Joost JM van Griethuysen, Andriy Fedorov, Chintan Parmar, Ahmed Hosny, Nicole Aucoin, Vivek Narayan, Regina GH Beets-Tan, Jean-Christophe Fillion-Robin, Steve Pieper, Hugo JWL Aerts, “Computational Radiomics System to Decode the Radiographic Phenotype”; Submitted 2017&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
Source code: https://github.com/Radiomics/SlicerRadiomics&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Quantification]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/Radiomics&amp;diff=51461</id>
		<title>Documentation/Nightly/Extensions/Radiomics</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/Radiomics&amp;diff=51461"/>
		<updated>2017-04-28T20:17:31Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: Created page with &amp;quot;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt; &amp;lt;!-- ---------------------------- --&amp;gt; {{documentation/{{documentation/version}}/module-header}} &amp;lt;!-- --------------------...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/Radiomics|Radiomics]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is funded in part by the National Institutes of Health National Cancer Institute through the Informatics Technology for Cancer Research program grant U24 CA194354 (PI Hugo Aerts).&amp;lt;br&amp;gt;&lt;br /&gt;
Authors: Andrey Fedorov (SPL), Joost van  Griethuysen (NKI), Nicole Aucoin (SPL), Jean-Christophe Fillion-Robin (Kitware), Steve Pieper (Isomics), Hugo Aerts (DFCI)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: pyradiomics community https://groups.google.com/forum/#!forum/pyradiomics&amp;lt;br&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
Radiomics provides a 3D Slicer interface to the [http://pyradiomics.readthedocs.io/en/latest/ pyradiomics library]. pyradiomics is an open-source python package for the extraction of Radiomics features from medical imaging. &lt;br /&gt;
&lt;br /&gt;
Usage instructions for SlicerRadiomics are available at https://github.com/Radiomics/SlicerRadiomics/blob/master/USAGE.md&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* Joost JM van Griethuysen, Andriy Fedorov, Chintan Parmar, Ahmed Hosny, Nicole Aucoin, Vivek Narayan, Regina GH Beets-Tan, Jean-Christophe Fillion-Robin, Steve Pieper, Hugo JWL Aerts, “Computational Radiomics System to Decode the Radiographic Phenotype”; Submitted 2017&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
Source code: https://github.com/Radiomics/SlicerRadiomics&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Quantification]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=51203</id>
		<title>Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=51203"/>
		<updated>2017-04-20T16:16:26Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To learn what is an extension, see [[Documentation/Nightly/Developers/FAQ#What_is_an_extension_.3F|here]]&lt;br /&gt;
&lt;br /&gt;
== Step-by-step: How to create, publish, distribute and maintain an extension ? ==&lt;br /&gt;
&lt;br /&gt;
* Scan through the [[Documentation/{{documentation/version}}/FAQ/Extensions|user]] and [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions|developer]] extension FAQs&lt;br /&gt;
* Optional: Present your extension(s) on the [http://massmail.bwh.harvard.edu/mailman/listinfo/slicer-devel slicer developers list] to check if other developer are working on a similar project, to seek for advice or to reach out for potential collaborator.&lt;br /&gt;
* Optional (required if developing loadable or CLI [[Documentation/{{documentation/version}}/Developers/Modules|module types]]): [[Documentation/{{documentation/version}}/Developers/Build_Instructions|Build Slicer application]] in &amp;lt;code&amp;gt;Release&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Use the Extension Wizard to create an extension bundling your module(s). Learn more about ExtensionWizard capabilities [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|here]]. To learn about extension description file format see [[Documentation/{{documentation/version}}/Developers/Extensions/DescriptionFile|here]]&lt;br /&gt;
* Upload source code of your extension to a publicly available repository&lt;br /&gt;
** GitHub is recommended (due to large user community, free public project hosting): join [https://github.com/join Github] and [https://help.github.com/articles/set-up-git#set-up-git setup Git]&lt;br /&gt;
** Extension Wizard command-line interface can upload source code of your extension to GitHub:&lt;br /&gt;
{{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Implement your extension. &amp;lt;code&amp;gt;Hack, hack, hack :)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Create documentation page for your extension&lt;br /&gt;
** It is recommended to use the Slicer wiki: [[Documentation/{{documentation/version}}/Developers/Tutorials/DocumentExtension#Extension_page|Create a documentation page for your extension]].&lt;br /&gt;
* Optional (necessary, if you want to upload test data to MIDAS or troubleshoot extension upload problems): [[Documentation/{{documentation/version}}/Developers/Tutorials/ObtainExtensionServerApiKey|Create an account on the extension server and obtain an API Key]]. You will then use your midas login and api key to substitute &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-LOGIN&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-APIKEY&amp;gt;&amp;lt;/code&amp;gt; in the examples. Go to [http://slicer.kitware.com/midas3/community/23 NA-MIC community] and click on &amp;lt;code&amp;gt;Join community&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
* Optional (required for loadable and CLI modules): [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions#How_to_build_an_extension_.3F|Build your extension]]&lt;br /&gt;
* Test your extension:&lt;br /&gt;
** If you have built your extension then build the PACKAGE target to create a package file that you can install from the Extension Manager by clicking the small tool icon in the top-right corner.&lt;br /&gt;
** If you have not built your extension then set up your extension manually: [[Documentation/{{documentation/version}}/Developers/FAQ#How_to_manually_install_an_extension.3F|Build your extension]]&lt;br /&gt;
* If you consider your extension is ready for distribution, contribute it to the ExtensionsIndex:&lt;br /&gt;
** Fork ExtensionIndex repository (https://github.com/Slicer/ExtensionsIndex), add your extension, and send a pull request&lt;br /&gt;
** The Extension Wizard can automate this by the following command:&lt;br /&gt;
&lt;br /&gt;
  {{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --contribute ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you shared your extension by adding it to the ExtensionWizard, make sure you know about the Slicer testing dashboard: http://slicer.cdash.org/index.php?project=Slicer4&amp;amp;display=project&lt;br /&gt;
&lt;br /&gt;
The dashboard will attempt to check out the source code of your extension, build, test and package it on Windows, Linux and Windows platforms. To find your extension, go to the bottom of the section &amp;quot;Extensions-Nightly&amp;quot;, and select &amp;quot;All&amp;quot; for &amp;quot;Items per page&amp;quot;. Search the page for the name of your extension. If you see red in any of the columns for your extension, click on the hyperlinked number of errors to see the details.&lt;br /&gt;
&lt;br /&gt;
Always check the dashboard after you first introduce your extension, or after you make any changes to the code!&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/StartHere&amp;diff=51200</id>
		<title>Documentation/Nightly/Developers/StartHere</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/StartHere&amp;diff=51200"/>
		<updated>2017-04-20T16:14:50Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* New community member checklist */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= New community member checklist =&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;{{Done}}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Join&lt;br /&gt;
:: Sign up on [https://discourse.slicer.org/ Slicer discourse website] to make sure you hear of new developments, releases and bug fixes.&lt;br /&gt;
:: Sign-up on [https://github.com/join Github] and &amp;quot;star&amp;quot; the [https://github.com/Slicer/Slicer/ Slicer project] to show your support (click on the &amp;quot;Star&amp;quot; icon in the top-left corner).&amp;lt;!-- and [https://help.github.com/articles/set-up-git#set-up-git setup Git] --&amp;gt;&lt;br /&gt;
:: [http://na-mic.org/Mantis/signup_page.php Register] on the issue tracker&lt;br /&gt;
:: Join the [https://plus.google.com/u/0/communities/105715968666294296532 3DSlicer BarCamp] G+ community.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;{{Done}}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Read&lt;br /&gt;
:: Scan through [[Documentation/{{documentation/version}}/Developers/FAQ|developer FAQ]].&lt;br /&gt;
:: Read the [[Documentation/{{documentation/version}}/Developers/Style Guide|Slicer Style Guidelines]] so that we all understand each other :)&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;{{Done}}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Create&lt;br /&gt;
:: [[Documentation/{{documentation/version}}/Developers/Tutorials/BuildTestPackageDistributeExtensions|Step-by-step: How to create, build, test, distribute and maintain an extension ?]]&lt;br /&gt;
:: [[Documentation/{{documentation/version}}/Developers/Build_Instructions|Step-by-step: How to build Slicer ?]]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;{{Done}}&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Contribute&lt;br /&gt;
:: To improve this wiki: [[Special:RequestAccount|request an account]].&lt;br /&gt;
:: [[Documentation/{{documentation/version}}/Developers/Tutorials/ContributePatch|Step-by-step: How to contribute a patch ?]]&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=51197</id>
		<title>Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/BuildTestPackageDistributeExtensions&amp;diff=51197"/>
		<updated>2017-04-20T16:11:59Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To learn what is an extension, see [[Documentation/Nightly/Developers/FAQ#What_is_an_extension_.3F|here]]&lt;br /&gt;
&lt;br /&gt;
== Step-by-step: How to create, publish, distribute and maintain an extension ? ==&lt;br /&gt;
&lt;br /&gt;
* Scan through the [[Documentation/{{documentation/version}}/FAQ/Extensions|user]] and [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions|developer]] extension FAQs&lt;br /&gt;
* Optional: Present your extension(s) on the [http://massmail.bwh.harvard.edu/mailman/listinfo/slicer-devel slicer developers list] to check if other developer are working on a similar project, to seek for advice or to reach out for potential collaborator.&lt;br /&gt;
* Optional (required if developing loadable or CLI [[Documentation/{{documentation/version}}/Developers/Modules|module types]]): [[Documentation/{{documentation/version}}/Developers/Build_Instructions|Build Slicer application]] in &amp;lt;code&amp;gt;Release&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Use the Extension Wizard to create an extension bundling your module(s). Learn more about ExtensionWizard capabilities [[Documentation/{{documentation/version}}/Developers/ExtensionWizard|here]]. To learn about extension description file format see [[Documentation/{{documentation/version}}/Developers/Extensions/DescriptionFile|here]]&lt;br /&gt;
* Upload source code of your extension to a publicly available repository&lt;br /&gt;
** GitHub is recommended (due to large user community, free public project hosting): join [https://github.com/join Github] and [https://help.github.com/articles/set-up-git#set-up-git setup Git]&lt;br /&gt;
** Extension Wizard command-line interface can upload source code of your extension to GitHub:&lt;br /&gt;
{{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --publish ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
* Implement your extension. &amp;lt;code&amp;gt;Hack, hack, hack :)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Create documentation page for your extension&lt;br /&gt;
** It is recommended to use the Slicer wiki: [[Documentation/{{documentation/version}}/Developers/Tutorials/DocumentExtension#Extension_page|Create a documentation page for your extension]].&lt;br /&gt;
* Optional (necessary, if you want to upload test data to MIDAS or troubleshoot extension upload problems): [[Documentation/{{documentation/version}}/Developers/Tutorials/ObtainExtensionServerApiKey|Create an account on the extension server and obtain an API Key]]. You will then use your midas login and api key to substitute &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-LOGIN&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;YOUR-MIDAS-APIKEY&amp;gt;&amp;lt;/code&amp;gt; in the examples. Go to [http://slicer.kitware.com/midas3/community/23 NA-MIC community] and click on &amp;lt;code&amp;gt;Join community&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
* Optional (required for loadable and CLI modules): [[Documentation/{{documentation/version}}/Developers/FAQ/Extensions#How_to_build_an_extension_.3F|Build your extension]]&lt;br /&gt;
* Test your extension:&lt;br /&gt;
** If you have built your extension then build the PACKAGE target to create a package file that you can install from the Extension Manager by clicking the small tool icon in the top-right corner.&lt;br /&gt;
** If you have not built your extension then set up your extension manually: [[Documentation/{{documentation/version}}/Developers/FAQ#How_to_manually_install_an_extension.3F|Build your extension]]&lt;br /&gt;
* If you consider your extension is ready for distribution, contribute it to the ExtensionsIndex:&lt;br /&gt;
** Fork ExtensionIndex repository (https://github.com/Slicer/ExtensionsIndex), add your extension, and send a pull request&lt;br /&gt;
** The Extension Wizard can automate this by the following command:&lt;br /&gt;
&lt;br /&gt;
  {{pre2|&amp;lt;nowiki&amp;gt;$ bin/slicerExtensionWizard --contribute ~/Slicer-MyExtension/&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
If you shared your extension by adding it to the ExtensionWizard, make sure you know about the Slicer testing dashboard: slicer.cdash.org/index.php?project=Slicer4&amp;amp;display=project&lt;br /&gt;
&lt;br /&gt;
The dashboard will attempt to check out the source code of your extension, build, test and package it on Windows, Linux and Windows platforms. To find your extension, go to the bottom of the section &amp;quot;Extensions-Nightly&amp;quot;, and select &amp;quot;All&amp;quot; for &amp;quot;Items per page&amp;quot;. Search the page for the name of your extension. If you see red in any of the columns for your extension, click on the hyperlinked number of errors to see the details.&lt;br /&gt;
&lt;br /&gt;
Always check the dashboard after you first introduce your extension, or after you make any changes to the code!&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=49749</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=49749"/>
		<updated>2017-02-07T02:44:28Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:QuantitativeReportingLogo.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Documentation for this module is located at https://qiicr.gitbooks.io/quantitativereporting-guide&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/QIICR/QuantitativeReporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/SliceTracker&amp;diff=49715</id>
		<title>Documentation/Nightly/Extensions/SliceTracker</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/SliceTracker&amp;diff=49715"/>
		<updated>2017-02-03T15:42:29Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:SliceTracker_Logo_1.0_128x128.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/SliceTracker|SliceTracker]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is supported in part by the National Cancer Institute and the National Institute of Biomedical Imaging and Bioengineering of the  National Institutes of Health through the following grants:&lt;br /&gt;
* [http://igtpg.spl.harvard.edu/ Enabling technologies for MRI-guided prostate interventions] (R01 CA111288, PI Tempany)&lt;br /&gt;
* [http://ncigt.org/ The National Center for Image-Guided Therapy] (P41 EB015898, PI Tempany)&lt;br /&gt;
* [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)] (U24 CA180918, PIs Kikinis and Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Contributors: Christian Herz ({{collaborator|name|spl}}), Peter Behringer ({{collaborator|name|spl}}), Andrey Fedorov ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, &amp;lt;email&amp;gt;andrey.fedorov@gmail.com&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== ''NOTE: SliceTracker documentation is located here: https://slicerprostate.gitbooks.io/slicetracker'' ==&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|ncigt}}|{{collaborator|longname|ncigt}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Extension Description}}&lt;br /&gt;
&lt;br /&gt;
Slicetracker is a 3D Slicer extension for tracking prostate motion during MR-guided prostate biopsies. It implements registration of the pre-procedural to intra-procedural images, which aims to improve reliability of biopsy target re-identification.&lt;br /&gt;
&lt;br /&gt;
Furthermore, a so called z-Frame registration module is included for correlating the patient and 3D Slicers coordinate system. For guidance of the needle a template grid with 15x14 holes is placed in front of the z-Frame. The optimal hole is computed for inserting the needle and obtaining the tissue sample.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slicetracker.gif]]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
[1] Fedorov A., Tuncali K., Fennessy FM., Tokuda J., Hata N., Wells WM., Kikinis R., Tempany CM. 2012. Image registration for targeted MRI-guided transperineal prostate biopsy. Journal of magnetic resonance imaging: JMRI 36:987–992. DOI: 10.1002/jmri.23688.&lt;br /&gt;
&lt;br /&gt;
[2] Fedorov A., Tuncali K., Penzkofer T., Tokuda J., Song S-E., Hata N., Tempany C. 2013. Quantification of intra-procedural gland motion during transperineal MRI-guided prostate biopsy. In: Proc. of ISMRM’13.&lt;br /&gt;
&lt;br /&gt;
[3] Tokuda J., Tuncali K., Iordachita I., Song S-EE., Fedorov A., Oguro S., Lasso A., Fennessy FM., Tempany CM., Hata N. 2012. In-bore setup and software for 3T MRI-guided transperineal prostate biopsy. Physics in medicine and biology 57:5823–5840. DOI: 10.1088/0031-9155/57/18/5823.&lt;br /&gt;
&lt;br /&gt;
[4] Behringer P., Herz C., Penzkofer T., Tuncali K., Tempany C., Fedorov A. 2015. Open-­source Platform for Prostate Motion Tracking during in­-bore Targeted MRI­-guided Biopsy. In: MICCAI Workshop on Clinical Image-based Procedures: Translational Research in Medical Imaging. DOI: 10.1007/978-3-319-31808-0_15.&lt;br /&gt;
&lt;br /&gt;
[5] https://blog.kitware.com/clinical-research-employs-3d-slicer-extension/&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code on github: https://github.com/SlicerProstate/SliceTracker&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Modules:LabelDiameterEstimation-Documentation-3.6&amp;diff=49327</id>
		<title>Modules:LabelDiameterEstimation-Documentation-3.6</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Modules:LabelDiameterEstimation-Documentation-3.6&amp;diff=49327"/>
		<updated>2017-01-03T17:28:19Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: /* Source code &amp;amp; documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Documentation-3.6|Return to Slicer 3.6 Documentation]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
===Label Diameter Estimation===&lt;br /&gt;
LabelDiameterEstimation&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:labeldiameterestimation1.png|thumb|280px|Caption 1]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== General Information ==&lt;br /&gt;
===Module Type &amp;amp; Category===&lt;br /&gt;
&lt;br /&gt;
Type: CLI&lt;br /&gt;
&lt;br /&gt;
Category: Statistics&lt;br /&gt;
&lt;br /&gt;
===Authors, Collaborators &amp;amp; Contact===&lt;br /&gt;
* Andriy Fedorov, BWH&lt;br /&gt;
* Ron Kikinis, BWH&lt;br /&gt;
* Contact: Andriy Fedorov, fedorov at bwh&lt;br /&gt;
&lt;br /&gt;
===Module Description===&lt;br /&gt;
Given a binary label, this module estimates the largest diameter of the label, its largest in-plane perpendicular diameter, and the third diameter that is perpendicular to the plane of the first two.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Examples, Use Cases &amp;amp; Tutorials===&lt;br /&gt;
&lt;br /&gt;
This module was originally designed to calculate the dimensions of tumor, following the RECIST [1] and WHO guidelines.&lt;br /&gt;
&lt;br /&gt;
* '''Implementation details''' The module implements the following algorithm for calculating the dimensions of the label. First, the area of the label slice is computed in all the slices of the image that are passing through the label. This is done for the three orthogonal directions of the image. The largest area slice is found. ''The largest diameter (DA)'' is estimated by finding the two most distant points on the contour of the label cross-section. ''The second diameter (DB)'' is found by finding the two most distant points on the contour that lie on the line perpendicular to the first diameter. ''The third diameter (DC)'' is estimated by calculating the two points of intersection between the line perpendicular to the plane formed by ''DA'' and ''DB''passing through the point of their intersection, and the contour of the analyzed label.&lt;br /&gt;
&lt;br /&gt;
===Quick Tour of Features and Use===&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
* '''Control panel''' contains the following items&lt;br /&gt;
** '''Label value''' specifies which label should be used for diameter computation. When your label image has multiple labels, you can choose which one you want to measure. The default value of 0 will force the module to treat all label values in (1,255) as a single label.&lt;br /&gt;
** '''Input volume''' specifies the image with the label to be measured&lt;br /&gt;
** '''Output label image''' is a label image, which will have the computed diameters represented by distinctive labels. The diameters from the longest to the shortest are represented by consecutive labels from 1 to 3.&lt;br /&gt;
** '''File to keep the output fiducials''' must be specified to store the endpoints of the diameters. After computation is completed, the fiducials can be loaded from the ''File -&amp;gt; Add data...'' menu. The fiducials are named as ''DA-0'' and ''DA-1'' for the endpoints of the longest diameter, ''DB-0''/''DB-1'' and ''DC-0''/''DC-1'' for the other two.&lt;br /&gt;
&lt;br /&gt;
* '''Advanced parameters'''&lt;br /&gt;
** '''Orthogonality tolerance''' You should change this parameter only if the module does not give you a meaningful answer with the default value. The larger the tolerance is, the more non-perpendicular the diameters are allowed to be. This is related to the implementation details of the module. Try increasing the tolerance from 0.01 to 0.1 if the results don't make sense.&lt;br /&gt;
&lt;br /&gt;
The module also outputs numeric values for the lengths of the computed diameters. To see these numbers, open ''Log Viewer'', and select the first from top log record with the name  ''Label Diameter Estimation: standard output''. The reported numbers are the lenghts of the three diameters, the volume estimate calculated as ''A*B*C/2'' (a formula suggested in the literature for estimating volume of hematomas from planimetric measurements [2]), and the true label volume in mm^3.&lt;br /&gt;
|&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:LabelDiameterEstimation_controls.jpg|thumb|250px|LabelDiameterEstimation control panel]]&lt;br /&gt;
&lt;br /&gt;
|[[Image:LabelDiameterEstimation_slice.jpg|thumb|200px|Input label outline and the extracted diameters. Note the largest diameter is in blue (label 1), second largest is pink (label 2).]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:ExtractSubvolumeROI_output.jpg|thumb|250px|LabelDiameterEstimation standard output in &amp;quot;Log Viewer&amp;quot; reports lenghts of the computed diameters]]&lt;br /&gt;
&lt;br /&gt;
|[[Image:ExtractSubvolumeROI_3dmodel.jpg|thumb|200px|Fiducials of the diameter endpoints and the model constructed from the input label]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
Standing issues under development:&lt;br /&gt;
* would be nice to have fiducials read automatically; currently not possible, since fiducials are not fully integrated with CLI&lt;br /&gt;
* use measurements widgets instead of label images for diameter visualization; measurements are also not integrated with CLI, and are not yet feature-complete&lt;br /&gt;
* update Acks tab to point to documentation and give credit to BSF&lt;br /&gt;
&lt;br /&gt;
===Dependencies===&lt;br /&gt;
&lt;br /&gt;
===Known bugs===&lt;br /&gt;
&lt;br /&gt;
This extension expects that the volume is axis aligned. If this is not the case, use [[Modules:PythonExplodeVolumeTransform-Documentation-3.6|ExplodeVolumeTransform module]] first to obtain axis-aligned volume.&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker.&lt;br /&gt;
&lt;br /&gt;
===Usability issues===&lt;br /&gt;
&lt;br /&gt;
Follow this [http://na-mic.org/Mantis/main_page.php link] to the Slicer3 bug tracker. Please select the '''usability issue category''' when browsing or contributing.&lt;br /&gt;
&lt;br /&gt;
===Source code &amp;amp; documentation===&lt;br /&gt;
&lt;br /&gt;
Source code can accessed [http://viewvc.slicer.org/viewvc.cgi/NAMICSandBox/trunk/ChangeTrackerExtra/LabelDiameterEstimation/ here]&lt;br /&gt;
&lt;br /&gt;
[http://www.na-mic.org/Slicer/Documentation/Slicer3-doc/html/ Links] to documentation generated by doxygen.&lt;br /&gt;
&lt;br /&gt;
== More Information == &lt;br /&gt;
&lt;br /&gt;
===Acknowledgment===&lt;br /&gt;
Supported by Brain Science Foundation.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
[1] E. Eisenhauer, P. Therasse, J. Bogaerts, L. Schwartz, D. Sargent, R. Ford, J. Dancey, S. Arbuck, S. Gwyther, and M. Mooney, &amp;quot;New response evaluation criteria in solid tumours: Revised recist guideline (version 1.1),&amp;quot; European Journal of Cancer, vol. 45, no. 2, pp. 228-247, January 2009. [http://dx.doi.org/10.1016/j.ejca.2008.10.026 DOI]&lt;br /&gt;
&lt;br /&gt;
[2] H. B. Huttner, T. Steiner, M. Hartmann, M. Kohrmann, E. Juettler, S. Mueller, J. Wikner, U. Meyding-Lamade, P. Schramm, S. Schwab, and P. D. Schellinger, &amp;quot;Comparison of abc/2 estimation technique to computer-assisted planimetric analysis in warfarin-related intracerebral parenchymal hemorrhage,&amp;quot; Stroke, vol. 37, no. 2, pp. 404-408, February 2006. [http://dx.doi.org/10.1161/01.STR.0000198806.67472.5c DOI]&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/SlicerPathology&amp;diff=49049</id>
		<title>Documentation/Nightly/Extensions/SlicerPathology</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/SlicerPathology&amp;diff=49049"/>
		<updated>2016-12-07T20:54:40Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/SlicerPathology|SlicerPathology]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work was supported by via the NIH-National Cancer Institute Grant U24 CA180918, as well as, U24 CA180918 Quantitative Image Informatics for Cancer Research (QIICR), http://qiicr.org, PIs Ron Kikinis and Andrey Fedorov, Brigham and Women's Hospital.&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Erich Bremer&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Contributor 1: Yi Gao&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor 2: Nicole Aucoin ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor 3: Andrey Fedorov ({{collaborator|name|spl}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contributor 4: Jean-Christophe Fillion-Robin ({{collaborator|name|kitware}})&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Erich Bremer, &amp;lt;email&amp;gt;erich.bremer@stonybrook.edu&amp;lt;/email&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Module Description}}&lt;br /&gt;
This extension provides tools for automatic and semi-automatic pathology image segmentation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Use Cases}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-developerinfo}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Tutorials}}&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://www.youtube.com/watch?v=n6RtJoU9nGQ&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot2.png|thumb|800px|Step 1 - Go to the SlicerPathology Extension.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot3.png|thumb|800px|Step 2 - Click the user information tab.  Enter your email address.  This is used for identification of you in the file data files.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot4.png|thumb|800px|Step 3 - Click &amp;quot;Load data&amp;quot; to select an image.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot5.png|thumb|800px|Step 4 - Click the button Quick TCGA Effect button to activate the effect.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot6.png|thumb|800px|Step 5 - Click &amp;quot;Start TCGA Segmenter and adjust the five segmentation algorithm parameters as needed.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot7.png|thumb|800px|Step 6 - you can select a subregion to speed up the parameter tuning process.  Press &amp;quot;Y&amp;quot; to execute the segmenter on the subregion (if it was selected) or the whole image]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot8.png|thumb|800px|Step 7 - you can click &amp;quot;Clear Selection&amp;quot; to clear the selected sub-region so that the segmenter operates on the whole image.]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot9.png|thumb|800px|Step 8 - &amp;quot;Click the &amp;quot;Submission&amp;quot; tab so that you can save your label masks and related meta data. (meta data will be stored as JSON)]]&lt;br /&gt;
|}&lt;br /&gt;
{|&lt;br /&gt;
|[[File:SlicerPathologyScreenShot-json.png|thumb|800px|Step 9 - &amp;quot;This is a sample of the stored meta data.  Notice the addition of your username for identification.]]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|References}}&lt;br /&gt;
* [http://qiicr.org Quantitative Image Informatics for Cancer Research (QIICR)]&lt;br /&gt;
* [http://opencv.org Open Source Computer Vision] &lt;br /&gt;
* [http://cancergenome.nih.gov/ The Cancer Genome Atlas]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Information for Developers}}&lt;br /&gt;
The source code for SlicerPathology is available at https://github.com/SBU-BMI/SlicerPathology&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Libraries]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48889</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48889"/>
		<updated>2016-11-27T16:54:59Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:QuantitativeReportingLogo.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:QuantitativeReporting-screenshot.jpg|thumb|width=500px|Test]]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/QIICR/QuantitativeReporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.jpg&amp;diff=48778</id>
		<title>File:QuantitativeReporting-screenshot.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.jpg&amp;diff=48778"/>
		<updated>2016-11-25T21:54:19Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: Fedorov uploaded a new version of File:QuantitativeReporting-screenshot.jpg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.jpg&amp;diff=48777</id>
		<title>File:QuantitativeReporting-screenshot.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.jpg&amp;diff=48777"/>
		<updated>2016-11-25T21:53:02Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48774</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48774"/>
		<updated>2016-11-25T21:52:34Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:QuantitativeReportingLogo.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[File:QuantitativeReporting-screenshot.jpg|thumb|width=500px|Test]]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/fedorov/Reporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.png&amp;diff=48773</id>
		<title>File:QuantitativeReporting-screenshot.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:QuantitativeReporting-screenshot.png&amp;diff=48773"/>
		<updated>2016-11-25T21:49:58Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48770</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48770"/>
		<updated>2016-11-25T21:49:47Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:QuantitativeReportingLogo.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Image:QuantitativeReporting-screenshot.png]]&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/fedorov/Reporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=File:QuantitativeReportingLogo.png&amp;diff=48739</id>
		<title>File:QuantitativeReportingLogo.png</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=File:QuantitativeReportingLogo.png&amp;diff=48739"/>
		<updated>2016-11-25T02:57:18Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48736</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48736"/>
		<updated>2016-11-25T02:56:56Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
[[Image:QuantitativeReportingLogo.png]]&lt;br /&gt;
|&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/fedorov/Reporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48733</id>
		<title>Documentation/Nightly/Extensions/QuantitativeReporting</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Extensions/QuantitativeReporting&amp;diff=48733"/>
		<updated>2016-11-25T02:55:24Z</updated>

		<summary type="html">&lt;p&gt;Fedorov: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-header}}&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/module-section|Introduction and Acknowledgements}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-start|{{documentation/modulename}}}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
Extension: [[Documentation/{{documentation/version}}/Extensions/QuantitativeReporting|QuantitativeReporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acknowledgments:&lt;br /&gt;
This work is done as part of the [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)] , and is funded by the National Institutes of Health, National Cancer Institute through the grant U24 CA180918 (PIs Kikinis &amp;amp; Fedorov).&amp;lt;br&amp;gt;&lt;br /&gt;
Author: Christian Herz (SPL), Andrey Fedorov (SPL, BWH), Csaba Pinter (Queen's), Andras Lasso (Queen's), Steve Pieper (Isomics)&amp;lt;br&amp;gt;&lt;br /&gt;
Contact: Andrey Fedorov, fedorov at bwh dot harvard dot edu&amp;lt;br&amp;gt;&lt;br /&gt;
License: [http://www.slicer.org/pages/LicenseText Slicer License]&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-row}}&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-logo-gallery&lt;br /&gt;
|{{collaborator|logo|spl}}|{{collaborator|longname|spl}}&lt;br /&gt;
|{{collaborator|logo|isomics}}|{{collaborator|longname|isomics}}&lt;br /&gt;
|{{collaborator|logo|namic}}|{{collaborator|longname|namic}}&lt;br /&gt;
|{{collaborator|logo|qiicr}}|{{collaborator|longname|qiicr}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/module-introduction-end}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Modules}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|References}}&lt;br /&gt;
* [http://itcr.nci.nih.gov/ Informatics Technology for Cancer Research (ITCR)]&lt;br /&gt;
* [http://imaging.cancer.gov/programsandresources/specializedinitiatives/qin Quantitative Imaging Network (QIN)]&lt;br /&gt;
* Fedorov A, Clunie D, Ulrich E, Bauer C, Wahle A, Brown B, Onken M, Riesmeier J, Pieper S, Kikinis R, Buatti J, Beichel RR. (2016) DICOM for quantitative imaging biomarker development: a standards based approach to sharing clinical data and structured PET/CT analysis results in head and neck cancer research. PeerJ 4:e2057 https://doi.org/10.7717/peerj.2057&lt;br /&gt;
* Sample data: [https://wiki.cancerimagingarchive.net/display/Public/QIN-HEADNECK TCIA QIN-HEADNECK collection]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-section|Information for Developers}}&lt;br /&gt;
* Source code of the extension: https://github.com/fedorov/Reporting&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;br /&gt;
{{documentation/{{documentation/version}}/extension-footer}}&lt;br /&gt;
[[Category:Documentation/{{documentation/version}}/Modules/Informatics]]&lt;br /&gt;
&amp;lt;!-- ---------------------------- --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Fedorov</name></author>
		
	</entry>
</feed>