AsChannelLast/First to support multiple dims#3650
AsChannelLast/First to support multiple dims#3650wyli wants to merge 3 commits intoProject-MONAI:devfrom
AsChannelLast/First to support multiple dims#3650Conversation
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
|
What's the use case for this? We expect input to be some permutation of |
I'm refactoring the image writers and the nifti format and nibabel API assumes the spatial dimensions (up to 3d) first -- |
|
I agree it would be useful, though the name isn't valid if we're using it to move spatial dimensions (or other dimensions) around. Perhaps we should have a generic |
sure I see that keeping |
Hi @wyli , Thanks for the explanation of the logic. Thanks. |
|
@wyli do we want to push through this change still? |
sure, I'll rebase.. |
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
| if not (isinstance(channel_dim, int) and channel_dim >= -1): | ||
| raise AssertionError("invalid channel dimension.") | ||
| self.channel_dim = channel_dim | ||
| def __init__(self, channel_dim: Union[int, Sequence[int]] = -1) -> None: |
There was a problem hiding this comment.
this transform is deprecated, if we still want this feature, it should be in EnsureChannelFirst cc @ericspod
There was a problem hiding this comment.
This was related to another task you were working on. If we haven't had the need to implement this I would close this PR and return the concept later, though it seems that Transpose has similar behaviour anyhow.
Signed-off-by: Wenqi Li wenqil@nvidia.com
Description
depends on #3648
this will be useful for handling the nifti format, for example to move the time/channel dimensions together
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests --disttests.make htmlcommand in thedocs/folder.