Skip to content

Commit a1d91c4

Browse files
author
Simon Rit
committed
ENH: Allow one step reconstruction with fast switching
1 parent e1484a0 commit a1d91c4

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

applications/rtkspectralonestep/rtkspectralonestep.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ main(int argc, char * argv[])
256256
itk::ImageIOBase::Pointer headerAttenuations = GetFileHeader(args_info.attenuations_arg);
257257
unsigned int nMaterials = headerAttenuations->GetDimensions(0);
258258

259-
if (nMaterials == 2 && nBins == 2)
259+
if (nMaterials == 3 && nBins == 1)
260+
rtk::rtkspectralonestep<1, 3>(args_info);
261+
else if (nMaterials == 2 && nBins == 1)
262+
rtk::rtkspectralonestep<1, 2>(args_info);
263+
else if (nMaterials == 2 && nBins == 2)
260264
rtk::rtkspectralonestep<2, 2>(args_info);
261265
else if (nMaterials == 2 && nBins == 5)
262266
rtk::rtkspectralonestep<5, 2>(args_info);

src/rtkCudaWeidingerForwardModelImageFilter.cu

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
215215
default:
216216
{
217217
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters, "
218-
"currently set to nMaterials=2 or 3, nMaterials= "
218+
"currently set to 2 or 3 materials."
219219
<< nMaterials << " is not supported.");
220220
}
221221
}
@@ -229,10 +229,14 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
229229
kernel_forward_model<1, 79, 2>
230230
<<<dimGrid, dimBlock>>>(pMatProj, pPhoCount, pSpectrum, pProjOnes, pOut1, pOut2, nProjSpectrum, nIdxProj);
231231
break;
232+
case 3:
233+
kernel_forward_model<1, 79, 3>
234+
<<<dimGrid, dimBlock>>>(pMatProj, pPhoCount, pSpectrum, pProjOnes, pOut1, pOut2, nProjSpectrum, nIdxProj);
235+
break;
232236
default:
233237
{
234238
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters, "
235-
"currently set to nMaterials=2 or 3, nMaterials= "
239+
"currently set to 2 or 3 materials."
236240
<< nMaterials << " is not supported.");
237241
}
238242
}
@@ -241,7 +245,7 @@ CUDA_WeidingerForwardModel(int projectionSize[3],
241245
else
242246
{
243247
itkGenericExceptionMacro(<< "The CUDA version of WeidingerForwardModel works with hard-coded parameters "
244-
"(nBins,nEnergies,nMaterials) equal to (5,150,2),(5,150,3),(1,79,2).");
248+
"(nBins,nEnergies) equal to (5,150),(5,150),(1,79),(1,79).");
245249
}
246250
CUDA_CHECK_ERROR;
247251
}

0 commit comments

Comments
 (0)