mekhaelt / B-Mode-Beamforming-in-Ultrasound-Imaging

Simulates B-Mode-Beamforming in Ultrasound Imaging
1 stars 1 forks source link

Overwritting on the loading RF data #2

Open Remo12392 opened 1 year ago

Remo12392 commented 1 year ago

In the following portion of the code

int dataBuffer::loadRFData(complex RFData, std::ifstream imagFile, std::ifstream realFile) { char line[100]; // char array to store input

for (int i = 0; i < numElement; i++) // Populate dataBuffer using a nested for loop
{
    for (int j = 0; j < numSample; j++)
    {
        realFile->getline(line, 100); // retrieves data stored within real file
        imagFile->getline(line, 100); // retrieves data stored within imag file

        // converts char array to a float and stores the value within the respective array
        RFData[i][j].real = atof(line);
        RFData[i][j].imag = atof(line);
    }
}
return 0;

}**

I can see that the line array is used concurrently for real and imaginary, so the data will be overwritten and same datas will be loaded on both real and imaginary of RF array.

Will you please check from your side @mekhaelt