Difference between revisions of "Documentation/4.0/Modules/EMSegment Command-line"

From Slicer Wiki
Jump to: navigation, search
(Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<noinclude>{{documentation/versioncheck}}</noinclude>
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-header}}
 
{{documentation/{{documentation/version}}/module-header}}
Line 20: Line 21:
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
 
{{documentation/{{documentation/version}}/module-section|Module Description}}
{{documentation/{{documentation/version}}/module-description|xmlurl=http://viewvc.slicer.org/viewvc.cgi/Slicer3/trunk/Modules/EMSegment/CommandLineApplication/EMSegmentCommandLine.xml?revision=16914&view=co}}
+
{{documentation/{{documentation/version}}/module-description}}
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 27: Line 28:
 
The primary function of the <B>EMSegmenter</B> module is to step the user through the process of calibrating, via algorithm parameters, the segmentation algorithm to a particular set of input data.  However, once a successful collection of parameters is established, the user will commonly want to bypass this detailed calibration process when segmenting new images by using those parameters collected from the calibration process in <B>EMSegmenter</B> module. The <B>EMSegment Command-line module</B> which wraps the <B>EMSegmentCommandLine executable</B> provides this batch processing capability. The <B>EMSegment Command-line module</B> is automatic generated from the <B>EMSegmentCommandLine executable</B> using the --xml option.
 
The primary function of the <B>EMSegmenter</B> module is to step the user through the process of calibrating, via algorithm parameters, the segmentation algorithm to a particular set of input data.  However, once a successful collection of parameters is established, the user will commonly want to bypass this detailed calibration process when segmenting new images by using those parameters collected from the calibration process in <B>EMSegmenter</B> module. The <B>EMSegment Command-line module</B> which wraps the <B>EMSegmentCommandLine executable</B> provides this batch processing capability. The <B>EMSegment Command-line module</B> is automatic generated from the <B>EMSegmentCommandLine executable</B> using the --xml option.
  
===Use Cases, Examples, Tutorials===
+
This module is especially appropriate for segmenting large quantity of data by scripted/batch processing. It requires predefined parameter set, and new target/atlas images can be specified on command line. A list of predefined task is given [[ EMSegmenter-Tasks | here]].
  
This module is especially appropriate for segmenting large quantity of data by scripted/batch processing. It requires predefined parameter set, and new target/atlas images can be specified on command line.
+
<!-- ---------------------------- -->
 
+
{{documentation/{{documentation/version}}/module-section|Tutorials}}
* A full Tutorial for all three EMSegment modules
 
  
These slides and data describe the Slicer3 implementation of all three EMSegment modules and demonstrate their use.  A recent (later than 7Jan08) version of Slicer3 is required to run the test data.
+
These slides and data describe the Slicer3 implementation of all three EMSegment modules and demonstrate their use.
  
 
[[Media:EMSegTutorial-AHM2008.ppt | Slides]] - [[Media:EMSegTutorial-AHM2008.zip | Data]]
 
[[Media:EMSegTutorial-AHM2008.ppt | Slides]] - [[Media:EMSegTutorial-AHM2008.zip | Data]]
 
* Export EMSEG_TUTORIAL_DIR environment variable ( e.g. <PATH TO TUTORIAL> = /tmp/EMSegmentTutorial-Jan2008/ )
 
export EMSEG_TUTORIAL_DIR=<PATH_TO_TUTORIAL>
 
 
===Quick Tour of Features and Use===
 
 
The above EMSegment tutorial data set demonstrates the use of the command line interface.
 
 
If the command-line module is invoked from Slicer3 GUI, there will be a '''Parameters panel:''' [[Image:EMSegment-CL-Panel.png|400px|thumb|EMSegment Simple Parameters Panel]]
 
# MRML Scene: Select the mrml scene  for the tutorial parameter set
 
# Result Labelmap: Select a new image filename for output labelmap
 
# Target Volumes: Select input target volumes (Multiple files can be selected at one time)
 
# Click `Apply’
 
 
Here are some basic examples to run this module from command line directly
 
 
* Export the Slicer3_HOME environment variable ( e.g. <PATH_TO_SLICER> = /tmp/3DSlicer/Slicer3-build/ )
 
export Slicer3_HOME=<PATH_TO_SLICER>
 
 
* Run the executable to see the documentation
 
${Slicer3_HOME}/Slicer3 --launch $Slicer3_HOME/lib/Slicer3/Plugins/EMSegmentCommandLine --help
 
 
* Run the segmentation algorithm with tutorial data
 
The script "Run-BrainTutorial-Defaults.sh" demonstrates how to run the EMSegmenter on the tutorial data. The resulting labelmap is written into the VolumeData_Output directory.  Try adding the "--intermediateResultsDirectory myDirectoryName" flag to write out intermediate data.  Intermediate data is saved in the "myDirectoryName" directory: you can load this scene to visualize the intermediate data (e.g. intensity normalized and registered images) and segmentation results.
 
 
source ${Slicer3_HOME}/bin/Slicer3SetupPaths.sh
 
RUN_NAME=BrainTutorial-Defaults
 
mkdir -p $EMSEG_TUTORIAL_DIR/Working/$RUN_NAME
 
${Slicer3_HOME}/Slicer3 --launch $Slicer3_HOME/lib/Slicer3/Plugins/EMSegmentCommandLine \
 
--verbose \
 
--mrmlSceneFileName $EMSEG_TUTORIAL_DIR/EMSeg-Brain-MRT1T2.mrml \
 
--intermediateResultsDirectory $EMSEG_TUTORIAL_DIR/Working/$RUN_NAME \
 
--resultVolumeFileName $EMSEG_TUTORIAL_DIR/VolumeData_Output/Segmentation-$RUN_NAME.nhdr \
 
 
* Run the segmentation algorithm with new data
 
The other script, "BrainTutorial-SetTarget1.sh" demonstrate how to run the EMSegmenter on new
 
data. Because the tutorial EMSegment parameters are designed to  accept one T1 and one T2 input image, each script supplies one new T1 and one T2 to be segmented (NB: order is important).
 
 
source ${Slicer3_HOME}/bin/Slicer3SetupPaths.sh
 
RUN_NAME=BrainTutorial-SetTarget
 
mkdir -p $EMSEG_TUTORIAL_DIR/Working/$RUN_NAME
 
${Slicer3_HOME}/Slicer3 --launch $Slicer3_HOME/lib/Slicer3/Plugins/EMSegmentCommandLine \
 
--verbose \
 
--mrmlSceneFileName $EMSEG_TUTORIAL_DIR/EMSeg-Brain-MRT1T2.mrml \
 
--targetVolumeFileNames \
 
    $EMSEG_TUTORIAL_DIR/VolumeData_Input/Target/t1.nhdr,$EMSEG_TUTORIAL_DIR/VolumeData_Input/Target/t2.nhdr \
 
--resultVolumeFileName \
 
    VolumeData_Output/Segmentation-$RUN_NAME.nhdr \
 
--intermediateResultsDirectory \
 
    $EMSEG_TUTORIAL_DIR/Working/$RUN_NAME \
 
 
* Run the MRI-Human-Brain task
 
 
source ${Slicer3_HOME}/bin/Slicer3SetupPaths.sh
 
${Slicer3_HOME}/Slicer3 --launch $Slicer3_HOME/lib/Slicer3/Plugins/EMSegmentCommandLine \
 
--verbose \
 
--mrmlSceneFileName \
 
    $Slicer3_HOME/share/Slicer3/Modules/EMSegment/Tasks/MRI-Human-Brain.mrml \
 
--targetVolumeFileNames  \
 
    $Slicer3_HOME/../Slicer3/Modules/EMSegment/Testing/TestData/MiscVolumeData/MRIHumanBrain_T1_aligned.nrrd \
 
--resultVolumeFileName \
 
    /tmp/Result_MRI-Human-Brain.nhdr \
 
 
Most frequently used for these scenarios:
 
 
 
 
* Use Case 1:
 
* Use Case 2:
 
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Tutorials}}
 
Links to tutorials that use this module
 
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
Line 115: Line 42:
 
A list of all the panels in the interface, their features, what they mean, and how to use them. For instance:
 
A list of all the panels in the interface, their features, what they mean, and how to use them. For instance:
  
{|style="width: 100%"
+
{{documentation/{{documentation/version}}/module-parametersdescription}}
|
 
* Input panel1:
 
** First input
 
** Second input
 
* Parameters panel:
 
** First parameter
 
** Second parameter
 
* Output panel:
 
** First output
 
** Second output
 
* Viewing panel:
 
| align="right" |
 
[[Image:screenshotBlankNotOptional.png|thumb|280px|Name of panel 1]]
 
|-
 
|
 
* Input panel2:
 
** First input
 
** Second input
 
* Parameters panel:
 
** First parameter
 
** Second parameter
 
* Output panel:
 
** First output
 
** Second output
 
* Viewing panel:
 
| align="right" |
 
[[Image:screenshotBlankNotOptional.png|thumb|280px|Name of panel 2]]
 
|}
 
 
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Similar Modules}}
 
* Point to other modules that have similar functionality
 
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|References}}
 
{{documentation/{{documentation/version}}/module-section|References}}
Publications related to this module go here. Links to pdfs would be useful.
+
Pohl K, Bouix S, Nakamura M, Rohlfing T, McCarley R, Kikinis R, Grimson W, Shenton M, Wells W. [http://www.slicer.org/pages/Special:PubDB_View?dspaceid=608 A Hierarchical Algorithm for MR Brain Image Parcellation.] IEEE Transactions on Medical Imaging. 2007 Sept;26(9):1201-1212.
For extensions: link to the source code repository and additional documentation
 
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
{{documentation/{{documentation/version}}/module-developerinfo|ModuleTemplate|type=Interactive|category=Example}}
+
{{documentation/{{documentation/version}}/module-developerinfo}}
 
 
 
 
<!-- ----------------------------------------------------------------- -->
 
<!-- THE FOLLOWING SHOULD BE REMOVED FOR YOUR OWN MODULE DOCUMENTATION -->
 
<!-- ----------------------------------------------------------------- -->
 
{{note}}The section above is generated using the following wiki code:
 
<pre>
 
{{documentation/{{documentation/version}}/module-section|Information for Developers}}
 
{{documentation/{{documentation/version}}/module-developerinfo|ModuleTemplate|type=Interactive|category=Example}}
 
</pre>
 
 
 
If you are documenting a CLI, the category should be extracted from the corresponding XML description. This could be done automatically using the following wiki template:<pre>{{documentation/{{documentation/version}}/module-category|xmlurl=http://path/to/YOURMODULENAME.xml }}</pre>
 
 
 
If your module is available in Slicer repository, the following template could be useful to obtain the corresponding URL:
 
<pre>{{documentation/{{documentation/version}}/module-cli-xmlurl|{{documentation/modulename}}|SVNREVISION}}</pre>
 
 
 
Using this later template, the final syntax would be:
 
<pre>{{documentation/{{documentation/version}}/module-category|xmlurl={{documentation/{{documentation/version}}/module-cli-xmlurl|{{documentation/modulename}}|SVNREVISION}} }}</pre>
 
<!-- ----------------------------------------------------------------- -->
 
<!-- ----------------------------------------------------------------- -->
 
<!-- ----------------------------------------------------------------- -->
 
 
 
  
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->
{{documentation/{{documentation/version}}/module-footer|category=Example}}
+
{{documentation/{{documentation/version}}/module-footer}}
 
<!-- ---------------------------- -->
 
<!-- ---------------------------- -->

Latest revision as of 07:31, 14 June 2013

Home < Documentation < 4.0 < Modules < EMSegment Command-line


For the latest Slicer documentation, visit the read-the-docs.



Introduction and Acknowledgements

This work was funded by the ARRA Supplement to the Neuroimage Analysis Center (NAC), funded by the National Institutes of Health. Information on NAC can be obtained from the NAC website.
Author: Kilian Pohl, UPenn
Contributor1: Daniel Haehn, UPENN
Contact: Kilian Pohl, <email>pohl.kilian@gmail.com</email>

University of Pennsylvania  
Surgical Planning Laboratory  

Module Description

Use Cases

The primary function of the EMSegmenter module is to step the user through the process of calibrating, via algorithm parameters, the segmentation algorithm to a particular set of input data. However, once a successful collection of parameters is established, the user will commonly want to bypass this detailed calibration process when segmenting new images by using those parameters collected from the calibration process in EMSegmenter module. The EMSegment Command-line module which wraps the EMSegmentCommandLine executable provides this batch processing capability. The EMSegment Command-line module is automatic generated from the EMSegmentCommandLine executable using the --xml option.

This module is especially appropriate for segmenting large quantity of data by scripted/batch processing. It requires predefined parameter set, and new target/atlas images can be specified on command line. A list of predefined task is given here.

Tutorials

These slides and data describe the Slicer3 implementation of all three EMSegment modules and demonstrate their use.

Slides - Data

Panels and their use

A list of all the panels in the interface, their features, what they mean, and how to use them. For instance:

Parameters:





     * '
     
       ** ': 
     
   
 


References

Pohl K, Bouix S, Nakamura M, Rohlfing T, McCarley R, Kikinis R, Grimson W, Shenton M, Wells W. A Hierarchical Algorithm for MR Brain Image Parcellation. IEEE Transactions on Medical Imaging. 2007 Sept;26(9):1201-1212.

Information for Developers