<div dir="ltr"><div>Hi,</div><div>It should work. UpdateOutputInformation is not required (it's done by Update already). Does the outputImage passed as input to the backprojection have the same information as reader->GetOutput()?</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 12, 2022 at 8:57 AM Adarsh S Sunil <<a href="mailto:adarshto3@gmail.com">adarshto3@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr"><div>Hi all,</div><div><br></div><div> I'm a beginner in rtk. I want to use the forward and backward projection in CT images. For that I defined the RTK geometry object and seriesIdContainer. </div><div><br></div><div>Then I read CT data and assign it to a reader and set it as inputImage. </div><div><br></div><div><i> while (seriesItr != seriesUID.end())<br></i></div><div><i> {<br> seriesIdentifier = seriesItr->c_str();<br> seriesItr++;<br> std::cout << "\nReading: ";<br> std::cout << seriesIdentifier << std::endl;<br> using FileNamesContainer = std::vector<std::string>;<br> FileNamesContainer fileNames = nameGenerator->GetFileNames(seriesIdentifier);<br> using ImageIOType = itk::GDCMImageIO;<br> auto dicomIO = ImageIOType::New();<br> reader->SetImageIO(dicomIO);<br> reader->SetFileNames(fileNames);<br> reader->ForceOrthogonalDirectionOff(); // properly read CTs with gantry tilt<br> TRY_AND_EXIT_ON_ITK_EXCEPTION(reader->Update())<br> }<br></i></div><div><i> using RegionType = itk::ImageRegion<3>;<br> ImageType::Pointer inputImage = reader->GetOutput();<br> RegionType inputRegion = inputImage->GetLargestPossibleRegion();<br> ImageType::Pointer outputImage = ImageType::New();</i><br></div><div><br></div><div>Then I created Imageregion and imageFilter for outputImage.</div><div>Then I set the regions, spacing, origin etc.</div><div><br></div><div>Then I get the Forward Projection like the following:</div><div><br></div><div><i> rtk::ForwardProjectionImageFilter<ImageType, ImageType>::Pointer ForwardProj = rtk::CudaForwardProjectionImageFilter<ImageType, ImageType>::New();<br> dynamic_cast<rtk::CudaForwardProjectionImageFilter<ImageType, ImageType> *>(ForwardProj.GetPointer()) ->SetStepSize( 1 );<br> ForwardProj->SetInput( 0, <b>outputImage</b> );<br> ForwardProj->SetInput( 1, changeFilter->GetOutput());<br> ForwardProj->SetGeometry( geometry );<br> ForwardProj->Update();</i><br></div><div><br></div><div>Then I wrote the ForwardProj to an mha file.</div><div><br></div><div>Then I put the output from Forward Projection as input of Back Projection.</div><div>Now I am trying to get the back projection like the following:</div><div><br></div><div><i> using ReaderType1 = rtk::ProjectionsReader<ImageType>;<br> ReaderType1::Pointer reader1 = ReaderType1::New();<br> reader1->SetFileNames( fileNames );<br> reader1->Update();<br> using BackFilter = rtk::CudaFDKConeBeamReconstructionFilter;<br> auto BackProjFilter = BackFilter::New();<br> // FDK reconstruction<br> BackProjFilter->SetInput( 0, <b>outputImage</b> );<br> BackProjFilter->SetInput( 1, reader1->GetOutput() );<br> BackProjFilter->SetGeometry( geometry );<br> BackProjFilter->Update();<br> BackProjFilter->UpdateOutputInformation();</i><br></div><div><br></div><div>But I'm not getting the back projection. Are there any additional options I have to set??</div><div>Is there anything I have missed??</div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div style="font-size:small">Thanks & Regards</div><div style="font-size:small">Adarsh S S</div></div></div></div></div>
</div></div>
_______________________________________________<br>
Rtk-users mailing list<br>
<a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a><br>
<a href="https://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">https://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users</a><br>
</blockquote></div>