Skip to content

Commit

Permalink
fix image_only flag issue
Browse files Browse the repository at this point in the history
Signed-off-by: Wei_Chuan, Chiang <[email protected]>
  • Loading branch information
slicepaste committed Dec 23, 2024
1 parent c5ebb0d commit 1aabdae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions monai/transforms/spatial/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def __call__(self, data: Mapping[Hashable, torch.Tensor], lazy: bool | None = No
output_spatial_shape=output_shape_k if should_match else None,
lazy=lazy_,
)
if isinstance(d[key], MetaTensor) and "filename_or_obj" in d[key].meta:
if is_supported_format(d[key].meta["filename_or_obj"], ["nii", "nii.gz"]):
if isinstance(d[key], MetaTensor) and f"{key}_meta_dict" in d:
if 'filename_or_obj' in d[key].meta and is_supported_format(d[key].meta['filename_or_obj'], ["nii", "nii.gz"]):
d = transforms.sync_meta_info(key, d)
if output_shape_k is None:
output_shape_k = d[key].peek_pending_shape() if isinstance(d[key], MetaTensor) else d[key].shape[1:]
Expand Down

0 comments on commit 1aabdae

Please sign in to comment.