Skip to content
Merged
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
8 changes: 4 additions & 4 deletions monai/apps/deepedit/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,12 +614,12 @@ class AddGuidanceFromPointsDeepEditd(Transform):
Args:
ref_image: key to reference image to fetch current and original image details.
guidance: output key to store guidance.
meta_keys: explicitly indicate the key of the meta data dictionary of `ref_image`.
meta_keys: explicitly indicate the key of the metadata dictionary of `ref_image`.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
if None, will try to construct meta_keys by `{ref_image}_{meta_key_postfix}`.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to to fetch the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to to fetch the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.

Expand Down
48 changes: 24 additions & 24 deletions monai/apps/deepgrow/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ class SpatialCropForegroundd(MapTransform):
allow_smaller: when computing box size with `margin`, whether allow the image size to be smaller
than box size, default to `True`. if the margined size is bigger than image size, will pad with
specified `mode`.
meta_keys: explicitly indicate the key of the corresponding meta data dictionary.
meta_keys: explicitly indicate the key of the corresponding metadata dictionary.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
it can be a sequence of string, map to the `keys`.
if None, will try to construct meta_keys by `key_{meta_key_postfix}`.
meta_key_postfix: if meta_keys is None, use `{key}_{meta_key_postfix}` to fetch/store the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_keys is None, use `{key}_{meta_key_postfix}` to fetch/store the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.
start_coord_key: key to record the start coordinate of spatial bounding box for foreground.
Expand Down Expand Up @@ -475,12 +475,12 @@ class AddGuidanceFromPointsd(Transform):
depth_first: if depth (slices) is positioned at first dimension.
spatial_dims: dimensions based on model used for deepgrow (2D vs 3D).
slice_key: key that represents applicable slice to add guidance.
meta_keys: explicitly indicate the key of the meta data dictionary of `ref_image`.
meta_keys: explicitly indicate the key of the metadata dictionary of `ref_image`.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
if None, will try to construct meta_keys by `{ref_image}_{meta_key_postfix}`.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to fetch the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to fetch the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.

Expand Down Expand Up @@ -589,13 +589,13 @@ class SpatialCropGuidanced(MapTransform):
guidance: key to the guidance. It is used to generate the bounding box of foreground
spatial_size: minimal spatial size of the image patch e.g. [128, 128, 128] to fit in.
margin: add margin value to spatial dims of the bounding box, if only 1 value provided, use it for all dims.
meta_keys: explicitly indicate the key of the corresponding meta data dictionary.
meta_keys: explicitly indicate the key of the corresponding metadata dictionary.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
it can be a sequence of string, map to the `keys`.
if None, will try to construct meta_keys by `key_{meta_key_postfix}`.
meta_key_postfix: if meta_keys is None, use `key_{postfix}` to fetch the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_keys is None, use `key_{postfix}` to fetch the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.
start_coord_key: key to record the start coordinate of spatial bounding box for foreground.
Expand Down Expand Up @@ -712,12 +712,12 @@ class ResizeGuidanced(Transform):
Args:
guidance: key to guidance
ref_image: key to reference image to fetch current and original image details
meta_keys: explicitly indicate the key of the meta data dictionary of `ref_image`.
meta_keys: explicitly indicate the key of the metadata dictionary of `ref_image`.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
if None, will try to construct meta_keys by `{ref_image}_{meta_key_postfix}`.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to to fetch the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_key is None, use `{ref_image}_{meta_key_postfix}` to to fetch the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.
cropped_shape_key: key that records cropped shape for foreground.
Expand Down Expand Up @@ -787,13 +787,13 @@ class RestoreLabeld(MapTransform):
align_corners: Geometrically, we consider the pixels of the input as squares rather than points.
See also: https://pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html
It also can be a sequence of bool, each element corresponds to a key in ``keys``.
meta_keys: explicitly indicate the key of the corresponding meta data dictionary.
meta_keys: explicitly indicate the key of the corresponding metadata dictionary.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
it can be a sequence of string, map to the `keys`.
if None, will try to construct meta_keys by `key_{meta_key_postfix}`.
meta_key_postfix: if meta_key is None, use `key_{meta_key_postfix} to fetch the meta data according
to the key data, default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: if meta_key is None, use `key_{meta_key_postfix} to fetch the metadata according
to the key data, default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.
start_coord_key: key that records the start coordinate of spatial bounding box for foreground.
Expand Down Expand Up @@ -897,13 +897,13 @@ class Fetch2DSliced(MapTransform):
keys: keys of the corresponding items to be transformed.
guidance: key that represents guidance.
axis: axis that represents slice in 3D volume.
meta_keys: explicitly indicate the key of the corresponding meta data dictionary.
meta_keys: explicitly indicate the key of the corresponding metadata dictionary.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, original_shape, etc.
the metadata is a dictionary object which contains: filename, original_shape, etc.
it can be a sequence of string, map to the `keys`.
if None, will try to construct meta_keys by `key_{meta_key_postfix}`.
meta_key_postfix: use `key_{meta_key_postfix}` to fetch the meta data according to the key data,
default is `meta_dict`, the meta data is a dictionary object.
meta_key_postfix: use `key_{meta_key_postfix}` to fetch the metadata according to the key data,
default is `meta_dict`, the metadata is a dictionary object.
For example, to handle key `image`, read/write affine matrices from the
metadata `image_meta_dict` dictionary's `affine` field.
allow_missing_keys: don't raise exception if key is missing.
Expand Down
2 changes: 1 addition & 1 deletion monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ def ckpt_export(
else:
copy_model_state(dst=net, src=ckpt_file_ if key_in_ckpt_ == "" else ckpt_file_[key_in_ckpt_])

# convert to TorchScript model and save with meta data, config content
# convert to TorchScript model and save with metadata, config content
net = convert_to_torchscript(model=net)

extra_files: Dict = {}
Expand Down
4 changes: 2 additions & 2 deletions monai/data/csv_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CSVSaver:
Save the data in a dictionary format cache, and write to a CSV file finally.
Typically, the data can be classification predictions, call `save` for single data
or call `save_batch` to save a batch of data together, and call `finalize` to write
the cached data into CSV file. If no meta data provided, use index from 0 to save data.
the cached data into CSV file. If no metadata provided, use index from 0 to save data.
Note that this saver can't support multi-processing because it reads / writes single
CSV file and can't guarantee the data order in multi-processing situation.

Expand Down Expand Up @@ -88,7 +88,7 @@ def save(self, data: Union[torch.Tensor, np.ndarray], meta_data: Optional[Dict]

Args:
data: target data content that save into cache.
meta_data: the meta data information corresponding to the data.
meta_data: the metadata information corresponding to the data.

"""
save_key = meta_data[Key.FILENAME_OR_OBJ] if meta_data else str(self._data_index)
Expand Down
14 changes: 7 additions & 7 deletions monai/data/dataset_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def __init__(
dataset: dataset from which to load the data.
image_key: key name of images (default: ``image``).
label_key: key name of labels (default: ``label``).
meta_key: explicitly indicate the key of the corresponding meta data dictionary.
meta_key: explicitly indicate the key of the corresponding metadata dictionary.
for example, for data with key `image`, the metadata by default is in `image_meta_dict`.
the meta data is a dictionary object which contains: filename, affine, original_shape, etc.
the metadata is a dictionary object which contains: filename, affine, original_shape, etc.
if None, will try to construct meta_keys by `{image_key}_{meta_key_postfix}`.
meta_key_postfix: use `{image_key}_{meta_key_postfix}` to fetch the meta data from dict,
the meta data is a dictionary object (default: ``meta_dict``).
meta_key_postfix: use `{image_key}_{meta_key_postfix}` to fetch the metadata from dict,
the metadata is a dictionary object (default: ``meta_dict``).
num_workers: how many subprocesses to use for data loading.
``0`` means that the data will be loaded in the main process (default: ``0``).
kwargs: other parameters (except `batch_size` and `num_workers`) for DataLoader,
Expand All @@ -76,12 +76,12 @@ def __init__(

def collect_meta_data(self):
"""
This function is used to collect the meta data for all images of the dataset.
This function is used to collect the metadata for all images of the dataset.
"""

for data in self.data_loader:
if self.meta_key not in data:
raise ValueError(f"To collect meta data for the dataset, key `{self.meta_key}` must exist in `data`.")
raise ValueError(f"To collect metadata for the dataset, key `{self.meta_key}` must exist in `data`.")
self.all_meta_data.append(data[self.meta_key])

def get_target_spacing(self, spacing_key: str = "pixdim", anisotropic_threshold: int = 3, percentile: float = 10.0):
Expand All @@ -93,7 +93,7 @@ def get_target_spacing(self, spacing_key: str = "pixdim", anisotropic_threshold:
After loading with `monai.DataLoader`, "pixdim" is in the form of `torch.Tensor` with size `(batch_size, 8)`.

Args:
spacing_key: key of spacing in meta data (default: ``pixdim``).
spacing_key: key of spacing in metadata (default: ``pixdim``).
anisotropic_threshold: threshold to decide if the target spacing is anisotropic (default: ``3``).
percentile: for anisotropic target spacing, use the percentile of all spacings of the anisotropic axis to
replace that axis.
Expand Down
2 changes: 1 addition & 1 deletion monai/data/image_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
image_only: if True return only the image volume, otherwise, return image volume and the metadata.
transform_with_metadata: if True, the metadata will be passed to the transforms whenever possible.
dtype: if not None convert the loaded image to this data type.
reader: register reader to load image file and meta data, if None, will use the default readers.
reader: register reader to load image file and metadata, if None, will use the default readers.
If a string of reader name provided, will construct a reader object with the `*args` and `**kwargs`
parameters, supported reader name: "NibabelReader", "PILReader", "ITKReader", "NumpyReader"
args: additional parameters for reader if providing a reader name.
Expand Down
Loading