org.dcm4che.media
Interface DirBuilder


public interface DirBuilder

Builder facade for DirWriter to generate and insert Directory Records refering DICOM files in the DICOM Directory (= DICOMDIR file).

Can only be used for DICOM Directory with scheme

 PATIENT
  STUDY
    SERIES
      IMAGE|PRESENTATION|SR DOCUMENT|KEY OBJECT DOC|...
 

DirRecord objects will be generated according associated DirBuilderPref, specified in factory method. DirBuilderFactory.newDirBuilder(org.dcm4che.media.DirWriter, org.dcm4che.media.DirBuilderPref)

DirBuilder also take care, that there will be only

in the associated DICOM Directory.

Version:
$Revision: 3922 $ $Date: 2005-10-05 18:26:16 +0200 (Mi, 05 Okt 2005) $

Revisions:

2002/07/16 gunter zeilinger:

Author:
gunter zeilinger
See Also:
DirBuilderFactory.newDirBuilder(org.dcm4che.media.DirWriter, org.dcm4che.media.DirBuilderPref), DirBuilderPref, DirWriter, DirRecord

Method Summary
 int addFileRef(java.io.File file)
          Add (up to 4) DirRecord objects refering the DICOM object in the specified file to the associated DICOM Directory.
 int addFileRef(java.lang.String[] fileIDs, Dataset ds)
          Add (up to 4) DirRecord objects refering the DICOM object with a specified File IDs to the associated DICOM Directory.
 void close()
          Close the DICOM Dictionary (= DICOMDIR file).
 DirWriter getDirWriter()
          Get underlying DirWriter object
 

Method Detail

addFileRef

int addFileRef(java.io.File file)
               throws java.io.IOException
Add (up to 4) DirRecord objects refering the DICOM object in the specified file to the associated DICOM Directory.

The function may internally invoke DirWriter.commit() of the associated DirWriterDirWriter.rollback()!

Parameters:
file - DICOM file
Returns:
number of added DirRecord objects.
Throws:
java.io.IOException - if an IO error occurs, writing the record into the DICOM Directory.

addFileRef

int addFileRef(java.lang.String[] fileIDs,
               Dataset ds)
               throws java.io.IOException
Add (up to 4) DirRecord objects refering the DICOM object with a specified File IDs to the associated DICOM Directory.

The function may internally invoke DirWriter.commit() of the associated DirWriter. Therefore, the operation cannot be undo by DirWriter.rollback()!

Parameters:
fileIDs - File ID components
ds - DICOM Data Set
Returns:
number of added DirRecord objects.
Throws:
java.io.IOException - if an IO error occurs, writing the record into the DICOM Directory.

close

void close()
           throws java.io.IOException
Close the DICOM Dictionary (= DICOMDIR file).

Throws:
java.io.IOException - If an I/O error occurs

getDirWriter

DirWriter getDirWriter()
Get underlying DirWriter object

Returns:
underlying DirWriter object.