Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
profumo
PFM_Simulations
Commits
0d4f09ad
Commit
0d4f09ad
authored
Dec 08, 2019
by
Sam Harrison
Browse files
Remove `TwoColourTufteHist` dependency
New built-in `histogram` function is pretty decent.
parent
c6a704a2
Changes
4
Hide whitespace changes
Inline
Side-by-side
DataGeneration/generateBoldSignal.m
View file @
0d4f09ad
...
...
@@ -246,8 +246,9 @@ for s = 1:params.S
PA
{
s
}{
r
}
=
PA
{
s
}{
r
}
/
mPA
;
if
plotFigures
&&
(
s
==
1
)
&&
(
r
==
1
)
figure
;
TwoColourTufteHist
(
PA
{
s
}{
r
}(:),
49
,
'normalise'
,
...
'xlim'
,
1.2
*
[
-
1
1
]);
xlim
(
1.2
*
[
-
1
1
])
figure
;
histogram
(
PA
{
s
}{
r
}(:),
linspace
(
-
1.2
,
1.2
,
50
),
...
'Normalization'
,
'pdf'
);
xlim
(
1.2
*
[
-
1
1
]);
xlabel
(
'Kurtosis'
);
ylabel
(
'Probility density'
);
title
(
sprintf
(
'PA distribution pre-saturation (kurtosis: %.2f)'
,
...
kurtosis
(
PA
{
s
}{
r
}(:))))
...
...
@@ -271,8 +272,9 @@ for s = 1:params.S
legend
(
'Linear'
,
'Saturating'
)
title
(
'Saturating HRF: Comparison with linear HRF'
)
figure
;
TwoColourTufteHist
(
PA
{
s
}{
r
}(:),
49
,
'normalise'
,
...
'xlim'
,
1.2
*
[
-
1
1
]);
xlim
(
1.2
*
[
-
1
1
])
figure
;
histogram
(
PA
{
s
}{
r
}(:),
linspace
(
-
1.2
,
1.2
,
50
),
...
'Normalization'
,
'pdf'
);
xlim
(
1.2
*
[
-
1
1
]);
xlabel
(
'Kurtosis'
);
ylabel
(
'Probility density'
);
title
(
sprintf
(
'PA distribution post-saturation (kurtosis: %.2f)'
,
...
kurtosis
(
PA
{
s
}{
r
}(:))))
end
...
...
DataGeneration/generateData.m
View file @
0d4f09ad
...
...
@@ -137,7 +137,9 @@ end
%Plot noise distribution
if
plotFigures
s
=
randi
(
params
.
S
,
1
);
r
=
randi
(
params
.
R
(
s
),
1
);
figure
;
TwoColourTufteHist
(
noise
{
s
}{
r
}
/
std
(
noise
{
s
}{
r
}(:)),
'normalise'
)
figure
;
histogram
(
noise
{
s
}{
r
}
/
std
(
noise
{
s
}{
r
}(:)),
...
'Normalization'
,
'pdf'
);
xlabel
(
'Noise'
);
ylabel
(
'Probility density'
);
title
(
sprintf
(
'Noise distribution (kurtosis: %.2f)'
,
kurtosis
(
noise
{
s
}{
r
}(:))))
end
...
...
@@ -203,7 +205,9 @@ end
%Plot noise distribution
if
plotFigures
s
=
randi
(
params
.
S
,
1
);
r
=
randi
(
params
.
R
(
s
),
1
);
figure
;
TwoColourTufteHist
(
noise
{
s
}{
r
}
/
std
(
noise
{
s
}{
r
}(:)),
'normalise'
)
figure
;
histogram
(
noise
{
s
}{
r
}
/
std
(
noise
{
s
}{
r
}(:)),
...
'Normalization'
,
'pdf'
);
xlabel
(
'Noise'
);
ylabel
(
'Probility density'
);
title
(
sprintf
(
'Noise distribution (kurtosis: %.2f)'
,
kurtosis
(
noise
{
s
}{
r
}(:))))
[
U
,
S
,
V
]
=
svd
(
noise
{
s
}{
r
},
0
);
...
...
DataGeneration/generateMaps.m
View file @
0d4f09ad
...
...
@@ -501,7 +501,8 @@ colorbar; colormap(bluewhitered)
title
(
'Mean map'
)
%And the distribution of weights
figure
;
TwoColourTufteHist
(
Pg
(:),
'normalise'
)
figure
;
histogram
(
Pg
(:),
'Normalization'
,
'pdf'
);
xlabel
(
'Voxel value'
);
ylabel
(
'Probility density'
);
title
(
sprintf
(
'Mean map distribution (kurtosis: %.2f)'
,
kurtosis
(
Pg
(:))))
%Spatial correlations
...
...
@@ -561,8 +562,9 @@ PsPg = NaN(params.N, params.S); inds = 1:params.N;
for
s
=
1
:
params
.
S
PsPg
(:,
s
)
=
diag
(
cP
(
inds
,
s
*
params
.
N
+
inds
));
end
figure
;
TwoColourTufteHist
(
PsPg
(:),
'xlim'
,
[
-
1
1
],
'normalise'
);
xlabel
(
'Correlation'
);
ylabel
(
'Relative Frequency'
)
figure
;
histogram
(
PsPg
(:),
linspace
(
-
1.0
,
1.0
,
50
),
...
'Normalization'
,
'pdf'
);
xlim
([
-
1.0
1.0
]);
xlabel
(
'Correlation'
);
ylabel
(
'Probility density'
);
title
(
'Subject map - mean map correlations'
)
%Then to each other
...
...
@@ -570,8 +572,9 @@ cP = cP((params.N+1):end, (params.N+1):end); PsPs = [ ];
for
s
=
1
:(
params
.
S
-
1
)
PsPs
=
[
PsPs
;
diag
(
cP
,
s
*
params
.
N
)];
end
figure
;
TwoColourTufteHist
(
PsPs
(:),
'xlim'
,
[
-
1
1
],
'normalise'
);
xlabel
(
'Correlation'
);
ylabel
(
'Relative Frequency'
)
figure
;
histogram
(
PsPs
(:),
linspace
(
-
1.0
,
1.0
,
50
),
...
'Normalization'
,
'pdf'
);
xlim
([
-
1.0
1.0
]);
xlabel
(
'Correlation'
);
ylabel
(
'Probility density'
);
title
(
'Subject map - subject map correlations'
)
%--------------------------------------------------------------------------
...
...
DataGeneration/generateNeuralTimecourses.m
View file @
0d4f09ad
...
...
@@ -190,8 +190,8 @@ set(gca, 'YTick', 0); ylabel('FFT')
title
(
'Frequency content of neuronal signal'
)
%Plot the distribution of values
figure
;
TwoColourTufteHist
(
An
{
s
}{
r
}(:),
'
n
ormali
se
'
)
xlabel
(
'Neural signal (a.u.)'
);
ylabel
(
'
Relative Frequenc
y'
)
figure
;
histogram
(
An
{
s
}{
r
}(:),
'
N
ormali
zation'
,
'pdf
'
)
;
xlabel
(
'Neural signal (a.u.)'
);
ylabel
(
'
Probility densit
y'
)
;
title
(
'Distribution of neural activity'
)
%Look at temporal correlations
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment