Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwinUNETR /BTCV: transform difference in validation and test phase #247

Open
YunchaoYang opened this issue May 11, 2023 · 1 comment
Open

Comments

@YunchaoYang
Copy link

Hi Dear MONAI researchers,

I am reading the SwinUNETR/BTCV code, I found that there is difference between in the dataset transform in the utils/data_utils.py.

For validation:

    val_transform = transforms.Compose(
        [
            transforms.LoadImaged(keys=["image", "label"]),
            transforms.AddChanneld(keys=["image", "label"]),
            transforms.Orientationd(keys=["image", "label"], axcodes="RAS"),
            transforms.Spacingd(
                keys=["image", "label"], pixdim=(args.space_x, args.space_y, args.space_z), mode=("bilinear", "nearest")
            ),
            transforms.ScaleIntensityRanged(
                keys=["image"], a_min=args.a_min, a_max=args.a_max, b_min=args.b_min, b_max=args.b_max, clip=True
            ),
            transforms.CropForegroundd(keys=["image", "label"], source_key="image"),
            transforms.ToTensord(keys=["image", "label"]),
        ]
    )

For testing:

  test_transform = transforms.Compose(
       [
           transforms.LoadImaged(keys=["image", "label"]),
           transforms.AddChanneld(keys=["image", "label"]),
           # transforms.Orientationd(keys=["image"], axcodes="RAS"),
           transforms.Spacingd(keys="image", pixdim=(args.space_x, args.space_y, args.space_z), mode="bilinear"),
           transforms.ScaleIntensityRanged(
               keys=["image"], a_min=args.a_min, a_max=args.a_max, b_min=args.b_min, b_max=args.b_max, clip=True
           ),
           transforms.ToTensord(keys=["image", "label"]),
       ]
   )

I am just wondering why in the testing phase, the Orientationd and CropForegroundd are not included?

Thanks!

@YunchaoYang YunchaoYang changed the title SwinUNETR /BTCV: transform difference in validation and test SwinUNETR /BTCV: transform difference in validation and test phase May 11, 2023
@Kenton831
Copy link

Hi did you get any clues about that? I have the same confusion, thanks for replying

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

No branches or pull requests

2 participants