Applications rtkmotioncompensatedfourdconjugategradient and rtkmcrooster both crash, for separate reasons that might be linked together. To reproduce the crash, follow the steps described in the documentation pages added in cyrilmory@77e7ca3 (currently being reviewed as PR#864)
The crash in rtkmotioncompensatedfourdconjugategradient is a segfault in
void
CudaWarpBackProjectionImageFilter ::SetDisplacementField(const DVFType * DVF)
{
this->SetInput("DisplacementField", const_cast<DVFType *>(DVF));
}
caused by the fact that in
WarpProjectionStackToFourDImageFilter<VolumeSeriesType, ProjectionStackType>::GenerateOutputInformation(),
wbp = dynamic_cast<CudaWarpBackProjectionImageFilter *>(this->m_BackProjectionFilter.GetPointer());
fails, leaving wbp as nullptr
The crash in rtkmcrooster is an itkException in rtkMotionCompensatedFourDROOSTERConeBeamReconstructionFilter.h triggered by SetForwardProjectionFilter. Since the warped forward and back projections have only been implemented in CUDA, the filters of MCROOSTER override SetForwardProjectionFilter and SetBackProjectionFilter to generate an exception, but the Superclass filter still calls those functions to set the forward and back projection filters in its GenerateOutputInformation().
The exception should occur also for MC4DCG, by the way, but for some reason it does not.
Commenting out those overrides leads to the same Segfault as for rtkmotioncompensatedfourdconjugategradient.
The forward and back projector are simply never created with the right type. They are created with SetForwardProjectionFromGgo and SetBackProjectionFromGgo. But CudaWarpForwardProjectionImageFilter and CudaWarpBackProjectionImageFilter are not listed in the enums of forward and back projectors in rtkIterativeConeBeamReconstructionFilter.
So, I see at least two things to do:
- add CudaWarpForwardProjectionImageFilter and CudaWarpBackProjectionImageFilter to the enums in rtkIterativeConeBeamReconstructionFilter
- in rtkMotionCompensatedFourDROOSTERConeBeamReconstructionFilter and in rtkMotionCompensatedFourDConjugateGradientConeBeamReconstructionFilter, override the SetForwardProjectionFilter and SetBackProjectionFilter to force the CudaWarpForwardProjectionImageFilter and CudaWarpBackProjectionImageFilter
Applications rtkmotioncompensatedfourdconjugategradient and rtkmcrooster both crash, for separate reasons that might be linked together. To reproduce the crash, follow the steps described in the documentation pages added in cyrilmory@77e7ca3 (currently being reviewed as PR#864)
The crash in rtkmotioncompensatedfourdconjugategradient is a segfault in
caused by the fact that in
WarpProjectionStackToFourDImageFilter<VolumeSeriesType, ProjectionStackType>::GenerateOutputInformation(),
wbp = dynamic_cast<CudaWarpBackProjectionImageFilter *>(this->m_BackProjectionFilter.GetPointer());fails, leaving
wbpasnullptrThe crash in rtkmcrooster is an itkException in rtkMotionCompensatedFourDROOSTERConeBeamReconstructionFilter.h triggered by SetForwardProjectionFilter. Since the warped forward and back projections have only been implemented in CUDA, the filters of MCROOSTER override SetForwardProjectionFilter and SetBackProjectionFilter to generate an exception, but the Superclass filter still calls those functions to set the forward and back projection filters in its GenerateOutputInformation().
The exception should occur also for MC4DCG, by the way, but for some reason it does not.
Commenting out those overrides leads to the same Segfault as for rtkmotioncompensatedfourdconjugategradient.
The forward and back projector are simply never created with the right type. They are created with SetForwardProjectionFromGgo and SetBackProjectionFromGgo. But CudaWarpForwardProjectionImageFilter and CudaWarpBackProjectionImageFilter are not listed in the enums of forward and back projectors in rtkIterativeConeBeamReconstructionFilter.
So, I see at least two things to do: