Skip to content

Commit d9f424f

Browse files
committed
Reverted the const qualifier from the can_read method in both the header 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.
1 parent d4f640e commit d9f424f

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/IO/PETSIRDCListmodeInputFileFormat.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Class defining input file format for coincidence listmode data for PETSIRD.
44
5-
Copyright 2025, UMCG
5+
Copyright 2025, 2026 UMCG
66
Copyright 2025 National Physical Laboratory
77
88
Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,7 +38,7 @@
3838
START_NAMESPACE_STIR
3939

4040
bool
41-
PETSIRDCListmodeInputFileFormat::can_read(const FileSignature& signature, const std::string& filename)
41+
PETSIRDCListmodeInputFileFormat::can_read(const FileSignature& signature, const std::string& filename) const
4242
{
4343

4444
std::array<char, 4> hdf5_signature = { 'H', 'D', 'F', '5' };

src/include/stir/IO/InputFileFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class InputFileFormat
4646
{
4747
return this->actual_can_read(signature, input);
4848
}
49-
virtual bool can_read(const FileSignature& signature, const std::string& filename)
49+
virtual bool can_read(const FileSignature& signature, const std::string& filename) const
5050
{
5151
std::ifstream input;
5252
open_read_binary(input, filename);

src/include/stir/IO/PETSIRDCListmodeInputFileFormat.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Class defining input file format for coincidence listmode data for PETSIRD.
44
5-
Copyright 2025, UMCG
5+
Copyright 2025, 2026 UMCG
66
Copyright 2025 National Physical Laboratory
77
88
Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,12 +54,12 @@ class PETSIRDCListmodeInputFileFormat : public InputFileFormat<ListModeData>
5454
const std::string get_name() const override { return "PETSIRD"; }
5555

5656
//! Checks in binary data file for correct signature.
57-
bool can_read(const FileSignature& signature, const std::string& filename) override;
57+
bool can_read(const FileSignature& signature, const std::string& filename) const override;
5858

5959
protected:
6060
bool actual_can_read(const FileSignature& signature, std::istream& input) const override { return false; }
6161

62-
bool use_hdf5 = false;
62+
mutable bool use_hdf5 = false;
6363

6464
public:
6565
unique_ptr<data_type> read_from_file(std::istream& input) const override

src/include/stir/IO/SAFIRCListmodeInputFileFormat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class SAFIRCListmodeInputFileFormat : public InputFileFormat<ListModeData>, publ
9191

9292
//! Checks in binary data file for correct signature (can be either "SAFIR CListModeData", "NeuroLF CListModeData" or "MUPET
9393
//! CListModeData").
94-
bool can_read(const FileSignature& signature, const std::string& filename) override
94+
bool can_read(const FileSignature& signature, const std::string& filename) const override
9595
{
9696
// Looking for the right key in the parameter file
9797
std::ifstream par_file(filename.c_str());
@@ -151,7 +151,7 @@ class SAFIRCListmodeInputFileFormat : public InputFileFormat<ListModeData>, publ
151151
mutable std::string listmode_filename;
152152
mutable std::string crystal_map_filename;
153153
mutable std::string template_proj_data_filename;
154-
mutable double lor_randomization_sigma = 0.0;
154+
mutable double lor_randomization_sigma;
155155

156156
bool actual_can_read(const FileSignature& signature, std::istream& input) const override
157157
{

0 commit comments

Comments
 (0)