Hi

The question I am generally not clear about is the unit to use for the
xaxis (the distance).
In the small script you provided it says:

function [f,a,sa,ns] = get_curve(datax,datay)
L = 10;
[n,x] = hist(datax,500);
edges = calc_edges(x,n,L);
[n,x] = histc(datax,edges);


I don't yet understand why to first hist with 500 and then reduce it
down to L=10, when calculating the edges. Could you explain this,
please?

This is just a little trick I used to get bins that have the same number of data points per bin, rather than bins of the same length. If you just need bins of the same length, you only need to use “hist” once with your chosen number of bins.



Would it make sense to bin the histogram according to the number of
1-voxel steps between the two COG of ROI_A and ROI_B, e.g.?

Sure, but you won’t have many data points per bin..

Cheers
Saad



Thank you very much in advance!
Markus

2014-08-15 12:12 GMT+02:00 Saad Jbabdi <[log in to unmask]>:
Hi Markus

Instead of taking the maximum of distA_B or distB_A, you can take the
average distance within A or B as your maximum distance, then bin your FA
histograms with distances ranging from 0 to avg_distA and avg_distB for
connections from B->A and A->B respectively.

Cheers
Saad

On 14 Aug 2014, at 15:24, Markus Gschwind <[log in to unmask]> wrote:

Dear all, and especially Saad!

I have been digging this out, and I would like to discuss how to best
do this usign both tracking directions

I think best is to use the common thresholded path in MNI space to
exctract the FA (or other) values in MNI space, right.

However, when doing as Saad proposed, I can plot the FA distribution
along he distance for every tracking direction A_B and B_A
separatedly, but how could I combine both trackign directions A_B and
B_A together?

I tried using

max(dist_binA_B)  minus dist_bin_BA

in order to invert the direction of the plot for the B_A condition,
however the absolute distance between comes out random as the
max(dist_binA) does not really correpond to the absolute distance
between A and B, and doesnt make much sense.

Does anyone have any other idea? Has tried something that worked?

Thanks in advance!

Markus



2010-01-31 20:45 GMT+01:00 Saad Jbabdi <[log in to unmask]>:


Hi


Hi Saad, thanks for your answer.

i followed your instructions and used fslmeants with the --showall option

fslmeants -i dtifit_FA.nii.gz -o FA.txt -m cst_mask.nii.gz --showall
fslmeants -i path_dist.nii.gz -o dist.txt -m cst_mask.nii.gz --showall

and used the 4th line of each textfile for plotting. Is that right?



Yes that's right. you might need to discard the last column if i remember
right...




You can re-bin the distances using hist and calculate mean FA in each
bin.
I can send you some code if you find it hard to do this in matlab.



Ok I've attached two matlab functions that you can add to your path.

then you can use the following code:

load('fa.txt');fa=fa(4,1:end);
load('dist.txt');dist=dist(4,1:end-1);

[dist_bin,fa_avg,fa_std] = get_curve(dist,fa);
plot(dist,fa,'.');
errorbar(dist_bin,fa_avg,fa_std);


Cheers,
Saad.











--
Dr Markus Gschwind
Functional Brain Mapping Laboratory | Campus Biotech - Neuroscience
Department | phone +41.22.37.90.886
postal adress:  9 Chemin des Mines | Case postale 60 | 1211 Genève 20,
Switzerland
https://sites.google.com/site/fbmlab/


------------------------------------------------------------------
Saad Jbabdi, PhD
MRC Career Development Fellow &
University Research Lecturer

FMRIB Centre, University of Oxford,
John Radcliffe Hospital, Oxford, OX3 9DU, UK.
tel (+44)1865-222466  (fax 717)
www.ndcn.ox.ac.uk/team/researchers/saad-jbabdi






--
Dr Markus Gschwind
Functional Brain Mapping Laboratory | Campus Biotech - Neuroscience
Department | phone +41.22.37.90.886
postal adress:  9 Chemin des Mines | Case postale 60 | 1211 Genève 20,
Switzerland
https://sites.google.com/site/fbmlab/

------------------------------------------------------------------
Saad Jbabdi, PhD
MRC Career Development Fellow &
University Research Lecturer

FMRIB Centre, University of Oxford,
John Radcliffe Hospital, Oxford, OX3 9DU, UK. 
tel (+44)1865-222466  (fax 717)
www.ndcn.ox.ac.uk/team/researchers/saad-jbabdi