Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TOF mashing to SSRB #1397

Open
KrisThielemans opened this issue Mar 11, 2024 · 2 comments
Open

add TOF mashing to SSRB #1397

KrisThielemans opened this issue Mar 11, 2024 · 2 comments

Comments

@KrisThielemans
Copy link
Collaborator

Some pointers to enable this.

The ProjDataInfo code:

  • this would need be deleted
    if (num_tof_bins_to_combine != 1)
    error("SSRB: num_tof_bins_to_combine (%d) currently needs to be 1", num_tof_bins_to_combine);
  • This looks fine
    if (num_tof_bins_to_combine != 1)
    {
    if (num_tof_bins_to_combine < 1)
    error("SSRB: num_tof_bins_to_combine needs to be at least 1");
    const int new_tof_mash_factor = in_proj_data_info_sptr->get_tof_mash_factor() * num_tof_bins_to_combine;
    out_proj_data_info_sptr->set_tof_mash_factor(new_tof_mash_factor);
    }

The actual rebinning code:

  • compute num_tof_bins_to_combine like for views
  • add in and out_timing_pos_num in various places when constructing the sinos
  • loop over out_timing_pos_num here
  • loop over in_timing_pos_num here
  • add num_tof_bins_to_combine in the normalisation step
    out_sino /= static_cast<float>(num_in_ax_pos * num_views_to_combine);
@NicoleJurjew
Copy link
Contributor

NicoleJurjew commented Mar 14, 2024

Hello Kris, thanks for the detailed instructions! I've implemented them (as best as I could) here, but I have a few questions/remarks (normalisation is currently incorrect, I've not touched that yet).

The code compiles and I have used it on some 3D Vision TOF data to get 2D Vision TOF data out. That "worked" (at least the output dimensions are correct, no further testing performed so far), with the following command:
SSRB det_effs_test.hs detection_efficiencies_SIRF.hs 9

Now I'm having trouble to call the command such that it tries to combine TOF bins. From this here:

void SSRB(const std::string& output_filename,
const ProjData& in_projdata,
const int num_segments_to_combine,
const int num_views_to_combine = 1,
const int num_tangential_poss_to_trim = 0,
const bool do_normalisation = true,
const int max_in_segment_num_to_process = -1,
const int num_tof_bins_to_combine = 1);

I thought that SSRB det_effs_test.hs detection_efficiencies_SIRF.hs 9 1 0 1 -1 33 should do the trick, but that just prompts the help docstring (which never mentions tof-bins). Could you please tell me how I need to do this? Do I need to change something in the code?

Other thoughts:

  • Don't we always want to have an odd number of TOF-bin? So, as for views, the num_tof_bins_to_combine must not be even then? Or is it more complicated?
  • I guess we need a check to make sure that non-TOF data is not called with a num_TOF_bins_to_combine greater than 1, but that's just a side note, can do that.

Thank you!

@KrisThielemans
Copy link
Collaborator Author

great!

Looks like you will need to adjust the utility as well, i.e. here and usage message etc.

  • Don't we always want to have an odd number of TOF-bin? So, as for views, the num_tof_bins_to_combine must not be even then? Or is it more complicated?

At present, the output number of TOF bins need to be odd, but @danieldeidda is addressing that in #1334 . I wouldn't put any checks in here, except for saying that it needs to divide (e.g. org_num_tof_bins % num_tof_bins_to_combine == 0)

  • I guess we need a check to make sure that non-TOF data is not called with a num_TOF_bins_to_combine greater than 1, but that's just a side note, can do that.

yes, the above check could handle that, but likely it needs another one like org_num_tof_bins >= num_tof_bins_to_combine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants