Skip to content

Commit

Permalink
ENH: Allow one step reconstruction with fast switching
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Dec 30, 2022
1 parent e1484a0 commit a1d91c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion applications/rtkspectralonestep/rtkspectralonestep.cxx
Expand Up @@ -256,7 +256,11 @@ main(int argc, char * argv[])
itk::ImageIOBase::Pointer headerAttenuations = GetFileHeader(args_info.attenuations_arg);
unsigned int nMaterials = headerAttenuations->GetDimensions(0);

if (nMaterials == 2 && nBins == 2)
if (nMaterials == 3 && nBins == 1)
rtk::rtkspectralonestep<1, 3>(args_info);
else if (nMaterials == 2 && nBins == 1)
rtk::rtkspectralonestep<1, 2>(args_info);
else if (nMaterials == 2 && nBins == 2)
rtk::rtkspectralonestep<2, 2>(args_info);
else if (nMaterials == 2 && nBins == 5)
rtk::rtkspectralonestep<5, 2>(args_info);
Expand Down
10 changes: 7 additions & 3 deletions src/rtkCudaWeidingerForwardModelImageFilter.cu
Expand Up @@ -215,7 +215,7 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
default:
{
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters, "
"currently set to nMaterials=2 or 3, nMaterials= "
"currently set to 2 or 3 materials."
<< nMaterials << " is not supported.");
}
}
Expand All @@ -229,10 +229,14 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
kernel_forward_model<1, 79, 2>
<<<dimGrid, dimBlock>>>(pMatProj, pPhoCount, pSpectrum, pProjOnes, pOut1, pOut2, nProjSpectrum, nIdxProj);
break;
case 3:
kernel_forward_model<1, 79, 3>
<<<dimGrid, dimBlock>>>(pMatProj, pPhoCount, pSpectrum, pProjOnes, pOut1, pOut2, nProjSpectrum, nIdxProj);
break;
default:
{
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters, "
"currently set to nMaterials=2 or 3, nMaterials= "
"currently set to 2 or 3 materials."
<< nMaterials << " is not supported.");
}
}
Expand All @@ -241,7 +245,7 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
else
{
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters "
"(nBins,nEnergies,nMaterials) equal to (5,150,2),(5,150,3),(1,79,2).");
"(nBins,nEnergies) equal to (5,150),(5,150),(1,79),(1,79).");
}
CUDA_CHECK_ERROR;
}

0 comments on commit a1d91c4

Please sign in to comment.