I successfully ran the FirstCudaReconstruction.py file on my project. But sometimes the scanning angle may only be 90 °, and the reconstruction effect using FDK is not good. I checked the rtk and found that ADMM reconstruction may be used for non full week scan reconstruction.
I referred to rtkadmmtotalvariationtest.cxx, but encountered an error.
itk.support.extras.TemplateTypeError: itk.ADMMTotalVariationConeBeamReconstructionFilter is not wrapped for input type `itk.CudaImage[itk.F,3], itk.CudaImage[itk.CovariantVector[itk.F,3],3]`.
How can I create an correct object about ADMMTotalVariationConeBeamReconstructionFilter? Any help would be appreciated.
The wrapping deduces some of the templates from default values:
It should work with itk.RTK.ADMMTotalVariationConeBeamReconstructionFilter[ImageType].
Don’t you have the following full error message to indicate the reason for the problem?
Traceback (most recent call last):
File "/home/srit/src/itk/lin64-PythonWrapping-bindings/itk/support/template_class.py", line 525, in __getitem__
this_item = self.__template__[key]
KeyError: (<class 'itk.itkCudaImagePython.itkCudaImageF3'>, <class 'itk.itkCudaImagePython.itkCudaImageCVF33'>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/srit/src/itk/lin64-PythonWrapping-bindings/itk/support/template_class.py", line 529, in __getitem__
raise itk.TemplateTypeError(self, key)
itk.support.extras.TemplateTypeError: itk.ADMMTotalVariationConeBeamReconstructionFilter is not wrapped for input type `itk.CudaImage[itk.F,3], itk.CudaImage[itk.CovariantVector[itk.F,3],3]`.
To limit the size of the package, only a limited number of
types are available in ITK Python. To print the supported
types, run the following command in your python environment:
itk.ADMMTotalVariationConeBeamReconstructionFilter.GetTypes()
Possible solutions:
* If you are an application user:
** Convert your input image into a supported format (see below).
** Contact developer to report the issue.
* If you are an application developer, force input images to be
loaded in a supported pixel type.
e.g.: instance = itk.ADMMTotalVariationConeBeamReconstructionFilter[itk.CudaImage[itk.F,3]].New(my_input)
* (Advanced) If you are an application developer, build ITK Python yourself and
turned to `ON` the corresponding CMake option to wrap the pixel type or image
dimension you need. When configuring ITK with CMake, you can set
`ITK_WRAP_${type}` (replace ${type} with appropriate pixel type such as
`double`). If you need to support images with 4 or 5 dimensions, you can add
these dimensions to the list of dimensions in the CMake variable
`ITK_WRAP_IMAGE_DIMS`.
Supported input types:
itk.CudaImage[itk.F,3]
itk.Image[itk.F,3]
itk.Image[itk.D,3]
Thank you for your reply. I have tried itk.RTK.ADMMTotalVariationConeBeamReconstructionFilter[ImageType]. But I’m not sure is there need pip other wrapping like use itk.CudaImage, so I asked this question there for some suggestions. It’s really help for me.
By the way, does RTK support reconstructing partial data first, so that scanned data can be reconstructed simultaneously with CT scans, achieving the goal of accelerating reconstruction speed.
On the rtkadmmtotalvariationtest.cxx, it’s seems that the calculation method of origins is not formula origin = spacing*(size-1)*(-0.5) like FDK reconstruction. How can I set the value of origin?
On the other word, I want run ADMM on GPU, so I use SetPixelContainer to transfer my data to GPU. There is an error happened, and that error didn’t happen on CPU.
admmtotalvariation.Update()
RuntimeError: C:\P\IPP\ITK-source\ITK\Modules\Core\Common\include\itkImageConstIterator.h:211:
ITK ERROR: Region ImageRegion (000000CDBE4B2330)
Dimension: 3
Index: [0, 468, 111]
Size: [752, 156, 1]
is outside of buffered region ImageRegion (000002B7B213EEA0)
Dimension: 3
Index: [0, 0, 0]
Size: [0, 0, 0]
Yes, you can start the reconstruction before the end of the acquisition but it is a bit tricky and I removed the example showing it with this commit (to reduce the maintenance burden).
The formula is used to center the detector around the origin (0,0) but it does not have to be perfectly centered as long as the simulation is consistent with the reconstruction.
There is not enough context to understand what is going here. Did you update the reader beforehand?
So is there a problem with the way I transfer data to the GPU? I don’t know where the problem is because this pipepline was useful on FDK GPU reconstruction.
By monitoring the system memory, there was a momentary high GPU usage, and it is unclear if this is the problem. My data size is about 920KB*180, GPU size is 15GB.
I just checked your data and code that you sent privately. The volume you’re trying to reconstruct has a sizeOutput of [752, 752, 624], i.e., 10 GB. Make it [128, 128, 128] and your code runs fine. Don’t forget that advanced reconstruction algorithms require multiple copies of the volume.