Nifti plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Nifti plugin

Ahearn, Dr Trevor S.
Hello,
 I'm trying to write a macro to convert a whole bunch of images from
analyze to nifti using the nifti_io.jar plugin. At the moment the line
saveAs("some format",path) doesn't recognise "nifti" or "nifti-1". Could
someone tell me what I've missed.

Thanks in advance


============================================
Dr. Trevor Ahearn
Research Fellow
Dept. Radiology and TauRX
Lilian Sutton Building
University of Aberdeen
Foresterhill
AB25 2ZD
tel: (01224) 559726
fax: (01224) 559718

===========================================
Reply | Threaded
Open this post in threaded view
|

Re: Nifti plugin

Wayne Rasband
The saveAs("some format",path) macro function does not support external
plugins such as nifti_io.jar. Instead, use the command recorder
(Plugins>Macros>Record) to generate the needed macro code. This is what
it generates when I save the blobs sample image using File>Save
As>NIfTI-1:

    run("NIfTI-1", "save=/Users/wayne/blobs.nii");

Use string concatenation to use a variable for the file path.

     path = getDirectory("home")+"blobs2.ii";
     run("NIfTI-1", "save=["+path+"]");

The brackets ("[" and "]") are needed if case the path contains a space.

-wayne

On Oct 25, 2007, at 7:25 AM, Ahearn, Dr Trevor S. wrote:

> Hello,
>  I'm trying to write a macro to convert a whole bunch of images from
> analyze to nifti using the nifti_io.jar plugin. At the moment the line
> saveAs("some format",path) doesn't recognise "nifti" or "nifti-1".
> Could
> someone tell me what I've missed.
>
> Thanks in advance
>
>
> ============================================
> Dr. Trevor Ahearn
> Research Fellow
> Dept. Radiology and TauRX
> Lilian Sutton Building
> University of Aberdeen
> Foresterhill
> AB25 2ZD
> tel: (01224) 559726
> fax: (01224) 559718
>
> ===========================================
>