Skip to content
Snippets Groups Projects
Commit d388463e authored by kar's avatar kar
Browse files

fixed small bug in matlab script for QSP

parent 6f889ed8
No related branches found
No related tags found
No related merge requests found
function [T1_max, T1_min, S1_max, S1_min, pdfCount] = spins_QSP_reader(filename)
% Reads in the csv file and interprets it in the correct way for the user.
%
% Input: Filename (string) name of csv file.
%
% Output: Returns the max/min values for T1 and S1 (as specified in
% spins.conf) and the (normalized) pdfCount histogram.
function [T1_max, T1_min, S1_max, S1_min, pdfCount] = spins_QSP_csv(filename)
%% Reads in the csv file and interprets it in the correct way for the user.
%%
%% Input:
%% Filename (string): name of csv file.
%%
%% Output:
%% T1_max (float): upper limit of the maximum-valued bin of T1 tracer
%% T1_min (float): lower limit of the minimum-valued bin of T1 tracer
%% S1_max (float): upper limit of the maximum-valued bin of S1 tracer
%% S1_min (float): lower limit of the minimum-valued bin of S1 tracer
A = importdata(filename);
T1_max = A(1, 1);
T1_min = A(1, 2);
S1_max = A(1, 3);
S1_min = A(1, 4);
pdfCount = A(2:end, :);
pdfCount /= sum(sum(pdfCount));
pdfCount = pdfCount / sum(sum(pdfCount));
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment