UCL / UCL/STIR

SPECT image xy-origin is half a pixel off for even-sized images

Open
#1,235 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When even-sized, STIR PET images are non-symmetric, running from (-N/2),...(N/2-1) * voxel_size. This is taken into account in the PET projectors. However, the SPECT projectors take the centre in the middle as far as I understand. This means that our origin is wrong, and therefore LPS coordinates are also half a voxel off.

Changing this would also need changing https://github.com/UCL/STIR/blob/4a9391257c76e8b8b1b68c22bc81fa92033bff77/src/buildblock/VoxelsOnCartesianGrid.cxx#L303, which means it would be backwards incompatible in 2 ways:

  • default num_voxels_xy would no longer be odd (i.e. would be 1 smaller)
  • origin would be different when using an even number of voxels

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.

Research direction

Start with the SPECT projector coordinate handling and compare it with the PET projector behavior described in the issue. Inspect src/buildblock/VoxelsOnCartesianGrid.cxx at the linked line, focusing on the default num_voxels_xy and origin calculations. Done means the half-voxel origin discrepancy and both stated backward-compatibility implications have a clearly decided resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.