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
4 changes: 4 additions & 0 deletions monai/handlers/segmentation_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
class SegmentationSaver:
"""
Event handler triggered on completing every iteration to save the segmentation predictions into files.
It can extract the input image meta data(filename, affine, original_shape, etc.) and resample the predictions
based on the meta data.

"""

def __init__(
Expand Down Expand Up @@ -96,6 +99,7 @@ def __init__(
output will be: /output/test1/image/image_seg.nii.gz
batch_transform: a callable that is used to transform the
ignite.engine.batch into expected format to extract the meta_data dictionary.
it can be used to extract the input image meta data: filename, affine, original_shape, etc.
output_transform: a callable that is used to transform the
ignite.engine.output into the form expected image data.
The first dimension of this transform's output will be treated as the
Expand Down
7 changes: 4 additions & 3 deletions monai/transforms/io/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ class SaveImaged(MapTransform):
keys: keys of the corresponding items to be transformed.
See also: :py:class:`monai.transforms.compose.MapTransform`
meta_key_postfix: `key_{postfix}` was used to store the metadata in `LoadImaged`.
So need the key to extract metadata to save images, default is `meta_dict`.
The meta data is a dictionary object, if no corresponding metadata, set to `None`.
For example, for data with key `image`, the metadata by default is in `image_meta_dict`.
so need the key to extract metadata to save images, default is `meta_dict`.
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.
if no corresponding metadata, set to `None`.
output_dir: output image directory.
output_postfix: a string appended to all output file names, default to `trans`.
output_ext: output file extension name, available extensions: `.nii.gz`, `.nii`, `.png`.
Expand Down