hello, I am facing the same error after running the code,
i am working on rtk::CudaIterativeFDKConeBeamReconstructionFilter
typedef
rtk::LUTbasedVariableI0RawToAttenuationImageFilter<ImageType,volumeType> ConvertFilterType;
ConvertFilterType::Pointer convert = ConvertFilterType::New();
convert->SetInput(ioFilter->GetOutput());
try
{
convert->Update();
qDebug() << "lut updated";
}
catch(itk::ExceptionObject e)
{
throw(e);
return 0;
}
// using DDFOFFFOVType =rtk::CudaDisplacedDetectorImageFilter;
using DDFOFFFOVType =rtk::DisplacedDetectorForOffsetFieldOfViewImageFilter;
DDFOFFFOVType::Pointer ddf;
ddf = DDFOFFFOVType::New();
ddf->SetInput(convert->GetOutput());
ddf->SetGeometry(geo);
// using PSSFType= rtk::CudaParkerShortScanImageFilter;
typedef rtk::ParkerShortScanImageFilter PSSFType;
PSSFType::Pointer pssf = PSSFType::New();
pssf->SetInput(ddf->GetOutput());
pssf->SetGeometry(geo);
pssf->InPlaceOff();
TRY_AND_EXIT_ON_ITK_EXCEPTION(pssf->Update());
// try
// {
// pssf->Update();
// qDebug() << “pssf updated”;
// }
// catch(itk::ExceptionObject e)
// {
// throw(e);
// return 0;
// }
std::cout << "Volume spacing: " << constVolume->GetOutput()->GetSpacing() << std::endl;
std::cout << "Projection spacing: " << ddf->GetOutput()->GetSpacing() << std::endl;
QTime time1;
time1.start();
// using IterativeFDKType = rtk::IterativeFDKConeBeamReconstructionFilter;
using IterativeFDKType = rtk::CudaIterativeFDKConeBeamReconstructionFilter;
volumeType::Pointer currentvol =constVolume->GetOutput();
for(int i=0;i<1;++i)
{
IterativeFDKType::Pointer IterativeFDK = IterativeFDKType::New();
IterativeFDK->SetInput(0, currentvol/*->GetOutput()*/);
IterativeFDK->SetInput(1, pssf->GetOutput());
IterativeFDK->SetGeometry(geo);
//IterativeFDK->SetProjectionSubsetSize(1);
IterativeFDK->SetLambda(1.0f);
IterativeFDK->SetNumberOfIterations(1);
IterativeFDK->SetForwardProjectionFilter(2);
IterativeFDK->SetBackProjectionFilter(2);
//IterativeFDK->SetEnforcePositivity(true);
IterativeFDK->SetHannCutFrequency(0.3);
//IterativeFDK->SetTruncationCorrection(1.0);
// IterativeFDK->SetGPUEnabled(true); // Make sure GPU is enabled (usually default)
IterativeFDK->UpdateOutputInformation(); // before .Update()
qDebug() << "iterativeFDK parameter is set" << i;
// TRY_AND_EXIT_ON_ITK_EXCEPTION(IterativeFDK->Update());
// try {
IterativeFDK->Update();
qDebug() << “CUDA Iterative FDK completed successfully.”;
currentvol=IterativeFDK->GetOutput();
// } catch (itk::ExceptionObject &e) {
// qCritical() << “Error during CUDA Iterative FDK:” << e.GetDescription();
// return nullptr;
}
int timetook1=time1.elapsed();
qDebug() << “timetook1” << timetook1;
typedef rtk::FieldOfViewImageFilter<volumeType,volumeType>
FOVFilterType;
FOVFilterType::Pointer fov=FOVFilterType::New();
fov->SetInput(0, currentvol/*->GetOutput()*/);
fov->SetProjectionsStack(pssf->GetOutput());
fov->SetGeometry(geo);
try
{
fov->Update();
}
catch(itk::ExceptionObject e)
{
throw(e);
}
this is snippet of my code, please help me to solve this error
the error is,
ExceptionObject caught with pssf->Update() in file mainwindow.cpp line 412
itk::ExceptionObject (000000B9710FE7E0)
Location: “unknown”
File: D:/vs3/rtk/code/rtkCudaParkerShortScanImageFilter.cu
Line: 165
Description: itk::ERROR: CUDA ERROR: an illegal memory access was encountered