Skip to content

Commit

Permalink
Merge pull request #337 from zhujun98/dev
Browse files Browse the repository at this point in the history
Avoid destructing Reconstructor during reconstructing
  • Loading branch information
zhujun98 authored Aug 28, 2024
2 parents c90c946 + 770198f commit d87c73b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ make -j12 && make install

- Windows

TBD

#### Installing the GUI client

- Linux / MacOS
Expand All @@ -51,6 +53,8 @@ make -j12 && make install

- Windows

TBD

## Package managers

TBD
5 changes: 5 additions & 0 deletions docs/docs/performance_consideration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ Currently, the bottleneck of the data processing pipeline is the preprocessing p
is still implemented in CPU. The total number of threads of the current benchmark machine is
only 32. We expect a significant performance boost on a GPU node with a decent number of threads.

The 3 GB/s throughput was measured using a projection size of 512 x 512 pixels and 500 projections per scan.
The throughput will decrease as the total size of data per scan increases since the performance does
not scale linearly. If you need a high throughput with large projections sizes and/or large numbers of projections per
scan, it is recommended to down-sample the projections, which can be configured in the GUI.

## Visualization

The data rate in RECASTX is really high not only in terms of the raw
Expand Down
10 changes: 7 additions & 3 deletions recon/src/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,6 @@ void Application::initParams() {
group_size_ = (scan_mode_ == rpc::ScanMode_Mode_CONTINUOUS || angle_count_ == 0)
? scan_update_interval_ : angle_count_;
proj_mediator_->setFilter(group_size_);

sino_initialized_ = false;
gpu_buffer_index_ = 0;
}

void Application::maybeInitFlatFieldBuffer(uint32_t row_count, uint32_t col_count) {
Expand Down Expand Up @@ -601,6 +598,13 @@ void Application::initReconstructor(uint32_t col_count, uint32_t row_count) {
};

double_buffering_ = scan_mode_ == rpc::ScanMode_Mode_DYNAMIC;

std::lock_guard lck(recon_mtx_);

sino_uploaded_ = false;
sino_initialized_ = false;
gpu_buffer_index_ = 0;

recon_.reset();
recon_ = recon_factory_->create(proj_geom, slice_geom, volume_geom, double_buffering_);

Expand Down
10 changes: 8 additions & 2 deletions recon/src/reconstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ void ParallelBeamReconstructor::reconstructSlice(Orientation x, int buffer_idx,
py = scale.cwiseProduct(rot * py);
d -= 0.5f * (num_cols * px + num_rows * py);

vec_buf_[i] = {r[0], r[1], r[2], d[0], d[1], d[2], px[0], px[1], px[2], py[0], py[1], py[2]};
vec_buf_[i] = {r[0], r[1], r[2],
d[0], d[1], d[2],
px[0], px[1], px[2],
py[0], py[1], py[2]};
++i;
}

Expand Down Expand Up @@ -234,7 +237,10 @@ void ConeBeamReconstructor::reconstructSlice(Orientation x, int buffer_idx, Tens
t1 = scale.cwiseProduct(rot * t1);
t2 = scale.cwiseProduct(rot * t2);

vec_buf_[i] = {s[0], s[1], s[2], d[0], d[1], d[2], t1[0], t1[1], t1[2], t2[0], t2[1], t2[2]};
vec_buf_[i] = {s[0], s[1], s[2],
d[0], d[1], d[2],
t1[0], t1[1], t1[2],
t2[0], t2[1], t2[2]};
++i;
}

Expand Down

0 comments on commit d87c73b

Please sign in to comment.