/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.baselibs;



import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataElement;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDicomValue;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDictionaryReader;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITransferSyntax;
import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidItemException;
import cdac.medinfo.sdk.dcm30_04.exceptions.MandatoryMissingException;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConfig;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
import cdac.medinfo.sdk.dcm30_04.utils.DicomLogger;




/**
* This item class contains set and get methods for all the attributes in the SequenceOfUltrasoundRegions
 */
public class SequenceOfUltrasoundRegionsItem extends Item  
{
	


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * This constructor creates the item and with default TransferSyntax 
	 */
	SequenceOfUltrasoundRegionsItem()
	{
		super();
	}

	/**
	 * This constructor creates the item with default TransferSyntax 
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 */
	SequenceOfUltrasoundRegionsItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

	/**
	 * This constructor creates SequenceOfUltrasoundRegionsItem with specified TransferSyntax and
	 * specified DictionaryReader
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	SequenceOfUltrasoundRegionsItem(ITransferSyntax objTransferSyntax, IDictionaryReader objDictionaryReader)
	{
		super(objTransferSyntax,objDictionaryReader);
	}

	/**
	 * Validates all the attributes in CodeSequenceMacro that are present in the DataSet
	 * @return boolean - Success -true, Failure - false
	 * @throws InvalidItemException throws InvalidItemException If Mandatory or Conditional element fails.
	 */
	public boolean validateForModule()  throws InvalidItemException
	{
		try{
			if(!contains(0x0018,0x6018))
				throw new MandatoryMissingException("0018,6018");
			else if(!contains(0x0018,0x601A))
				throw new MandatoryMissingException("0018,601A");
			else if(!contains(0x0018,0x601C))
				throw new MandatoryMissingException("0018,601C");
			else if(!contains(0x0018,0x601E))
				throw new MandatoryMissingException("0018,601E");
			else if(!contains(0x0018,0x6024))
				throw new MandatoryMissingException("0018,6024");
			else if(!contains(0x0018,0x6026))
				throw new MandatoryMissingException("0018,6026");
			else  if(!contains(0x0018,0x602C))
				throw new MandatoryMissingException("0018,602C");
			else if(!contains(0x0018,0x602E))
				throw new MandatoryMissingException("0018,602E");
			else if(!contains(0x0018,0x6012))
				throw new MandatoryMissingException("0018,6012");
			else if(!contains(0x0018,0x6014))
				throw new MandatoryMissingException("0018,6014");
			else if(!contains(0x0018,0x6016))
				throw new MandatoryMissingException("0018,6016");
			else
			{
				if(!contains(0x0018,0x6044) && contains(0x0018,0x604C))
					throw new ConditionFailedException("conditional Element 0018,6044 reuired for Tag 0018,604C is missing") ;
				if(!contains(0x0018,0x6044) && contains(0x0018,0x604E))
					throw new ConditionFailedException("conditional Element 0018,6044 reuired for Tag 0018,604E is missing") ;
				else
				{
					short shPixelComponentOrg = Short.parseShort(getDataForTag(0x0018,0x6044).toString());
					if(contains(0x0018,0x6050) && (shPixelComponentOrg != 0 && shPixelComponentOrg != 1))
						throw new ConditionFailedException("value of conditional Element 0018,6044 should be 0 or 1 required for Tag 0018,6050") ;
					if(contains(0x0018,0x6054) && (shPixelComponentOrg != 0 && shPixelComponentOrg != 1))
						throw new ConditionFailedException("value of conditional Element 0018,6044 should be 0 or 1 required for Tag 0018,6054") ;
					if(contains(0x0018,0x6052) && (shPixelComponentOrg != 0 && shPixelComponentOrg != 1))
						throw new ConditionFailedException("value of conditional Element 0018,6044 should be 0 or 1 required for Tag 0018,6052") ;
					if(contains(0x0018,0x6056) && shPixelComponentOrg != 2)
						throw new ConditionFailedException("value of conditional Element 0018,6044 should be 2 required for Tag 0018,6056") ;
					if(contains(0x0018,0x605A) && shPixelComponentOrg != 2)
						throw new ConditionFailedException("value of conditional Element 0018,6044 should be 2 required for Tag 0018,605A") ;
					if(contains(0x0018,0x6046) && shPixelComponentOrg != 0)
						throw new ConditionFailedException("value of conditional Element 0018,6046 should be 0 required for Tag 0018,6046") ;
					if((contains(0x0018,0x6048)) && (shPixelComponentOrg != 1))
						throw new ConditionFailedException("value of conditional Element 0018,6046 should be 1 required for Tag 0018,6048") ;
					if(contains(0x0018,0x604A) && shPixelComponentOrg != 1)
						throw new ConditionFailedException("value of conditional Element 0018,6046 should be 1 required for Tag 0018,604A") ;
				}
			}
		}
		catch(ConditionFailedException ce)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(ce.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),ce); 
		}
		catch( MandatoryMissingException me)
		{
			if(DicomConfig.createInstance().isLoggingOn())
			{
				DicomLogger.getLogger().log(me.getMessage());
			}
			throw new InvalidItemException(this.getClass().getSimpleName(),me);
		}
		return true;
	}

	/**
	 * Sets the bounds of a rectangle specifying the location of the region, x0,y0,x1,y1.
	 * @param iRegionLocationMinX0 Value of Region Location Co-Ordinate MinX0
	 */
	public void setRegionLocationMinX0(int  iRegionLocationMinX0)
	{
		/*Accept the Region Location Min X0 in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6018, iRegionLocationMinX0,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6018,DicomConstants.DCM_DT_UL, iRegionLocationMinX0);

		addDataElement(objIDataElement);


	}

	/**
	 * Returns bounds of a rectangle specifying the location of the region
	 * @return int - Value of Region Location Co-Ordinate MinX0
	 */
	public int getRegionLocationMinX0()
	{
		Object objValue = getValue(0x0018,0x6018);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the bounds of a rectangle specifying the location of the region, x0,y0,x1,y1.
	 * @param iRegionLocationMaxX1 Value of Region Location Co-Ordinate MinX1
	 */
	public void setRegionLocationMaxX1(int  iRegionLocationMaxX1)
	{
		/*Accept the Region Location Max X1 in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x601C, iRegionLocationMaxX1,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x601C,DicomConstants.DCM_DT_UL, iRegionLocationMaxX1);

		addDataElement(objIDataElement);


	}

	/**
	 * Return bounds of a rectangle specifying the location of the region
	 * @return int - Value of Region Location Co-Ordinate MinX1
	 */
	public int getRegionLocationMaxX1()
	{
		Object objValue = getValue(0x0018,0x601C);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the bounds of a rectangle specifying the location of the region, x0,y0,x1,y1.
	 * @param iRegionLocationMaxY1 Value of Region Location Co-Ordinate MinY1
	 */
	public void setRegionLocationMinY1(int  iRegionLocationMaxY1)
	{
		/*Accept the Region Location Min Y1 in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x601E, iRegionLocationMaxY1,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x601E,DicomConstants.DCM_DT_UL, iRegionLocationMaxY1);

		addDataElement(objIDataElement);


	}

	/**
	 * Return bounds of a rectangle specifying the location of the region
	 * @return int - Value of Region Location Co-Ordinate MinY1
	 */
	public int getRegionLocationMaxY1()
	{
		Object objValue = getValue(0x0018,0x601E);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * The physical units of the dimensions of the region.
	 * @param shPhysicalUnitsXDirection Integer value of units of the dimensions of the X Co-Ordinate region
	 */
	public void setPhysicalUnitsXDirection(short  shPhysicalUnitsXDirection)
	{
		/*Accept the Physical Units X Direction in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6024, shPhysicalUnitsXDirection,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6024,DicomConstants.DCM_DT_US, shPhysicalUnitsXDirection);

		addDataElement(objIDataElement);


	}

	/**
	 * Return physical units of the dimensions of the region.
	 * @return int - Integer value of units of the dimensions of X Co-Ordinate of the region
	 */
	public short getPhysicalUnitsXDirection()
	{
		Object objValue = getValue(0x0018,0x6024);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the physical units of the dimensions of Y Co-Ordinateof the region.
	 * @param shPhysicalUnitsYDirection short value of Y Co-Ordinateof the region.
	 */
	public void setPhysicalUnitsYDirection(short  shPhysicalUnitsYDirection)
	{
		/*Accept the Physical Units Y Direction in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6026, shPhysicalUnitsYDirection,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6026,DicomConstants.DCM_DT_US, shPhysicalUnitsYDirection);

		addDataElement(objIDataElement);


	}

	/**
	 * Return physical units of the dimensions of Y Co-Ordinateof the region. of the region.
	 * @return short - short value of Y Co-Ordinateof the region.
	 */
	public short getPhysicalUnitsYDirection()
	{
		Object objValue = getValue(0x0018,0x6026);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the physical value increments per positive X pixel increment. The units are as
	 * specified in the Physical Units X Direction (0018,6024).
	 * @param dPhysicalDeltaX physical value increments per positive X pixel increment
	 */
	public void setPhysicalDeltaX(double  dPhysicalDeltaX)
	{
		/*Accept the Physical Delta X in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x602C, dPhysicalDeltaX,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x602C,DicomConstants.DCM_DT_FD, dPhysicalDeltaX);

		addDataElement(objIDataElement);


	}

	/**
	 * Return physical value increments per positive X pixel increment.
	 * @return double - double value of value increments per positive X pixel increment.
	 */
	public double getPhysicalDeltaX()
	{
		Object objValue = getValue(0x0018,0x602C);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the physical value increments per positive Y pixel increment. The units are as
	 * specified in the Physical Units Y Direction (0018,6026).
	 * @param dPhysicalDeltaY  double value of value increments per positive Y pixel increment
	 */
	public void setPhysicalDeltaY(double  dPhysicalDeltaY)
	{
		/*Accept the Physical Delta Y in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x602E, dPhysicalDeltaY,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x602E,DicomConstants.DCM_DT_FD, dPhysicalDeltaY);

		addDataElement(objIDataElement);


	}

	/**
	 * Return physical value increments per positive Y pixel increment.
	 * @return double - double value of value increments per positive Y pixel increment
	 */
	public double getPhysicalDeltaY()
	{
		Object objValue = getValue(0x0018,0x602E);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the coordinate pair, x0,y0 defines the location of a virtual "reference" pixel.
	 * @param iReferencePixelX0 x0 co-ordinate of the coordinate pair that defines the location of a virtual "reference" pixel.
	 */
	public void setReferencePixelX0(int  iReferencePixelX0)
	{
		/*Accept the Reference Pixel X0 in Double format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6020, iReferencePixelX0,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6020,DicomConstants.DCM_DT_SL, iReferencePixelX0);

		addDataElement(objIDataElement);


	}

	/**
	 * Return coordinate pair, x0,y0 defines the location of a virtual "reference" pixel.
	 * @return int - x0 co-ordinate of the coordinate pair that defines the location of a virtual "reference" pixel.
	 */
	public int getReferencePixelX0()
	{
		Object objValue = getValue(0x0018,0x6020);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * This coordinate pair, x0,y0 defines the location of a virtual "reference" pixel.
	 * @param iReferencePixelY0 y0 co-ordinate of the coordinate pair that defines the location of a virtual "reference" pixel.
	 */
	public void setReferencePixelY0(int  iReferencePixelY0)
	{
		/*Accept the Reference Pixel Y0 in Double format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6022, iReferencePixelY0,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6022,DicomConstants.DCM_DT_SL, iReferencePixelY0);

		addDataElement(objIDataElement);


	}

	/**
	 * Return coordinate pair, x0,y0 defines the location of a virtual "reference" pixel.
	 * @return int - y0 co-ordinate of the coordinate pair that defines the location of a virtual "reference" pixel.
	 */
	public int getReferencePixelY0()
	{
		Object objValue = getValue(0x0018,0x6022);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the Physical Value at the reference pixel x location. The units are specified in the
	 * Physical Units field.
	 * @param dRefPixelPhysicalValueX Physical Value at the reference pixel x location.
	 */
	public void setRefPixelPhysicalValueX(double  dRefPixelPhysicalValueX)
	{
		/*Accept the Ref. Pixel Physical Value X in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6028, dRefPixelPhysicalValueX,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6028,DicomConstants.DCM_DT_FD, dRefPixelPhysicalValueX);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve Physical Value at the reference pixel x location.
	 * @return double - Value at the reference pixel x location.
	 */
	public double getRefPixelPhysicalValueX()
	{
		Object objValue = getValue(0x0018,0x6028);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the Physical Value at the reference pixel y location. The units are specified in the
	 * Physical Units field.
	 * @param dRefPixelPhysicalValueY Value at the reference pixel y location.
	 */
	public void setRefPixelPhysicalValueY(double  dRefPixelPhysicalValueY)
	{
		/*Accept the Ref. Pixel Physical Value Y in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x602A, dRefPixelPhysicalValueY,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x602A,DicomConstants.DCM_DT_FD, dRefPixelPhysicalValueY);

		addDataElement(objIDataElement);


	}

	/**
	 * Return Physical Value at the reference pixel y location.
	 * @return double - Value at the reference pixel y location.
	 */
	public double getRefPixelPhysicalValueY()
	{
		Object objValue = getValue(0x0018,0x602A);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the spatial organization of the data within the region.
	 * @param shRegionSpatialFormat spatial organization of the data within the region.
	 */
	public void setRegionSpatialFormat(short  shRegionSpatialFormat)
	{
		/*Accept the Region Spatial Format in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x6012, shRegionSpatialFormat,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6012,DicomConstants.DCM_DT_US, shRegionSpatialFormat);

		addDataElement(objIDataElement);


	}

	/**
	 * Retreive the spatial organization of the data within the region.
	 * @return short - short value of spatial organization of the data within the region.
	 */
	public short getRegionSpatialFormat()
	{
		Object objValue = getValue(0x0018,0x6012);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the type of data within the region.
	 * @param shRegionDataType short value of the type of data.
	 */
	public void setRegionDataType(short  shRegionDataType)
	{
		/*Accept the Region Data Type in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6014, shRegionDataType,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6014,DicomConstants.DCM_DT_US, shRegionDataType);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve the type of data within the region.
	 * @return - short value of type of data within the region.
	 */
	public short getRegionDataType()
	{
		Object objValue = getValue(0x0018,0x6014);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Set Flags used for special handling of the region.
	 * @param iRegionFlags Intege value of Flags
	 */
	public void setRegionFlags(int  iRegionFlags)
	{
		/*Accept the Region Flags in Double format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6016, iRegionFlags,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6016,DicomConstants.DCM_DT_UL, iRegionFlags);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve Flags used for special handling of the region.
	 * @return int - integer value of Flags
	 */
	public int getRegionFlags()
	{
		Object objValue = getValue(0x0018,0x6016);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets value that describes how the components of a pixel can be described. Required if pixel
	 * component calibration exists for this region.
	 * @param shPixelComponentOrganization short value of Pixel Component Organization
	 */
	public void setPixelComponentOrganization(short  shPixelComponentOrganization)
	{
		/*Accept the Pixel Component Organization in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6044, shPixelComponentOrganization,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6044,DicomConstants.DCM_DT_US, shPixelComponentOrganization);

		addDataElement(objIDataElement);


	}

	/**
	 * Return description of the components of a pixel
	 * @return short - short value of Pixel Component Organization
	 */
	public short getPixelComponentOrganization()
	{
		Object objValue = getValue(0x0018,0x6044);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the value which is ANDed with the composite pixel code for each pixel within the region,
	 *  then shifted right by the number of contiguous least significant zeros in the
	 *  mask to obtain what will be referred to as the "Shifted Masked Composite Pixel
	 *  Code" (SMCPC). Required if Pixel Component Organization = Bit aligned.
	 *  @param iPixelComponentMask integer value of Pixel Component Mask
	 */
	public void setPixelComponentMask(int  iPixelComponentMask)
	{
		/*Accept the Pixel Component Mask in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6046, iPixelComponentMask,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6046,DicomConstants.DCM_DT_UL, iPixelComponentMask);

		addDataElement(objIDataElement);


	}

	/**
	 * Return Flags used for special handling of the region.
	 * @return int - integer value of Pixel Component Mask
	 */
	public int getPixelComponentMask()
	{
		Object objValue = getValue(0x0018,0x6046);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the value that defines the start of the numeric range of values within the composite pixel where
	 * calibration is to be defined by the "pixel physical calibration table". To be used only
	 * when ranges are used to describe the portion of the composite pixel.
	 * @param iPixelComponentRangeStart value that defines the start of the numeric range of values within the composite pixel
	 */
	public void setPixelComponentRangeStart(int  iPixelComponentRangeStart)
	{
		/*Accept the Pixel Component Range Start in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x6048, iPixelComponentRangeStart,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6048,DicomConstants.DCM_DT_UL, iPixelComponentRangeStart);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve the value that starts the numeric range of values within the composite pixel
	 * @return int - integer value of value that starts the numeric range of values within the composite pixel
	 */
	public int getPixelComponentRangeStart()
	{
		Object objValue = getValue(0x0018,0x6048);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets value that defines the stop of the numeric range of values within the composite pixel where
	 * calibration is to be defined by the "pixel physical calibration table". To be used only
	 * when ranges are used to describe the portion of the composite pixel.
	 * @param iPixelComponentRangeStop integer value of  value that defines the stop of the numeric range of values within the composite pixel
	 */
	public void setPixelComponentRangeStop(int  iPixelComponentRangeStop)
	{
		/*Accept the Pixel Component Range Start in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x604A, iPixelComponentRangeStop,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x604A,DicomConstants.DCM_DT_UL, iPixelComponentRangeStop);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieves value that stops the numeric range of values within the composite pixel
	 * @return int - integer value that stops the numeric range of values within the composite pixel
	 */
	public int getPixelComponentRangeStop()
	{
		Object objValue = getValue(0x0018,0x604A);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the physical units to be applied to the pixel component. Required if Pixel Component Organization
	 * exists.
	 * @param shPixelComponentPhysicalUnits short value of units to be applied to the pixel component
	 */
	public void setPixelComponentPhysicalUnits(short  shPixelComponentPhysicalUnits)
	{
		/*Accept the Pixel Component Physical Units in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x604C, shPixelComponentPhysicalUnits,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x604C,DicomConstants.DCM_DT_US, shPixelComponentPhysicalUnits);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve physical units to be applied to the pixel component
	 * @return short - short value of units to be applied to the pixel component
	 */
	public short getPixelComponentPhysicalUnits()
	{
		Object objValue = getValue(0x0018,0x604C);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the type of data for the pixel component. Required if Pixel Component Organization
	 * exists.
	 * @param shPixelComponentDataType short value of type of data for the pixel component
	 */
	public void setPixelComponentDataType(short  shPixelComponentDataType)
	{
		/*Accept the Pixel Component Data Type in short format of type US
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x604E, shPixelComponentDataType,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x604E,DicomConstants.DCM_DT_US, shPixelComponentDataType);

		addDataElement(objIDataElement);


	}

	/**
	 * Return type of data for the pixel component.
	 * @return short  - short value of type of data for the pixel component
	 */
	public short getPixelComponentDataType()
	{
		Object objValue = getValue(0x0018,0x604E);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the number of break point coordinate pairs used to describe a piece wise linear
	 * curve. Required if Pixel Component Organization equals 0 or 1. Otherwise not used.
	 * @param iNumberOfTableBreakPoints integer value of number of break point coordinate pairs
	 */
	public void setNumberOfTableBreakPoints(int  iNumberOfTableBreakPoints)
	{
		/*Accept the Number of Table Break Points in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6050, iNumberOfTableBreakPoints,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6050,DicomConstants.DCM_DT_UL, iNumberOfTableBreakPoints);

		addDataElement(objIDataElement);


	}

	/**
	 * Return number of break point coordinate pairs used to describe a piece wise linear
	 * curve
	 * @return int integer value of number of break point coordinate pairs 
	 */
	public int getNumberOfTableBreakPoints()
	{
		Object objValue = getValue(0x0018,0x6050);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets an array of X values used to create the piece wise linear curve.
	 * Required if Pixel Component Organization equals 0 or 1. Otherwise not used.
	 * @param arrIntTableOfXBreakPoints Array of X values used to create the piece wise linear curve.
	 */
	/*
	 * For multiple values we make use of Array and not collection
	 */
	public void setTableOfXBreakPoints(int[]  arrIntTableOfXBreakPoints)
	{
		/*Accept the Table of X Break Points in integer Array format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6052, arrIntTableOfXBreakPoints,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6052,DicomConstants.DCM_DT_UL, arrIntTableOfXBreakPoints);

		addDataElement(objIDataElement);


	}

	/**
	 * Return collection of X values used to create the piece wise linear curve.
	 * @return int[] - Array of X values used to create the piece wise linear curve.
	 */
	public int[] getTableOfXBreakPoints()
	{
		Object objValue = getValue(0x0018,0x6052);
		if(objValue != null)
			return (int[])objValue;
		return null;
	}

	/**
	 * Sets an array of Y values used to create the piece wise linear curve.
	 * Required if Pixel Component Organization equals 0 or 1. Otherwise not used.
	 * @param arrDblTableOfYBreakPoints double array of Y values used to create the piece wise linear curve
	 */
	/*
	 * For multiple values we make use of Array and not collection
	 */	
	public void setTableOfYBreakPoints(double[]  arrDblTableOfYBreakPoints)
	{
		/*Accept the Table of Y Break Points in integer Array format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x6054, arrDblTableOfYBreakPoints,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6054,DicomConstants.DCM_DT_UL, arrDblTableOfYBreakPoints);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve collection of Y values used to create the piece wise linear curve.
	 * @return double[] - double Array of Y values used to create the piece wise linear curve. 
	 */
	public double[] getTableOfYBreakPoints()
	{
		Object objValue = getValue(0x0018,0x6054);
		if(objValue != null)
			return (double[])objValue;
		return null;
	}

	/**
	 * Sets the number of entries in the Table of Pixel Values.
	 * Required if the Pixel Component Organization equals 2.
	 * @param iNumberOfTableEntries integer value of number of entries in the Table of Pixel Values.
	 */
	public void setNumberOfTableEntries(int iNumberOfTableEntries)
	{
		/*Accept the Number of Table Entries in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6056, iNumberOfTableEntries,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6056,DicomConstants.DCM_DT_UL, iNumberOfTableEntries);

		addDataElement(objIDataElement);


	}

	/**
	 * Return number of entries in the Table of Pixel Values.
	 * @return int - integer value of number of entries in the Table of Pixel Values.
	 */
	public int getNumberOfTableEntries()
	{
		Object objValue = getValue(0x0018,0x6056);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets a table of Pixel Values used in conjunction with the Table of Parameter Values to
	 * provide a mapping from Pixel Value to Parameter Value.
	 * Required if the Pixel Component Organization equals 2. Otherwise not used.
	 * @param arrIntTableOfPixelValues integer array of Pixel Values
	 */
	/*
	 * For multiple values we make use of Array and not collection
	 */
	public void setTableOfPixelValues(int[] arrIntTableOfPixelValues)
	{
		/*Accept the Table of X Pixel Values in integer Array format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6058, arrIntTableOfPixelValues,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6058,DicomConstants.DCM_DT_UL, arrIntTableOfPixelValues);

		addDataElement(objIDataElement);


	}

	/**
	 * Return collection of X values used to create the piece wise linear curve.
	 * @return int[] - integer array of Pixel Values
	 */
	public int[] getTableOfPixelValues()
	{
		Object objValue = getValue(0x0018,0x6058);
		if(objValue != null)
			return (int[])objValue;
		return null;
	}

	/**
	 * Sets a table of Parameter Values used in conjunction with the Table of Pixel Values
	 * to provide a mapping from Pixel Value to Parameter Value.
	 * Required if the Pixel Component Organization equals 2.
	 * @param arrFltTableOfParameterValues float array of Parameter Values
	 */
	/*
	 * For multiple values we make use of Array and not collection
	 */
	public void setTableOfParameterValues(float[]  arrFltTableOfParameterValues)
	{
		/*Accept the Table of Parameter Values in Float Array format of type FL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x605A, arrFltTableOfParameterValues,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x605A,DicomConstants.DCM_DT_FL, arrFltTableOfParameterValues);

		addDataElement(objIDataElement);


	}

	/**
	 * Return collection of Parameter Values
	 * @return float[] - float array of Parameter Values
	 */
	/*
	 * For multiple values we make use of Array and not collection
	 */
	public float[] getTableOfParameterValues()
	{
		Object objValue = getValue(0x0018,0x6058);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}

	/**
	 * Retrieves pre-initialized object of PixelValueMappingCodeSequence.If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence.
	 * @return PixelValueMappingCodeSequence - instance of Pixel Value Mapping Code Sequence. 
	 */
	public PixelValueMappingCodeSequence getPixelValueMappingCodeSequence()
	{
		PixelValueMappingCodeSequence objPixelValueMappingCodeSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x0040, 0x9098);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objPixelValueMappingCodeSequence = (PixelValueMappingCodeSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objPixelValueMappingCodeSequence = (PixelValueMappingCodeSequence)objDicomV3Factory.createSequence(0x0040, 0x9098, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x0040, 0x9098, objPixelValueMappingCodeSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x0040, 0x9098, DicomConstants.DCM_DT_SQ, objPixelValueMappingCodeSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objPixelValueMappingCodeSequence;
	}
	
	/**
	 * Sets the manufacturer defined description of center frequency of the interrogating
	 * ultrasound energy. The units are kilohertz.	
	 * @param iTransducerFrequency integer value of description of center frequency of the interrogating
	 * ultrasound energy.
	 */
	public void setTransducerFrequency(int iTransducerFrequency)
	{
		/*Accept the Transducer Frequency in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6030, iTransducerFrequency,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6030,DicomConstants.DCM_DT_UL, iTransducerFrequency);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve description of center frequency of the interrogating
	 * ultrasound energy
	 * @return int - integer value of description of center frequency of the interrogating
	 * ultrasound energy
	 */
	public int getTransducerFrequency()
	{
		Object objValue = getValue(0x0018,0x6030);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the ultrasound pulse repetition frequency, as defined by the manufacturer, used to
	 * collect data in the region. The units are in hertz.
	 * @param iPulseRepetitionFrequency integer value of ultrasound pulse repetition frequency
	 */
	public void setPulseRepetitionFrequency(int  iPulseRepetitionFrequency)
	{
		/*Accept the Pulse Repetition Frequency in integer format of type UL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6032, iPulseRepetitionFrequency,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6032,DicomConstants.DCM_DT_UL, iPulseRepetitionFrequency);

		addDataElement(objIDataElement);


	}

	/**
	 * Retreive ultrasound pulse repetition frequency
	 * @return integer value of ultrasound pulse repetition frequency.
	 */
	public int getPulseRepetitionFrequency()
	{
		Object objValue = getValue(0x0018,0x6032);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the Doppler correction angle. The units are degrees.
	 * @param dDopplerCorrectionAngle double value of the Doppler correction angle
	 */
	public void setDopplerCorrectionAngle(double  dDopplerCorrectionAngle)
	{
		/*Accept the Doppler Correction Angle in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x0018,0x6034, dDopplerCorrectionAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6034,DicomConstants.DCM_DT_FD, dDopplerCorrectionAngle);

		addDataElement(objIDataElement);


	}

	/**
	 * Retrieve the Doppler correction angle
	 * @return double - double value of the Doppler correction angle
	 */
	public double getDopplerCorrectionAngle()
	{
		Object objValue = getValue(0x0018,0x6034);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the steering angle, as defined by the manufacturer, used for a steered 2D
	 * image. The units are degrees.
	 * @param dblSteeringAngle double value of the steering angle
	 */
	public void setSteeringAngle(double  dblSteeringAngle)
	{
		/*Accept the Steering Angle in Double format of type FD
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6036, dblSteeringAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6036,DicomConstants.DCM_DT_FD, dblSteeringAngle);

		addDataElement(objIDataElement);


	}

	/** 
	 * Return steering angle,used for a steered 2D image
	 * @return double - double value of the steering angle
	 */
	public double getSteeringAngle()
	{
		Object objValue = getValue(0x0018,0x6036);
		if(objValue != null)
			return Double.parseDouble(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the x displacement, in pixels, from the Reference pixel to the center of the
	 * Doppler sample volume.
	 * @param iDopplerSampleVolumeXPosition integer value of the x displacement
	 */
	public void setDopplerSampleVolumeXPosition(int  iDopplerSampleVolumeXPosition)
	{
		/*Accept the Doppler Sample Volume X Position in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6039, iDopplerSampleVolumeXPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6039,DicomConstants.DCM_DT_UL, iDopplerSampleVolumeXPosition);

		addDataElement(objIDataElement);


	}

	/**
	 * Return  x displacement, in pixels, from the Reference pixel to the center of the
	 * Doppler sample volume
	 * @return integer value of x displacement, in pixels.
	 */
	public int getDopplerSampleVolumeXPosition()
	{
		Object objValue = getValue(0x0018,0x6039);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the y displacement, in pixels, from the Reference pixel to the center of the
	 * Doppler sample volume.
	 * @param iDopplerSampleVolumeYPosition y displacement, in pixels, from the Reference pixel to the center of the
	 * Doppler sample volume.
	 */
	public void setDopplerSampleVolumeYPosition(int  iDopplerSampleVolumeYPosition)
	{
		/*Accept the Doppler Sample Volume Y Position in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x603B, iDopplerSampleVolumeYPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x603B,DicomConstants.DCM_DT_UL, iDopplerSampleVolumeYPosition);

		addDataElement(objIDataElement);


	}

	/**
	 * Return  y displacement, in pixels, from the Reference pixel to the center of the
	 * Doppler sample volume.
	 * @return int - y displacement, in pixels
	 */
	public int getDopplerSampleVolumeYPosition()
	{
		Object objValue = getValue(0x0018,0x603B);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the starting and ending coordinates pairs of the m-line. Where the X0,Y0 are the
	 * starting point and X1,Y1 are the end point of the tm-line.
	 * @param iTMLinePositionX0 integer value of X0 co-ordinate of ending coordinate pair of m-line
	 */
	public void setTMLinePositionX0(int  iTMLinePositionX0)
	{
		/*Accept the TM-Line Position X0 in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x603D, iTMLinePositionX0,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x603D,DicomConstants.DCM_DT_UL, iTMLinePositionX0);

		addDataElement(objIDataElement);


	}

	/**
	 * Return X co-ordinate of starting coordinates pairs of the m-line.
	 * @return int - integer value of X co-ordinate of starting coordinates pairs of the m-line.
	 */
	public int getTMLinePositionX0()
	{
		Object objValue = getValue(0x0018,0x603D);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the starting and ending coordinates pairs of the m-line. Where the X0,Y0 are the
	 * starting point and X1,Y1 are the end point of the tm-line.
	 * @param iTMLinePositionY0 integer value of Y0 co-ordinate of ending coordinate pair of m-line
	 */
	public void setTMLinePositionY0(int iTMLinePositionY0)
	{
		/*Accept the TM-Line Position Y0 in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x603F, iTMLinePositionY0,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x603F,DicomConstants.DCM_DT_UL, iTMLinePositionY0);

		addDataElement(objIDataElement);


	}

	/**
	 * Return Y co-ordinate of starting coordinates pairs of the m-line.
	 * @return - integer value of Y0 co-ordinate of ending coordinate pair of m-line
	 */
	public int getTMLinePositionY0()
	{
		Object objValue = getValue(0x0018,0x603F);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the starting and ending coordinates pairs of the m-line. Where the X0,Y0 are the
	 * starting point and X1,Y1 are the end point of the tm-line.
	 * @param iTMLinePositionX1 integer value of X1 co-ordinate of start coordinate pair of m-line
	 */
	public void setTMLinePositionX1(int iTMLinePositionX1)
	{
		/*Accept the TM-Line Position X1 in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6041, iTMLinePositionX1,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6041,DicomConstants.DCM_DT_UL, iTMLinePositionX1);

		addDataElement(objIDataElement);


	}

	/**
	 * Return X co-ordinate of ending coordinates pairs of the m-line.
	 * @return int - integer value of X1 co-ordinate of ending coordinate pair of m-line
	 */
	public int getTMLinePositionX1()
	{
		Object objValue = getValue(0x0018,0x6041);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets the starting and ending coordinates pairs of the m-line. Where the X0,Y0 are the
	 * starting point and X1,Y1 are the end point of the tm-line.
	 * @param iTMLinePositionY1 integer value of Y1 co-ordinate of ending coordinate pair of m-line
	 */
	public void setTMLinePositionY1(int iTMLinePositionY1)
	{
		/*Accept the TM-Line Position Y1 in integer format of type SL
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * 
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x0018,0x6043, iTMLinePositionY1,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x0018,0x6043,DicomConstants.DCM_DT_UL, iTMLinePositionY1);

		addDataElement(objIDataElement);


	}

	/**
	 * Return Y co-ordinate of ending coordinates pairs of the m-line.
	 * @return int - integer value of Y1 co-ordinate of ending coordinate pair of m-line
	 */
	public int getTMLinePositionY1()
	{
		Object objValue = getValue(0x0018,0x6043);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
}
