UCL / UCL/STIR

surprising conventions used for ProjDataInfoBlocksOnCylindricalNoArcCorr constructor and subsequent problems

Open
#1,706 0 comments 0 reactions 1 assignee View on GitHub

@KrisThielemans is already working on this.

Since May 15, 2026.

Dominant language
C++
Stars
160
Forks
113
Avg merge
12d 15h
Merged PRs (30d)
1

Description

I'm following the plot_scanner_LORs example

num_rings = scanner.get_num_rings()
num_dets_per_ring = scanner.get_num_detectors_per_ring()

#scanner.set_scanner_geometry("BlocksOnCylindrical")
#scanner.set_up()
# %% construct new span=1 data
# more complicated then it should be
min_r_diff = stir.IntVectorWithOffset((2 * num_rings - 1))
max_r_diff = stir.IntVectorWithOffset((2 * num_rings - 1))
num_ax_pps = stir.IntVectorWithOffset((2 * num_rings - 1))
for i in range(0, 2 * num_rings - 1, 1):
    min_r_diff[i] = -num_rings + 1 + i
    max_r_diff[i] = -num_rings + 1 + i
    if i < num_rings:
        num_ax_pps[i] = num_rings + min_r_diff[i]
    else:
        num_ax_pps[i] = num_rings - min_r_diff[i]
    # print(num_ax_pps[i])

proj_data_info_blocks = stir.ProjDataInfoBlocksOnCylindricalNoArcCorr(scanner, num_ax_pps, min_r_diff, max_r_diff,
                                                                      scanner.get_max_num_views(),
                                                                      scanner.get_max_num_non_arccorrected_bins())

Surprisingly, this gives min_segment_num=0, with the first segment corresponding to min_r_diff[0], as opposed to the usual "centred" approach, where segment_num range is symmetric.

This doesn't seem to cause problems, except for the VoxelsOnCartesianGrid constructor, which returns an image with only 1 plane

target = stir.FloatVoxelsOnCartesianGrid(proj_data_out.get_exam_info(), proj_data_out.get_proj_data_info(), zoom)

This is because that constructor uses segment 0 to find information
https://github.com/UCL/STIR/blob/4704b12cccb559866ab415152423e24258699b3d/src/buildblock/VoxelsOnCartesianGrid.cxx#L76-L78

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.