Can't export ImagePlus as DICOM with FileExporter plugin

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

Can't export ImagePlus as DICOM with FileExporter plugin

Jim Cant
Hi,

I am having trouble saving a DICOM files using the 'FileExporter'
plugin in the package de.iftm.ij.plugins.dcmie;

The error message in a popup message box is
"image == null Can't create output file".

I can export an ImagePlus produced by opening a conventional DICOM
file.

What I can't export is a ImagePlus that I have created with my own
data using the bit of code below.  This images display happily in my
application. (I'm not using the ImageJ gui).


Can anyone help me with this?  I'd appreciate any advice or other
suggestions. Or is there another plugin I could use?  (Even an external tool that I could create a DICOM file from using the raw data would be useful.)

Thanks a lot.

jim cant

static public ImagePlus imageFromArray( String title, int width, int height,
                double[] imageAsVector )
{
    ImagePlus imagePlus = null;

    float[] imageData = Utils.doubleAryToFloatAry( imageAsVector );

    FloatProcessor floatProcessor = new FloatProcessor( width, height,
                        imageData, null );

    imagePlus = new ImagePlus( title, floatProcessor );

    return imagePlus;
}
Reply | Threaded
Open this post in threaded view
|

Re: Can't export ImagePlus as DICOM with FileExporter plugin

Jonathan Jackson-2
On Fri, 7 Sep 2007 09:10:08 -0700, Jim Cant <[hidden email]> wrote:

>Hi,
>
>I am having trouble saving a DICOM files using the 'FileExporter'
>plugin in the package de.iftm.ij.plugins.dcmie;
>
>The error message in a popup message box is
>"image == null Can't create output file".
>
>I can export an ImagePlus produced by opening a conventional DICOM
>file.
>
>What I can't export is a ImagePlus that I have created with my own
>data using the bit of code below.  This images display happily in my
>application. (I'm not using the ImageJ gui).
>

Have you tried specifying a full path name when saving the new image. Images
opened from disk keep a reference to the original directory from which they
came. It may be that the plugin is trying to save your image to a location
where you don't have write access, eg / on a *nix system.

Jon