-
Notifications
You must be signed in to change notification settings - Fork 164
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
Using Github CI to generate wheels and compiling to Windows too. #345
Conversation
thank you for this - really helpful. a few comments:
|
This is the output of test:
|
Yeah this also suggests pointer magic is failing for windows
On Wed, Mar 30, 2022 at 3:54 PM Thiago Franco de Moraes < ***@***.***> wrote:
This is the output of test:
ANTsPy on wheels_ci [?] via 🐍 pyenv 3.10.2 (my_env) took 59s
❯ .\tests\run_tests.bat
C:\Users\Oscar\Sources\sss\ANTsPy>SET PYCMD=python
C:\Users\Oscar\Sources\sss\ANTsPy>pushd "tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running core tests"
"Running core tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_core_ants_image.py
.C:\Users\Oscar\Sources\sss\my_env\lib\site-packages\ants\core\ants_image.py:479: RuntimeWarning:
invalid value encountered in true_divide
C:\Users\Oscar\Sources\sss\ANTsPy\tests\test_core_ants_image.py:284: RuntimeWarning:
invalid value encountered in true_divide
.........C:\Users\Oscar\Sources\sss\my_env\lib\site-packages\ants\core\ants_image.py:490: RuntimeWarning:
overflow encountered in power
C:\Users\Oscar\Sources\sss\ANTsPy\tests\test_core_ants_image.py:303: RuntimeWarning:
overflow encountered in power
...........................
----------------------------------------------------------------------
Ran 37 tests in 21.143s
OK
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_core_ants_image_io.py
.... file 000001E6F5869730 does not exist .
E...
======================================================================
ERROR: test_images_to_matrix (__main__.TestModule_ants_image_io)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\Oscar\Sources\sss\ANTsPy\tests\test_core_ants_image_io.py", line 183, in test_images_to_matrix
imgmat = ants.images_to_matrix(imglist)
File "C:\Users\Oscar\Sources\sss\my_env\lib\site-packages\ants\core\ants_image_io.py", line 323, in images_to_matrix
mask = utils.get_mask(image_list[0])
File "C:\Users\Oscar\Sources\sss\my_env\lib\site-packages\ants\utils\get_mask.py", line 60, in get_mask
mask_image = threshold_image(image, low_thresh, high_thresh)
File "C:\Users\Oscar\Sources\sss\my_env\lib\site-packages\ants\utils\threshold_image.py", line 56, in threshold_image
libfn(processed_args)
RuntimeError: C:\Users\Oscar\Sources\sss\ANTsPy\itksource\Modules\Core\Common\src\itkProcessObject.cxx:1339:
ITK ERROR: BinaryThresholdImageFilter(000001E6F6398850): Input Primary is required but not set.
----------------------------------------------------------------------
Ran 8 tests in 12.345s
FAILED (errors=1)
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_core_ants_transform.py
........................
----------------------------------------------------------------------
Ran 24 tests in 3.527s
OK
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_core_ants_transform_io.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.499s
OK
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_core_ants_metric.py
..........
----------------------------------------------------------------------
Ran 10 tests in 13.159s
OK
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running learn tests"
"Running learn tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_learn.py
file 00000118B3B2FB30 does not exist .
E file 00000118B3B2FDE0 does not exist .
You have reached an umimplemented section of code by calling:
iMath 2 00000118B3B30070 Normalize 00000118B3B2FDE0
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running registation tests"
"Running registation tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_registation.py
file 00000200E84E4EF0 does not exist .
file 00000200E84E4F90 does not exist .
zero image1 error E file 00000200E84E5200 does not exist .
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running segmentation tests"
"Running segmentation tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_segmentation.py
file 000001FBEF56FF60 does not exist .
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running utils tests"
"Running utils tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_utils.py
file 000001FA3FF134F0 does not exist .
C:\Users\Oscar\Sources\sss\ANTsPy\tests>echo "Running bug tests"
"Running bug tests"
C:\Users\Oscar\Sources\sss\ANTsPy\tests>python test_bugs.py
file 000001C8735E4C20 does not exist .
C:\Users\Oscar\Sources\sss\ANTsPy\tests>popd
—
Reply to this email directly, view it on GitHub
<#345 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACPE7WF3XTM2WLUDZBH4T3VCSWPTANCNFSM5SAM6XJQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
brian
|
I like this PR and would be happy to merge when you are ready. a few questions:
thx again. |
@stnava it's already building on Windows, but it's needed to fix this problem that makes registration not work. My C++ level is a little low, but I can try to help. Yes, it's possible to push to GH release. Some projects, like Neovim, use GH actions to generate nightly build https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml |
ok - I will merge and we can put the windows fix on the (very long) to do list. |
@stnava if you give some directions, I can try to fix this problem with WIndows. |
unfortunately, I don't know much about windows development nor do I have a windows machine --- I know there are some ppl out there who would appreciate these efforts and could help but not sure who. the short story is that the pointer to the image is getting lost somewhere, likely either at the read or in passing the read pointer to downstream functions - it's probably fairly easy to isolate. would involve developing a minimally reproducible example ... or at least finding a simpler example that fails - |
The Windows build had known problems, see for example #345. I'm not sure if those got fixed. If we have working builds for Windows it might be possible to ask PyPi for more space, or we could look into hosting the other artifacts as part of the Github release. |
Sorry to bother everyone in this PR... @tfmoraes I wrote a patch in pure python here that works on Windows. Just tested : ) Please see my diagnosis here: #429 Basically the script works as "injection" that replaces The script was designed for my R package so there are some "weird" stuff. However, I believe you will have better solution to this problem. If you want to use this method, please remember to delete the temporary file once the C++ returns. Al so thanks for compiling ANTsPy on windows. It works like a charm ;P |
This PR does 2 things:
setup.py
and created thebat
files to configureITK
andAntPy
. I used this tool to help convert from shell to batch, but I needed to some conversions by hand. I tried these 2 tutorials (https://github.com/ANTsX/ANTsPy/blob/master/tutorials/Transform%20Generators.ipynb and https://github.com/ANTsX/ANTsPy/blob/master/tutorials/motionCorrectionExample.ipynb) and everything worked except the registration, it's showing this error: