Skip to content

Commit

Permalink
DOCS: Update usage section on commandline usage
Browse files Browse the repository at this point in the history
Show correct way to specify output file in batch processing.
Fix help message in the commandline script showing the default format (is "txt", but help message said "csv").
  • Loading branch information
JoostJM committed Aug 13, 2018
1 parent 1f16b9e commit fe0e2c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion docs/usage.rst
Expand Up @@ -45,7 +45,7 @@ Command Line Use

* To extract features from a batch run::

pyradiomics <path/to/input> <path/to/output>
pyradiomics <path/to/input>

* The input file for batch processing is a CSV file where the first row is contains headers and each subsequent row
represents one combination of an image and a segmentation and contains at least 2 elements: 1) path/to/image,
Expand All @@ -60,6 +60,13 @@ Command Line Use

All headers should be unique and different from headers provided by PyRadiomics (``<filter>_<class>_<feature>``).

* By default, results are printed out to the console window. To store the results in a CSV-structured text file, add the
``-o <PATH>`` and ``-f csv`` arguments, where ``<PATH>`` specifies the filepath where the results should be stored.
e.g.::

pyradiomics <path/to/image> <path/to/segmentation> -o results.csv -f csv
pyradiomics <path/to/input> -o results.csv -f csv

* Extraction can be customized by specifying a `parameter file <radiomics-parameter-file-label>` in the ``--param``
argument and/or by specifying override settings (only `type 3 customization <radiomics-settings-label>`) in the
``--setting`` argument. Multiple overrides can be used by specifying ``--setting`` multiple times.
Expand Down
6 changes: 3 additions & 3 deletions radiomics/scripts/__init__.py
Expand Up @@ -58,11 +58,11 @@ def parse_args(custom_arguments=None):
'invalid result (NaN)')
outputGroup.add_argument('--format', '-f', choices=['csv', 'json', 'txt'], default='txt',
help='Format for the output.\n'
'"csv" (Default): one row of feature names, followed by one row of\n'
'feature values per case.\n'
'"txt" (Default): one feature per line in format "case-N_name:value"\n'
'"json": Features are written in a JSON format dictionary\n'
'(1 dictionary per case, 1 case per line) "{name:value}"\n'
'"txt": one feature per line in format "case-N_name:value"')
'"csv": one row of feature names, followed by one row of\n'
'feature values per case.')
outputGroup.add_argument('--format-path', choices=['absolute', 'relative', 'basename'], default='absolute',
help='Controls input image and mask path formatting in the output.\n'
'"absolute" (Default): Absolute file paths.\n'
Expand Down

0 comments on commit fe0e2c3

Please sign in to comment.