Login  Register

Re: How to export images into DICOM in Java code??

Posted by Johannes Hermen on Aug 21, 2012; 5:45am
URL: http://imagej.273.s1.nabble.com/How-to-export-images-into-DICOM-in-Java-code-tp4999810p4999815.html

Take a look at our DICOM Toolkit

http://www.santec.lu/project/dicom

it offers a DICOM Exporter class:

DicomExporter exporter = new DicomExporter();
File dcmFile = new File("/home/hermenj/jhermen.dcm");
ImagePlus ip = new ImagePlus("/home/hermenj/im0");
DicomObject dObj = exporter.createHeader(ip, true, true, true);
exporter.write(dObj, ip, dcmFile, true);


Greets
      Johannes



-----------------------------------------------------------------
Johannes Hermen  -  Ingenieur de Recherche
[hidden email]
-----------------------------------------------------------------
CRP Henri Tudor  http://www.santec.tudor.lu
29, Avenue John F. Kennedy
L-1855 Luxembourg
-----------------------------------------------------------------



From: 周鑫 <[hidden email]>
To: <[hidden email]>,
Date: 18.08.2012 10:49
Subject: How to export images into DICOM in Java code??
Sent by: ImageJ Interest Group <[hidden email]>



Hello Hacklaender,

I'm a developer working with ImageJ for quite a long time.

It was recently that I discovered ImageJ does not have a function like
saveAsDicom,

and the only possibility seems to be using plugins such as dcmie or
tudordicom......

Both plugins are quite big, with non-necessary code for my research
project.

As dcmie requires less third-part dependency, I try to make it work for my
project.

I red the Dcm_Export.java and FileExporter.java, but still has no idea
about how to make it work.

Suppose that I have two variables, a ImagePlus "imp" which contains the
images and a path "path" to save as.

Usually suing FileSaver, it can be done in two lines:

=====================================

  FileSaver fs = new FileSaver(imp);
   fs.saveAsTiff(path);

=====================================

Now with Dcm_Export, I initialized an instance but did not find one
function which deal with the export.

The FileExporter, on the other hand, requires 4 variables, which are not
trivial to obtain from my point of view.

Could you give me a hand?

Best regards, Xin



--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html