A small printing utility is attached.
you can type in
savFig
and follow the instructions displayed (jpg as default format and portrait)
To save tif
savFig('filename','tif',gcf,1); %assuming graphical window as current fig,
%1: portrait tall, 2: landscape,
%3: portrait
%dont try pic format
On Tue, 24 Sep 2002, Ogg, Robert wrote:
> Screen capture with 'The GIMP' (a unix/linux photoshop-like program) works
> well to capture the spm graphics window, allowing you to crop etc before
> saving in a variety of file formats (tif included).
>
> Rob
>
> Robert J. Ogg, Ph.D.
> Department of Diagnostic Imaging
> St. Jude Children's Research Hospital
> tel: 901.495.2502 fax: 901.495.4398
> email: [log in to unmask]
>
>
> -----Original Message-----
> From: Michael Schlund [mailto:[log in to unmask]]
> Sent: Tuesday, September 24, 2002 12:48 PM
> To: [log in to unmask]
> Subject: Re: tif files in SPM99 Unix based
>
>
> To print info from the graphics window (e.g., slice images, sections etc...)
> to a .tif file, try typing in the MATLAB window:
>
> PRINT -DTIFF -NOUI YOUR_FILENAME.TIF
>
> Then you can open and edit in Phototshop etc...
>
> This works for me.
> Mike Schlund, Ph.D.
> JHUSOM and KKI
>
>
> >>> Matthew Brett <[log in to unmask]> 09/24/02 10:50AM >>>
> > Clear DayDear SPMers:
>
> Not sure how clear day I am, but...
>
> > How do you create a tiff file within SPM99 within a Unix system? I am
> able
> > to do this in SPM96, but I don't see a way to do it in SPM99. I'm unable
> to
> > open the tiff files I've created in SPM96 within UNIX and then emailed to
> a
> > computer with Microsoft Image and Powerpoint (trying to open the tif files
> > within Image or Powerpoint. I've tried both tiff, and tif endings. This
> > seems like it should be easy task...
> > Thanks in advance for any help,
> > Karen
>
> Have you tried changing the print output options:
>
> Defaults->Printing->Other output to file->Tiff
>
> and then printing in the normal way? This works for me at least...
>
> Best,
>
> Matthew
>
--
Kewei Chen, Ph.D
PET Bio-mathematician
from my Linux A31p IBM thinkPad
(Workstation power goes mobile)
reply to [log in to unmask]
function savFig(filename, fig_fmt, fig_h, ori);
%function savFig(filename, fig_fmt, fig_h, ori);
%filename is the filename the figure file is to be saved
%fig_fmt supports the followings:
%fig_fmt='gif': save as gif file
%fig_fmt='pcx': save as pcx file
%fig_fmt='cps': save as color ps file
%fig_fmt='pic': save as pict file
%fig_fmt='tif': save as tiff file
%fig_fmt='bmp': save as bmp file
%fig_fmt='jpg': save as jpeg file
% ........ will add more
%for current figure: let fig_h=gcf first;
% ori==1;orient tall
% ori==2;orient landscape;
% ori==3;orient portrait;
%fig_h is the handler for the figure to be saved
%e.g., gcf (get current figure handler)
if nargin<1;filename=input('file name for saving image: ','s');end;
if nargin<2;disp('****');disp('ASSUMING default JPEG format');fig_fmt='jpg';end;
if nargin<3;disp('using current figure');fig_h=gcf;disp('****');end;
if nargin<4;disp('1: orient tall (||)');disp('2: landscape (==)');
disp('3: portrait (||)');ori=input('which one: ');end;
banben=version;banben=str2num(banben(1));
if ori==1;orient tall
elseif ori==2;orient landscape;
elseif ori==3;orient portrait;end;
l=fig_h;
if fig_fmt=='gif';
eval(['print -dgif8 -f',int2str(l),' ',filename]);
elseif fig_fmt=='pcx';
eval(['print -dpcx256 -f',int2str(l),' ',filename]);
elseif fig_fmt=='tif';
%eval(['print -dtiffnocompression -f',int2str(l),' ',filename]);
eval(['print -noui -dtiff -f',int2str(l),' ',filename,'.tif']);
elseif fig_fmt=='cps';
eval(['print -noui -depsc2 -f',int2str(l),' ',filename]);
elseif fig_fmt=='jpg';
keyboard;
eval(['print -djpeg90 -f',int2str(l),' ',filename]);
elseif fig_fmt=='pic';
disp('use snapshot to draw the picture area and to save');
disp('it in snap.rgb file');
!snapshot
disp('When it is ready, press any key to continue');
pause;
unixstr=['!topict snap.rgb ',filename,'.pic'];
eval(unixstr);
delete snap.rgb
elseif fig_fmt=='bmp';
if banben<5;
disp('use snapshot to draw the picture area and to save');
disp('it in snap.rgb file');
!snapshot
disp('When it is ready, press any key to continue');
pause;
%eval(['print -dgif8 -f',int2str(l),' snap.gif']);
%eval(['print -dpcx256 -f',int2str(l),' snap.pcx']);
%unixs=['!/bcat/kw_prog/bin/imgconv/imconv snap.gif ',filename,'.bmp'];
%unixs=['!/bcat/kw_prog/bin/imgconv/imconv snap.pcx ',filename,'.bmp'];
unixs=['!/bcat/kw_prog/bin/imgconv/imconv snap.rgb ',filename,'.bmp'];
eval(unixs);
delete snap.rgb
else;
eval(['print -dbitmap -f',int2str(l),' ',filename]);
end;
else
error('not availabe yet');
end;
|