DICOM Multiframe - Split into seperate DICOM files

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

DICOM Multiframe - Split into seperate DICOM files

StrongSteve
Hi Everybody!

As some of you might know, I am currently developing a web-based DICOM viewer based on ImageJ.

During the last few days I have been trying to support multiframe DICOM images. Unfortunately I have recognized some problems.

First of all it is nearly impossible to open large DICOM multiframe images (> 400Mb) as you nearly always run out of memory. Even increasing the JVM's memory is not an option. ;)

Secondly my DICOM viewer's design is aimed at single-frame DICOM files, that are cached and available locally. If not, they are loaded in the background.

Therefore I want to take the following approach.
When having downloaded a multiframe DICOM file to the client's cache, I want to split it up and save each slice (or is it called frame in the DICOM world?) as an individual DICOM file in the cache and pass it on to the viewing component for display.

But I am a little stuck on how to do this.
Altough I am already able to read a uncompressed multiframe DICOM file I have no idea on how to extract one slice after the other and save it as a DICOM file (it would be great if I could preserve the DICOM header as well).

How can I achive this using ImageJ?

Moreover I have the fear, that creating an ImagePlus object with the multiframe DICOM file to extract all slices, will result in loading the complete file into the memory. And this may be a problem, too.

Any ideas?

Thanks in Advance for both your time and knowledge! ;)

Greetings
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: DICOM Multiframe - Split into seperate DICOM files

ctrueden
Hi Stefan,

Why not use ImageJ's support for virtual stacks? That way, ImageJ only keeps
the currently visible plane in memory.

The Bio-Formats plugin (<http://www.loci.wisc.edu/ome/formats.html>)
supports multi-frame DICOM files, including the ability to open them as
virtual stacks to save memory. As each plane is displayed, it is read from
disk on the fly, and the previously visible plane is dropped.

You can use Bio-Formats as a Java library in your DICOM viewer application.
The Javadocs are online at <http://www.loci.wisc.edu/software/docs/>. Take a
look at loci.plugins.Importer and loci.plugins.CustomStack to see how it
works.

If you are reading DICOM planes across the network, you should be able to
create your own simple extension of VirtualStack (similar to CustomStack) to
read planes on the fly from the network, or from the cache, as needed.
ImageJ will only keep one plane at a time in memory.

-Curtis

On Thu, Mar 13, 2008 at 12:04 PM, StrongSteve <[hidden email]> wrote:

> Hi Everybody!
>
> As some of you might know, I am currently developing a web-based DICOM
> viewer based on ImageJ.
>
> During the last few days I have been trying to support multiframe DICOM
> images. Unfortunately I have recognized some problems.
>
> First of all it is nearly impossible to open large DICOM multiframe images
> (> 400Mb) as you nearly always run out of memory. Even increasing the
> JVM's
> memory is not an option. ;)
>
> Secondly my DICOM viewer's design is aimed at single-frame DICOM files,
> that
> are cached and available locally. If not, they are loaded in the
> background.
>
> Therefore I want to take the following approach.
> When having downloaded a multiframe DICOM file to the client's cache, I
> want
> to split it up and save each slice (or is it called frame in the DICOM
> world?) as an individual DICOM file in the cache and pass it on to the
> viewing component for display.
>
> But I am a little stuck on how to do this.
> Altough I am already able to read a uncompressed multiframe DICOM file I
> have no idea on how to extract one slice after the other and save it as a
> DICOM file (it would be great if I could preserve the DICOM header as
> well).
>
> How can I achive this using ImageJ?
>
> Moreover I have the fear, that creating an ImagePlus object with the
> multiframe DICOM file to extract all slices, will result in loading the
> complete file into the memory. And this may be a problem, too.
>
> Any ideas?
>
> Thanks in Advance for both your time and knowledge! ;)
>
> Greetings
> Stefan
> --
> View this message in context:
> http://www.nabble.com/DICOM-Multiframe---Split-into-seperate-DICOM-files-tp16031836p16031836.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: DICOM Multiframe - Split into seperate DICOM files

StrongSteve
In reply to this post by StrongSteve
Great idea, I will give it a try! Thanks a lot!

Nevertheless - just in case I will need it lateron for exporting specific slides - is there a way to save specific slides as single frame DICOM images?

StrongSteve wrote
Hi Everybody!

As some of you might know, I am currently developing a web-based DICOM viewer based on ImageJ.

During the last few days I have been trying to support multiframe DICOM images. Unfortunately I have recognized some problems.

First of all it is nearly impossible to open large DICOM multiframe images (> 400Mb) as you nearly always run out of memory. Even increasing the JVM's memory is not an option. ;)

Secondly my DICOM viewer's design is aimed at single-frame DICOM files, that are cached and available locally. If not, they are loaded in the background.

Therefore I want to take the following approach.
When having downloaded a multiframe DICOM file to the client's cache, I want to split it up and save each slice (or is it called frame in the DICOM world?) as an individual DICOM file in the cache and pass it on to the viewing component for display.

But I am a little stuck on how to do this.
Altough I am already able to read a uncompressed multiframe DICOM file I have no idea on how to extract one slice after the other and save it as a DICOM file (it would be great if I could preserve the DICOM header as well).

How can I achive this using ImageJ?

Moreover I have the fear, that creating an ImagePlus object with the multiframe DICOM file to extract all slices, will result in loading the complete file into the memory. And this may be a problem, too.

Any ideas?

Thanks in Advance for both your time and knowledge! ;)

Greetings
Stefan
Reply | Threaded
Open this post in threaded view
|

Re: DICOM Multiframe - Split into seperate DICOM files

ctrueden
Hi Stefan,

Nevertheless - just in case I will need it lateron for exporting specific
> slides - is there a way to save specific slides as single frame DICOM
> images?
>

I do not know if any plugins that can write DICOM format, but perhaps
someone else does. You could easily save individual frames as PNG, JPEG or
TIFF, though.

-Curtis

On Thu, Mar 13, 2008 at 1:28 PM, StrongSteve <[hidden email]> wrote:

> Great idea, I will give it a try! Thanks a lot!
>
> Nevertheless - just in case I will need it lateron for exporting specific
> slides - is there a way to save specific slides as single frame DICOM
> images?
>
>
> StrongSteve wrote:
> >
> > Hi Everybody!
> >
> > As some of you might know, I am currently developing a web-based DICOM
> > viewer based on ImageJ.
> >
> > During the last few days I have been trying to support multiframe DICOM
> > images. Unfortunately I have recognized some problems.
> >
> > First of all it is nearly impossible to open large DICOM multiframe
> images
> > (> 400Mb) as you nearly always run out of memory. Even increasing the
> > JVM's memory is not an option. ;)
> >
> > Secondly my DICOM viewer's design is aimed at single-frame DICOM files,
> > that are cached and available locally. If not, they are loaded in the
> > background.
> >
> > Therefore I want to take the following approach.
> > When having downloaded a multiframe DICOM file to the client's cache, I
> > want to split it up and save each slice (or is it called frame in the
> > DICOM world?) as an individual DICOM file in the cache and pass it on to
> > the viewing component for display.
> >
> > But I am a little stuck on how to do this.
> > Altough I am already able to read a uncompressed multiframe DICOM file I
> > have no idea on how to extract one slice after the other and save it as
> a
> > DICOM file (it would be great if I could preserve the DICOM header as
> > well).
> >
> > How can I achive this using ImageJ?
> >
> > Moreover I have the fear, that creating an ImagePlus object with the
> > multiframe DICOM file to extract all slices, will result in loading the
> > complete file into the memory. And this may be a problem, too.
> >
> > Any ideas?
> >
> > Thanks in Advance for both your time and knowledge! ;)
> >
> > Greetings
> > Stefan
> >
>
> --
> View this message in context:
> http://www.nabble.com/DICOM-Multiframe---Split-into-seperate-DICOM-files-tp16031836p16034956.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>