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

public class DicomWriter extends loci.formats.FormatWriter implements 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

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Option for turning off TIFF metadata.
    static final String
     
    static final String
    Option 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, validBits

    Fields inherited from class loci.formats.FormatHandler

    COMPRESSION_SUFFIXES, currentId, format, LOGGER, metadataOptions, suffixes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
     
    static String
    formatFixedWidth(double v, int width)
    Format the given double as a string with no more than width characters.
    loci.formats.codec.Codec
     
    int[]
     
    int
     
    int
     
     
    void
    saveBytes(int no, byte[] buf, int x, int y, int w, int h)
     
    void
    saveCompressedBytes(int no, byte[] buf, int x, int y, int w, int h)
     
    void
    setBigTiff(boolean bigTiff)
    Sets whether or not BigTIFF files should be written.
    void
    Add a tag provider.
    void
     
    void
     
    void
    setSeries(int s)
     
    int
    setTileSizeX(int tileSize)
     
    int
    setTileSizeY(int tileSize)
     
    protected org.perf4j.slf4j.Slf4JStopWatch
     
    boolean
    Checks 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, setWriteSequentially

    Methods inherited from class loci.formats.FormatHandler

    checkSuffix, checkSuffix, getFormat, getMetadataOptions, getNativeDataType, getSuffixes, getSupportedMetadataLevels, isThisType, setMetadataOptions

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface loci.formats.IFormatHandler

    getFormat, getNativeDataType, getSuffixes, isThisType

    Methods inherited from interface loci.formats.IMetadataConfigurable

    getMetadataOptions, getSupportedMetadataLevels, setMetadataOptions
  • Field Details

  • Constructor Details

    • DicomWriter

      public DicomWriter()
  • Method Details

    • setExtraMetadata

      public void setExtraMetadata(Object tagSource)
      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:
      setExtraMetadata in interface IExtraMetadataWriter
    • 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:
      setSeries in interface loci.formats.IFormatWriter
      Overrides:
      setSeries in class loci.formats.FormatWriter
      Throws:
      loci.formats.FormatException
    • setResolution

      public void setResolution(int r)
      Specified by:
      setResolution in interface loci.formats.IPyramidHandler
      Overrides:
      setResolution in class loci.formats.FormatWriter
    • getCodec

      public loci.formats.codec.Codec getCodec()
      Specified by:
      getCodec in interface loci.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:
      saveCompressedBytes in interface loci.formats.ICompressedTileWriter
      Throws:
      loci.formats.FormatException
      IOException
    • saveBytes

      public void saveBytes(int no, byte[] buf, int x, int y, int w, int h) throws loci.formats.FormatException, IOException
      Specified by:
      saveBytes in interface loci.formats.IFormatWriter
      Throws:
      loci.formats.FormatException
      IOException
      See Also:
      • IFormatWriter.saveBytes(int, byte[], int, int, int, int)
    • canDoStacks

      public boolean canDoStacks()
      Specified by:
      canDoStacks in interface loci.formats.IFormatWriter
      Overrides:
      canDoStacks in class loci.formats.FormatWriter
    • getPixelTypes

      public int[] getPixelTypes(String codec)
      Specified by:
      getPixelTypes in interface loci.formats.IFormatWriter
      Overrides:
      getPixelTypes in class loci.formats.FormatWriter
    • setId

      public void setId(String id) throws loci.formats.FormatException, IOException
      Specified by:
      setId in interface loci.formats.IFormatHandler
      Overrides:
      setId in class loci.formats.FormatWriter
      Throws:
      loci.formats.FormatException
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class loci.formats.FormatWriter
      Throws:
      IOException
    • setTileSizeX

      public int setTileSizeX(int tileSize) throws loci.formats.FormatException
      Specified by:
      setTileSizeX in interface loci.formats.IFormatWriter
      Overrides:
      setTileSizeX in class loci.formats.FormatWriter
      Throws:
      loci.formats.FormatException
    • getTileSizeX

      public int getTileSizeX()
      Specified by:
      getTileSizeX in interface loci.formats.IFormatWriter
      Overrides:
      getTileSizeX in class loci.formats.FormatWriter
    • setTileSizeY

      public int setTileSizeY(int tileSize) throws loci.formats.FormatException
      Specified by:
      setTileSizeY in interface loci.formats.IFormatWriter
      Overrides:
      setTileSizeY in class loci.formats.FormatWriter
      Throws:
      loci.formats.FormatException
    • getTileSizeY

      public int getTileSizeY()
      Specified by:
      getTileSizeY in interface loci.formats.IFormatWriter
      Overrides:
      getTileSizeY in class loci.formats.FormatWriter
    • getUIDRoot

      public String getUIDRoot()
    • formatFixedWidth

      public static String formatFixedWidth(double v, int width)
      Format the given double as a string with no more than width characters.
    • stopWatch

      protected org.perf4j.slf4j.Slf4JStopWatch stopWatch()