creating pixelData in dcm4che3

161 views
Skip to first unread message

Dimitri Pianeta

unread,
Jan 21, 2014, 5:54:56 PM1/21/14
to


I made image pocessing with PixelData. My matrix is a lattrice (one dimension) of pixel and I arrive not put pixel in metdata.
I think that he will make use : putInt for example.




I will write new tag in dicom with use package dcm4che3.


Think for aids,
 

Dimitri Pianeta

unread,
Jan 21, 2014, 6:22:50 PM1/21/14
to dcm...@googlegroups.com

Solving is :


 private static DicomInputStream din;
    private static Attributes object, fmi;
  private DicomEncodingOptions encOpts = DicomEncodingOptions.DEFAULT;





private static Attributes loadDicomObject(File f) throws IOException {
        if (f == null)
            return null;
        DicomInputStream dis = new DicomInputStream(f);
    fmi = dis.getFileMetaInformation();
              object = dis.readDataset(-1,-1);
       
       
        try {
            return object;
        } finally {
            SafeClose.close(dis);
        }
    }


public void writeTo(File fileOutput) throws IOException {
                  
           
             
        DicomOutputStream dos = new DicomOutputStream( new File (fileOutput +".dcm"));
        dos.setEncodingOptions(encOpts);
        dos.writeDataset(fmi, object);
        dos.finish();
        dos.flush();
   


    }
Reply all
Reply to author
Forward
0 new messages