Skip to content

Commit 5200cc6

Browse files
authored
fixes discussion #5678 suppress_invalid_tags (#5721)
Signed-off-by: Wenqi Li <wenqil@nvidia.com> fixes #5678 fixes #5724 fixes #5725 according to https://pydicom.github.io/pydicom/stable/reference/generated/pydicom.dataset.Dataset.html#pydicom.dataset.Dataset.to_json_dict ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <wenqil@nvidia.com>
1 parent ff12159 commit 5200cc6

31 files changed

Lines changed: 56 additions & 54 deletions

monai/apps/detection/networks/retinanet_detector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def postprocess_detections(
604604
) -> List[Dict[str, Tensor]]:
605605
"""
606606
Postprocessing to generate detection result from classification logits and box regression.
607-
Use self.box_selector to select the final outut boxes for each image.
607+
Use self.box_selector to select the final output boxes for each image.
608608
609609
Args:
610610
head_outputs_reshape: reshaped head_outputs. ``head_output_reshape[self.cls_key]`` is a Tensor

monai/apps/nuclick/transforms.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,21 +315,21 @@ def __call__(self, data):
315315
mask = d[self.label] if isinstance(d[self.label], torch.Tensor) else torch.from_numpy(d[self.label])
316316

317317
inc_sig = self.inclusion_map(mask[0], dtype=image.dtype)
318-
inc_sig = self._apply_gaussion(inc_sig)
318+
inc_sig = self._apply_gaussian(inc_sig)
319319
if self.add_exclusion_map:
320320
others = d[self.others] if isinstance(d[self.others], torch.Tensor) else torch.from_numpy(d[self.others])
321321
exc_sig = self.exclusion_map(
322322
others[0], dtype=image.dtype, drop_rate=self.drop_rate, jitter_range=self.jitter_range
323323
)
324-
exc_sig = self._apply_gaussion(exc_sig)
324+
exc_sig = self._apply_gaussian(exc_sig)
325325
image = torch.cat((image, inc_sig[None], exc_sig[None]), dim=0)
326326
else:
327327
image = torch.cat((image, inc_sig[None]), dim=0)
328328

329329
d[self.image] = image if isinstance(d[self.image], torch.Tensor) else convert_to_numpy(image)
330330
return d
331331

332-
def _apply_gaussion(self, t):
332+
def _apply_gaussian(self, t):
333333
if not self.gaussian or torch.count_nonzero(t) == 0:
334334
return t
335335
x = GaussianFilter(spatial_dims=2, truncated=self.truncated, sigma=self.sigma)(t.unsqueeze(0).unsqueeze(0))
@@ -500,19 +500,19 @@ def get_patches_and_signals(self, img, click_map, bounding_boxes, cx, cy, x, y):
500500
this_click_map[cx[i], cy[i]] = 1
501501

502502
nuc_points = this_click_map[x_start:x_end, y_start:y_end]
503-
nuc_points = self._apply_gaussion(nuc_points)
503+
nuc_points = self._apply_gaussian(nuc_points)
504504

505505
if self.add_exclusion_map:
506506
others_click_map = ((click_map - this_click_map) > 0).type(img.dtype)
507507
other_points = others_click_map[x_start:x_end, y_start:y_end]
508-
other_points = self._apply_gaussion(other_points)
508+
other_points = self._apply_gaussian(other_points)
509509
patches.append(torch.cat([patch, nuc_points[None], other_points[None]]))
510510
else:
511511
patches.append(torch.cat([patch, nuc_points[None]]))
512512

513513
return torch.stack(patches)
514514

515-
def _apply_gaussion(self, t):
515+
def _apply_gaussian(self, t):
516516
if not self.gaussian or torch.count_nonzero(t) == 0:
517517
return t
518518
x = GaussianFilter(spatial_dims=2, truncated=self.truncated, sigma=self.sigma)(t.unsqueeze(0).unsqueeze(0))

monai/apps/pathology/engines/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class PrepareBatchHoVerNet(PrepareBatch):
2828
2929
Args:
3030
extra_keys: If a sequence of strings is provided, values from the input dictionary are extracted from
31-
those keys and passed to the nework as extra positional arguments.
31+
those keys and passed to the network as extra positional arguments.
3232
"""
3333

3434
def __init__(self, extra_keys: Sequence[str]) -> None:

monai/apps/reconstruction/transforms/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __init__(
5050
same length as center_fractions. If multiple values are
5151
provided, then one of these is chosen uniformly each time.
5252
spatial_dims: Number of spatial dims (e.g., it's 2 for a 2D data;
53-
it's also 2 for psuedo-3D datasets like the fastMRI dataset).
53+
it's also 2 for pseudo-3D datasets like the fastMRI dataset).
5454
The last spatial dim is selected for sampling. For the fastMRI
5555
dataset, k-space has the form (...,num_slices,num_coils,H,W)
5656
and sampling is done along W. For a general 3D data with the

monai/apps/reconstruction/transforms/dictionary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class RandomKspaceMaskd(RandomizableTransform, MapTransform):
8383
same length as center_fractions. If multiple values are provided,
8484
then one of these is chosen uniformly each time.
8585
spatial_dims: Number of spatial dims (e.g., it's 2 for a 2D data; it's
86-
also 2 for psuedo-3D datasets like the fastMRI dataset).
86+
also 2 for pseudo-3D datasets like the fastMRI dataset).
8787
The last spatial dim is selected for sampling. For the fastMRI
8888
dataset, k-space has the form (...,num_slices,num_coils,H,W)
8989
and sampling is done along W. For a general 3D data with the
@@ -151,7 +151,7 @@ class EquispacedKspaceMaskd(RandomKspaceMaskd):
151151
length as center_fractions. If multiple values are provided,
152152
then one of these is chosen uniformly each time.
153153
spatial_dims: Number of spatial dims (e.g., it's 2 for a 2D data;
154-
it's also 2 for psuedo-3D datasets like the fastMRI dataset).
154+
it's also 2 for pseudo-3D datasets like the fastMRI dataset).
155155
The last spatial dim is selected for sampling. For the fastMRI
156156
dataset, k-space has the form (...,num_slices,num_coils,H,W)
157157
and sampling is done along W. For a general 3D data with the shape

monai/bundle/scripts.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def get_all_bundles_list(
366366
"""
367367
Get all bundles names (and the latest versions) that are stored in the release of specified repository
368368
with the provided tag. The default values of arguments correspond to the release of MONAI model zoo.
369-
In order to increase the rate limits of calling GIthub APIs, you can input your personal access token.
369+
In order to increase the rate limits of calling Github APIs, you can input your personal access token.
370370
Please check the following link for more details about rate limiting:
371371
https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
372372
@@ -401,7 +401,7 @@ def get_bundle_versions(
401401
"""
402402
Get the latest version, as well as all existing versions of a bundle that is stored in the release of specified
403403
repository with the provided tag.
404-
In order to increase the rate limits of calling GIthub APIs, you can input your personal access token.
404+
In order to increase the rate limits of calling Github APIs, you can input your personal access token.
405405
Please check the following link for more details about rate limiting:
406406
https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
407407
@@ -439,7 +439,7 @@ def get_bundle_info(
439439
Get all information
440440
(include "id", "name", "size", "download_count", "browser_download_url", "created_at", "updated_at") of a bundle
441441
with the specified bundle name and version.
442-
In order to increase the rate limits of calling GIthub APIs, you can input your personal access token.
442+
In order to increase the rate limits of calling Github APIs, you can input your personal access token.
443443
Please check the following link for more details about rate limiting:
444444
https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
445445
@@ -544,7 +544,7 @@ def run(
544544
logging_file: config file for `logging` module in the program, default to `None`. for more details:
545545
https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig.
546546
tracking: enable the experiment tracking feature at runtime with optionally configurable and extensible.
547-
if "mlflow", will add `MLFlowHandler` to the parsed bundle with default loggging settings,
547+
if "mlflow", will add `MLFlowHandler` to the parsed bundle with default logging settings,
548548
if other string, treat it as file path to load the logging settings, if `dict`,
549549
treat it as logging settings, otherwise, use all the default settings.
550550
will patch the target config content with `tracking handlers` and the top-level items of `configs`.
@@ -925,6 +925,8 @@ def init_bundle(
925925
network: if given instead of ckpt_file this network's weights will be stored in bundle
926926
dataset_license: if `True`, a default license file called "data_license.txt" will be produced. This
927927
file is required if there are any license conditions stated for data your bundle uses.
928+
metadata_str: optional metadata string to write to bundle, if not given a default will be used.
929+
inference_str: optional inference string to write to bundle, if not given a default will be used.
928930
"""
929931
if metadata_str is None:
930932
metadata_str = DEFAULT_METADATA

monai/bundle/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
},
154154
}
155155

156-
DEFAULT_EXP_MGMT_SETTINGS = {"mlflow": DEFAULT_MLFLOW_SETTINGS} # default expriment management settings
156+
DEFAULT_EXP_MGMT_SETTINGS = {"mlflow": DEFAULT_MLFLOW_SETTINGS} # default experiment management settings
157157

158158

159159
def load_bundle_config(bundle_path: str, *config_names, **load_kw_args) -> Any:

monai/data/box_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def non_max_suppression(
10551055
boxes_t, *_ = convert_data_type(boxes, torch.Tensor)
10561056
scores_t, *_ = convert_to_dst_type(scores, boxes_t)
10571057

1058-
# sort boxes in desending order according to the scores
1058+
# sort boxes in descending order according to the scores
10591059
sort_idxs = torch.argsort(scores_t, dim=0, descending=True)
10601060
boxes_sort = deepcopy(boxes_t)[sort_idxs, :]
10611061

monai/data/dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,10 +978,10 @@ class SmartCacheDataset(Randomizable, CacheDataset):
978978
will take the minimum of (cache_num, data_length x cache_rate, data_length).
979979
num_init_workers: the number of worker threads to initialize the cache for first epoch.
980980
If num_init_workers is None then the number returned by os.cpu_count() is used.
981-
If a value less than 1 is speficied, 1 will be used instead.
981+
If a value less than 1 is specified, 1 will be used instead.
982982
num_replace_workers: the number of worker threads to prepare the replacement cache for every epoch.
983983
If num_replace_workers is None then the number returned by os.cpu_count() is used.
984-
If a value less than 1 is speficied, 1 will be used instead.
984+
If a value less than 1 is specified, 1 will be used instead.
985985
progress: whether to display a progress bar when caching for the first epoch.
986986
shuffle: whether to shuffle the whole data list before preparing the cache content for first epoch.
987987
it will not modify the original input data sequence in-place.

monai/data/fft_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def ifftn_centered(ksp: NdarrayOrTensor, spatial_dims: int, is_complex: bool = True) -> NdarrayOrTensor:
2020
"""
2121
Pytorch-based ifft for spatial_dims-dim signals. "centered" means this function automatically takes care
22-
of the required ifft and fft shifts. This function calls monai.metworks.blocks.fft_utils_t.ifftn_centered_t.
22+
of the required ifft and fft shifts. This function calls monai.networks.blocks.fft_utils_t.ifftn_centered_t.
2323
This is equivalent to do fft in numpy based on numpy.fft.ifftn, numpy.fft.fftshift, and numpy.fft.ifftshift
2424
2525
Args:
@@ -58,7 +58,7 @@ def ifftn_centered(ksp: NdarrayOrTensor, spatial_dims: int, is_complex: bool = T
5858
def fftn_centered(im: NdarrayOrTensor, spatial_dims: int, is_complex: bool = True) -> NdarrayOrTensor:
5959
"""
6060
Pytorch-based fft for spatial_dims-dim signals. "centered" means this function automatically takes care
61-
of the required ifft and fft shifts. This function calls monai.metworks.blocks.fft_utils_t.fftn_centered_t.
61+
of the required ifft and fft shifts. This function calls monai.networks.blocks.fft_utils_t.fftn_centered_t.
6262
This is equivalent to do ifft in numpy based on numpy.fft.fftn, numpy.fft.fftshift, and numpy.fft.ifftshift
6363
6464
Args:

0 commit comments

Comments
 (0)