On Oct 28, 2008, at 9:13 PM, pixelhead wrote:
> Hi -
>
> I'm just starting out to use ImageJ for a project which will primarily
> leverage the I/O plugins from ImageJ. My program will be storing
> image data
> as ImagePlus objects. Right now, I'm looking at reading Analyze and
> NIFTI
> files. However, I noticed the Analyze_Reader_Writer plugin doesn't
> actually
> return any ImagePlus object.
>
> So I'm wondering:
> 1) is there a plugin to do this already?
> 2) if I implement my own plugin, do I just modify the
> Analyze_Reader class
> to extend the ImagePlus class?
> 3) also, since I'm not using the GUI or filters right now, I'm not
> instantiating a new ImageJ. I'm just using the static IJ.openFile
> ( String )
> method. I programmatically set the "plugins.dir" and it seems to
> work. I
> just wanted to double check I wasn't doing anything too unkosher.
The Nifti_Reader plugin implements ImagePlus so you can use it to
open a NifTI or Analyze file as an ImagePlus using
ImagePlus imp = (ImagePlus)IJ.runPlugIn("Nifti_Reader", path");
or
ImagePlus imp = IJ.openImage("path");
-wayne