Skip to content
Snippets Groups Projects
Commit af30c699 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

spead tweak in mrc io real_dumper

parent a733e379
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ u v w x . . . d*c*b*a b c d 3 ...@@ -74,7 +74,7 @@ u v w x . . . d*c*b*a b c d 3
#include <ost/base.hh> #include <ost/base.hh>
#include <ost/img/image_state.hh> #include <ost/img/image_state.hh>
#include <ost/img/alg/stat.hh> #include <ost/img/alg/stat_accumulator.hh>
#include <ost/img/alg/normalizer_factory.hh> #include <ost/img/alg/normalizer_factory.hh>
#include <ost/img/util.hh> #include <ost/img/util.hh>
#include <ost/img/progress.hh> #include <ost/img/progress.hh>
...@@ -294,11 +294,19 @@ public: ...@@ -294,11 +294,19 @@ public:
y=1.0; y=1.0;
z=1.0; z=1.0;
} }
ost::img::alg::Stat stat; ost::img::alg::StatAccumulator<1> acc;
im.Apply(stat); if(im.GetType()==img::REAL) {
amin=stat.GetMinimum(); img::image_state::RealSpatialImageState *isr=dynamic_cast<img::image_state::RealSpatialImageState*>(im.ImageStatePtr().get());
amax=stat.GetMaximum(); if(! isr){
amean=stat.GetMean(); throw(IOException("MRC/CCP4 export: dynamic cast failed in header base."));
}
for(Real* ptr = isr->Data().GetData(); ptr<isr->Data().GetEnd(); ++ptr) {
acc(*ptr);
}
amin=acc.GetMinimum();
amax=acc.GetMaximum();
amean=acc.GetMean();
}
for(unsigned int i=0;i<800;++i) for(unsigned int i=0;i<800;++i)
{ {
label[i]=' '; label[i]=' ';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment