Closed KrisThielemans closed 4 years ago
@francescaleek found another problem if we want to have norm-factors compressed data (e.g. span>1). Both the measured_data
and model_data
have to be uncompressed due to limitations in find/apply*
.
Only way that I see around this without STIR surgery is to keep outputting the efficiencies as above, and then manually using SSRB
to get to the desired span. i.e. make sure that all data is span=1 as before and have the script as
apply_normfactors3D $eff_factors $factors ones.hs 1 $outer_iters $eff_iters
echo "inverting the eff_factors to get norm"
stir_math -s --including-first --power -1 $OutputFilename $eff_factors
Then say
span=2
SSRB span${span}_${eff_factors} ${eff_factors} $span 1 0
stir_math -s --including-first --power -1 span${span}_$OutputFilename span${span}_$eff_factors
However, this might not work for span=2
. The STIR C++ (and python) code would be able to handle a "template" so we can work around this.
oh well.
Oh dear... This may be a problem...
the first step should use ones.hs. At the moment it's "unnormalising" the model_data (good to compare to the measured data, but not good to get nrom factors!)
This seems to be a mistype then that got merged. The script creates ones.hs
but never uses it.
Regarding the span, let me see if I can get this right. It seems that if span>1
is wanted, the unlisting of the measured_data
must be span-1
. The norm should computed with EstimateGATESTIRNorm.sh
and then compressed to span-2
However, this might not work for span=2. The STIR C++ (and python) code would be able to handle a "template" so we can work around this.
Sorry, I dont understand why this might not work...
I will follow with a PR correcting the errror https://github.com/UCL/STIR-GATE-Connection/blob/3fef6c42adb9e0492b87bffbdcf5c2f491f4a3f1/VoxelisedSimulation/SubScripts/EstimateGATESTIRNorm.sh#L57 and introducing the span variable and its application on the data.
https://github.com/UCL/STIR-GATE-Connection/blob/3fef6c42adb9e0492b87bffbdcf5c2f491f4a3f1/VoxelisedSimulation/SubScripts/EstimateGATESTIRNorm.sh#L57-L60
seems wrong on 2 levels:
ones.hs
. At the moment it's "unnormalising" themodel_data
(good to compare to the measured data, but not good to get nrom factors!)So I believe this should be
Some notes:
stir_math
either. I guess we just have to make sure that there are no zeroes in the estimated factors. (The estimation itself will be fine, it's passing it toBinNormalisationFromProjData
that is the problem, is that needs the norm factors)