Fix imageExtrapolation.
This commit is contained in:
@@ -30,24 +30,18 @@ Matrix Recon::imageExtrapolation(const Matrix& aImg, int aDim)
|
||||
|
||||
if(!indexe.empty())
|
||||
{
|
||||
Matrix result = aImg;
|
||||
std::vector<int> lowerZIndexe;
|
||||
for(int i=0; i<=indexe[0] - 1; ++i)
|
||||
Matrix result = aImg;
|
||||
if(indexe[0] - 1 > 0)
|
||||
{
|
||||
lowerZIndexe.push_back(i);
|
||||
}
|
||||
for(int i=0; i<lowerZIndexe.size(); ++i)
|
||||
{
|
||||
Matrix insert = repmat(aImg($,$,indexe[0]).toMatrix(), 1, 1, sum(zIndexZero.block(0, 0, *lowerZIndexe.end()), FunctionDirection::All)[0]);
|
||||
Matrix insert = repmat(aImg($,$,indexe[0]).toMatrix(), 1, 1, indexe[0]);
|
||||
result.setBlock(2, 0, indexe[0] - 1, insert);
|
||||
}
|
||||
|
||||
// lowerZIndexe.clear();
|
||||
// for(size_t i=0; i<=*indexe.end(); ++i)
|
||||
// {
|
||||
// lowerZIndexe.push_back(i);
|
||||
// }
|
||||
Matrix insert = repmat(aImg($,$,*(indexe.end() - 1)).toMatrix(), 1, 1, sum(zIndexZero, FunctionDirection::All)[0]);
|
||||
result.setBlock(2, *(indexe.end()-1) + 1, zSize-1, insert);
|
||||
if(*(indexe.end()-1) + 1 < zSize-1)
|
||||
{
|
||||
Matrix insert = repmat(aImg($,$,*(indexe.end() - 1)).toMatrix(), 1, 1, zSize - *(indexe.end() - 1) - 1);
|
||||
result.setBlock(2, *(indexe.end()-1) + 1, zSize-1, insert);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user