reading of PETSIRD list-mode function#1604
Conversation
…its from classes
…D listmode data classes.
STIR no longer vendors PETSIRD as a submodule. PETSIRD integration is expected via an external installation using find_package(PETSIRD).
Introduced generic tests
1. Figuring out flattened geometries from STIR2PETSIRD converter. 2. Fixing detection efficiency lookup in BinNormalisationFromPETSIRD. Still some normalisation issues to be resolved. 3. Get / Set positions for PETSIRD Listmode data.
KrisThielemans
left a comment
There was a problem hiding this comment.
This is mostly clean. thanks! A lot of my comments are housekeeping, but there are some important ones. Major thing is to keep this PR separate from other things (I won't accept this PR with them...), for example:
- there are some changes here for
set_proj_data_infowhich probably came from another PR. Maybe they'll disappear when you merge master here - 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.
- there's some changes in
find_basic_vs_nums...which don't belong here - I see no reason to make
InputFormat::can_readnon-const. If this is really required for PETSIRD, please explain. We should then work around it.
I guess the BinNormalisation isn't finished yet. I would suggest we currently call error and do it in a separate PR.
| ref: fix/cmake-export | ||
| path: PETSIRD | ||
|
|
||
| - name: Checkout Yardl (main) |
There was a problem hiding this comment.
we can use yardl 0.6.6 now, no need to self-build
| return false; | ||
| }; | ||
|
|
||
| std::vector<petsird::ReplicatedDetectorModule> replicated_module_list |
There was a problem hiding this comment.
why the copy? Can be const auto&?
| void | ||
| PETSIRDInfo::figure_out_block_angles(std::set<float>& unique_angle_modules, const int rot_axis) | ||
| { | ||
| std::vector<petsird::ReplicatedDetectorModule> replicated_module_list |
| // const int num_ax = blocks_per_bucket_axial * num_axial_crystals_per_block; | ||
| // const int num_tang = blocks_per_bucket_transaxial * num_trans_crystals_per_block; | ||
|
|
||
| std::cerr << "Tile size (groupSize) = " << groupSize << "\n"; |
There was a problem hiding this comment.
will want to comment this out, or replace with an info call at high verbosity (and sensible text)
| std::cerr << "Map size mismatch!\n" | ||
| << "Forward size: " << petsird_to_stir->size() << "\n" | ||
| << "Reverse size: " << stir_to_petsird->size() << std::endl; | ||
| error("Forward and reverse maps differ in size"); |
There was a problem hiding this comment.
merge all of that, e.g. using fmt::format as we cannot see stderr in ython for instance
| // rotate by 30 degrees | ||
| phi2 = 30 * _PI / 180; | ||
| VoxelsOnCartesianGrid<float> image2 = *image.get_empty_copy(); | ||
| VoxelsOnCartesianGrid<float> image2(image); // = *image.get_empty_copy(); |
There was a problem hiding this comment.
changes from other PR?
| # This is a temporary makefile used for development only. | ||
| # Do not use. Instead, use CMake for building | ||
| SWIG=swig | ||
| # CMAKE generated file: DO NOT EDIT! |
There was a problem hiding this comment.
certainly cannot have this. We should probably just delete this file (but not in this PR)
| - *addons_apt_packages | ||
| - [g++-6] | ||
| env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF" CC=gcc-6 CXX=g++-6 | ||
| env: EXTRA_BUILD_FLAGS="-DDISABLE_CERN_ROOT=1 -DSTIR_OPENMP:BOOL=OFF -DDISABLE_PETSIRD:BOOL=ON" CC=gcc-6 CXX=g++-6 |
There was a problem hiding this comment.
forget about .travis.yml, we should delete this file (but not in this PR)
| if(TARGET PETSIRD::petsird) | ||
| get_target_property(_petsird_libs PETSIRD::petsird INTERFACE_LINK_LIBRARIES) | ||
|
|
||
| # --- HDF5 --- | ||
| if(_petsird_libs MATCHES "HDF5::") | ||
| if(DISABLE_HDF5) | ||
| message(STATUS "PETSIRD was built with HDF5 → forcing DISABLE_HDF5=OFF") | ||
| set(DISABLE_HDF5 OFF CACHE BOOL "disable use of HDF5 libraries" FORCE) | ||
| endif() | ||
| endif() | ||
|
|
||
| # --- nlohmann_json (optional but recommended) --- | ||
| if(_petsird_libs MATCHES "nlohmann_json::") | ||
| if(DISABLE_NLOHMANN_JSON) | ||
| message(STATUS "PETSIRD was built with nlohmann_json → forcing DISABLE_NLOHMANN_JSON=OFF") | ||
| set(DISABLE_NLOHMANN_JSON OFF CACHE BOOL "disable use of nlohmann JSON libraries" FORCE) | ||
| endif() | ||
| endif() |
There was a problem hiding this comment.
I see no reason to do this. It might be that PETSIRD has it, but someone doesn't want to have it in STIR for whatever reason. Let's just cut this
| - mkdir install | ||
| - cd build | ||
| - cmake .. -GNinja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_INSTALL_PREFIX="C:\projects\stir\install" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_CONFIGURATION_TYPES=%CONFIGURATION% -DSTIR_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=OFF -DBUILD_SWIG_PYTHON:BOOL=ON -DPython_EXECUTABLE=%CONDA_PREFIX%\python.exe -DCMAKE_PREFIX_PATH:PATH="%CONDA_PREFIX%" | ||
| - cmake .. -GNinja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_INSTALL_PREFIX="C:\projects\stir\install" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_CONFIGURATION_TYPES=%CONFIGURATION% -DSTIR_OPENMP:BOOL=ON -DBUILD_DOCUMENTATION:BOOL=OFF -DDISABLE_PETSIRD:BOOL=ON -DBUILD_SWIG_PYTHON:BOOL=ON -DPython_EXECUTABLE=%CONDA_PREFIX%\python.exe -DCMAKE_PREFIX_PATH:PATH="%CONDA_PREFIX%" |
There was a problem hiding this comment.
hopefully no need for an explicit DISABLE_PETSIRD. Logic should be that it still works if it's not found
|
You van have mutable members
Kris
________________________________
From: Nikos Efthimiou ***@***.***>
Sent: Wednesday, March 4, 2026 10:02:46 AM
To: UCL/STIR ***@***.***>
Cc: Kris Thielemans ***@***.***>; Author ***@***.***>
Subject: Re: [UCL/STIR] reading of PETSIRD list-mode function (PR #1604)
⚠ Caution: External sender
@NikEfth commented on this pull request.
________________________________
In src/include/stir/IO/InputFileFormat.h<#1604 (comment)>:
@@ -46,7 +46,7 @@ class InputFileFormat
{
return this->actual_can_read(signature, input);
}
- virtual bool can_read(const FileSignature& signature, const std::string& filename) const
+ virtual bool can_read(const FileSignature& signature, const std::string& filename)
This was necessary to support both the HDF5 and binary versions of PETSIRD. I could not think another way arround it.
—
Reply to this email directly, view it on GitHub<#1604 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABQRIHMFCYAB5WGTRVX5QVT4O75MNAVCNFSM6AAAAACBU47CHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTQOBYGM4DKOJQHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
WIP