Skip to content

Commit

Permalink
ENH: set division threshold for SART
Browse files Browse the repository at this point in the history
My attempt at fixing #151
  • Loading branch information
acoussat committed Apr 14, 2020
1 parent bc6d102 commit 1d2100e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions applications/rtksart/rtksart.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ main(int argc, char * argv[])
sart->SetEnforcePositivity(true);
}

if (args_info.divisionthreshold_given)
{
sart->SetDivisionThreshold(args_info.divisionthreshold_arg);
}

REPORT_ITERATIONS(sart, rtk::SARTConeBeamReconstructionFilter<OutputImageType>, OutputImageType)

TRY_AND_EXIT_ON_ITK_EXCEPTION(sart->Update())
Expand Down
1 change: 1 addition & 0 deletions applications/rtksart/rtksart.ggo
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option "positivity" - "Enforces positivity during the reconstruction" f
option "input" i "Input volume" string no
option "nprojpersubset" - "Number of projections processed between each update of the reconstructed volume (1 for SART, several for OSSART, all for SIRT)" int no default="1"
option "nodisplaced" - "Disable the displaced detector filter" flag off
option "divisionthreshold" - "Threshold below which pixels in the denominator in the projection space are considered zero" double no

section "Phase gating"
option "signal" - "File containing the phase of each projection" string no
Expand Down
8 changes: 8 additions & 0 deletions include/rtkSARTConeBeamReconstructionFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class ITK_EXPORT SARTConeBeamReconstructionFilter
/** Some convenient type alias. */
using VolumeType = TVolumeImage;
using ProjectionType = TProjectionImage;
using ProjectionPixelType = typename ProjectionType::PixelType;

/** Typedefs of each subfilter of this composite filter */
using ExtractFilterType = itk::ExtractImageFilter<ProjectionType, ProjectionType>;
Expand Down Expand Up @@ -209,6 +210,13 @@ class ITK_EXPORT SARTConeBeamReconstructionFilter
itkSetMacro(DisableDisplacedDetectorFilter, bool);
itkGetMacro(DisableDisplacedDetectorFilter, bool);

/** Set the threshold below which pixels in the denominator in the projection space are considered zero. The division
* by zero will then be evaluated at zero. Avoid noise magnification from low projections values when working with
* noisy and/or simulated data.
*/
void
SetDivisionThreshold(ProjectionPixelType threshold);

protected:
SARTConeBeamReconstructionFilter();
~SARTConeBeamReconstructionFilter() override = default;
Expand Down
7 changes: 7 additions & 0 deletions include/rtkSARTConeBeamReconstructionFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ SARTConeBeamReconstructionFilter<TVolumeImage, TProjectionImage>::SetGatingWeigh
m_IsGated = true;
}

template <class TVolumeImage, class TProjectionImage>
void
SARTConeBeamReconstructionFilter<TVolumeImage, TProjectionImage>::SetDivisionThreshold(ProjectionPixelType threshold)
{
m_DivideProjectionFilter->SetThreshold(threshold);
}

template <class TVolumeImage, class TProjectionImage>
void
SARTConeBeamReconstructionFilter<TVolumeImage, TProjectionImage>::VerifyPreconditions() ITKv5_CONST
Expand Down

0 comments on commit 1d2100e

Please sign in to comment.