Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ProjDataInMemory::read_from_file to return a ProjDataInMemory object #1510

Merged
merged 3 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions documentation/release_6.3.htm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ <h3>Known problems</h3>

<H2>What is new for developers (aside from what should be obvious from the above):</H2>

<h3>New functionality</h3>

<li>
<code>ProjDataInMemory</code> <code>read_from_file</code> method now returns a <code>ProjDataInMemory</code> object.
</li>

<h3>Changed functionality</h3>

Expand Down
6 changes: 6 additions & 0 deletions src/buildblock/ProjDataInMemory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ ProjDataInMemory::ProjDataInMemory(const ProjDataInMemory& proj_data)
std::copy(proj_data.begin_all(), proj_data.end_all(), this->begin_all());
}

shared_ptr<ProjDataInMemory>
ProjDataInMemory::read_from_file(const std::string& filename)
{
return std::make_shared<ProjDataInMemory>(*ProjData::read_from_file(filename));
}

float
ProjDataInMemory::get_bin_value(Bin& bin)
{
Expand Down
3 changes: 3 additions & 0 deletions src/include/stir/ProjDataInMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class ProjDataInMemory : public ProjData
//! Copy constructor
ProjDataInMemory(const ProjDataInMemory& proj_data);

//! A static member to get the projection data in memory from a file
static shared_ptr<ProjDataInMemory> read_from_file(const std::string& filename);

Viewgram<float> get_viewgram(const int view_num,
const int segment_num,
const bool make_num_tangential_poss_odd = false,
Expand Down
Loading