From 04dc088c089a1ca2f1f72210da1792e2e8c81395 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Wed, 8 Sep 2021 15:57:16 +0200 Subject: [PATCH] Typos found by codespell (#185) --- README.md | 4 ++-- deid/config/__init__.py | 2 +- deid/config/utils.py | 2 +- deid/data/README.md | 1 - deid/dicom/groups.py | 2 +- deid/dicom/parser.py | 2 +- deid/dicom/pixels/clean.py | 2 +- deid/utils/actions.py | 2 +- docs/_docs/development/image-format.md | 4 ++-- docs/_docs/examples/recipe.md | 2 +- docs/_docs/getting-started/dicom-pixels.md | 3 +-- docs/_docs/getting-started/dicom-put.md | 2 +- docs/_docs/user-docs/index.md | 3 --- examples/deid/README.md | 2 +- examples/dicom/pixels/run-cleaner-client.py | 2 +- 15 files changed, 15 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index e53d067c..6f7c82f2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Best effort anonymization for medical images in Python. [![DOI](https://zenodo.org/badge/94163984.svg)](https://zenodo.org/badge/latestdoi/94163984) [![Build Status](https://travis-ci.org/pydicom/deid.svg?branch=master)](https://travis-ci.org/pydicom/deid) -Please see our [Documentation](https://pydicom.github.io/deid/) +Please see our [Documentation](https://pydicom.github.io/deid/). These are basic Python based tools for working with medical images and text, specifically for de-identification. The cleaning method used here mirrors the one by CTP in that we can identify images based on known @@ -35,4 +35,4 @@ docker run pydicom/deid --help ``` ## Issues -If you have an issue, or want to request a feature, please do so on our [issues board](https://www.github.com/pydicom/deid/issues) +If you have an issue, or want to request a feature, please do so on our [issues board](https://www.github.com/pydicom/deid/issues). diff --git a/deid/config/__init__.py b/deid/config/__init__.py index 4bfce7f9..a492b8bb 100644 --- a/deid/config/__init__.py +++ b/deid/config/__init__.py @@ -177,7 +177,7 @@ def ls_fieldlists(self): # Init def _init_deid(self, deid=None, base=False, default_base="dicom"): - """initalize the recipe with one or more deids, optionally including + """initialize the recipe with one or more deids, optionally including the default. This function is called at init time. If you need to add or work with already loaded configurations, use add/remove diff --git a/deid/config/utils.py b/deid/config/utils.py index cc15b1ff..cdc92304 100644 --- a/deid/config/utils.py +++ b/deid/config/utils.py @@ -289,7 +289,7 @@ def parse_label(section, config, section_name, members, label=None): section: the section name (e.g., header) must be one in sections config: the config (dictionary) parsed thus far section_name: an optional name for a section - members: the lines beloning to the section/section_name + members: the lines belonging to the section/section_name label: an optional name for the group of commands """ criteria = {"filters": [], "coordinates": []} diff --git a/deid/data/README.md b/deid/data/README.md index 59090aa9..1162207d 100644 --- a/deid/data/README.md +++ b/deid/data/README.md @@ -30,4 +30,3 @@ def get_dicom(dataset): dicom = get_dicom(dataset) ``` - diff --git a/deid/dicom/groups.py b/deid/dicom/groups.py index 375166dd..df6d070c 100644 --- a/deid/dicom/groups.py +++ b/deid/dicom/groups.py @@ -75,7 +75,7 @@ def extract_values_list(dicom, actions, fields=None): param_name = param_name.strip() param_val = param_val.strip() - # Set a custom parameter legnth + # Set a custom parameter length if param_name == "minlength": minlength = int(param_val) bot.debug("Minimum length set to %s" % minlength) diff --git a/deid/dicom/parser.py b/deid/dicom/parser.py index 4730d648..d2e41d89 100644 --- a/deid/dicom/parser.py +++ b/deid/dicom/parser.py @@ -402,7 +402,7 @@ def update_dicom(element, is_filemeta): # Assume we don't want to add an empty value if value is not None: - # If provided a field object, create based on keyword or tag identifer + # If provided a field object, create based on keyword or tag identifier name = field if isinstance(field, DicomField): name = field.element.keyword or field.stripped_tag diff --git a/deid/dicom/pixels/clean.py b/deid/dicom/pixels/clean.py index e7fb7417..a54dfe8d 100644 --- a/deid/dicom/pixels/clean.py +++ b/deid/dicom/pixels/clean.py @@ -243,7 +243,7 @@ def clean(self, fix_interpretation=True, pixel_data_attribute="PixelData"): # apply final 3D mask to 3D pixel data self.cleaned = final_mask * self.original - # greyscale image: no need to stack into the channel dim since it doesnt exist + # greyscale image: no need to stack into the channel dim since it doesn't exist elif len(self.original.shape) == 2: self.cleaned = mask * self.original diff --git a/deid/utils/actions.py b/deid/utils/actions.py index 8ec7a443..4e6b46b0 100644 --- a/deid/utils/actions.py +++ b/deid/utils/actions.py @@ -84,7 +84,7 @@ def get_func(function_name): def get_timestamp(item_date, item_time=None, jitter_days=None, format=None): """get_timestamp will return (default) a UTC timestamp - with some date and (optionall) time. A different format can be + with some date and (optional) time. A different format can be provided to change default behavior. eg: "%Y%m%d" """ if format is None: diff --git a/docs/_docs/development/image-format.md b/docs/_docs/development/image-format.md index be231368..afb290b2 100644 --- a/docs/_docs/development/image-format.md +++ b/docs/_docs/development/image-format.md @@ -18,13 +18,13 @@ deid This folder, and others like it, should contain should contain the following files: - **config.json** this is the default specification for how a dicom header is parsed, which primarily means additions, and a set of custom actions. - - **__init__.py**: has the purpose of exposing module functions to the higher up folder for import. For example, the function `get_identifiers` in [header.py](header.py) is programatically accessible via `from deid.dicom import get_identifiers` thanks to this file. If you create a new module with the equivalent functions, you should be fine to just copy this file, or import the functions directly from tasks.py in the module folder. + - **__init__.py**: has the purpose of exposing module functions to the higher up folder for import. For example, the function `get_identifiers` in [header.py](header.py) is programmatically accessible via `from deid.dicom import get_identifiers` thanks to this file. If you create a new module with the equivalent functions, you should be fine to just copy this file, or import the functions directly from tasks.py in the module folder. - **header.py**: should contain functions for `get_identifiers`, which should return a dictionary with top level indexes by entity, and the value of each entity another dictionary indexed by the item ids. This data structure, if provided by the client, must be understood by the function `remove_identifiers`. Note that, since we are working in Python, we will be using dicom headers that are mapped from the standard to pydicom, the entire mapping which is provided [here](https://github.com/pydicom/pydicom/blob/master/pydicom/_dicom_dict.py), -and programatically accessible via: +and programmatically accessible via: ```python from pydicom._dicom_dict import DicomDictionary diff --git a/docs/_docs/examples/recipe.md b/docs/_docs/examples/recipe.md index 4507498e..cbf69b07 100644 --- a/docs/_docs/examples/recipe.md +++ b/docs/_docs/examples/recipe.md @@ -58,7 +58,7 @@ recipe.get_format() ``` Note that validation of this structure happens at load time. If something is -incorrecly labeled or formatted, you will get an error message and it will +incorrectly labeled or formatted, you will get an error message and it will fail to load. You can also provide your own deid recipe file, and in doing so, you won't load the default. Here is one from our examples folder diff --git a/docs/_docs/getting-started/dicom-pixels.md b/docs/_docs/getting-started/dicom-pixels.md index 975bd5e3..1da9b24c 100644 --- a/docs/_docs/getting-started/dicom-pixels.md +++ b/docs/_docs/getting-started/dicom-pixels.md @@ -141,7 +141,7 @@ By default, we use a list of rules provided by CTP and other users in [dicom.dei There are two operations we can apply to coordinates: - `keepcoordinates` indicates a set of coordinates that you want to set the mask to a value of 1, to indicate keeping - - `coordinates` indicates a set of coordintes that you want to set the mask to a value of 0, to indicate cleaning. + - `coordinates` indicates a set of coordinates that you want to set the mask to a value of 0, to indicate cleaning. By default, deid will start with a mask of all 1s, indicating that we keep all coordinates. We then apply the list of rules provided by CTP and others in [dicom.deid](https://github.com/pydicom/deid/blob/master/deid/data/deid.dicom) @@ -341,4 +341,3 @@ client.clean(fix_interpretation=False) Please [see the note](https://pydicom.github.io/pydicom/stable/old/image_data_handlers.html#usage) on the pydicom documentation for more details. Also, it would be useful to use machine learning to detect text. if you want to develop this or have ideas, please reach out. - diff --git a/docs/_docs/getting-started/dicom-put.md b/docs/_docs/getting-started/dicom-put.md index f211f63c..e9b1fc4e 100644 --- a/docs/_docs/getting-started/dicom-put.md +++ b/docs/_docs/getting-started/dicom-put.md @@ -300,7 +300,7 @@ cleaned_dicoms = replace_identifiers(dicom_files=dicom_files) ``` The default recipe you can view [here](https://github.com/pydicom/deid/blob/master/deid/data/deid.dicom#L744). -It's fairly agressive and generally removes times and other identifiers. But *you should not use this verbatim!* +It's fairly aggressive and generally removes times and other identifiers. But *you should not use this verbatim!* It's important that you develop a strategy that is most robust for your datasets. The example is provided as a conservative start. If you want to save to temporary files, you can specify save=True: diff --git a/docs/_docs/user-docs/index.md b/docs/_docs/user-docs/index.md index 8dead983..d551b4a3 100644 --- a/docs/_docs/user-docs/index.md +++ b/docs/_docs/user-docs/index.md @@ -23,6 +23,3 @@ these pages will help you to use the deid software. ## Tools - [Tags]({{ site.baseurl }}/user-docs/tags): A few helpful functions for searching and filtering tags. - - - diff --git a/examples/deid/README.md b/examples/deid/README.md index cc2a476a..744751e9 100644 --- a/examples/deid/README.md +++ b/examples/deid/README.md @@ -2,5 +2,5 @@ This is a folder of deid recipe examples. If you have a recipe that you think would be useful for others, please contribute it here! You can also -add it to be included with the library (under ded/data) if you think this +add it to be included with the library (under deid/data) if you think this level of contribution is more relevant. diff --git a/examples/dicom/pixels/run-cleaner-client.py b/examples/dicom/pixels/run-cleaner-client.py index e0b183cd..4683ee9a 100644 --- a/examples/dicom/pixels/run-cleaner-client.py +++ b/examples/dicom/pixels/run-cleaner-client.py @@ -26,7 +26,7 @@ client = DicomCleaner() -# You can set the output folder if you want, otherwis tmpdir is used +# You can set the output folder if you want, otherwise tmpdir is used client = DicomCleaner(output_folder="/home/vanessa/Desktop") # Steps are to detect, clean, and save in desired format, one image