msscully/BRAINSStandAlone — comment on commit e0a4c0fd86b7b7bf9a54c749f95aa55cf85300fd
File: BRAINSABC/brainseg/BRAINSABC.cxx line 378
By hjmjohnson:

Why avgValue/(inputImageList.size()+1) ?

It should be avgValue/(inputImageList.size())

Even better would be:
ImageRegionIteratorType imgItr( inputImageList[0],inputImageList[0]->GetRequestedRegion() );
const unsigned int inputListSize = inputImageList.size();
const float invListSize = 1.0F/static_cast(inputListSize);

...

for (unsigned int j=0; jGetPixel(idx);
}
averageImage->SetPixel(idx, static_cast(avgValue*invListSize);