<div dir="ltr">Hi Simon,<div><br></div><div>I am currently trying to create an alternate version of rtkforwardprojection that takes an image pointer as an input and returns the projection without using the GGO parser. <div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"></div></div></div></div>
</div><div><br></div><div>It is very similar to the original with some minor adjustments to determine size and spacing. It currently works as intended when the forwardprojection flag type is set to use the JosephForwardProjectionImageFilter, however it returns a blank image with the correct spacing and dimensions when using the CudaForwardProjectionImageFilter.</div><div><br></div><div>Cuda is installed on my machine and the original rtkforwardprojection with cuda also works as intended. I have included a snippet of code and attached the header file containing the function if anyone wants to help me out on this one.<br><br>Thanks!</div><div><br></div><div>Solomon</div><div><br></div><div><br></div><div>....</div><div><div>rtk::ForwardProjectionImageFilter<OutputImageType, OutputImageType>::Pointer forwardProjection;</div><div> </div><div> switch(fp_flag)</div><div> {</div><div> case(1):</div><div> forwardProjection = rtk::JosephForwardProjectionImageFilter<OutputImageType, OutputImageType>::New();</div><div> break;</div><div> case(2):</div><div> forwardProjection = rtk::RayCastInterpolatorForwardProjectionImageFilter<OutputImageType, OutputImageType>::New();</div><div> break;</div><div> case(3): //This section does not work as intended, even though it almost exactly the same as original (SetStepSize argument is different)</div><div><span class="" style="white-space:pre"> </span>#ifdef RTK_USE_CUDA</div><div><span class="" style="white-space:pre"> </span>forwardProjection = rtk::CudaForwardProjectionImageFilter<OutputImageType, OutputImageType>::New();</div><div><span class="" style="white-space:pre"> </span>dynamic_cast<rtk::CudaForwardProjectionImageFilter<OutputImageType, OutputImageType>*>( forwardProjection.GetPointer() )->SetStepSize(spacingOutput[2]);</div><div><span class="" style="white-space:pre"> </span>#else</div><div><span class="" style="white-space:pre"> </span>std::cerr << "The program has not been compiled with cuda option" << std::endl;</div><div><span class="" style="white-space:pre"> </span>return EXIT_FAILURE;</div><div><span class="" style="white-space:pre"> </span>#endif</div><div> break;</div><div> default:</div><div><span class="" style="white-space:pre"> </span>throw std::exception("Unhandled --method value.");</div><div> /* std::cerr << "Unhandled --method value." << std::endl;</div><div> return EXIT_FAILURE;*/</div><div> }</div><div> forwardProjection->SetInput( constantImageSource->GetOutput() );</div><div> forwardProjection->SetInput(1, input_image );</div><div> forwardProjection->SetGeometry( geometryReader->GetOutputObject() );</div><div> projProbe.Start();</div><div> if(lowmem_flag)</div><div> {</div><div><span class="" style="white-space:pre"> </span>TRY_AND_EXIT_ON_ITK_EXCEPTION( forwardProjection->Update() );</div><div> }</div><div> projProbe.Stop();</div></div><div> </div><div>.....<br><br></div><div>return forwardProjection->GetOutput();</div></div>