https://www.slicer.org/w/index.php?title=Modules:AtlasCreator:CLI&feed=atom&action=historyModules:AtlasCreator:CLI - Revision history2024-03-29T09:43:49ZRevision history for this page on the wikiMediaWiki 1.33.0https://www.slicer.org/w/index.php?title=Modules:AtlasCreator:CLI&diff=19635&oldid=prevHaehn: Created page with 'Back to the AtlasCreator documentation.. = AtlasCreator: Commandline Interface = The Atlas Creator comes with a command line interface. This interface …'2011-04-15T00:44:54Z<p>Created page with 'Back to <a href="/wiki/Modules:AtlasCreator" title="Modules:AtlasCreator">the AtlasCreator documentation</a>.. = AtlasCreator: Commandline Interface = The Atlas Creator comes with a command line interface. This interface …'</p>
<p><b>New page</b></p><div>Back to [[Modules:AtlasCreator|the AtlasCreator documentation]]..<br />
<br />
= AtlasCreator: Commandline Interface =<br />
<br />
The Atlas Creator comes with a command line interface. This interface can be used by invoking the following command.<br />
<br />
<pre><br />
# in the source directory<br />
cd Slicer3/Modules/AtlasCreator/<br />
<br />
# or in the build directory<br />
cd Slicer3-build/lib/Slicer3/Modules/AtlasCreator/<br />
<br />
# start the command line interface<br />
python atlascreator.py<br />
</pre><br />
<br />
== Help ==<br />
<br />
A detailed help system is available by calling '''python atlascreator.py --help''':<br />
<br />
<pre><br />
$ cd Slicer3-release/lib/Slicer3/Modules/AtlasCreator/atlascreator.py<br />
$ python atlascreator.py --help<br />
AtlasCreator for 3D Slicer<br />
Version v0.4<br />
<br />
Usage:<br />
<br />
-h, --help<br />
Show this information.<br />
<br />
-i, --images DIR<br />
Directory containing original images.<br />
<br />
-s, --segmentations DIR<br />
Directory containing segmentations.<br />
<br />
-o, --output DIR<br />
Output directory.<br />
<br />
--cmtk<br />
Use the CMTK toolkit for registration and resampling, instead of BRAINSFit.<br />
The CMTK4Slicer extensions have to be installed in order to use CMTK.<br />
<br />
--skipRegistration<br />
Skip the registration and use existing transforms.<br />
<br />
The following arguments have to be specified if the registration is skipped:<br />
<br />
--transforms DIR<br />
Directory containing existing transforms.<br />
<br />
--existingTemplate FILEPATH<br />
Filepath to an existing template used for resampling only.<br />
<br />
--dynamic<br />
Use a dynamic template for registration based on means of images.<br />
<br />
The following arguments have to be specified if dynamic registration is chosen:<br />
<br />
-m, --meanIterations INT<br />
Number of iterations to compute and register against a mean image.<br />
<br />
--fixed<br />
Use a fixed template for registration.<br />
<br />
The following arguments have to be specified if fixed registration is chosen:<br />
<br />
--template FILEPATH<br />
Filepath to an image used as a template for fixed registration.<br />
<br />
--ignoreTemplateSegmentation<br />
If activated, the template's segmentation will not be added to the atlases.<br />
<br />
-n, --non-rigid<br />
Use Non-Rigid registration additionally.<br />
<br />
-w, --writeTransforms<br />
Write transforms to output directory.<br />
<br />
--keepAligned<br />
Keep the aligned images and segmentations.<br />
<br />
-l, --labels STRING<br />
List of labels to include for the atlases, f.e. "3 4 5 6 8 10".<br />
DEFAULT: detect labels automatically<br />
<br />
--normalize<br />
Normalize Atlases to 0..1.<br />
If activated, the output cast will be set to Double.<br />
<br />
--normalizeTo INT<br />
The upper value to normalize the atlases to.<br />
DEFAULT: 1<br />
<br />
--outputCast INT<br />
Output cast for the atlases. Possible values:<br />
0: Char<br />
1: Unsigned Char<br />
2: Double<br />
3: Float<br />
4: Int<br />
5: Unsigned Int<br />
6: Long<br />
7: Unsigned Long<br />
8: Short<br />
9: Unsigned Short<br />
DEFAULT: 8<br />
<br />
-c, --cluster<br />
Use the cluster mode.<br />
<br />
The following arguments have to be specified if cluster mode is chosen:<br />
<br />
--schedulerCommand EXECUTABLE<br />
The executable to use as a scheduler in cluster mode, f.e. "qsub".<br />
<br />
--pca<br />
Perform PCA Analysis on top of Resampling.<br />
<br />
--pcaMaxEigenVectors INT<br />
The number of maximal Eigenvectors to use for model generation.<br />
DEFAULT: 10<br />
<br />
--pcaCombine<br />
Combine the PCA output.<br />
<br />
--slicer FILEPATH<br />
Filepath to the 3D Slicer launcher including arguments, f.e. "/usr/bin/Slicer3 --tmp_dir /var/tmp".<br />
DEFAULT: Find the 3D Slicer launcher automatically.<br />
<br />
-d, --debug<br />
Enable debug information.<br />
<br />
--dryrun<br />
Output executable commands instead of running the registration or resampling.<br />
<br />
--examples<br />
Show usage examples.<br />
<br />
<br />
Developed by Daniel Haehn and Kilian Pohl, University of Pennsylvania. The research was funded by an ARRA supplement to NIH NCRR (P41 RR13218).<br />
<br />
Thanks to everyone!<br />
<br />
<br />
</pre><br />
<br />
<br />
==Examples==<br />
<br />
<pre><br />
$ python atlascreator.py --examples<br />
AtlasCreator for 3D Slicer<br />
Version v0.4<br />
<br />
Examples:<br />
-----------------------------------------------------------------------------------------------<br />
1. Run fixed registration with the testdata and normalize the atlases to 1:<br />
<br />
python atlascreator.py -i TestData/originals/ -s TestData/segmentations/ -o /tmp/acout --fixed --template TestData/originals/case62.nrrd -w -l "3 4 5 6 7 8 9" --normalize<br />
<br />
-----------------------------------------------------------------------------------------------<br />
2. Run fixed registration with the testdata and use CMTK instead of BRAINSFit and label auto-detection:<br />
<br />
python atlascreator.py -i TestData/originals/ -s TestData/segmentations/ -o /tmp/acout --fixed --template TestData/originals/case62.nrrd -w --cmtk<br />
<br />
-----------------------------------------------------------------------------------------------<br />
3. Run dynamic registration with the testdata and normalize the atlases to 0..100:<br />
<br />
python atlascreator.py -i TestData/originals/ -s TestData/segmentations/ -o /tmp/acout --dynamic --meanIterations 5 -w -l "3 4 5 6 7 8 9" --normalize --normalizeTo 100<br />
<br />
-----------------------------------------------------------------------------------------------<br />
4. Run dynamic registration with the testdata on a cluster (scheduler command "qsub -l centos5"):<br />
<br />
python atlascreator.py -i TestData/originals/ -s TestData/segmentations/ -o /tmp/acout --dynamic --meanIterations 5 -w -l "3 4 5 6 7 8 9" --normalize --cluster --schedulerCommand "qsub -l centos5"<br />
<br />
-----------------------------------------------------------------------------------------------<br />
5. Use existing registrations and just re-sample<br />
<br />
python atlascreator.py --skipRegistration --transforms /tmp/acout --existingTemplate TestData/segmentations/case62.nrrd -s TestData/segmentations/ -o /tmp/acout -l "3 4 5 6 7 8 9" --normalize --outputCast 3<br />
<br />
<br />
</pre></div>Haehn