|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.imageio.ImageWriter org.dcm4che2.imageioimpl.plugins.dcm.DicomImageWriter
public class DicomImageWriter
Write DICOM files containing images - handles transcoding to a new representation, as well as transcoding the images. Can also use raw data if the original type is the same type as the new one.
Field Summary | |
---|---|
protected DicomOutputStream |
dos
|
protected boolean |
encapsulated
|
protected javax.imageio.ImageWriteParam |
writeParam
The write param for the child element |
protected javax.imageio.ImageWriter |
writer
|
Fields inherited from class javax.imageio.ImageWriter |
---|
availableLocales, locale, originatingProvider, output, progressListeners, warningListeners, warningLocales |
Constructor Summary | |
---|---|
DicomImageWriter(javax.imageio.spi.ImageWriterSpi spi)
Create a new DICOM Image Writer. |
Method Summary | |
---|---|
boolean |
canWriteSequence()
Writing as a sequence is actually the preferred approach. |
javax.imageio.metadata.IIOMetadata |
convertImageMetadata(javax.imageio.metadata.IIOMetadata metadata,
javax.imageio.ImageTypeSpecifier type,
javax.imageio.ImageWriteParam param)
The image metadata provided MUST be of the correct type for the child image writer, as the meta-data will only be written to the child image. |
javax.imageio.metadata.IIOMetadata |
convertStreamMetadata(javax.imageio.metadata.IIOMetadata metadata,
javax.imageio.ImageWriteParam param)
Can't convert anything except existing DicomStreamMetaData |
void |
endWriteSequence()
Finish writing the header data to the stream. |
protected byte[] |
extractImageEncoding(javax.imageio.IIOImage iioimage,
javax.imageio.ImageWriteParam param)
This method gets the encoded image from the given object as a byte array of data. |
javax.imageio.metadata.IIOMetadata |
getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier image,
javax.imageio.ImageWriteParam writeParam)
No easy way to figure out what htis one as as the stream meta-data isn't yet available. |
javax.imageio.metadata.IIOMetadata |
getDefaultStreamMetadata(javax.imageio.ImageWriteParam arg0)
Get a default set of DICOM data to use in the stream meta-data. |
void |
prepareWriteSequence(javax.imageio.metadata.IIOMetadata metadata)
Start writing the intiial sequence. |
protected void |
setupWriter(javax.imageio.metadata.IIOMetadata metadata)
Sets up the child writer if it hasn't already been setup |
void |
updateDicomHeader(DicomStreamMetaData metadata,
java.awt.image.BufferedImage image)
This updates the metadata with relevant information from the image, such as the size etc. |
void |
write(javax.imageio.metadata.IIOMetadata metadata,
javax.imageio.IIOImage iioimage,
javax.imageio.ImageWriteParam param)
Writes the image, including the DICOM metadata. |
void |
writeBytesToSequence(byte[] data,
javax.imageio.ImageWriteParam param)
Write the given image as a byte array to the sequence. |
void |
writeToSequence(javax.imageio.IIOImage iioimage,
javax.imageio.ImageWriteParam param)
Write the given image to the sequence. |
Methods inherited from class javax.imageio.ImageWriter |
---|
abort, abortRequested, addIIOWriteProgressListener, addIIOWriteWarningListener, canInsertEmpty, canInsertImage, canRemoveImage, canReplaceImageMetadata, canReplacePixels, canReplaceStreamMetadata, canWriteEmpty, canWriteRasters, clearAbortRequest, dispose, endInsertEmpty, endReplacePixels, endWriteEmpty, getAvailableLocales, getDefaultWriteParam, getLocale, getNumThumbnailsSupported, getOriginatingProvider, getOutput, getPreferredThumbnailSizes, prepareInsertEmpty, prepareReplacePixels, prepareWriteEmpty, processImageComplete, processImageProgress, processImageStarted, processThumbnailComplete, processThumbnailProgress, processThumbnailStarted, processWarningOccurred, processWarningOccurred, processWriteAborted, removeAllIIOWriteProgressListeners, removeAllIIOWriteWarningListeners, removeIIOWriteProgressListener, removeIIOWriteWarningListener, removeImage, replaceImageMetadata, replacePixels, replacePixels, replaceStreamMetadata, reset, setLocale, setOutput, write, write, writeInsert |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DicomOutputStream dos
protected javax.imageio.ImageWriter writer
protected javax.imageio.ImageWriteParam writeParam
protected boolean encapsulated
Constructor Detail |
---|
public DicomImageWriter(javax.imageio.spi.ImageWriterSpi spi)
Method Detail |
---|
public javax.imageio.metadata.IIOMetadata convertImageMetadata(javax.imageio.metadata.IIOMetadata metadata, javax.imageio.ImageTypeSpecifier type, javax.imageio.ImageWriteParam param)
convertImageMetadata
in interface javax.imageio.ImageTranscoder
convertImageMetadata
in class javax.imageio.ImageWriter
public javax.imageio.metadata.IIOMetadata convertStreamMetadata(javax.imageio.metadata.IIOMetadata metadata, javax.imageio.ImageWriteParam param)
convertStreamMetadata
in interface javax.imageio.ImageTranscoder
convertStreamMetadata
in class javax.imageio.ImageWriter
public javax.imageio.metadata.IIOMetadata getDefaultImageMetadata(javax.imageio.ImageTypeSpecifier image, javax.imageio.ImageWriteParam writeParam)
getDefaultImageMetadata
in class javax.imageio.ImageWriter
public javax.imageio.metadata.IIOMetadata getDefaultStreamMetadata(javax.imageio.ImageWriteParam arg0)
getDefaultStreamMetadata
in class javax.imageio.ImageWriter
public void updateDicomHeader(DicomStreamMetaData metadata, java.awt.image.BufferedImage image)
metadata
- image
- public void write(javax.imageio.metadata.IIOMetadata metadata, javax.imageio.IIOImage iioimage, javax.imageio.ImageWriteParam param) throws java.io.IOException
write
in class javax.imageio.ImageWriter
java.io.IOException
public boolean canWriteSequence()
canWriteSequence
in class javax.imageio.ImageWriter
protected void setupWriter(javax.imageio.metadata.IIOMetadata metadata)
public void prepareWriteSequence(javax.imageio.metadata.IIOMetadata metadata) throws java.io.IOException
prepareWriteSequence
in class javax.imageio.ImageWriter
java.io.IOException
public void writeToSequence(javax.imageio.IIOImage iioimage, javax.imageio.ImageWriteParam param) throws java.io.IOException
writeToSequence
in class javax.imageio.ImageWriter
java.io.IOException
public void writeBytesToSequence(byte[] data, javax.imageio.ImageWriteParam param) throws java.io.IOException
java.io.IOException
protected byte[] extractImageEncoding(javax.imageio.IIOImage iioimage, javax.imageio.ImageWriteParam param) throws java.io.IOException
java.io.IOException
public void endWriteSequence() throws java.io.IOException
endWriteSequence
in class javax.imageio.ImageWriter
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |