LLNL / LEAP

comprehensive library of 3D transmission Computed Tomography (CT) algorithms with Python and C++ APIs, a PyQt GUI, and fully integrated with PyTorch
https://leapct.readthedocs.io
MIT License
116 stars 12 forks source link

ArgumentError in downsmapling #94

Open oooo1114 opened 3 months ago

oooo1114 commented 3 months ago

Hi, Kyle, I am trying the demo for scatter correction "d31_scatter_correction.py". But the code run into an error in line 178 when down-sampling the data. The error information is listed below:

Exception has occurred: ArgumentError
argument 2: <class 'TypeError'>: array must have data type int32
  File "d31_scatter_correction.py.py", line 178, in <module>
    g_dn = leapct_LR.down_sample_projections([1,downSampleFactor,downSampleFactor],g)
ctypes.ArgumentError: argument 2: <class 'TypeError'>: array must have data type int32

Any suggestions? Thanks.

kylechampley commented 3 months ago

The script runs fine for me. Did you make any changes to it? What version of LEAP are you running?

oooo1114 commented 2 months ago

v1.19, I think the error may be related to my environment since you can run.

kylechampley commented 2 months ago

It seems strange to me that your python environment would cause this issue. Have you changed anything in that script?

oooo1114 commented 2 months ago

No. It might be related to other packages in the environment. Never-mind, I use torch interpolate instead. Thanks.

kylechampley commented 2 months ago

OK, just make sure you update the LEAP CT parameters accordingly.