-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9bb6d42
commit 9f94e16
Showing
14 changed files
with
501 additions
and
140 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
git clone https://www.github.com/qMRLab/qMRLab.git ../qMRLab | ||
cd ../qMRLab | ||
git checkout f481d86da7272ee0f74abdbe9020cf93be06000f | ||
cd binder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
repo2data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
clear all | ||
clc | ||
close all | ||
%% | ||
|
||
dim = 128; | ||
x=linspace(1,dim,dim); | ||
|
||
signal = 1000; | ||
|
||
PulseOpt.slope = dim/100; | ||
|
||
b1_func = signal*fermi_pulse(x, dim, PulseOpt); | ||
|
||
%% | ||
|
||
filtered_obj = filter_map(); | ||
filtered_obj.options.Smoothingfilter_Dimension = '2D'; | ||
data.Raw = repmat(b1_func, dim, 1); | ||
|
||
vox_range = 1:25; | ||
|
||
gauss_b1_1d = zeros(length(vox_range), dim); | ||
median_b1_1d = zeros(length(vox_range), dim); | ||
|
||
for ii=1:length(vox_range) | ||
fwhm_vox = vox_range(ii); | ||
|
||
filtered_obj.options.Smoothingfilter_sizex = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizey = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizez = fwhm_vox; | ||
|
||
filtered_obj.options.Smoothingfilter_Type = 'gaussian'; | ||
fit_results = filtered_obj.fit(data); | ||
gauss_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'median'; | ||
fit_results = filtered_obj.fit(data); | ||
median_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
end | ||
|
||
|
||
order_range = 1:25; | ||
|
||
spline_b1_1d = zeros(length(order_range), dim); | ||
poly_b1_1d = zeros(length(order_range), dim); | ||
|
||
|
||
for ii=1:length(order_range) | ||
filtered_obj.options.Smoothingfilter_order = order_range(ii); | ||
|
||
filtered_obj.options.Smoothingfilter_Type = 'spline'; | ||
fit_results = filtered_obj.fit(data); | ||
spline_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'polynomial'; | ||
fit_results = filtered_obj.fit(data); | ||
poly_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
end | ||
|
||
save("b1filt_fig1.mat", "b1_func", "gauss_b1_1d", "median_b1_1d", "spline_b1_1d", "poly_b1_1d", "vox_range", "order_range") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
clear all | ||
clc | ||
close all | ||
%% | ||
|
||
dim = 128; | ||
x=linspace(1,dim,dim); | ||
|
||
signal = 1000; | ||
|
||
PulseOpt.slope = dim/100; | ||
|
||
b1_func = signal*fermi_pulse(x, dim, PulseOpt); | ||
|
||
%% | ||
|
||
vox_range = 1:10; | ||
|
||
gauss_b1_1d = zeros(length(vox_range), dim); | ||
median_b1_1d = zeros(length(vox_range), dim); | ||
spline_b1_1d = zeros(length(vox_range), dim); | ||
|
||
for ii=1:length(vox_range) | ||
|
||
% Gaussian | ||
w = gausswin(2*vox_range(ii)+1, 2); | ||
w = w/sum(w); | ||
|
||
tmp_data = [zeros(1, vox_range(ii)) b1_func zeros(1, vox_range(ii))]; | ||
|
||
tmp = filter(w, 1, tmp_data); | ||
shifted_tmp_data = [tmp(vox_range(ii)+1:end) zeros(1,vox_range(ii))]; | ||
shifted_tmp_data(1:vox_range(ii)) = []; | ||
shifted_tmp_data(end-vox_range(ii)+1:end) = []; | ||
gauss_b1_1d(ii,:) = shifted_tmp_data; | ||
|
||
% Median | ||
median_b1_1d(ii,:) = medfilt1(b1_func,vox_range(ii)); | ||
|
||
% Spline | ||
spline_b1_1d(ii,:) = smoothn(b1_func, vox_range(ii)); | ||
end | ||
|
||
save("b1filt_fig1.mat", "b1_func", "gauss_b1_1d", "median_b1_1d", "spline_b1_1d", "vox_range") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
clear all | ||
clc | ||
close all | ||
%% | ||
|
||
dim = 128; | ||
x=linspace(1,dim,dim); | ||
|
||
signal = 1000; | ||
|
||
PulseOpt.slope = dim/100; | ||
|
||
b1_func = signal*fermi_pulse(x, dim, PulseOpt); | ||
|
||
%% Add noise | ||
|
||
SNR_range = 1:100; | ||
noisy_b1_1d = zeros(length(SNR_range), dim); | ||
|
||
%% | ||
|
||
filtered_obj = filter_map(); | ||
filtered_obj.options.Smoothingfilter_Dimension = '2D'; | ||
|
||
fwhm_vox = 5; | ||
filtered_obj.options.Smoothingfilter_sizex = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizey = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizez = fwhm_vox; | ||
|
||
filtered_obj.options.Smoothingfilter_order = 6; | ||
|
||
noisy_b1 = zeros(length(SNR_range), dim); | ||
gauss_b1_1d = zeros(length(SNR_range), dim); | ||
median_b1_1d = zeros(length(SNR_range), dim); | ||
spline_b1_1d = zeros(length(SNR_range), dim); | ||
poly_b1_1d = zeros(length(SNR_range), dim); | ||
|
||
for ii=1:length(SNR_range) | ||
noisy_b1(ii,:) = addNoise(b1_func, SNR_range(ii)); | ||
data.Raw = repmat(noisy_b1(ii,:), dim, 1); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'gaussian'; | ||
fit_results = filtered_obj.fit(data); | ||
gauss_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'median'; | ||
fit_results = filtered_obj.fit(data); | ||
median_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'spline'; | ||
fit_results = filtered_obj.fit(data); | ||
spline_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
|
||
|
||
filtered_obj.options.Smoothingfilter_Type = 'polynomial'; | ||
fit_results = filtered_obj.fit(data); | ||
poly_b1_1d(ii,:) = fit_results.Filtered(1,:); | ||
end | ||
|
||
save("b1filt_fig2.mat", "b1_func", "noisy_b1", "gauss_b1_1d", "median_b1_1d", "spline_b1_1d", "poly_b1_1d", "SNR_range") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
clear all | ||
clc | ||
close all | ||
%% | ||
|
||
dim = 128; | ||
x=linspace(1,dim,dim); | ||
|
||
signal = 1000; | ||
|
||
PulseOpt.slope = dim/100; | ||
|
||
b1_func = signal*fermi_pulse(x, dim, PulseOpt); | ||
|
||
%% Add noise | ||
|
||
SNR_range = 1:100; | ||
noisy_b1_1d = zeros(length(SNR_range), dim); | ||
|
||
%% | ||
|
||
filtered_obj = filter_map(); | ||
filtered_obj.options.Smoothingfilter_Dimension = '2D'; | ||
|
||
fwhm_vox = 5; | ||
filtered_obj.options.Smoothingfilter_sizex = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizey = fwhm_vox; | ||
filtered_obj.options.Smoothingfilter_sizez = fwhm_vox; | ||
|
||
smoothingfilter_order = 6; | ||
|
||
noisy_b1 = zeros(length(SNR_range), dim); | ||
gauss_b1_1d = zeros(length(SNR_range), dim); | ||
median_b1_1d = zeros(length(SNR_range), dim); | ||
spline_b1_1d = zeros(length(SNR_range), dim); | ||
poly_b1_1d = zeros(length(SNR_range), dim); | ||
|
||
for ii=1:length(SNR_range) | ||
|
||
noisy_b1(ii,:) = addNoise(b1_func, SNR_range(ii)); | ||
data.Raw = repmat(noisy_b1(ii,:), dim, 1); | ||
|
||
% Gaussian | ||
w = gausswin(2*fwhm_vox+1, 2); | ||
w = w/sum(w); | ||
|
||
tmp_data = [zeros(1, fwhm_vox) noisy_b1(ii,:) zeros(1, fwhm_vox)]; | ||
|
||
tmp = filter(w, 1, tmp_data); | ||
shifted_tmp_data = [tmp(fwhm_vox+1:end) zeros(1,fwhm_vox)]; | ||
shifted_tmp_data(1:fwhm_vox) = []; | ||
shifted_tmp_data(end-fwhm_vox+1:end) = []; | ||
gauss_b1_1d(ii,:) = shifted_tmp_data; | ||
|
||
% Median | ||
median_b1_1d(ii,:) = medfilt1(noisy_b1(ii,:),fwhm_vox); | ||
|
||
% Spline | ||
spline_b1_1d(ii,:) = smoothn(noisy_b1(ii,:), smoothingfilter_order); | ||
end | ||
|
||
save("b1filt_fig2.mat", "b1_func", "noisy_b1", "gauss_b1_1d", "median_b1_1d", "spline_b1_1d", "SNR_range") |
Oops, something went wrong.