-
Notifications
You must be signed in to change notification settings - Fork 95
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
changing SPECTUB global variables to class members #1169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment in
\todo Variables wm, wmh and Rrad are currently global variables. This means that this code would be very dangerous |
remove extern declarations at
STIR/src/include/stir/recon_buildblock/SPECTUB_Weight3d.h
Lines 38 to 40 in 94efb22
extern wm_da_type wm; //! weight (or probability) matrix | |
extern wmh_type wmh; //! information to construct wm | |
extern float * Rrad; //! radii per view |
Will need to disable the copy-constructor which is something like
// disable copy-constructor as currently unsafe to copy due to bare pointers
ProjMatrixSPECTUB(const &ProjMatrixSPECTUB) = delete;
Ideally (in next step) make Rrad
and std::vector
such that we don't need to deallocate etc. Can then be passed to SPECTUB functions as &Rrad[0]
, which is of course a bit ugly... So we can leave that for later.
Where should this go I am guessing in the ProjMatrixByBinSPECTUB.h? |
notice a syntax error. that'll likely have to be ProjMatrixSPECTUB(const ProjMatrixSPECTUB&) = delete; |
removing unnecessary namespace;
let's try to make |
Linking errors
so some functions are still expecting the global varaibles |
use const * Rrad where possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! It is working fine.
Can you clean-up by removing comments, and adding something to release_5.2.htm
? (along the lines of "removed global variables in the SPECTUB code, such that we can now have multiple SPECTUB projectors (PR #1169)"
@samdporter want to try this out? it should work now. |
@mastergari we'll have to do the same for the pinhole code presumably. can do that later. |
Looks good with the tests in here. I'll do something a bit more difficult and let you know Sam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great. @samdporter let us know when you're happy.
Ok to squash-merge?
Looks good to me see updated repo |
No description provided.