Skip to content

reading of PETSIRD list-mode function#1604

Open
KrisThielemans wants to merge 124 commits intomasterfrom
PETSIRD
Open

reading of PETSIRD list-mode function#1604
KrisThielemans wants to merge 124 commits intomasterfrom
PETSIRD

Conversation

@KrisThielemans
Copy link
Copy Markdown
Collaborator

WIP

@KrisThielemans KrisThielemans self-assigned this Jul 16, 2025
NikEfth added 8 commits March 20, 2026 10:29
…der and source files, as well as the use_hdf5 member variable, to match the original code. Also added the new cmakedefine for HAVE_PETSIRD_HDF5_PROTOCOLS in the STIRConfig.h.in file.
Copy link
Copy Markdown
Collaborator

@NikEfth NikEfth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[x] there are some changes here for set_proj_data_info which probably came from another PR. Maybe they'll disappear when you merge master here

  • Merged with master is fine now.

[ x] there are changes here to cope with even number of TOF bins. They might be good, but it doesn't have anything to do with PETSIRD.

  • I know. But I had to make them as the data shared by people in the hackathon had even number of bins. If you you want to compare with that we need these changes here. I can document more.

[x] there's some changes in find_basic_vs_nums... which don't belong here

  • Yes that code doesn't do anything atm.

[x] I see no reason to make InputFormat::can_read non-const. If this is really required for PETSIRD, please explain. We should then work around it.

  • Done

[x] I guess the BinNormalisation isn't finished yet. I would suggest we currently call error and do it in a separate PR.

  • No it is finished. Unless you have comments.

Comment on lines +20 to +21
- Mat3: std::array<std::array<float,3>,3> for compact fixed-size storage.
- Vec3: std::array<float,3> for simple 3D vectors.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I started a bit of this. From the test_ . It won't be hard.

class CListModeDataSAFIR : public CListModeDataBasedOnCoordinateMap
{
public:
/*! Constructor
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. Reverted

else
{
bin.timing_pos_num() = -timing_pos_num;
bin.timing_pos_num() = -timing_pos_num - (get_num_tof_poss() % 2 == 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry, I don't understand. We need to make adjustments for even and odd number of bins.

auto stir_scanner_sptr = petsird_info_sptr->get_scanner_sptr();

int tof_mash_factor = 1;
this->set_proj_data_info_sptr(std::const_pointer_cast<const ProjDataInfo>(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

experimenting.

Comment on lines +42 to +43
// for (int timing_pos_num = proj_data_info.get_min_tof_pos_num(); timing_pos_num <= proj_data_info.get_max_tof_pos_num();
// ++timing_pos_num)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is n't used atm.

@NikEfth NikEfth marked this pull request as ready for review March 20, 2026 13:04
Copy link
Copy Markdown
Collaborator Author

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some other clean-up suggestions

Comment on lines +363 to +369
find_unique_values(std::set<elemT>& values, const Array<num_dim, elemT>& input)
{
for (int i = input.get_min_index(); i <= input.get_max_index(); ++i)
{
find_unique_values(values, input[i]);
}
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail, as input[i] is an num_dim-1 array. You probably wanted to iterate using begin_all(), but as it doesn't create trouble, it means this function isn't used, so you could cut it. If it is needed, the 1D and nD implementation could be the same.

CMakeLists.txt Outdated
# minimum C++ version required (you can still ask for a more recent one
# by setting CMAKE_CXX_STANDARD)
UseCXX(17)
UseCXX(20)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can only do this for STIR 7.*. So I suggest we keep this here at 17, and make it 20 if we found PETSIRD (like what is done for ROOT)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did something similar, but maybe better.

Copy link
Copy Markdown
Collaborator

@NikEfth NikEfth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all done

@NikEfth
Copy link
Copy Markdown
Collaborator

NikEfth commented Mar 20, 2026

Do you want the PETSIRDInfo_helpers with stir::Arrays?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants