public class DicomFileHeader extends java.lang.Object implements IDicomFileHeader
| Constructor and Description |
|---|
DicomFileHeader()
Constructs DicomFileHeader by initializing headerlength to zero
|
| Modifier and Type | Method and Description |
|---|---|
int |
addDataElement(IDataElement objIDataElement)
Adds DataElements in the Header.
|
void |
createDefaultHeader()
This method creates default header with MetaGroupLengthElement and TransferSyntaxUID
|
IDataElement |
getDataFromTag(int iGroupNumber,
int iElementNumber)
This method retrieves the data for specified Tag.
|
ISingleCollection<byte[]> |
getFileMetaInformationVersion()
Gets the File Meta Information Version.
|
byte[] |
getHeader()
This method serializes the FileMetaElements which are populated in the DicomFileHeader
|
java.lang.String |
getImplementationClassUID()
Retrieves Implementation Class UID.
|
java.lang.String |
getImplementationVersionName()
Retrieves a version for an Implementation Class UID using up to 16 characters of the repertoire.
|
int |
getLength()
This function gets the length of Dicom File Header.
|
java.lang.String |
getMediaStorageSOPClassUID()
Retrieves the SOP Class associated with the Data Set.
|
java.lang.String |
getMediaStorageSOPInstanceUID()
Retrieves the SOP Instance associated with the Data Set placed in the file and following the File Meta Information.
|
byte[] |
getPreAmble()
This method is used to get the preamble to be written before the header part
|
ISingleCollection<byte[]> |
getPrivateInformation()
This function gets the Private Information placed in the File Meta Information.
|
java.lang.String |
getPrivateInformationCreatorUID()
This function gets the The UID of the creator of the private information
|
java.lang.String |
getSourceApplicationEntityTitle()
Retrieves The DICOM Application Entity (AE) Title of the AE which wrote this file's content.
|
ITransferSyntax |
getTransferSyntax()
This method checks the UID for TransferSyntax and returns the appropriate TransferSyntax object
|
java.lang.String |
getTransferSyntaxUID()
This is the accessor method for TransferSyntax unique ID
|
ICollectionIterator<IDataElement> |
iterator()
Provides iterator over the collection of DataElements
|
void |
populate(byte[] header)
This method gets the byte buffer containing header part of a dicom file and
populates itself with the DataElements present in the header
|
int |
serialize(IDicomStream objIDicomStream)
This method serializes Dicom File Header onto the stream attached to the header
|
void |
setFileMetaInformationVersion(ISingleCollection<byte[]> objFileMetaInformationVersion)
This is a two byte field where each bit identifies a version of this File Meta Information header.
|
void |
setImplementationClassUID(java.lang.String strImplementationClassUID)
Uniquely identifies the implementation which wrote this file and its content.
|
void |
setImplementationVersionName(java.lang.String strImplementationVersionName)
Sets a version for an Implementation Class UID using up to 16 characters of the repertoire.
|
void |
setMediaStorageSOPClassUID(java.lang.String strMediaStorageSOPClassUID)
Sets the SOP Class associated with the Data Set.
|
void |
setMediaStorageSOPInstanceUID(java.lang.String strMediaStorageSOPInstanceUID)
Sets the SOP Instance associated with the Data Set placed in the file and following the File Meta Information.
|
void |
setPreAmble(byte[] bytePreamble)
This method sets the 128 byte preamble in the dicom file header
|
void |
setPrivateInformation(ISingleCollection<byte[]> objPrivateInformation)
This function sets the Private Information placed in the File Meta Information.
|
void |
setPrivateInformationCreatorUID(java.lang.String strPrivateInformationCreatorUID)
This function sets the The UID of the creator of the private information
|
void |
setSourceApplicationEntityTitle(java.lang.String strSourceApplicationEntityTitle)
Sets the DICOM Application Entity (AE) Title of the AE which wrote this file's content.
|
void |
setTransferSyntaxUID(java.lang.String strTransferSyntaxUID)
This method sets the transfersyntax unique ID.
|
public DicomFileHeader()
public void setPreAmble(byte[] bytePreamble)
setPreAmble in interface IDicomFileHeaderbytePreamble - : 128 byte buffer containing preamble datapublic byte[] getPreAmble()
getPreAmble in interface IDicomFileHeaderpublic void populate(byte[] header)
throws InvalidHeaderException,
java.io.IOException
populate in interface IDicomFileHeaderheader - byte array containing header value.InvalidHeaderException - if validation of header fails.java.io.IOException - if Input/Output operation fails.public ITransferSyntax getTransferSyntax()
getTransferSyntax in interface IDicomFileHeaderpublic byte[] getHeader()
throws InvalidHeaderException,
java.io.IOException
getHeader in interface IDicomFileHeaderInvalidHeaderException - if Header validation fails.java.io.IOException - if Input/Output operation fails.public ICollectionIterator<IDataElement> iterator()
iterator in interface ICollectionIterable<IDataElement>iterator in interface java.lang.Iterable<IDataElement>public IDataElement getDataFromTag(int iGroupNumber, int iElementNumber)
getDataFromTag in interface IDicomFileHeaderiGroupNumber - integer value of group number.iElementNumber - integer value of element number.public void createDefaultHeader()
throws InvalidHeaderException
createDefaultHeader in interface IDicomFileHeaderInvalidHeaderException - if Header validation fails.public int serialize(IDicomStream objIDicomStream) throws java.io.IOException
serialize in interface IDicomFileHeaderobjIDicomStream - Stream on which the DICOM data is availablejava.io.IOException - If Input/Output operation fails.public void setTransferSyntaxUID(java.lang.String strTransferSyntaxUID)
setTransferSyntaxUID in interface IDicomFileHeaderstrTransferSyntaxUID - string value of transfersyntax.public java.lang.String getTransferSyntaxUID()
getTransferSyntaxUID in interface IDicomFileHeaderpublic int addDataElement(IDataElement objIDataElement) throws InvalidHeaderException
addDataElement in interface IDicomFileHeaderobjIDataElement - specifies the Data Element to be added.InvalidHeaderException - throws when the DataElement to be added does not obey increasing order
of the Header DataElementspublic void setFileMetaInformationVersion(ISingleCollection<byte[]> objFileMetaInformationVersion)
objFileMetaInformationVersion - - value of File Meta Information Version.public ISingleCollection<byte[]> getFileMetaInformationVersion()
public void setMediaStorageSOPClassUID(java.lang.String strMediaStorageSOPClassUID)
strMediaStorageSOPClassUID - String vlaue of Media Storage SOP Class UIDpublic java.lang.String getMediaStorageSOPClassUID()
public void setMediaStorageSOPInstanceUID(java.lang.String strMediaStorageSOPInstanceUID)
strMediaStorageSOPInstanceUID - String value of Media Storage SOP Instance UIDpublic java.lang.String getMediaStorageSOPInstanceUID()
public void setImplementationClassUID(java.lang.String strImplementationClassUID)
strImplementationClassUID - String value of Implementation Class UID.public java.lang.String getImplementationClassUID()
public void setImplementationVersionName(java.lang.String strImplementationVersionName)
strImplementationVersionName - String value of Implementation Version Name.public java.lang.String getImplementationVersionName()
public void setSourceApplicationEntityTitle(java.lang.String strSourceApplicationEntityTitle)
strSourceApplicationEntityTitle - String value of Source Application Entity Title.public java.lang.String getSourceApplicationEntityTitle()
public void setPrivateInformationCreatorUID(java.lang.String strPrivateInformationCreatorUID)
strPrivateInformationCreatorUID - String value of Private Information Creator UID.public java.lang.String getPrivateInformationCreatorUID()
public void setPrivateInformation(ISingleCollection<byte[]> objPrivateInformation)
objPrivateInformation - byte array collection containing Private Information placed in the File Meta Information.public ISingleCollection<byte[]> getPrivateInformation()
public int getLength()