org.dicom4j.io.file
Class DicomFileReader

java.lang.Object
  extended by org.dicom4j.io.DicomReader
      extended by org.dicom4j.io.file.DicomFileReader

public class DicomFileReader
extends DicomReader

A specialized DicomReader to read DICOM Files.

This class add specialized methods to manage theFileMetaInformation

Since:
0.0.0
Author:
Laurent Lecomte

Constructor Summary
DicomFileReader(byte[] aBytes)
          Creates a new DicomReader
DicomFileReader(File aFile)
          Creates a new DicomFileReader
DicomFileReader(InputStream aInputStream)
          Creates a new DicomReader
DicomFileReader(String aPathName)
          Creates a new DicomFileReader
 
Method Summary
 TransferSyntaxFactory getTsFactory()
           
 boolean hasFileMetaInformation()
          return true if the stream contains FileMetaInformation
 void readFile(FileMetaInformation aFileMetaInformation, DataSet aDataSet)
          Read the FileMetaInformation and the DataSet of a DICOM File.
 void readFileMetaInformation(FileMetaInformation aFileMetaInformation)
          Read the FileMetaInformation of a DICOM File.
 void setTsFactory(TransferSyntaxFactory tsFactory)
           
 
Methods inherited from class org.dicom4j.io.DicomReader
close, getDictionary, getVrFactory, read, read, setDictionary, setInputStream, setVrFactory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DicomFileReader

public DicomFileReader(byte[] aBytes)
Creates a new DicomReader

Parameters:
aBytes - the bytes to read from

DicomFileReader

public DicomFileReader(File aFile)
                throws FileNotFoundException
Creates a new DicomFileReader

Parameters:
File - the file to read
Throws:
FileNotFoundException

DicomFileReader

public DicomFileReader(InputStream aInputStream)
Creates a new DicomReader

Parameters:
aInputStream - the stream to read from

DicomFileReader

public DicomFileReader(String aPathName)
                throws FileNotFoundException
Creates a new DicomFileReader

Parameters:
aPathName - the pathname of the file to read
Throws:
FileNotFoundException
Method Detail

hasFileMetaInformation

public boolean hasFileMetaInformation()
                               throws IOException,
                                      DicomException
return true if the stream contains FileMetaInformation

Returns:
true if have FileMetaInformation
Throws:
IOException
DicomException

readFile

public void readFile(FileMetaInformation aFileMetaInformation,
                     DataSet aDataSet)
              throws IOException,
                     DicomException,
                     Exception
Read the FileMetaInformation and the DataSet of a DICOM File.
The TransferSyntax to use for the DataSet will depend of the FileMetaInformation. before reading FileMetaInformation and DataSet are cleared

Parameters:
aFileMetaInformation - the FileMetaInformation where to add read data (can be null)
aDataSet - the DataSet where to add read data
Throws:
IOException
DicomException
Exception

readFileMetaInformation

public void readFileMetaInformation(FileMetaInformation aFileMetaInformation)
                             throws IOException,
                                    DicomException,
                                    Exception
Read the FileMetaInformation of a DICOM File.
the Stream is always rewinded after the reading

Parameters:
aFileMetaInformation - the FileMetaInformation where to add read data
Throws:
IOException
DicomException
Exception

getTsFactory

public TransferSyntaxFactory getTsFactory()

setTsFactory

public void setTsFactory(TransferSyntaxFactory tsFactory)


Copyright © 2009 dicom4j. All Rights Reserved.