Skip to content

Commit 6417022

Browse files
authored
Adds ProjDataInMemory::read_from_file to return a ProjDataInMemory object (#1510)
ProjDataInMemory::read_from_file to return a ProjDataInMemory object
1 parent e168b07 commit 6417022

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

documentation/release_6.3.htm

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ <h3>Known problems</h3>
4848

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

51+
<h3>New functionality</h3>
52+
53+
<li>
54+
<code>ProjDataInMemory</code> <code>read_from_file</code> method now returns a <code>ProjDataInMemory</code> object.
55+
</li>
5156

5257
<h3>Changed functionality</h3>
5358

src/buildblock/ProjDataInMemory.cxx

+6
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ ProjDataInMemory::ProjDataInMemory(const ProjDataInMemory& proj_data)
350350
std::copy(proj_data.begin_all(), proj_data.end_all(), this->begin_all());
351351
}
352352

353+
shared_ptr<ProjDataInMemory>
354+
ProjDataInMemory::read_from_file(const std::string& filename)
355+
{
356+
return std::make_shared<ProjDataInMemory>(*ProjData::read_from_file(filename));
357+
}
358+
353359
float
354360
ProjDataInMemory::get_bin_value(Bin& bin)
355361
{

src/include/stir/ProjDataInMemory.h

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class ProjDataInMemory : public ProjData
6262
//! Copy constructor
6363
ProjDataInMemory(const ProjDataInMemory& proj_data);
6464

65+
//! A static member to get the projection data in memory from a file
66+
static shared_ptr<ProjDataInMemory> read_from_file(const std::string& filename);
67+
6568
Viewgram<float> get_viewgram(const int view_num,
6669
const int segment_num,
6770
const bool make_num_tangential_poss_odd = false,

0 commit comments

Comments
 (0)