Hello,
one more ;) option:
% === snip ===
clc;
betas = spm_select([1 Inf],'image','Select beta images',[],pwd,'beta_.*$');
V = spm_vol(betas);
try,
disp(['...reading in ' num2str(size(betas,1)) ', please wait...']);
betas = spm_read_vols(V);
catch
error(['...reading in ' num2str(size(betas,1)) ' beta images failed,
please check orientation and sizes!...']);
end;
done = 0;
counter = 0;
res = cell(100,3);
while done == 0
counter = counter +1;
coord_mm = spm_input('MNI coordinates to check','!+1','e',[0 0 0]);
if numel(coord_mm) ~= 3,
disp('...please supply three input values...');
continue;
end;
coord_vx = inv(V(1).mat) * [coord_mm 1]';
curr = squeeze(betas(round(coord_vx(1)), round(coord_vx(2)),
round(coord_vx(3)), :));
res{counter,1} = coord_mm;
res{counter,2} = round(coord_vx(1:3))';
res{counter,3} = curr';
done = spm_input('Done?','!+1','b', ' Yes| No', [1 0],1);
end;
res(counter+1:end,:) = [];
disp('...done; results were stored in the cell array res...');
% === snap ===
As always, linebreaks need to be acocunted for when copying to Matlab's
command window.
Hope this helps,
Marko
Guillaume Flandin wrote:
> Dear Deng & Helmut,
>
> just to mention that in SPM12 you can directly obtain betas from a
> single (suprathreshold) voxel or cluster from the context menu of the
> MIP. I'm open to other suggestions of options you might want to have
> access from there.
>
> Best regards,
> Guillaume.
>
>
>
> On 05/03/14 14:37, H. Nebl wrote:
>> Dear Deng,
>>
>>
>> alternatively, you could also build single-voxel ROIs corresponding to the coordinates of interest with Marsbar (works well with SPM8 but not with SPM12) and extract the beta/contrast estimates with that toolbox.
>>
>>
>> Best,
>>
>> Helmut
>>
>>
>> On Wed, 2014-03-05 at 13:04 +0000, SUBSCRIBE SPM Deng Wang wrote:
>>> Dear all,
>>>
>>> Does anyone know how to extract beta weights for a specific coordinate (for example MNI: x=-22;y=-10;z=52 or Talairach: x=-22;y=-16;z=49) in SPM8? I would appreciate it if you could reply to me.
>>>
>>> Best,
>>> Deng
>>
>
>
--
____________________________________________________
PD Dr. med. Marko Wilke
Facharzt für Kinder- und Jugendmedizin
Leiter, Experimentelle Pädiatrische Neurobildgebung
Universitäts-Kinderklinik
Abt. III (Neuropädiatrie)
Marko Wilke, MD, PhD
Pediatrician
Head, Experimental Pediatric Neuroimaging
University Children's Hospital
Dept. III (Pediatric Neurology)
Hoppe-Seyler-Str. 1
D - 72076 Tübingen, Germany
Tel. +49 7071 29-83416
Fax +49 7071 29-5473
[log in to unmask]
http://www.medizin.uni-tuebingen.de/kinder/epn/
____________________________________________________
|