On Thu, 7 Jun 2001, Badreddine Bencherif wrote:
> Dear SPM ers:
> Is there an equivalent in SPM99 to the XVIEWER in SPM96 (As I
> remember Tom Nichols added this feature in spm_mip).
> The XVIEWER allowed to see MIP of Z values in a nice contrasted
> window apart of the SPM windows.
Matthew replied, but just to make it part of jiscmail history...
Just add this to the end of spm_mip.m...
%
% Optionally bring up mip in X-viewer.
%
% For example, if you have xv on unix:
%
% global XVIEWER; XVIEWER = 'xv';
%
global XVIEWER
if ~isempty(XVIEWER) & isstr(XVIEWER)
% Make a tmp name...
t = clock;
TmpNm = sprintf('/tmp/mip%02d%02d%02d%02d%02d.pgm', ...
floor(t(3:6)),floor(100*(t(6)-floor(t(6)))));
fid = fopen(TmpNm,'w');
fprintf(fid,'P5\n%d %d\n255\n',size(mip));
fwrite(fid,fliplr(mip*255),'uchar');
fclose(fid);
unix(['(' XVIEWER ' ' TmpNm ';\rm ' TmpNm ' ) &']);
end
|