Skip to content

Commit 82dfe8d

Browse files
author
Lee Newberg
committed
DOC: Apply black to Python; supported versions are 3.6-3.9
1 parent e40d186 commit 82dfe8d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ We have set up a demonstration of this using [Binder](www.mybinder.org) that any
2222

2323
[![PyPI Version](https://img.shields.io/pypi/v/itk-spcn.svg)](https://pypi.python.org/pypi/itk-spcn)
2424

25-
ITKColorNormalization and all its dependencies can be easily installed with [Python wheels](https://blog.kitware.com/itk-is-on-pypi-pip-install-itk-is-here/). Wheels have been generated for macOS, Linux, and Windows and several versions of Python, 3.5, 3.6, 3.7, and 3.8. If you do not want the installation to be to your current Python environment, you should first create and activate a [Python virtual environment (venv)](https://docs.python.org/3/tutorial/venv.html) to work in. Then, run the following from the command-line:
25+
ITKColorNormalization and all its dependencies can be easily installed with [Python wheels](https://blog.kitware.com/itk-is-on-pypi-pip-install-itk-is-here/). Wheels have been generated for macOS, Linux, and Windows and several versions of Python, 3.6, 3.7, 3.8, and 3.9. If you do not want the installation to be to your current Python environment, you should first create and activate a [Python virtual environment (venv)](https://docs.python.org/3/tutorial/venv.html) to work in. Then, run the following from the command-line:
2626

2727
```shell-script
2828
pip install itk-spcn
@@ -32,8 +32,9 @@ Launch `python`, import the itk package, and set variable names for the input im
3232

3333
```python
3434
import itk
35-
input_image_filename = 'path/to/image_to_be_normalized'
36-
reference_image_filename = 'path/to/image_to_be_used_as_color_reference'
35+
36+
input_image_filename = "path/to/image_to_be_normalized"
37+
reference_image_filename = "path/to/image_to_be_used_as_color_reference"
3738
```
3839

3940
## Usage in Python
@@ -62,7 +63,8 @@ eager_normalized_image = itk.structure_preserving_color_normalization_filter(
6263
input_image,
6364
reference_image,
6465
color_index_suppressed_by_hematoxylin=0,
65-
color_index_suppressed_by_eosin=1)
66+
color_index_suppressed_by_eosin=1,
67+
)
6668

6769
itk.imwrite(eager_normalized_image, output_image_filename)
6870
```
@@ -75,7 +77,9 @@ Alternatively, you can use the ITK pipeline infrastructure that waits until a ca
7577
input_reader = itk.ImageFileReader.New(FileName=input_image_filename)
7678
reference_reader = itk.ImageFileReader.New(FileName=reference_image_filename)
7779

78-
spcn_filter = itk.StructurePreservingColorNormalizationFilter.New(Input=input_reader.GetOutput())
80+
spcn_filter = itk.StructurePreservingColorNormalizationFilter.New(
81+
Input=input_reader.GetOutput()
82+
)
7983
spcn_filter.SetColorIndexSuppressedByHematoxylin(0)
8084
spcn_filter.SetColorIndexSuppressedByEosin(1)
8185
spcn_filter.SetInput(0, input_reader.GetOutput())

0 commit comments

Comments
 (0)