Hi, 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()? Simon
On Fri, Aug 12, 2022 at 8:57 AM Adarsh S Sunil <adarsh...@gmail.com> wrote: > > Hi all, > > 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. > > Then I read CT data and assign it to a reader and set it as inputImage. > > > * while (seriesItr != seriesUID.end())* > > > > > > > > > > > > > > > * { seriesIdentifier = seriesItr->c_str(); seriesItr++; > std::cout << "\nReading: "; std::cout << seriesIdentifier << std::endl; > using FileNamesContainer = std::vector<std::string>; > FileNamesContainer fileNames = > nameGenerator->GetFileNames(seriesIdentifier); using ImageIOType = > itk::GDCMImageIO; auto dicomIO = ImageIOType::New(); > reader->SetImageIO(dicomIO); reader->SetFileNames(fileNames); > reader->ForceOrthogonalDirectionOff(); // properly read CTs with gantry > tilt TRY_AND_EXIT_ON_ITK_EXCEPTION(reader->Update()) }* > > > > * using RegionType = itk::ImageRegion<3>; ImageType::Pointer > inputImage = reader->GetOutput(); RegionType inputRegion = > inputImage->GetLargestPossibleRegion(); ImageType::Pointer outputImage = > ImageType::New();* > > Then I created Imageregion and imageFilter for outputImage. > Then I set the regions, spacing, origin etc. > > Then I get the Forward Projection like the following: > > > > > > > * rtk::ForwardProjectionImageFilter<ImageType, ImageType>::Pointer > ForwardProj = rtk::CudaForwardProjectionImageFilter<ImageType, > ImageType>::New(); > dynamic_cast<rtk::CudaForwardProjectionImageFilter<ImageType, ImageType> > *>(ForwardProj.GetPointer()) ->SetStepSize( 1 ); ForwardProj->SetInput( 0, > outputImage ); ForwardProj->SetInput( 1, changeFilter->GetOutput()); > ForwardProj->SetGeometry( geometry ); ForwardProj->Update();* > > Then I wrote the ForwardProj to an mha file. > > Then I put the output from Forward Projection as input of Back Projection. > Now I am trying to get the back projection like the following: > > > > > > > > > > > > > * using ReaderType1 = rtk::ProjectionsReader<ImageType>; > ReaderType1::Pointer reader1 = ReaderType1::New(); reader1->SetFileNames( > fileNames ); reader1->Update(); using BackFilter = > rtk::CudaFDKConeBeamReconstructionFilter; auto BackProjFilter = > BackFilter::New(); // FDK reconstruction BackProjFilter->SetInput( 0, > outputImage ); BackProjFilter->SetInput( 1, reader1->GetOutput() ); > BackProjFilter->SetGeometry( geometry ); BackProjFilter->Update(); > BackProjFilter->UpdateOutputInformation();* > > But I'm not getting the back projection. Are there any additional options > I have to set?? > Is there anything I have missed?? > > Thanks & Regards > Adarsh S S > _______________________________________________ > Rtk-users mailing list > Rtk-users@public.kitware.com > https://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users >
_______________________________________________ Rtk-users mailing list Rtk-users@public.kitware.com https://public.kitware.com/cgi-bin/mailman/listinfo/rtk-users