Add transmissionReconstruction.
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
#include "Data/ElectricIndex.h"
|
||||
#include "Data/MetaData.h"
|
||||
#include "ShotList/ShotList.h"
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
using namespace Recon;
|
||||
@@ -18,12 +20,17 @@ using namespace Aurora;
|
||||
|
||||
namespace
|
||||
{
|
||||
std::vector<int> findTasIndex(TasIndicesPointer aTasIndices, int aTasNum)
|
||||
std::vector<int> findTasAndElementIndex(TasIndicesPointer aTasIndices, ReceiverIndicesPointer aReceiverIndices, const Matrix& aRl, const Matrix& aRn)
|
||||
{
|
||||
std::vector<int> result;
|
||||
Matrix sortRl = Matrix::copyFromRawData(aRl.getData(), aRl.getDimSize(0), aRl.getDimSize(1), aRl.getDimSize(2));
|
||||
Matrix sortRn = Matrix::copyFromRawData(aRn.getData(), aRn.getDimSize(0), aRn.getDimSize(1), aRn.getDimSize(2));
|
||||
std::sort(sortRl.getData(), sortRl.getData() + sortRl.getDataSize());
|
||||
std::sort(sortRn.getData(), sortRn.getData() + sortRn.getDataSize());
|
||||
for(int i=0; i<aTasIndices.getLength(); ++i)
|
||||
{
|
||||
if (aTasIndices.get()[i] == aTasNum)
|
||||
if (std::binary_search(sortRl.getData(), sortRl.getData() + sortRl.getDataSize(), aTasIndices.get()[i]) &&
|
||||
std::binary_search(sortRn.getData(), sortRn.getData() + sortRn.getDataSize(), aReceiverIndices.get()[i]) )
|
||||
{
|
||||
result.push_back(i);
|
||||
}
|
||||
@@ -37,8 +44,8 @@ AscanBlock Recon::getAscanBlock(Parser* aParser, const Aurora::Matrix& aMp, cons
|
||||
const Aurora::Matrix& aRl, const Aurora::Matrix& aRn)
|
||||
{
|
||||
AscanBlock result;
|
||||
int numScans = aMp.getDataSize() * aSl.getDataSize() * aSn.getDataSize() * aRl.getDataSize() * aRn.getDataSize();
|
||||
int numScansIndex = 0;
|
||||
size_t numScans = aMp.getDataSize() * aSl.getDataSize() * aSn.getDataSize() * aRl.getDataSize() * aRn.getDataSize();
|
||||
//size_t numScansIndex = 0;
|
||||
int ascanBlockSize = numScans * aParser->getMetaData().getSampleNumber();
|
||||
double* ascanBlockData = new double[ascanBlockSize];
|
||||
double* mpBlockData = new double[numScans];
|
||||
@@ -57,30 +64,39 @@ AscanBlock Recon::getAscanBlock(Parser* aParser, const Aurora::Matrix& aMp, cons
|
||||
OneTasAScanData oenTasData = aParser->getOneTasAscanDataOfMotorPosition(1);
|
||||
auto tasIndices = aParser->getMetaData().getTasIndices();
|
||||
auto receiverIndices = aParser->getMetaData().getReceiverIndices();
|
||||
auto tasElementMapper = findTasAndElementIndex(tasIndices, receiverIndices, aRl, aRn);
|
||||
|
||||
for(int mpIndex=0; mpIndex<aMp.getDataSize();++mpIndex)
|
||||
{
|
||||
for(int slIndex=0; slIndex<aSl.getDataSize();++slIndex)
|
||||
{
|
||||
OneTasAScanData oenTasData = aParser->getOneTasAscanDataOfMotorPosition(aSl[slIndex]);
|
||||
|
||||
for(int snIndex=0; snIndex<aSn.getDataSize();++snIndex)
|
||||
{
|
||||
//int mapperIndex = 0;
|
||||
#pragma omp parallel for
|
||||
for(int rlIndex=0; rlIndex<aRl.getDataSize();++rlIndex)
|
||||
{
|
||||
auto rElementIndex = findTasIndex(tasIndices, aRl[rlIndex]);
|
||||
for(int rnIndex=0; rnIndex<rElementIndex.size(); ++rnIndex)
|
||||
{
|
||||
for(int rnIndex=0; rnIndex<aRn.getDataSize(); ++rnIndex)
|
||||
{
|
||||
size_t mapperIndex = rnIndex + rlIndex*aRn.getDataSize();
|
||||
size_t numScansIndex = rnIndex + rlIndex*aRn.getDataSize() + snIndex * aRl.getDataSize() * aRn.getDataSize() +
|
||||
slIndex * aRl.getDataSize() * aRn.getDataSize() * aSn.getDataSize() +
|
||||
mpIndex * aRl.getDataSize() * aRn.getDataSize() * aSn.getDataSize() * aSl.getDataSize();
|
||||
MotorPosition mp = aMp[mpIndex] == 1 ? MotorPosition::MotorPosition1 : MotorPosition::MotorPosition2;
|
||||
AScanData ascan = aParser->searchAscanDataFromOneTasAscanDataOfMP(oenTasData, ElementIndex(GeometryIndex(aSn[snIndex])), TasElementIndex(aRl[rlIndex], ElementIndex(GeometryIndex(receiverIndices.get()[rElementIndex[rnIndex]]))), mp);
|
||||
std::copy(ascan.get() ,ascan.get() + ascan.getAscanDataLength(), ascanBlockData);
|
||||
ascanBlockData += ascan.getAscanDataLength();
|
||||
|
||||
AScanData ascan = aParser->searchAscanDataFromOneTasAscanDataOfMP(oenTasData, ElementIndex(GeometryIndex(aSn[snIndex])), TasElementIndex(tasIndices.get()[tasElementMapper[mapperIndex]], ElementIndex(GeometryIndex(receiverIndices.get()[tasElementMapper[mapperIndex]]))), mp);
|
||||
double* startPointer = ascanBlockData + numScansIndex * ascan.getAscanDataLength();
|
||||
std::copy(ascan.get() ,ascan.get() + ascan.getAscanDataLength(), startPointer);
|
||||
//ascanBlockData += ascan.getAscanDataLength();
|
||||
mpBlockData[numScansIndex] = aMp[mpIndex];
|
||||
slBlockData[numScansIndex] = aSl[slIndex];
|
||||
snBlockData[numScansIndex] = aSn[snIndex];
|
||||
rlBlockData[numScansIndex] = aRl[rlIndex];
|
||||
rnBlockData[numScansIndex] = receiverIndices.get()[rElementIndex[rnIndex]];
|
||||
rlBlockData[numScansIndex] = tasIndices.get()[tasElementMapper[mapperIndex]];
|
||||
rnBlockData[numScansIndex] = receiverIndices.get()[tasElementMapper[mapperIndex]];
|
||||
gainBlockData[numScansIndex] = ascan.getAmplification()[0];
|
||||
++numScansIndex;
|
||||
//++numScansIndex;
|
||||
//++mapperIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user