Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

FilteredBackProjection crashes on any input

Open Beginner friendly
#227 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python, pytorch

Research direction

Start in algorithms/fbp.py and inspect FilteredBackProjection.init and call. Reproduce the small SPECT example, then verify the three reported failures involving self.proj, FFT dimensions, and projection-count handling are resolved. Done means FilteredBackProjection can be called on the example without these AttributeError or TypeError crashes.

Written by the indexing model from the issue text.

Description

Hi, thanks for maintaining PyTomography - I've been learning XCT reconstruction algorithms and reading the source has been really helpful.

I tried running FilteredBackProjection on a small SPECT example and it always crashes. Looking at algorithms/fbp.py, three things stand out:

  1. __init__ takes projections but never stores it (self.proj), while __call__ reads self.proj -> AttributeError on the first use.

  2. The FFT calls use axis=-2, but torch.fft.fft / ifft take dim (in older torch versions axis is not accepted at all, and the project requires torch>=1.10.2).

  3. len(self.system_matrix.proj_meta.shape[0]) calls len() on an int (shape[0] is the number of projections) -> TypeError. Looks like it should just be torch.pi / self.system_matrix.proj_meta.shape[0].

I confirmed the first crash locally (AttributeError on self.proj). It's possible I'm missing something, but this class seems unusable on any input right now. Let me know if you'd like me to open a PR for the fixes.

Dominant language
Python
Stars
173
Forks
38
Avg merge
1h 17m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

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.

More from PyTomography/PyTomography

All issues in PyTomography/PyTomography

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.