2016-03-31 13 views
0

kullanarak DICOM görüntüden ayıklamak için windows platformda java kullanarak dicom görüntüden görüntü ve meta verileri ayıklamak çalışıyorum. Ben dcm4che'de yeniyim. kodum i tüm kavanoz dosyaları i içermelidir ... bana yardım edin hatayıgörüntü ve meta verileri java

Exception in thread "main" java.lang.NoClassDefFoundError:  org/dcm4che2/image/PartialComponentSampleModel 
at org.dcm4che2.imageioimpl.plugins.dcm.DicomImageReaderSpi.createReaderInstance(DicomImageReaderSpi.java:146) 
at javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320) 
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:529) 
at javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:513) 
at miec.extraction.extraction.extractionD(extraction.java:32) 
at miec.MIEC.main(MIEC.java:46) 
Caused by: java.lang.ClassNotFoundException: org.dcm4che2.image.PartialComponentSampleModel 
at java.net.URLClassLoader$1.run(URLClassLoader.java:372) 
at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
at java.security.AccessController.doPrivileged(Native Method) 
at java.net.URLClassLoader.findClass(URLClassLoader.java:360) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 
... 6 more 

alıyorum

..

+0

kodunuzu da ekleyin – Pavya

+0

Bu hatayı nasıl aldınız? – Pierre

cevap

0

Kullanım PixelMed
İşte örnek

import com.pixelmed.dicom.Attribute; 
import com.pixelmed.dicom.AttributeList; 
import com.pixelmed.dicom.AttributeTag; 
import com.pixelmed.dicom.TagFromName; 
import com.pixelmed.display.SourceImage; 


public class DisplayImageTagsToConsole { 

private static AttributeList list = new AttributeList(); 
public static void readDcmFile() { 
    String dicomFile = "E:\\eye\\demo12.dcm"; 

    try { 
     list.read(dicomFile); 
     System.out.println("Patient Name:" + getTagInformation(TagFromName.PatientName)); 
      System.out.println("Patient ID:" + getTagInformation(TagFromName.PatientID)); 
      System.out.println("Transfer Syntax:" + getTagInformation(TagFromName.TransferSyntaxUID)); 
     System.out.println("SOP Class:" + getTagInformation(TagFromName.SOPClassUID)); 
     System.out.println("Modality:" + getTagInformation(TagFromName.Modality)); 
     System.out.println("Samples Per Pixel:" + getTagInformation(TagFromName.SamplesPerPixel)); 
     System.out.println("Photometric Interpretation:" + getTagInformation(TagFromName.PhotometricInterpretation)); 
     System.out.println("Pixel Spacing:" + getTagInformation(TagFromName.PixelSpacing)); 
     System.out.println("Bits Allocated:" + getTagInformation(TagFromName.BitsAllocated)); 
     System.out.println("Bits Stored:" + getTagInformation(TagFromName.BitsStored)); 
     System.out.println("High Bit:" + getTagInformation(TagFromName.HighBit)); 
     SourceImage img = new com.pixelmed.display.SourceImage(list); 
     System.out.println("Number of frames " + img.getNumberOfFrames()); 
     System.out.println("Width " + img.getWidth());//all frames will have same width 
     System.out.println("Height " + img.getHeight());//all frames will have same height 
     System.out.println("Is Grayscale? " + img.isGrayscale()); 
     System.out.println("Pixel Data present:" + (list.get(TagFromName.PixelData) != null)); 

    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
} 

private static String getTagInformation(AttributeTag attrTag) { 
    return Attribute.getDelimitedStringValuesOrEmptyString(list, attrTag); 
    } 
}