InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.4k stars 664 forks source link

`PythonFFTImageFilterTest` failing in Windows CI #3057

Closed tbirdso closed 2 years ago

tbirdso commented 2 years ago

Description

Windows CI is failing after #3002 due to issue in FFT test

CDash results

Steps to Reproduce

Windows CI on Azure

Expected behavior

ComplexToRealImageFilter is available and all CI passes

Actual behavior

Running itkImageFileWriterICF2... done
Traceback (most recent call last):
  File "D:/a/1/s/Modules/Filtering/FFT/wrapping/test/FFTImageFilterTest.py", line 45, in <module>
    realFilter = itk.ComplexToRealImageFilter[ComplexImageType, ImageType].New(fftFilter)
  File "D:\a\1\s-build\Wrapping\Generators\Python\itk\support\lazy.py", line 130, in __getattribute__
    value = types.ModuleType.__getattribute__(self, attr)
AttributeError: module 'itk' has no attribute 'ComplexToRealImageFilter'
itkTestDriver: Process exited with return value: 1

Reproducibility

Appears in master branch throughout several merges, but did not appear in CI checks for #3002 prior to merge and does not seem to appear locally

Versions

main branch

Environment

Windows CI

Additional Information

3002 which seems to have introduced the issue dealt with C++ TestDriver changes but not wrappings, so I'm a little confused as to how this error appeared from there. Will investigate.

tbirdso commented 2 years ago

Haven't been able to recreate on my Windows setup after rebuilding against master. PythonFFTImageFilterTest passes, I can instantiate itk.ComplexToRealImageFilter just fine, and itkComplexToRealImageFilter.wrap has not been touched in years.

It would be helpful to have another set of eyes on this, maybe I'm missing something obvious. @dzenanz if you have a moment could you please weigh in on this issue?

dzenanz commented 2 years ago

Let's wait for nightly builds and see whether my computer also chokes on it. If so, I could try to fix it.

Oops, we don't have a nightly Windows Python build. Rebasing would probably require a massive rebuild. I could do that overnight.

tbirdso commented 2 years ago

Thank you! I'll give it another pass as well and see if I can spot anything.

tbirdso commented 2 years ago

@dzenanz Checking back in, did you have a chance to try rebuilding the main branch on your local Windows machine? I'm still having difficulty recreating this issue.

dzenanz commented 2 years ago

I cannot reproduce it:

C:\Dev\ITK-py>C:\Dev\ITK-py\Wrapping\Generators\Python\itk\itkTestDriver.exe "--add-before-env" "PYTHONPATH" "C:/Dev/ITK-py/Wrapping/Generators/Python" "--add-before-env" "PYTHONPATH" "C:/Dev/ITK-py/Wrapping/Generators/Python/itk" "--add-before-libpath" "C:/Dev/ITK-py/Wrapping/Generators/Python/itk" "--compare" "C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterRealTest.png" "C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png" "--compare" "C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterImaginaryTest.png" "C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png" "C:/Program Files/Python37/python.exe" "C:/Dev/ITK-git/Modules/Filtering/FFT/wrapping/test/FFTImageFilterTest.py" "C:\Dev\ITK-vs19\ExternalData\Modules\Filtering\LabelMap\test\Input\cthead1.png" "C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterRealTest.png" "C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterImaginaryTest.png"
Loading ITKPyBase... done
Loading ITKCommon... done
Loading ITKIOImageBase... done
Loading ITKPyUtils... done
Loading ITKStatistics... done
Loading ITKImageFilterBase... done
Loading ITKTransform... done
Loading ITKImageFunction... done
Loading ITKImageGrid... done
Loading ITKFFT... done
Running itkImageFileReaderIF2... done
Running itkForwardFFTImageFilterIF2ICF2... done
Running itkForwardFFTImageFilterIF2ICF2... done
Running itkImageFileWriterICF2... done
Loading ITKPath... done
Loading ITKMesh... done
Loading ITKSpatialObjects... done
Loading ITKImageCompose... done
Loading ITKImageStatistics... done
Loading ITKImageIntensity... done
Running itkForwardFFTImageFilterIF2ICF2... done
Running itkComplexToRealImageFilterICF2IF2... done
done
done
done
done
done
done
done
done
done
done
done
done
Running itkRescaleIntensityImageFilterIF2IUC2... done
done
done
done
done
done
done
done
done
done
Running itkImageFileWriterIUC2... done
Running itkForwardFFTImageFilterIF2ICF2... done
Running itkComplexToImaginaryImageFilterICF2IF2... done
done
done
done
done
done
done
done
Running itkRescaleIntensityImageFilterIF2IUC2... done
done
done
done
done
done
done
done
done
Running itkImageFileWriterIUC2... done
Exception detected while reading C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterRealTest.png :  Could not create IO object for reading file C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png
The file doesn't exist.
Filename = C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterRealTest.png
<DartMeasurement name="BaselineImageName" type="text/string">INVALID_BASELINE_GIVEN</DartMeasurement>
Exception detected while reading C:/Dev/ITK-py/Testing/Temporary/PythonFFTImageFilterImaginaryTest.png :  Could not create IO object for reading file C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png
The file doesn't exist.
Filename = C:/Dev/ITK-py/ExternalData/Modules/Filtering/FFT/wrapping/test/Baseline/PythonFFTImageFilterImaginaryTest.png
<DartMeasurement name="BaselineImageName" type="text/string">INVALID_BASELINE_GIVEN</DartMeasurement>

C:\Dev\ITK-py>

I did not build tests, so the baseline image is not downloaded. Hence the failure at the comparison stage.

tbirdso commented 2 years ago

Some notes from additional investigation:

From these facts we find the following:

The following changes are proposed and will be addressed in #3074 :

Thank you @dzenanz for helping point me in the right direction on this investigation!

tbirdso commented 2 years ago

Latest CDash results show that PythonFFTImageFilterTest is no longer failing.

New failure in itkConnectedRegionsMeshFilterPythonTest seems to originate from a recent change and may have a similar resolution, will track in a separate issue with additional thoughts.