Fix discretizePositions

This commit is contained in:
kradchen
2023-05-31 14:43:09 +08:00
parent 1170b72d04
commit 30ea494d51
3 changed files with 17 additions and 4 deletions

View File

@@ -83,10 +83,22 @@ namespace Recon {
result.res = calculateResolution(result.ddims, result.dims);
int numDim = aVSenderCoordList.getDimSize(0);
auto tempDdims = result.ddims.block(0,0,numDim-1);
auto tempTransRes = repmat(transpose(result.res),1,2);
auto tempDivRes = repmat(transpose(tempDdims / result.res),1,2);
auto tempTransRes = repmat(transpose(result.res),1,aVSenderCoordList.getDimSize(1));
auto tempDivRes = repmat(transpose(tempDdims / result.res),1,aVSenderCoordList.getDimSize(1));
aVSenderCoordList = (aVSenderCoordList / tempTransRes) - tempDivRes + 1;
aVReceiverCoordList = (aVReceiverCoordList / tempTransRes) - tempDivRes + 1;
{
float* temp = new float[aVReceiverCoordList.getDataSize()]{0};
std::copy(aVReceiverCoordList.getData(),aVReceiverCoordList.getData()+aVReceiverCoordList.getDataSize(),temp);
std::copy(temp,temp+aVReceiverCoordList.getDataSize(),aVReceiverCoordList.getData());
delete [] temp;
}
{
float* temp = new float[aVSenderCoordList.getDataSize()]{0};
std::copy(aVSenderCoordList.getData(),aVSenderCoordList.getData()+aVSenderCoordList.getDataSize(),temp);
std::copy(temp,temp+aVSenderCoordList.getDataSize(),aVSenderCoordList.getData());
delete [] temp;
}
result.receiverCoordList = aVReceiverCoordList;
result.senderCoordList = aVSenderCoordList;
return result;

View File

@@ -4,7 +4,7 @@
namespace Recon {
struct DiscretizePositionValues{
Aurora::Matrix senderCoordList;
Aurora::Matrix receiverCoordList;
Aurora::Matrix receiverCoordList;
Aurora::Matrix ddims;
Aurora::Matrix dims;
Aurora::Matrix res;