Package loci.formats.out
Class DicomWriter
java.lang.Object
loci.formats.FormatHandler
loci.formats.FormatWriter
loci.formats.out.DicomWriter
- All Implemented Interfaces:
Closeable,AutoCloseable,loci.formats.ICompressedTileWriter,loci.formats.IFormatHandler,loci.formats.IFormatWriter,loci.formats.IMetadataConfigurable,loci.formats.IPyramidHandler,IExtraMetadataWriter
DicomWriter is the file format writer for DICOM files.
This is designed for whole slide images, and may not produce
schema-compliant files for other modalities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOption for turning off TIFF metadata.static final Stringstatic final StringOption for setting the organization root for UIDs.Fields inherited from class loci.formats.FormatWriter
cm, compression, compressionTypes, fps, initialized, interleaved, metadataRetrieve, options, out, resolution, resolutionData, sequential, series, validBitsFields inherited from class loci.formats.FormatHandler
COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclose()static StringformatFixedWidth(double v, int width) Format the given double as a string with no more thanwidthcharacters.loci.formats.codec.CodecgetCodec()int[]getPixelTypes(String codec) intintvoidsaveBytes(int no, byte[] buf, int x, int y, int w, int h) voidsaveCompressedBytes(int no, byte[] buf, int x, int y, int w, int h) voidsetBigTiff(boolean bigTiff) Sets whether or not BigTIFF files should be written.voidsetExtraMetadata(Object tagSource) Add a tag provider.voidvoidsetResolution(int r) voidsetSeries(int s) intsetTileSizeX(int tileSize) intsetTileSizeY(int tileSize) protected org.perf4j.slf4j.Slf4JStopWatchbooleanChecks the writer's associated MetadataOptions to see if dual personality writing has been explicitly enabled or disabled.Methods inherited from class loci.formats.FormatWriter
changeOutputFile, checkParams, createOutputStream, getCodecOptions, getColorModel, getCompression, getCompressionTypes, getFramesPerSecond, getMetadataRetrieve, getPixelTypes, getPlaneCount, getPlaneCount, getResolution, getResolutionCount, getResolutions, getSamplesPerPixel, getSamplesPerPixel, getSeries, getSizeX, getSizeY, hasResolutions, isFullPlane, isInterleaved, isSupportedType, saveBytes, saveBytes, savePlane, savePlane, savePlane, seekToPlaneOffset, setCodecOptions, setColorModel, setCompression, setFramesPerSecond, setInterleaved, setMetadataRetrieve, setResolutions, setValidBitsPerPixel, setWriteSequentiallyMethods inherited from class loci.formats.FormatHandler
checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface loci.formats.IFormatHandler
getFormat, getNativeDataType, getSuffixes, isThisTypeMethods inherited from interface loci.formats.IMetadataConfigurable
getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
-
Field Details
-
UID_ROOT_KEY
Option for setting the organization root for UIDs.- See Also:
-
UID_DEFAULT_ROOT
- See Also:
-
TIFF_KEY
Option for turning off TIFF metadata.- See Also:
-
-
Constructor Details
-
DicomWriter
public DicomWriter()
-
-
Method Details
-
setExtraMetadata
Add a tag provider. tagSource is expected to be either an ITagProvider, or a String file name that can be read by DicomJSONProvider.- Specified by:
setExtraMetadatain interfaceIExtraMetadataWriter
-
setBigTiff
public void setBigTiff(boolean bigTiff) Sets whether or not BigTIFF files should be written. This flag is not reset when close() is called. -
writeDualPersonality
public boolean writeDualPersonality()Checks the writer's associated MetadataOptions to see if dual personality writing has been explicitly enabled or disabled. If the option is not set, the default is to return true, enabling dual personality writing. -
setSeries
public void setSeries(int s) throws loci.formats.FormatException - Specified by:
setSeriesin interfaceloci.formats.IFormatWriter- Overrides:
setSeriesin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
setResolution
public void setResolution(int r) - Specified by:
setResolutionin interfaceloci.formats.IPyramidHandler- Overrides:
setResolutionin classloci.formats.FormatWriter
-
getCodec
public loci.formats.codec.Codec getCodec()- Specified by:
getCodecin interfaceloci.formats.ICompressedTileWriter
-
saveCompressedBytes
public void saveCompressedBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
saveCompressedBytesin interfaceloci.formats.ICompressedTileWriter- Throws:
loci.formats.FormatExceptionIOException
-
saveBytes
public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException - Specified by:
saveBytesin interfaceloci.formats.IFormatWriter- Throws:
loci.formats.FormatExceptionIOException- See Also:
-
IFormatWriter.saveBytes(int, byte[], int, int, int, int)
-
canDoStacks
public boolean canDoStacks()- Specified by:
canDoStacksin interfaceloci.formats.IFormatWriter- Overrides:
canDoStacksin classloci.formats.FormatWriter
-
getPixelTypes
- Specified by:
getPixelTypesin interfaceloci.formats.IFormatWriter- Overrides:
getPixelTypesin classloci.formats.FormatWriter
-
setId
- Specified by:
setIdin interfaceloci.formats.IFormatHandler- Overrides:
setIdin classloci.formats.FormatWriter- Throws:
loci.formats.FormatExceptionIOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classloci.formats.FormatWriter- Throws:
IOException
-
setTileSizeX
public int setTileSizeX(int tileSize) throws loci.formats.FormatException - Specified by:
setTileSizeXin interfaceloci.formats.IFormatWriter- Overrides:
setTileSizeXin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
getTileSizeX
public int getTileSizeX()- Specified by:
getTileSizeXin interfaceloci.formats.IFormatWriter- Overrides:
getTileSizeXin classloci.formats.FormatWriter
-
setTileSizeY
public int setTileSizeY(int tileSize) throws loci.formats.FormatException - Specified by:
setTileSizeYin interfaceloci.formats.IFormatWriter- Overrides:
setTileSizeYin classloci.formats.FormatWriter- Throws:
loci.formats.FormatException
-
getTileSizeY
public int getTileSizeY()- Specified by:
getTileSizeYin interfaceloci.formats.IFormatWriter- Overrides:
getTileSizeYin classloci.formats.FormatWriter
-
getUIDRoot
-
formatFixedWidth
Format the given double as a string with no more thanwidthcharacters. -
stopWatch
protected org.perf4j.slf4j.Slf4JStopWatch stopWatch()
-