Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Download Figures artifact
- name: Download Figures artifact

if: ${{ github.event.workflow_run.conclusion == 'success' }}
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -50,7 +50,7 @@ jobs:

# Download Data artifact
- name: Download Data artifact
if: ${{ github.event.workflow_run.conclusion == 'success' }}
#if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 4 additions & 6 deletions utilities/data_simulation/GenerateData.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,29 +185,27 @@ def simulate_training_data(self, bvalues, SNR = (5,100), n = 1000000, Drange = (
- Noise is applied after generating noise-free IVIM signals, using either Gaussian or Rician noise.
- Simulated signals are normalized by the mean S0 (b = 0) signal.
"""
test = self._rng.uniform(0, 1, (n, 3))
test = self._rng.uniform(0, 1, (n, 4))
D = Drange[0] + test[:, [0]] * (Drange[1] - Drange[0])
f = frange[0] + test[:, [1]] * (frange[1] - frange[0])
Dp = Dprange[0] + test[:, [2]] * (Dprange[1] - Dprange[0])
#data_sim = np.zeros([len(D), len(bvalues)])
bvalues = np.array(bvalues)
if type(SNR) == tuple:
test = self._rng.uniform(0, 1, (n, 1))
SNR = np.exp(np.log(SNR[1]) + (test * (np.log(SNR[0]) - np.log(SNR[1]))))
noise_std = 1/SNR[1] + test[:,4] * (1/SNR[0] - 1/SNR[1])
addnoise = True
elif SNR == 0:
addnoise = False
SNR = np.ones((n, 1))
noise_std = np.ones((n, 1))
else:
SNR = np.full((n, 1), SNR)
noise_std = np.full((n, 1), 1/SNR)
addnoise = True
# loop over array to fill with simulated IVIM data
bvalues = np.array(bvalues).reshape(1, -1)
data_sim = 1 * (f * np.exp(-bvalues * Dp) + (1 - f) * np.exp(-bvalues * D))

# if SNR is set to zero, don't add noise
if addnoise:
noise_std = 1 / SNR # shape (n, 1)
noise_real = self._rng.normal(0, noise_std, data_sim.shape)
noise_imag = self._rng.normal(0, noise_std, data_sim.shape)

Expand Down
Loading