Login  Register

Re: Need java code to uncompress a multiframe DICOM

Posted by vmunukutla on Jan 02, 2009; 1:26pm
URL: http://imagej.273.s1.nabble.com/Need-java-code-to-uncompress-a-multiframe-DICOM-tp3694125p3694126.html

Prashanth,

Thank very much for your value able suggestion.
Actaully my requirement is I will upload a compressed DICOM image from a web page and I have to uncompress the DICOM image and store the umcompressed images into the database.

Using bio-formats as a library I am able to get the uncompressed images.

But as I am uploading MultiFrame DICOM image from web page, is there any way to pass byte array as param to the IFormatReader.setId() method instead of file path.

import java.io.IOException;
import loci.formats.ChannelSeparator;
import loci.formats.FormatException;
import loci.formats.IFormatReader;
public class Read_Image {
          public static void main(String args[]) {
                   
                String id  = "D:\\compressed\\US-PAL-8-10x-echo.dcm";
                IFormatReader r = new ChannelSeparator();
                try {  
                      r.setId(id);
                      int num = r.getImageCount();    
                      System.out.println("num :: "+num);    
                }
                catch (FormatException exc) {
                     exc.printStackTrace();
                }
                catch (IOException exc) {
                    exc.printStackTrace();
                }
          }
}