UCL / STIR

Software for Tomographic Image Reconstruction
http://stir.sourceforge.net/
Other
114 stars 95 forks source link

Error in triple energy window scatter correction formula #524

Closed mastergari closed 4 years ago

mastergari commented 4 years ago

The current triple energy window implementation in estimate_triple_energy_window_scatter_sinogram.cxx places the width of the lower energy window in the denominator of both summed terms and does not take into consideration the width of the upper energy window. The correct code should resemble:

`

  //     The following apply the the TEW method C_{scatter}=(C_{lower}/W_{lower}+C_{upper}/W_{upper})*W_{peak}/2

  pow_times_add divide_by_lower_width(add_scalar, 1/estimate.lower_width,power ,min_threshold ,max_threshold );
  pow_times_add divide_by_upper_width(add_scalar, 1/estimate.upper_width,power ,min_threshold ,max_threshold );
  pow_times_add mult_by_half_peak_width(add_scalar, estimate.peak_width/2,power ,min_threshold ,max_threshold );

  in_place_apply_function(filter_lower_segment_by_view, divide_by_lower_width);
  in_place_apply_function(filter_upper_segment_by_view, divide_by_upper_width);
  //in_place_apply_function(filter_upper_segment_by_view, divide_by_small_width);

   scatter_segment_by_view=filter_lower_segment_by_view;
   scatter_segment_by_view+=filter_upper_segment_by_view;

   in_place_apply_function(scatter_segment_by_view, mult_by_half_peak_width);`
danieldeidda commented 4 years ago

Hi, Thanks for your feedback. This utility follows the method in http://jnm.snmjournals.org/content/34/12/2216.long. Usually lower and upper window have the same width so it makes sense to divide for one of the two. If that is the way you were looking to use it the results will be the same. However, I suppose one would like to experiment the effect of using windows with asymmetric width. Is this what you want to do? I can have a go at this modification in the following weeks, but also feel free to make a pull request if you like. thanks Daniel

mastergari commented 4 years ago

Hi Daniel,

Thanks for the clarification. The comment in the script states “the following apply the TEW method ” when in fact the following code does not apply as written. It does not make use of the upper window width despite the user being required to enter the upper window width. The paper you provided is arguably more of a slight modification on the original TEW method.

I agree, usually lower and upper widths are equal, in which case the current implementation holds true. But shouldn’t that be up to the user to decide if they want both windows to be equal in width? Otherwise they are setting an upper width as a required parameter which would make most users think it has an effect, especially since most TEW sources in the literature cite the formula as defined by Ogawa in 1991.

To be honest, I’m looking at implementing a dual isotope SPECT protocol on a preclinical camera. The timing of the release of STIR 4 is parallel with my research where I’m just preparing to implement a TEW method. Seeing formulae for scatter correction is one thing, but seeing it implemented in code is an entirely different beast so I appreciate having your code as reference. Unfortunately, since STIR only supports SPECT recons with parallel hole collimators, I am unable to use STIR explicitly with my data.

Positively, Matthew

On May 2, 2020, at 9:41 AM, Daniel Deidda notifications@github.com wrote:

 CAUTION: The Sender of this email is not from within Dalhousie.

Hi, Thanks for your feedback. This utility follows the method in http://jnm.snmjournals.org/content/34/12/2216.long. Usually lower and upper window have the same width so it makes sense to divide for one of the two. If that is the way you were looking to use it the results will be the same. However, I suppose one would like to experiment the effect of using windows with asymmetric width. Is this what you want to do? I can have a go at this modification in the following weeks, but also feel free to make a pull request if you like. thanks Daniel

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/UCL/STIR/issues/524#issuecomment-622947741, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ANNU5SO43CVIJ6YB4YGOTP3RPQII5ANCNFSM4MXN3FOA.

danieldeidda commented 4 years ago

Hi, yes sure you are right it should be up to the user.

It would be great to have a Pinhole collimator model in STIR. Unfortunately, I am not sure when this will happen.