diff --git a/monai/data/image_writer.py b/monai/data/image_writer.py index b9e8b9e68e..5b47a5e6e5 100644 --- a/monai/data/image_writer.py +++ b/monai/data/image_writer.py @@ -405,7 +405,7 @@ def set_data_array( ``None`` indicates data without any channel dimension. squeeze_end_dims: if ``True``, any trailing singleton dimensions will be removed. kwargs: keyword arguments passed to ``self.convert_to_channel_last``, - currently support ``spatial_ndim`` and ``contiguous``, defauting to ``3`` and ``False`` respectively. + currently support ``spatial_ndim`` and ``contiguous``, defaulting to ``3`` and ``False`` respectively. """ n_chns = data_array.shape[channel_dim] if channel_dim is not None else 0 self.data_obj = self.convert_to_channel_last( @@ -424,7 +424,7 @@ def set_data_array( def set_metadata(self, meta_dict: Mapping | None = None, resample: bool = True, **options): """ - Resample ``self.dataobj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. + Resample ``self.data_obj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. Args: meta_dict: a metadata dictionary for affine, original affine and spatial shape information. @@ -575,7 +575,7 @@ def set_data_array( ``None`` indicates data without any channel dimension. squeeze_end_dims: if ``True``, any trailing singleton dimensions will be removed. kwargs: keyword arguments passed to ``self.convert_to_channel_last``, - currently support ``spatial_ndim``, defauting to ``3``. + currently support ``spatial_ndim``, defaulting to ``3``. """ self.data_obj = self.convert_to_channel_last( data=data_array, @@ -586,7 +586,7 @@ def set_data_array( def set_metadata(self, meta_dict: Mapping | None, resample: bool = True, **options): """ - Resample ``self.dataobj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. + Resample ``self.data_obj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. Args: meta_dict: a metadata dictionary for affine, original affine and spatial shape information. @@ -726,7 +726,7 @@ def set_data_array( squeeze_end_dims: if ``True``, any trailing singleton dimensions will be removed. contiguous: if ``True``, the data array will be converted to a contiguous array. Default is ``False``. kwargs: keyword arguments passed to ``self.convert_to_channel_last``, - currently support ``spatial_ndim``, defauting to ``2``. + currently support ``spatial_ndim``, defaulting to ``2``. """ self.data_obj = self.convert_to_channel_last( data=data_array, @@ -738,7 +738,7 @@ def set_data_array( def set_metadata(self, meta_dict: Mapping | None = None, resample: bool = True, **options): """ - Resample ``self.dataobj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. + Resample ``self.data_obj`` if needed. This method assumes ``self.data_obj`` is a 'channel-last' ndarray. Args: meta_dict: a metadata dictionary for affine, original affine and spatial shape information. diff --git a/tests/data/test_cachedataset.py b/tests/data/test_cachedataset.py index 0c0a7ef286..e0bf9a5b93 100644 --- a/tests/data/test_cachedataset.py +++ b/tests/data/test_cachedataset.py @@ -57,7 +57,7 @@ def test_shape(self, transform, expected_shape): self.assertEqual(len(data3), 1) if transform is None: - # Check without providing transfrom + # Check without providing transform dataset2 = CacheDataset(data=test_data, cache_rate=0.5, as_contiguous=True) for k in ["image", "label", "extra"]: self.assertEqual(dataset[0][k], dataset2[0][k]) diff --git a/tests/data/test_smartcachedataset.py b/tests/data/test_smartcachedataset.py index 7e59747c5c..9fca5d6dcd 100644 --- a/tests/data/test_smartcachedataset.py +++ b/tests/data/test_smartcachedataset.py @@ -61,7 +61,7 @@ def test_shape(self, replace_rate, num_replace_workers, transform): num_replace_workers=num_replace_workers, ) if transform is None: - # Check without providing transfrom + # Check without providing transform dataset2 = SmartCacheDataset( data=test_data, replace_rate=replace_rate,