Difference between revisions of "EMSegmenter-CreateTask"
From Slicer Wiki
Line 4: | Line 4: | ||
=Task creation process - for developer= | =Task creation process - for developer= | ||
The goal is to create a task with the name 'Hello World' in Slicer 3 and Slicer 4. Before doing so, we define | The goal is to create a task with the name 'Hello World' in Slicer 3 and Slicer 4. Before doing so, we define | ||
− | < | + | <DIR> = for Slicer 3 as Slicer3/Modules/EMSegment/Tasks/ (source directory) and |
for Slicer 4 as Slicer-build/share/Slicer-4.*/qt-loadable-modules/EMSegment/Tasks (build directory) | for Slicer 4 as Slicer-build/share/Slicer-4.*/qt-loadable-modules/EMSegment/Tasks (build directory) | ||
+ | |||
After following the instructions below the new task will consist of following files: | After following the instructions below the new task will consist of following files: | ||
− | < | + | <DIR>/Hello-World.mrml |
− | + | <DIR>/Hello-World.tcl | |
− | + | <DIR>/Hello-World/<atlas_file_1> | |
− | + | <DIR>/Hello-World/<atlas_file_2> | |
[...] | [...] | ||
− | + | <DIR>/Hello-World/<atlas_file_i> | |
[...] | [...] | ||
− | + | <DIR>/Hello-World/<atlas_file_N> | |
− | * Create a new directory | + | * Create a new directory <DIR>/Hello-World |
* Copy the atlas files for air, GM, T1 into this directory. | * Copy the atlas files for air, GM, T1 into this directory. | ||
Line 28: | Line 29: | ||
** Pre-processing: None | ** Pre-processing: None | ||
* Basically follow our EMSegmenter advanced tutorial, but create a simple tree | * Basically follow our EMSegmenter advanced tutorial, but create a simple tree | ||
− | ** load . | + | ** load <DIR>/../Testing/TestData/MiscVolumeData/MRIHumanBrain_T1_aligned.nrrd |
** Add a channel, call it T1, assign MRIHumanBrain_T1_aligned | ** Add a channel, call it T1, assign MRIHumanBrain_T1_aligned | ||
** Create a simple anatomical tree (air and GM) | ** Create a simple anatomical tree (air and GM) | ||
− | ** Load atlas files only from | + | ** Load atlas files only from <DIR>/Hello-World/ |
** generate mean and covariance values | ** generate mean and covariance values | ||
** specify node weights | ** specify node weights | ||
* At step 9/9. click on 'Create Template File' | * At step 9/9. click on 'Create Template File' | ||
− | ** Save the file under | + | ** Save the file under <DIR>/Hello-World.mrml |
** The target node and some other unneeded nodes will be removed from the mrml scene and written to disk. | ** The target node and some other unneeded nodes will be removed from the mrml scene and written to disk. | ||
* Close Slicer | * Close Slicer | ||
− | * Copy our standard tcl file | + | * Copy our standard tcl file <DIR>/Template.tcl to <DIR>/Hello-World.tcl |
* Adjust this tcl file to include your pre-processing pipeline. | * Adjust this tcl file to include your pre-processing pipeline. | ||
− | * edit | + | * edit <DIR>/Hello-World.tcl to specify your own pre-processing |
− | * edit | + | * edit <DIR>/Hello-World.mrml to use your own pre-processing |
** - <EMS TclTaskFilename="GenericTask.tcl" ></EMS> | ** - <EMS TclTaskFilename="GenericTask.tcl" ></EMS> | ||
** + <EMS TclTaskFilename="Hello-World.tcl" ></EMS> | ** + <EMS TclTaskFilename="Hello-World.tcl" ></EMS> | ||
− | * touch ../Slicer3/Modules/EMSegment/CMakeLists.txt and do a 'make' to copy the new files into the binary directory | + | * For Slicer 3 only : |
+ | touch ../Slicer3/Modules/EMSegment/CMakeLists.txt and do a 'make' to copy the new files into the binary directory | ||
Revision as of 21:24, 2 August 2012
Home < EMSegmenter-CreateTaskReturn to EMSegmenter Task Overview Page
Task creation process - for developer
The goal is to create a task with the name 'Hello World' in Slicer 3 and Slicer 4. Before doing so, we define
<DIR> = for Slicer 3 as Slicer3/Modules/EMSegment/Tasks/ (source directory) and for Slicer 4 as Slicer-build/share/Slicer-4.*/qt-loadable-modules/EMSegment/Tasks (build directory)
After following the instructions below the new task will consist of following files:
<DIR>/Hello-World.mrml <DIR>/Hello-World.tcl <DIR>/Hello-World/<atlas_file_1> <DIR>/Hello-World/<atlas_file_2> [...] <DIR>/Hello-World/<atlas_file_i> [...] <DIR>/Hello-World/<atlas_file_N>
- Create a new directory <DIR>/Hello-World
- Copy the atlas files for air, GM, T1 into this directory.
- Start Slicer
- Switch to the EMSegmenter module
- Create new task
- Name: Hello World
- Pre-processing: None
- Basically follow our EMSegmenter advanced tutorial, but create a simple tree
- load <DIR>/../Testing/TestData/MiscVolumeData/MRIHumanBrain_T1_aligned.nrrd
- Add a channel, call it T1, assign MRIHumanBrain_T1_aligned
- Create a simple anatomical tree (air and GM)
- Load atlas files only from <DIR>/Hello-World/
- generate mean and covariance values
- specify node weights
- At step 9/9. click on 'Create Template File'
- Save the file under <DIR>/Hello-World.mrml
- The target node and some other unneeded nodes will be removed from the mrml scene and written to disk.
- Close Slicer
- Copy our standard tcl file <DIR>/Template.tcl to <DIR>/Hello-World.tcl
- Adjust this tcl file to include your pre-processing pipeline.
- edit <DIR>/Hello-World.tcl to specify your own pre-processing
- edit <DIR>/Hello-World.mrml to use your own pre-processing
- - <EMS TclTaskFilename="GenericTask.tcl" ></EMS>
- + <EMS TclTaskFilename="Hello-World.tcl" ></EMS>
- For Slicer 3 only :
touch ../Slicer3/Modules/EMSegment/CMakeLists.txt and do a 'make' to copy the new files into the binary directory
The result of the process above can also be downloaded here:
After Installing both files this 'Hello World' task will appear in the task list under the name 'Hello World'.
EMSegmenter-Task Template
Please use this wiki page as a template for you task specific Wiki page.