Skip to content

Commit

Permalink
update based on comments
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
  • Loading branch information
wyli committed Mar 15, 2023
1 parent 071b556 commit 2a4cb8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions monai/data/image_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ class ITKWriter(ImageWriter):
output_dtype: DtypeLike = None
channel_dim: int | None

def __init__(self, output_dtype: DtypeLike = np.float32, affine_lps_to_ras: bool | None = None, **kwargs):
def __init__(self, output_dtype: DtypeLike = np.float32, affine_lps_to_ras: bool | None = True, **kwargs):
"""
Args:
output_dtype: output data type.
affine_lps_to_ras: whether to convert the affine matrix from "LPS" to "RAS". Defaults to ``None``.
affine_lps_to_ras: whether to convert the affine matrix from "LPS" to "RAS". Defaults to ``True``.
Set to ``True`` to be consistent with ``NibabelWriter``,
otherwise the affine matrix is assumed already in the ITK convention.
kwargs: keyword arguments passed to ``ImageWriter``.
Expand Down Expand Up @@ -478,7 +478,7 @@ def create_backend_obj(
channel_dim: int | None = 0,
affine: NdarrayOrTensor | None = None,
dtype: DtypeLike = np.float32,
affine_lps_to_ras: bool | None = None,
affine_lps_to_ras: bool | None = True,
**kwargs,
):
"""
Expand All @@ -489,7 +489,7 @@ def create_backend_obj(
channel_dim: channel dimension of the data array. This is used to create a Vector Image if it is not ``None``.
affine: affine matrix of the data array. This is used to compute `spacing`, `direction` and `origin`.
dtype: output data type.
affine_lps_to_ras: whether to convert the affine matrix from "LPS" to "RAS". Defaults to ``None``.
affine_lps_to_ras: whether to convert the affine matrix from "LPS" to "RAS". Defaults to ``True``.
Set to ``True`` to be consistent with ``NibabelWriter``,
otherwise the affine matrix is assumed already in the ITK convention.
kwargs: keyword arguments. Current `itk.GetImageFromArray` will read ``ttype`` from this dictionary.
Expand Down

0 comments on commit 2a4cb8d

Please sign in to comment.