Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions monai/data/image_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_cachedataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_smartcachedataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down