# ITK/RTK config and build to use CudaBackProjectionImageFilter python wrapper

**URL:** https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658
**Category:** Engineering
**Tags:** itk, python, cmake
**Created:** [November 6, 2025, 11:00pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658 "2025-11-06T23:00:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jshenNT](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jshenNT](https://discourse.itk.org/u/jshenNT)
#### Post date: [November 6, 2025, 11:00pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/1 "2025-11-06T23:00:41Z")

</div>

Hello,  
I’m new to ITK/RTK and currently working on a project where we want to use RTK’s reconstruction functionality, specifically CudaFDKBackProjectionImageFilter.  
However, due to my limited experience with ITK/RTK, I’ve encountered some challenges and difficulties, and I’m seeking guidance and support.

In short, after some trial and error, I was finally able to complete a successful ITK build using the following configuration:  
cmake ../ITK -G “Visual Studio 17 2022” -A x64 ^  
-DCMAKE\_BUILD\_TYPE=Release ^  
-DCMAKE\_INSTALL\_PREFIX=“C:/ITKRTK/ITK-install” ^  
-DBUILD\_EXAMPLES=OFF ^  
-DBUILD\_TESTING=OFF ^  
-DBUILD\_SHARED\_LIBS=OFF ^  
-DITK\_WRAP\_PYTHON=ON ^  
-DITK\_BUILD\_DEFAULT\_MODULES=OFF ^  
-DModule\_ITKCommon=ON ^  
-DModule\_ITKIOImageBase=ON ^  
-DModule\_ITKIONIFTI=ON ^  
-DModule\_ITKIOPNG=ON ^  
-DModule\_ITKIOGDCM=ON ^  
-DModule\_RTK=ON ^  
-DModule\_CudaCommon=ON ^  
-DRTK\_USE\_CUDA=ON ^  
-DITK\_WRAP\_unsigned\_short:BOOL=ON ^  
-DITK\_WRAP\_double:BOOL=ON ^  
-DITK\_WRAP\_complex\_double:BOOL=ON ^  
-DITK\_WRAP\_IMAGE\_DIMS:STRING=“2;3;4” ^  
-DPython3\_EXECUTABLE=“c:/Python/Python311/python.exe” ^  
-DPython3\_INCLUDE\_DIR=“c:/Python/Python311/include” ^  
-DPython3\_LIBRARY=“c:/Python/Python311/libs/python311.lib” ^  
-DPY\_SITE\_PACKAGES\_PATH=“C:/Python/Python311/Lib/site-packages” ^  
-DModule\_ITKHDF5:BOOL=OFF ^  
-DModule\_ITKIOHDF5:BOOL=OFF ^  
-DModule\_ITKIOTransformHDF5:BOOL=OFF ^  
-DModule\_ITKIOTransformBase:BOOL=OFF ^  
-DModule\_ITKIOTransformMatlab:BOOL=OFF  
The build completed successfully, but when I tried the following Python commands (We need to use this CudaFDKBackProjectionImageFilter instead of CudaBackProjectionImageFilter), I received an error indicating that the function was not found:  
from itk import RTK  
from itk import RTK as rtk  
aa = rtk.CudaFDKBackProjectionImageFilter.New()  
Any suggestions on how to resolve this will be highly appreciated.

Thank you

James

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [November 7, 2025, 9:41am UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/2 "2025-11-07T09:41:08Z")

</div>

Sorry to hear your trouble. An easier solution is to download the Cuda compiled by GitHub actions, e.g. [here](https://github.com/RTKConsortium/RTK/actions/runs/19073909646) for the latest one (available as artifacts when you log in to GitHub).

For fixing your build, when you do not indicate a specific value to `Module_RTK_GIT_TAG`, it uses the value in [RTK.remote.cmake](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Modules/Remote/RTK.remote.cmake). Currently, this is [1fb003a0e052fd9fec94520c9fa39ff4339828e0](https://github.com/RTKConsortium/RTK/commit/1fb003a0e052fd9fec94520c9fa39ff4339828e0) which is prior to [1f8574496e2c29ef74159ff69018a6b40daa35ec](https://github.com/RTKConsortium/RTK/commit/1f8574496e2c29ef74159ff69018a6b40daa35ec), the commit which wraps this filter. So the solution is to indicate a more recent hash as a CMake option, `-DModule_RTK_GIT_TAG=“main”`. You can check after the CMake configuration that RTK git HEAD is where you’d like in `../ITK/Modules/Remote/RTK`.

---

<div class="post-metadata">

### Author: ![jshenNT](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jshenNT](https://discourse.itk.org/u/jshenNT)
#### Post date: [November 7, 2025, 6:37pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/3 "2025-11-07T18:37:11Z")

</div>

Thanks, Simon, for the suggestion. I added the option `DModule_RTK_GIT_TAG="main"`, and it seems the `rtkCudaFDKBackProjectionImageFilter` module was successfully fetched and compiled. However, I’m now encountering other errors. Without this option, the build and installation complete successfully. Do you have any suggestions or insights on how to resolve these new errors? Here are some of them: C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkWarpSequenceImageFilter.hxx(85,5): error C2679: binary ‘=’: no operator found w

hich takes a right-hand operand of type ‘rtk::CudaForwardWarpImageFilter::Pointer’ (or there is no acceptable conversion) [

C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

(compiling source file ‘../RTK/rtkFourDROOSTERConeBeamReconstructionFilterPython.cpp’)

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkWarpSequenceImageFilter.hxx(87,5): error C2679: binary ‘=’: no operator found w

hich takes a right-hand operand of type ‘rtk::CudaWarpImageFilter::Pointer’ (or there is no acceptable conversion) [C:\ITKR

TK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

(compiling source file ‘../RTK/rtkFourDROOSTERConeBeamReconstructionFilterPython.cpp’)

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkWarpSequenceImageFilter.hxx(92,5): error C2679: binary ‘=’: no operator found w

hich takes a right-hand operand of type ‘rtk::CudaCyclicDeformationImageFilter::Pointer’ (or there is no acceptable convers

ion) [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

(compiling source file ‘../RTK/rtkFourDROOSTERConeBeamReconstructionFilterPython.cpp’)

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: 'void rtk:

:WeidingerForwardModelImageFilter\<TMaterialProjections,TPhotonCounts,TSpectrum,TProjections\>::SetInputProjectionsOfOnes(con

st TProjections \*)': cannot convert argument 1 from ‘itk::Image\<float,3\> \*’ to ‘const TProjections \*’ [C:\ITKRTK\ITK-Build\

Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: wi

th [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: [

[C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664:

TMaterialProjections=itk::CudaImage\<itk::Vector\<float,2\>,3\>, [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664:

TPhotonCounts=itk::CudaImage\<itk::Vector\<float,2\>,3\>, [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664:

TSpectrum=itk::CudaImage\<float,3\>, [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664:

TProjections=itk::CudaImage\<float,3\> [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: ]

[C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: an

d [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: [

[C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664:

TProjections=itk::CudaImage\<float,3\> [C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

C:\ITKRTK\ITK\Modules\Remote\RTK\include\rtkMechlemOneStepSpectralReconstructionFilter.hxx(438,23): error C2664: ]

[C:\ITKRTK\ITK-Build\Wrapping\Modules\RTK\RTKPython.vcxproj]

(compiling source file ‘../RTK/rtkMechlemOneStepSpectralReconstructionFilterPython.cpp’)

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [November 10, 2025, 11:48am UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/4 "2025-11-10T11:48:48Z")

</div>

I don’t know what is the issue, sorry. Can you try to provide a complete log? The errors seem incomplete. Can you also confirm which version of ITK you’re using?

---

<div class="post-metadata">

### Author: ![jshenNT](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jshenNT](https://discourse.itk.org/u/jshenNT)
#### Post date: [November 11, 2025, 4:31pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/5 "2025-11-11T16:31:08Z")

</div>

Hi Simon,

For ITK, I used version **5.4.4**.

Attached are the log files:

- **CMakeOutput.log** and **CMakeError.log** (configuration logs)

- **build\_log.txt** (build log from command line redirect

Please let me know if you have any suggestions.

Thank you.

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [November 13, 2025, 3:15pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/6 "2025-11-13T15:15:41Z")

</div>

I’m not sure I understand but you seem to compile with a mingw terminal? The compiler seems to believe you’re under unix (hence the unistd.h inclusion errors). Check that you’re using a visual studio terminal, which can also be obtained by running cmd.exe and then

```auto
call “c:\Program Files (x86)\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat”

```

---

<div class="post-metadata">

### Author: ![jshenNT](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jshenNT](https://discourse.itk.org/u/jshenNT)
#### Post date: [November 15, 2025, 1:22am UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/7 "2025-11-15T01:22:23Z")

</div>

Hi Simon,

I don’t have a MinGW terminal, only the standard command line for configuring and building. Still, I tried your suggestion using a Visual Studio Developer Command Prompt and ran the config and build steps. As far as I can tell, I’m seeing the same behavior and the same errors. Do you have any other suggestions?

Thanks

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [November 15, 2025, 10:03pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/8 "2025-11-15T22:03:31Z")

</div>

Not really. From the log, I see that the compiler has `/D VXL_HAS_MINGW_ALIGNED_MALLOC`. This is triggered from [here](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Modules/ThirdParty/VNL/src/vxl/config/cmake/config/VXLIntrospectionConfig.cmake#L460). When executing `CMake` for the first time, you probably see

```auto
-- Performing Test VXL_HAS_MINGW_ALIGNED_MALLOC
-- Performing Test VXL_HAS_MINGW_ALIGNED_MALLOC - Success

```

Maybe try to understand why the test succeeds at CMake configuration but the compilation fails later? You can also try to manually turn `VXL_HAS_MINGW_ALIGNED_MALLOC` to `OFF` in the `CMakeCache.txt`

---

<div class="post-metadata">

### Author: ![jshenNT](https://discourse.itk.org/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jshenNT](https://discourse.itk.org/u/jshenNT)
#### Post date: [November 23, 2025, 5:50pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/9 "2025-11-23T17:50:47Z")

</div>

I’ve tried multiple times, including testing on another computer in case my main environment had become corrupted over time. Unfortunately, I continue to encounter the same errors—or different ones when I make adjustments—without any success. It has been quite frustrating.

We definitely want to use your ITK/RTK framework for our reconstruction work, and I will continue to try but I really need some guidance to help get past this issue.

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [December 4, 2025, 4:49pm UTC](https://discourse.itk.org/t/itk-rtk-config-and-build-to-use-cudabackprojectionimagefilter-python-wrapper/7658/10 "2025-12-04T16:49:00Z")

</div>

I understand the frustration but I cannot reproduce your problem. If I put the following code in a `.bat` file and execute it from the regular Windows terminal (`cmd`), everything works well (except the `write_geometry` function in the example, most likely because I did not install). Maybe you can provide your `CMakeCache.txt` to understand your issue? I could compare it to this compilation.

```auto
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"

cmake ../src/itk/ITK-main -G "Visual Studio 17 2022" -A x64 ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX="C:/james-install" ^
-DBUILD_EXAMPLES=OFF ^
-DBUILD_TESTING=OFF ^
-DBUILD_SHARED_LIBS=OFF ^
-DITK_WRAP_PYTHON=ON ^
-DITK_BUILD_DEFAULT_MODULES=OFF ^
-DModule_ITKCommon=ON ^
-DModule_ITKIOImageBase=ON ^
-DModule_ITKIONIFTI=ON ^
-DModule_ITKIOPNG=ON ^
-DModule_ITKIOGDCM=ON ^
-DModule_RTK=ON ^
-DModule_CudaCommon=ON ^
-DModule_CudaCommon_GIT_TAG="fdca68f53d2c9b4c34c5bacfd83d99cd9e2285a0" ^
-DRTK_USE_CUDA=ON ^
-DModule_RTK_GIT_TAG="c4722ef208891032d72860f0dd036b7c38dbb606" ^
-DITK_WRAP_unsigned_short:BOOL=ON ^
-DITK_WRAP_double:BOOL=ON ^
-DITK_WRAP_complex_double:BOOL=ON ^
-DITK_WRAP_IMAGE_DIMS:STRING="2;3;4" ^
-DPython3_EXECUTABLE="C:/Python311-x64/python.exe" ^
-DPython3_INCLUDE_DIR="C:/Python311-x64/include" ^
-DPython3_LIBRARY="C:/Python311-x64/libs/python311.lib" ^
-DPY_SITE_PACKAGES_PATH="C:/Python311-x64/Lib/site-packages" ^
-DModule_ITKHDF5:BOOL=OFF ^
-DModule_ITKIOHDF5:BOOL=OFF ^
-DModule_ITKIOTransformHDF5:BOOL=OFF ^
-DModule_ITKIOTransformBase:BOOL=OFF ^
-DModule_ITKIOTransformMatlab:BOOL=OFF

devenv ITK.sln /Build "Release|x64"
copy Wrapping\Generators\Python\WrapITK.pth test\Lib\site-packages
C:\Python311-x64\python.exe -m venv test
test\Scripts\activate.bat
pip install numpy
python c:\src\itk\ITK-main\Modules\Remote\RTK\examples\FirstReconstruction\FirstCudaReconstruction.py a.mha a.xml

```
