Skip to content

Commit

Permalink
Adds ProjDataInMemory::read_from_file to return a ProjDataInMemory ob…
Browse files Browse the repository at this point in the history
…ject (#1510)

ProjDataInMemory::read_from_file to return a ProjDataInMemory object
  • Loading branch information
robbietuk authored Sep 13, 2024
1 parent e168b07 commit 6417022
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit 6417022

Please sign in to comment.