Dear Andreas:
Hooo boy...
With respect to my old code- I can't find that it requests an
additional order of slices from you so I don't know why that is an
issue. However, your questions prompted me to reevaluate the code and
I think that the previous version is not very good. I have revised
the code to make the selection of a reference slice transparent to
the user. I have sent this to Rik Henson for his review and I really
hesitate to give this out until we've fully debugged it. For now I
would recommend that you choose option 4 and put in your own order
(using spm's original code). Then choose the slice by writing out the
slices and their order. In the example of a descending interleaved
sequence (10 slices)
the order is [10 8 6 4 2 9 7 5 3 1]
and the middle reference slice (in time) could be achieved by using 2
in response to reference slice.
I check what spm_slice_timing is doing by extracting the relevant
code to look at the amount each slice should be shifted in time. The
code to deal with images and the code to put things in the fourier
domain is correct and doesn't have to be reexamined. Below is the
extracted code for examining the sliceorder and shiftamount. You can
then play with your choice of reference slice.
I'm not really sure about what you said regarding TA and TR, but
agree in principle that the code should be able to deal with these
kinds of issues though I haven't tested your specific question.
best regards,
Darren
============================
function current_slicetime
% Current code to work out slice timing algorithms. Extracted from
spm_slice_timing.m v.2.7
fprintf('\n');
nslices = input('Enter number of slices: ');
TR = input('Enter the TR: ');
Seq = input('Enter sequence type (1=asc, 2=desc, 3=inter, 4=user): ');
refslice = input('Enter reference slice: ');
if Seq==[1],
sliceorder = [1:1:nslices];
elseif Seq==[2],
sliceorder = [nslices:-1:1];
elseif Seq==[3],
% Assumes interleaved sequences top-middle downwards
for k=1:nslices,
sliceorder(k) = round((nslices-k)/2 +
(rem((nslices-k),2) * (nslices - 1)/2)) + 1;
end;
elseif Seq==[4],
sliceorder = input('Enter the sliceorder: ');
end;
% simplified TA calculation for simulation. If desired this
could be entered via an input statement.
TA = TR-TR/nslices;
timing(2) = TR - TA;
timing(1) = TA / (nslices -1);
factor = timing(1)/TR;
fprintf('\n');
shiftamount =[];
for k = 1:nslices,
shiftamount = [shiftamount (find(sliceorder==k) -
find(sliceorder==refslice)) * factor];
end
fprintf('sliceorder [')
for i = 1:length(sliceorder)
fprintf('%d ',sliceorder(i));
end
fprintf(']\n');
fprintf('shiftamount [')
for i = 1:length(shiftamount)
fprintf('%0.2f ',shiftamount(i));
end
fprintf(']\n');
-------------------------------------------------------------------------
Darren R. Gitelman, M.D.
Cognitive Neurology and Alzheimer's Disease Center
E-mail: [log in to unmask] WWW:
http://www.brain.northwestern.edu
Voice: (312) 908-9023 Fax: (312) 908-8789
Northwestern Univ., 320 E. Superior St., Searle 11-470, Chicago, IL 60611
-------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|