org.dcm4che.media
Class DirBuilderFactory

java.lang.Object
  extended by org.dcm4che.media.DirBuilderFactory

public abstract class DirBuilderFactory
extends java.lang.Object

A DirBuilderFactory instance can be used to create DirReader, DirWriter, DirBuilder and DirBuilderPref objects.

Version:
1.0.0
Author:
gunter.zeilinger@tiani.com

Constructor Summary
DirBuilderFactory()
           
 
Method Summary
static DirBuilderFactory getInstance()
          Obtain a new instance of a DirBuilderFactory.
static java.lang.String getRecordType(java.lang.String classUID)
           
abstract  DirBuilder newDirBuilder(DirWriter writer, DirBuilderPref pref)
          Creates new DirBuilder associated with specified DirWriter and with specified preferences.
abstract  DirBuilderPref newDirBuilderPref()
          Create empty preferences for DirBuilder.
abstract  DirReader newDirReader(java.io.File file)
          Construct a DirReader from a File.
abstract  DirReader newDirReader(javax.imageio.stream.ImageInputStream in)
          Construct a DirReader from an ImageInputStream.
abstract  DirWriter newDirWriter(java.io.File file, DcmEncodeParam encParam)
          Construct a DirWriter to update an existing DICOM dictionary.
abstract  DirWriter newDirWriter(java.io.File file, FileMetaInfo fmi, java.lang.String filesetID, java.io.File descriptorFile, java.lang.String specCharSet, DcmEncodeParam encParam)
          Create new DICOM dictionary specified by the File argument and explicit specified File Meta Information.
abstract  DirWriter newDirWriter(java.io.File file, java.lang.String uid, java.lang.String filesetID, java.io.File descriptorFile, java.lang.String specCharSet, DcmEncodeParam encParam)
          Create new DICOM dictionary specified by the File argument and the Media Storage SOP Instance UID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirBuilderFactory

public DirBuilderFactory()
Method Detail

getRecordType

public static java.lang.String getRecordType(java.lang.String classUID)

getInstance

public static DirBuilderFactory getInstance()
Obtain a new instance of a DirBuilderFactory. This static method creates a new factory instance.

Returns:
new DirBuilderFactory instance, never null.

newDirReader

public abstract DirReader newDirReader(java.io.File file)
                                throws java.io.IOException
Construct a DirReader from a File. Normally a File reference should be used rather than an ImageInputStream reference, so DirReader.getRefFile(String[]) can resolve fileIDs to an absolute File reference.

Parameters:
file - A file reference to an existing DICOM dictionary (DICOMDIR).
Returns:
DirReader to read content of specified DICOM dictionary.
Throws:
java.io.IOException - if file does not exist or is not a valid DICOM dictionary

newDirReader

public abstract DirReader newDirReader(javax.imageio.stream.ImageInputStream in)
                                throws java.io.IOException
Construct a DirReader from an ImageInputStream. Normally a File reference should be used rather than an ImageInputStream reference, so DirReader.getRefFile(String[]) can resolve a fileID to a absolute File reference.

Parameters:
in - A ImageInputStream reference to a DICOM dictionary (DICOMDIR).
Returns:
DirReader to read content of specified DICOM dictionary.
Throws:
java.io.IOException - if the ImageInputStream does not reference a valid DICOM dictionary

newDirWriter

public abstract DirWriter newDirWriter(java.io.File file,
                                       DcmEncodeParam encParam)
                                throws java.io.IOException
Construct a DirWriter to update an existing DICOM dictionary.

Parameters:
file - A file reference to an existing DICOM dictionary (DICOMDIR).
encParam - Specifies encoding options, for new added directory records. May be null, in which case default encoding options will be used.
Returns:
DirWriter to update content of specified DICOM dictionary.
Throws:
java.io.IOException - if file does not reference a valid DICOM dictionary.

newDirWriter

public abstract DirWriter newDirWriter(java.io.File file,
                                       java.lang.String uid,
                                       java.lang.String filesetID,
                                       java.io.File descriptorFile,
                                       java.lang.String specCharSet,
                                       DcmEncodeParam encParam)
                                throws java.io.IOException
Create new DICOM dictionary specified by the File argument and the Media Storage SOP Instance UID. Other attributes of its File Meta Information will be initalized with default values.

Parameters:
file - Specifies the new created DICOM dictionary (DICOMDIR).
uid - Media Storage SOP Instance UID
filesetID - File-set ID. May be null.
descriptorFile - File-set Descriptor. May be null.
specCharSet - Specific Character Set of File-set Descriptor File. May be null.
encParam - Specifies encoding options. May be null, in which case default encoding options will be used.
Returns:
DirWriter to insert content into the new created DICOM dictionary.
Throws:
java.io.IOException - if the creation of the new DICOM dictionary failed caused by an i/o releated error.

newDirWriter

public abstract DirWriter newDirWriter(java.io.File file,
                                       FileMetaInfo fmi,
                                       java.lang.String filesetID,
                                       java.io.File descriptorFile,
                                       java.lang.String specCharSet,
                                       DcmEncodeParam encParam)
                                throws java.io.IOException
Create new DICOM dictionary specified by the File argument and explicit specified File Meta Information.

Parameters:
file - Specifies the new created DICOM dictionary (DICOMDIR).
fmi - explicit specified File Meta Information
filesetID - File-set ID. May be null.
descriptorFile - File-set Descriptor. May be null.
specCharSet - Specific Character Set of File-set Descriptor File. May be null.
encParam - Specifies encoding options. May be null, in which case default encoding options will be used.
Returns:
DirWriter to insert content into the new created DICOM dictionary.
Throws:
java.io.IOException - if the creation of the new DICOM dictionary failed caused by an i/o releated error.

newDirBuilderPref

public abstract DirBuilderPref newDirBuilderPref()
Create empty preferences for DirBuilder.

Returns:
empty preferences for DirBuilder.

newDirBuilder

public abstract DirBuilder newDirBuilder(DirWriter writer,
                                         DirBuilderPref pref)
Creates new DirBuilder associated with specified DirWriter and with specified preferences.

Parameters:
writer - associated DirWriter.
pref - Preferences for generated directory records.
Returns:
new DirBuilder associated with specified DirWriter.