Skip to content

Commit

Permalink
Typos found by codespell (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Sep 8, 2021
1 parent 418ce32 commit 04dc088
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
2 changes: 1 addition & 1 deletion deid/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deid/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": []}
Expand Down
1 change: 0 additions & 1 deletion deid/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ def get_dicom(dataset):

dicom = get_dicom(dataset)
```

2 changes: 1 addition & 1 deletion deid/dicom/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion deid/dicom/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deid/dicom/pixels/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion deid/utils/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/development/image-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/examples/recipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions docs/_docs/getting-started/dicom-pixels.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.

2 changes: 1 addition & 1 deletion docs/_docs/getting-started/dicom-put.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions docs/_docs/user-docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.



2 changes: 1 addition & 1 deletion examples/deid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion examples/dicom/pixels/run-cleaner-client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04dc088

Please sign in to comment.