Passed
Push — master ( 1dd98e...68316f )
by Fernando
01:10
created

torchio.cli.print_info   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A main() 0 15 1
1
# pylint: disable=import-outside-toplevel
2
3
"""Console script for torchio."""
4
import sys
5
import click
6
7
8
@click.command()
9
@click.argument('input-path', type=click.Path(exists=True))
10
def main(input_path):
11
    """Print information about an image.
12
13
    \b
14
    Example:
15
    $ tiohd input.nii.gz
16
    """
17
    # Imports are placed here so that the tool loads faster if not being run
18
    import torchio as tio
19
    image = tio.ScalarImage(input_path)
20
    image.load()
21
    print(image)  # noqa: T001
22
    return 0
23
24
25
if __name__ == '__main__':
26
    # pylint: disable=no-value-for-parameter
27
    sys.exit(main())  # pragma: no cover
28