Hi,
it looks like your algorithm changes the orientation of the scan.
This is the error message:
RuntimeError: Exception thrown in SimpleITK LabelOverlapMeasuresImageFilter_Execute: /tmp/SimpleITK-build/ITK-prefix/include/ITK-5.2/itkImageToImageFilter.hxx:220:
2022-07-02T18:53:22.336000+00:00 ITK ERROR: LabelOverlapMeasuresImageFilter(0x55707562ed30): Inputs do not occupy the same physical space!
2022-07-02T18:53:22.336000+00:00 InputImage Origin: [-4.0669400e+02, 2.0544357e+02, -1.1545000e+03], InputImage_1 Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00]
2022-07-02T18:53:22.336000+00:00 Tolerance: 2.0364201e-06
2022-07-02T18:53:22.336000+00:00 InputImage Spacing: [2.0364201e+00, 2.0364201e+00, 3.0000000e+00], InputImage_1 Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00]
2022-07-02T18:53:22.336000+00:00 Tolerance: 2.0364201e-06
2022-07-02T18:53:22.336000+00:00 InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00
2022-07-02T18:53:22.336000+00:00 0.0000000e+00 -1.0000000e+00 0.0000000e+00
2022-07-02T18:53:22.336000+00:00 0.0000000e+00 0.0000000e+00 1.0000000e+00
2022-07-02T18:53:22.336000+00:00 , InputImage_1 Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00
2022-07-02T18:53:22.336000+00:00 0.0000000e+00 1.0000000e+00 0.0000000e+00
2022-07-02T18:53:22.336000+00:00 0.0000000e+00 0.0000000e+00 1.0000000e+00
2022-07-02T18:53:22.336000+00:00
2022-07-02T18:53:22.336000+00:00 Tolerance: 1.0000000e-06