Skip to content

4822 remove deprecated class call in EnsureChannelFirst#4823

Merged
wyli merged 23 commits intoProject-MONAI:devfrom
KumoLiu:update-ensurechannelfirst
Aug 4, 2022
Merged

4822 remove deprecated class call in EnsureChannelFirst#4823
wyli merged 23 commits intoProject-MONAI:devfrom
KumoLiu:update-ensurechannelfirst

Conversation

@KumoLiu
Copy link
Copy Markdown
Contributor

@KumoLiu KumoLiu commented Aug 3, 2022

Fixes #4822 .
Fixed #4828 .

Description

Remove AddChannel and AsChannelFirst call in EnsureChannelFirst.
Update example in dataset's docstring.
Replace AsChannelFirst with EnsureChannelFirstd in deepgrow dataset
Replace AsChannelFirst with EnsureChannelFirstd in utils_create_transform_ims

Status

Ready

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@KumoLiu KumoLiu requested review from Nic-Ma, ericspod, rijobro and wyli August 3, 2022 11:24
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Aug 3, 2022

Should this be updated @Nic-Ma?

{"_target_": "AddChanneld", "keys": "image"},

@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Aug 3, 2022

Definitely.

Hi @KumoLiu ,

Please also update this part.

Thanks.

@KumoLiu
Copy link
Copy Markdown
Contributor Author

KumoLiu commented Aug 3, 2022

Should these also be updated? @Nic-Ma

transforms = Compose(
[LoadImaged(keys), AddChanneld(keys), ScaleIntensityd(CommonKeys.IMAGE), Rotate90d(keys, spatial_axes=[0, 2])]
)

return Compose(
[
LoadImaged(keys=keys),
AsChannelFirstd(keys=keys),
Orientationd(keys=keys, axcodes="RAS"),
Spacingd(keys=keys, pixdim=pixdim, mode=mode),
FromMetaTensord(keys=keys),
ToNumpyd(keys=keys + [PostFix.meta(k) for k in keys]),
]
)

@Nic-Ma
Copy link
Copy Markdown
Contributor

Nic-Ma commented Aug 3, 2022

Hi @KumoLiu ,

Please update the DeepGrow one, I think we should keep the utils_create_transform_ims.py to provide the transform images in doc-string.
@wyli Could you please help confirm it?

Thanks in advance.

@wyli
Copy link
Copy Markdown
Contributor

wyli commented Aug 3, 2022

agreed, I think we should update the deepgrow one to use EnsureChannelFirstd instead of AsChannelFirstd (cc @SachidanandAlle @diazandr3s)

@KumoLiu
Copy link
Copy Markdown
Contributor Author

KumoLiu commented Aug 4, 2022

Hi @wyli @Nic-Ma,

I confirmed that AddChanneld here won't change the transform images in doc-string. I will also update it.

transforms = Compose(
[LoadImaged(keys), AddChanneld(keys), ScaleIntensityd(CommonKeys.IMAGE), Rotate90d(keys, spatial_axes=[0, 2])]
)

Thanks!

KumoLiu added 2 commits August 4, 2022 10:24
Signed-off-by: KumoLiu <[email protected]>
@wyli
Copy link
Copy Markdown
Contributor

wyli commented Aug 4, 2022

/build

@wyli wyli enabled auto-merge (squash) August 4, 2022 09:31
@wyli wyli merged commit 63d06b2 into Project-MONAI:dev Aug 4, 2022
@KumoLiu KumoLiu deleted the update-ensurechannelfirst branch May 8, 2023 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in deepgrow dataset EnsureChannelFirst calls AddChannel which is deprecated

3 participants