Interfile to DICOM using libraries.

128 views
Skip to first unread message

pma...@hggm.es

unread,
Feb 6, 2014, 8:04:32 AM2/6/14
to dcm...@googlegroups.com
Hi everyone;

Could someone say me How could I use the libraries for converting images in interfile format to DICOM?

Thanks in advance.

Dimitri Pianeta

unread,
Feb 9, 2014, 8:41:09 AM2/9/14
to
Here code solve jpeg to dicom:



public class Testjpg2Dcm {
   
public static void main(String[] args) throws IOException, ImageReadException, ImageWriteException, Exception {
 
       
       
       
                     
JFileChooser choix = new JFileChooser();
     choix
.setFileSelectionMode(JFileChooser.FILES_ONLY);//sélectionne que le répertoire
                 
         
       
int retour = choix.showOpenDialog(null);
     
if(retour == JFileChooser.APPROVE_OPTION){
                   
       
File fileInput = choix.getSelectedFile();
       
JFileChooser saveDicom = new JFileChooser();
                saveDicom
.setFileSelectionMode(JFileChooser.FILES_ONLY);
        saveDicom
.setMultiSelectionEnabled(false);
        saveDicom
.showSaveDialog(null);
       
File fileOutput =saveDicom.getSelectedFile();
jpgdcm jpg
= new jpgdcm(fileInput,fileOutput);

   
   
}
}
 


jpgdcm.java

pma...@hggm.es

unread,
Feb 10, 2014, 5:30:44 AM2/10/14
to dcm...@googlegroups.com
Thank you Dimitri.

The format that I want to transform is similar to interfile but with more fields. Thinking about an interface for converting any image to DICOM. Because is faster and I needed for my job I will probably use the xml2dcm example ( any format (interface) -> XML -> DICOM ) instead directly to DICOM (any format (interface) -> DICOM). I will check your code and the xml2dcm code and I will do my best, lol. 

Best Regards. 
Message has been deleted

Dimitri Pianeta

unread,
Feb 10, 2014, 7:33:07 AM2/10/14
to dcm...@googlegroups.com
Here  solving xml to dcm
XmlDcm.java

Pedro Macías Gordaliza

unread,
Feb 11, 2014, 5:45:50 AM2/11/14
to dcm...@googlegroups.com
I got something similar from the xml2dcm example, but what about a case with multiple slices and frames?


2014-02-10 13:33 GMT+01:00 Dimitri Pianeta <dimitri...@gmail.com>:
Here  solving xml to dcm

--
You received this message because you are subscribed to a topic in the Google Groups "dcm4che" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dcm4che/QGwPttnOYBc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dcm4che+u...@googlegroups.com.
To post to this group, send email to dcm...@googlegroups.com.
Visit this group at http://groups.google.com/group/dcm4che.
For more options, visit https://groups.google.com/groups/opt_out.

Dimitri Pianeta

unread,
Feb 11, 2014, 9:19:16 AM2/11/14
to dcm...@googlegroups.com
My idea is made sequence in VR=OW for Tag Pixel Data.
We will for example modality US.
I even can't  make. I think at this problem and make an example code.
 



Pedro Macías Gordaliza

unread,
Feb 11, 2014, 2:40:55 PM2/11/14
to dcm...@googlegroups.com
Thank you Dimitri.
Afraid me neither, max I can do is split the raw data and create several DICOM files saving the position,thicness,ect in the corrects fields. 
Other issue for me is what can I do when I have 32-bit bits per sample?? (7FE0,0010) just allow OB or OW. maybe rescale slope?


Dimitri Pianeta

unread,
Feb 11, 2014, 5:18:55 PM2/11/14
to dcm...@googlegroups.com
8, 16 bits or 32 bits per sample meant that (2^32)-2 (4GB), and (7FE0, 0010) (Pixel Data) can OW.

Computing Tag PixelData :

ROWS * COLUMNS * NUMBER_OF_FRAMES * SAMPLES_PER_PIXEL * (BITS_ALLOCATED/8) 


OW meant Other Word String.

Pedro Macías Gordaliza

unread,
Feb 12, 2014, 1:03:15 PM2/12/14
to dcm...@googlegroups.com
Thank you Dimitri.
Thought OB goes for 1 - byte per sample and OW for 2 byte per sample, Which field can I use for indicating if the data is signed or unsigned? 


Pedro Macías Gordaliza

unread,
Feb 12, 2014, 1:08:58 PM2/12/14
to dcm...@googlegroups.com
Forget the last one, too much working today.lol... silly question.


Dimitri Pianeta

unread,
Feb 12, 2014, 3:10:05 PM2/12/14
to dcm...@googlegroups.com

Pedro Macías Gordaliza

unread,
Feb 13, 2014, 5:54:04 AM2/13/14
to dcm...@googlegroups.com
Last one,lol, What about float values? let's say 32 -bit real(float) values per pixel


2014-02-12 21:10 GMT+01:00 Dimitri Pianeta <dimitri...@gmail.com>:

Dimitri Pianeta

unread,
Feb 13, 2014, 7:59:09 AM2/13/14
to

These pixel Data can 32bits in integer (int).

Pedro Macías Gordaliza

unread,
Feb 13, 2014, 8:07:44 AM2/13/14
to dcm...@googlegroups.com
...yeah I know, but as the same way is possible to indicate signed or unsigned with the pixel representation element, is there one for float ? I am trying with rescale but I am getting nothing.


2014-02-13 13:58 GMT+01:00 Dimitri Pianeta <dimitri...@gmail.com>:

This pixel Data can 32bits in integer (int).

Dimitri Pianeta

unread,
Feb 13, 2014, 8:59:57 AM2/13/14
to dcm...@googlegroups.com
Let Pixel Representation (0028,0103) be  unsigned (0) or signed (1). By default, the tag (0028,0130) has value 0.
Pixel Representation has VR= US.

 

Reply all
Reply to author
Forward
0 new messages