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
ml_norm for virtual crystals #833
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.
This looks very nice to me. Thanks a lot.
I have 2 suggestions in the review below. In addition, I think we should get rid of the old make_fan_data
and its inverse. Otherwise we keep too much code duplication.
Add yourself as author and whoever owns your copyright in the headers. Also, add a note in release_5.0.htm in section changed functionality
.
const int num_physical_transaxial_crystals_per_block = num_transaxial_crystals_per_block - virtual_transaxial_crystals; | ||
|
||
const int num_physical_axial_crystals_per_block = num_axial_crystals_per_block - virtual_axial_crystals; |
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.
I guess we could just as well provide the member functions for these 2 as well.
src/buildblock/ML_norm.cxx
Outdated
int new_b = b - b/num_transaxial_crystals_per_block; | ||
int new_ra = ra - ra/ num_axial_crystals_per_block; | ||
int new_rb = rb - rb/num_axial_crystals_per_block; | ||
(*segment_ptr)[bin.axial_pos_num()][bin.view_num()][bin.tangential_pos_num()] = 0; |
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.
I suggest we use an extra input argument to the function gap_value
, defaulting to 0. It will also make it clearer what's happening here.
I believe this supersedes your other PR. If so, please close it by referring to this one. I don't understand the first picture. Can you provide a bit more detail? |
I used a cylinder source in gPET to cover the whole FOV and generated corresponding model projection data. It's hard to visualize the norm parameter. So I just use manip_segments to divide model_data by measure_data. And the result shows in the first picture. Maybe it's useless. |
easier to look at the inverse of it:
could do the trick |
I'd also compare measured data with model*eff_factors. I think you get the latter with |
they will be different because of noise of course. Hard to quantify that. But 19% doesn't look too bad. efficiencies look a bit strange but could be alright. I note that my text was confusing. with "eff_factors" I meant "eff*geo" (i.e. the total efficiency, also known as "1/norm_factors"). I'll call them "total_eff_factors" below. Things to compare measured with model*total_eff_factors:
Are you using https://github.com/UCL/STIR-GATE-Connection? If so, it tells you how to handle the norm (currently |
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.
can you merge master
in here to resolve the conflict? sorry.
src/buildblock/ML_norm.cxx
Outdated
/// **** This function make proj_data from fan_data while adding the intermodule gaps **** //// | ||
/// *** fan_data doesn't have gaps, proj_data has gaps *** /// | ||
void set_fan_data_add_gaps(ProjData& proj_data, | ||
const FanProjData& fan_data) | ||
const FanProjData& fan_data, const int gap_value) |
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.
float
please
src/include/stir/ML_norm.h
Outdated
void set_fan_data_add_gaps(ProjData& proj_data, | ||
const FanProjData& fan_data); | ||
const FanProjData& fan_data, | ||
const int gap_value=0); |
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.
const int gap_value=0); | |
const float gap_value=0.F); |
# Conflicts: # src/buildblock/ML_norm.cxx # src/include/stir/ML_norm.h
@gefeichen, will your mCT tests be affected by #838 and/or #837? |
Hi , I am sorry for the delay, I will test with my data tonight. |
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.
Hi @gefeichen
Thank you for your good work,
I don't have mCT data but from my data (which as we had discussed are slightly different ) (and your code) I saw that the last segment was coming out empty.
I don't think that this actually has to do with your modifications but, could you please check you last, and second to last segments? I believe that those would be +54 and +53 (?), might be wrong, though.
const int num_axial_blocks_in_max_delta = max_delta/(num_axial_crystals_per_block); | ||
const int new_max_delta = max_delta - (num_axial_blocks_in_max_delta)*virtual_axial_crystals; | ||
const int num_physical_detectors_per_ring = num_detectors_per_ring - num_transaxial_blocks*virtual_transaxial_crystals; | ||
const int num_physical_rings = num_rings - (num_axial_blocks-1)*virtual_axial_crystals; |
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.
I agree with this.
Hi @NikEfth |
This seems ready to me now, and we have the signed letter. @NikEfth if you have any final comments, let us know. Otherwise I'll merge |
I got it by dividing normalized projdata by raw projdata (mCT).
And no zero value found in
STIR/src/utilities/find_ML_normfactors3D.cxx
Line 162 in 882c261