我正在尝试按照教程
读取 dicom 文件。这是我运行的一些代码
private static AttributeList list = new AttributeList();
public static void main(String[] args) {
String dicomFile = "/path/to/CT1_J2KR.dcm";
try {
list.read(dicomFile);
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));
OtherWordAttribute pixelAttribute = (OtherWordAttribute)(list.get(TagFromName.PixelData));
//get the 16 bit pixel data values
short[] data = pixelAttribute.getShortValues();
} catch (Exception e) {
e.printStackTrace();
}
}
private static String getTagInformation(AttributeTag attrTag) {
return Attribute.getDelimitedStringValuesOrEmptyString(list, attrTag);
}
但在
list.read(dicomFile);
我明白了
com.pixelmed.dicom.DicomException: No reader for JPEG2000 available for Transfer Syntax 1.2.840.10008.1.2.4.91
at com.pixelmed.dicom.CompressedFrameDecoder.selectReaderFromCodecsAvailable(CompressedFrameDecoder.java:290)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:913)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:1166)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:1284)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:1365)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:1333)
at com.pixelmed.dicom.AttributeList.read(AttributeList.java:1486)
at com.ibm.whi.breastadvisor.controller.BCADicomParser.parse(BCADicomParser.java:47)
at com.ibm.whi.breastadvisor.controller.test.BCADicomParserUnitTest.dicomTest(BCADicomParserUnitTest.java:20)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
我该如何解决?另外,这是我得到pixelmed jar的方法