Last active
August 29, 2015 14:02
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")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment