- Require ALL DCMCHE jar file
- dcm4che-imageio-2.0.25 (Special One)
- dcm4che-imageio-rle-2.0.25 (Special One)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Iterator<ImageReader> iter = ImageIO.getImageReadersByFormatName("DICOM"); | |
ImageReader readers = (ImageReader)iter.next(); | |
//return DicomImageReadParam | |
DicomImageReadParam param1 = (DicomImageReadParam) readers.getDefaultReadParam(); | |
// Adjust the values of Rows and Columns in it and add a Pixel Data attribute with the byte array from the DataBuffer of the scaled Raster | |
ImageInputStream iis = ImageIO.createImageInputStream(file); | |
//sets the input source to use the given ImageInputSteam or other Object | |
readers.setInput(iis, true); | |
BufferedImage image = readers.read(frameNumber, param1); | |
//Releases all of the native sreen resources used by this Window, its subcomponents, and all of its owned children | |
readers.dispose(); | |
ImageIO.write(image, "jpg", new File("D://dd1//"+value+".jpg")); |
No comments:
Post a Comment