/*******************************************************************************
 *  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.enums.EnumBeamLimitingDeviceRotationDirection;
import cdac.medinfo.sdk.dcm30_04.enums.EnumGantryPitchRotationDirection;
import cdac.medinfo.sdk.dcm30_04.enums.EnumGantryRotationDirection;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPatientSupportRotationDirection;
import cdac.medinfo.sdk.dcm30_04.enums.EnumTableTopPitchRotationDirection;
import cdac.medinfo.sdk.dcm30_04.enums.EnumTableTopRollRotationDirection;
import cdac.medinfo.sdk.dcm30_04.utils.DicomConstants;
/**
* This item class contains the methods to set, get and validate the attribute present in Ion Control Point Verification Sequence .
 */


public class IonControlPointVerificationSequenceItem extends Item
{

	private static final long serialVersionUID = 1L;
	/**
	 * This constructor creates the item and internal code sequence macro with default TransferSyntax 
	 */
	IonControlPointVerificationSequenceItem()
	{
		super();
	}


	/**
	 * This constructor creates the item and internal code sequence macro with specified TransferSyntax 
	 * and default DictionaryReader
	 * @param objITransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 */
	IonControlPointVerificationSequenceItem(ITransferSyntax objITransferSyntax)
	{
		super(objITransferSyntax);
	}

	/**
	 * This constructor creates IonControlPointVerificationSequenceItem with specified TransferSyntax and
	 * specified DictionaryReader
	 * @param objTransferSyntax specifies the DICOM Standard defined TransfeSyntax
	 * @param objDictionaryReader specifies the DICOM Dictionary reader to be used 
	 */
	IonControlPointVerificationSequenceItem(ITransferSyntax objTransferSyntax, IDictionaryReader objDictionaryReader)
	{
		super(objTransferSyntax,objDictionaryReader);
	}
	
	/**
	 * The specified speed of delivery of the specified dose in units specified by Primary Dosimeter Unit (300A,00B3) in referenced RT Plan per minute.
	 * @param shMetersetRateSet short value of Rotation of right image.
	 */
	public void setMetersetRateSet(float shMetersetRateSet)
	{
		/* The specified speed of delivery of the specified dose in units specified by Primary Dosimeter Unit (300A,00B3) in referenced RT Plan per minute.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x3008,0x0045,shMetersetRateSet,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x3008,0x0045,DicomConstants.DCM_DT_FL, shMetersetRateSet);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves  MetersetRateSet
	 * @return short - short value of Rotation of Meterset Rate Set.
	 */
	public float getMetersetRateSet()
	{
		Object objValue = getValue(0x3008,0x0045);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets NominalBeamEnergy.Nominal Beam Energy at control point.
	 * @param strNominalBeamEnergy String value of Slice Thickness.
	 */
	public void setNominalBeamEnergy(String strNominalBeamEnergy)
	{
		/* Accept the NominalBeamEnergy in String format of type DS.
		 * Nominal Beam Energy at control point.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0114, strNominalBeamEnergy,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0114,DicomConstants.DCM_DT_DS, strNominalBeamEnergy);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves NominalBeamEnergy.
	 * @return String - value of Nominal Beam Energy.
	 */
	public String getNominalBeamEnergy()
	{
		Object objValue = getValue(0x300A,0x0114);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	
	/**
	 * Retrieves pre-initialized object of Beam Limiting Device Position Sequence.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 BeamLimitingDevicePositionSequence - instance of BeamLimitingDevicePositionSequence. 
	 */
	public BeamLimitingDevicePositionSequence getBeamLimitingDevicePositionSequence()
	{
		BeamLimitingDevicePositionSequence objBeamLimitingDevicePositionSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x011A);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objBeamLimitingDevicePositionSequence = (BeamLimitingDevicePositionSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objBeamLimitingDevicePositionSequence = (BeamLimitingDevicePositionSequence)objDicomV3Factory.createSequence(0x300A, 0x011A, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x011A, objBeamLimitingDevicePositionSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x011A, DicomConstants.DCM_DT_SQ, objBeamLimitingDevicePositionSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objBeamLimitingDevicePositionSequence;
	}

	
	/**
	 * Sets Gantry Angle.
	 * Gantry angle of radiation source in degrees, i.e., orientation of the IEC GANTRY coordinate system with respect to the IEC FIXED REFERENCE coordinate system
	 * @param strGantryAngle String value of Slice Thickness.
	 */
	public void setGantryAngle(String strGantryAngle)
	{
		/* Accept the SliceThickness in String format of type DS.
		 * Gantry angle of radiation source in degrees, i.e., orientation of the IEC GANTRY coordinate system with respect to the IEC FIXED REFERENCE coordinate system
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x011E, strGantryAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x011E,DicomConstants.DCM_DT_DS, strGantryAngle);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves GantryAngle.
	 * @return String - value of GantryAngle.
	 */
	public String getGantryAngle()
	{
		Object objValue = getValue(0x300A,0x011E);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the Gantry Rotation Direction Defined in Terms of TEXT
	 * Direction of Gantry Rotation when viewing gantry from isocenter, for segment following Control Point.
	 * @param strGantryRotationDirection type of the value encoded in this Item
	 */
	public void setGantryRotationDirection(EnumGantryRotationDirection enumGantryRotationDirection)
	{
		/* Accept the GantryRotationDirection Type in String format of type CS.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x011F, enumGantryRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x011F,DicomConstants.DCM_DT_CS, enumGantryRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Gantry Rotation Direction value encoded in this Item
	 * Direction of Gantry Rotation when viewing gantry from isocenter, for segment following Control Point.
	 * @return String - Type of the value encoded in this Item
	 */
	public String getGantryRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x011F);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets BeamLimitingDeviceAngle.
	 * Beam Limiting Device angle in degrees, i.e., orientation of the IEC BEAM LIMITING DEVICE coordinate system with respect to the IEC GANTRY coordinate system.
	 * @param strSliceThickness String value of Slice Thickness.
	 */
	public void setBeamLimitingDeviceAngle(String strBeamLimitingDeviceAngle)
	{
		/* Accept the BeamLimitingDeviceAngle in String format of type DS.
		 * Beam Limiting Device angle in degrees, i.e., orientation of the IEC BEAM LIMITING DEVICE coordinate system with respect to the IEC GANTRY coordinate system.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0120, strBeamLimitingDeviceAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0120,DicomConstants.DCM_DT_DS, strBeamLimitingDeviceAngle);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Beam Limiting Device Angle.
	 * @return String - value of BeamLimitingDeviceAngle.
	 */
	public String getBeamLimitingDeviceAngle()
	{
		Object objValue = getValue(0x300A,0x0120);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the BeamLimitingDeviceRotationDirection Defined in Terms of Enum
	 * Enumerated Values:
	 * CW	: clockwise
	 * CC	: counter-clockwise
	 * NONE	: no rotation
	 * @param strBeamLimitingDeviceRotationDirection Specifies type of the value encoded in this Item
	 */
	public void setBeamLimitingDeviceRotationDirection(EnumBeamLimitingDeviceRotationDirection enumBeamLimitingDeviceRotationDirection)
	{
		/* Accept the Value Type in Enum format of type CS.
		 * Direction of Beam Limiting Device Rotation when viewing beam limiting device (collimator) from radiation source, for segment following Control Point
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0121, enumBeamLimitingDeviceRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0121,DicomConstants.DCM_DT_CS, enumBeamLimitingDeviceRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves type of the value encoded in this Item
	 * @return String - Type of the value encoded in this Item
	 */
	public String getBeamLimitingDeviceRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x0121);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Patient Support Angle.Patient Support angle in degrees, i.e., 
	 * Orientation of the IEC PATIENT SUPPORT (turntable) coordinate system with respect to the IEC FIXED REFERENCE coordinate system.
	 * @param strPatientSupportAngle String value of Patient Support Angle.
	 */
	public void setPatientSupportAngle(String strPatientSupportAngle)
	{
		/* Accept the Patient Support Angle in String format of type DS.
		 * Orientation of the IEC PATIENT SUPPORT (turntable) coordinate system with respect to the IEC FIXED REFERENCE coordinate system
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0122, strPatientSupportAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0122,DicomConstants.DCM_DT_DS, strPatientSupportAngle);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Patient Support Angle.
	 * @return String - value of PatientSupportAngle.
	 */
	public String getPatientSupportAngle()
	{
		Object objValue = getValue(0x300A,0x0122);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the PatientSupportRotationDirection Defined in Terms of Enum
	 * Enumerated Values:
	 * CW	: clockwise
	 * CC	: counter-clockwise
	 * NONE	: no rotation
	 * @param strValueType Specifies type of the value encoded in this Item
	 */
	public void setPatientSupportRotationDirection(EnumPatientSupportRotationDirection enumPatientSupportRotationDirection)
	{
		/* Accept the Value Type in Enum format of type CS.
		 * Direction of Patient Support Rotation when viewing table from above, for segment following Control Point
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0123, enumPatientSupportRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0123,DicomConstants.DCM_DT_CS, enumPatientSupportRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves type of the PatientSupportRotationDirection value encoded in this Item
	 * @return String - Type of the value encoded in this Item
	 */
	public String getPatientSupportRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x0123);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets TableTopVerticalPosition.
	 * @param strTableTopVerticalPosition String value of Table Top Vertical Position.
	 */
	public void setTableTopVerticalPosition(String strTableTopVerticalPosition)
	{
		/* Accept the Table Top Vertical Position in String format of type DS.
		 * Table Top Vertical position in mm in the IEC TABLE TOP coordinate system
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0128, strTableTopVerticalPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0128,DicomConstants.DCM_DT_DS, strTableTopVerticalPosition);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves TableTopVerticalPosition.
	 * @return String - value of Table Top Vertical Position.
	 */
	public String getTableTopVerticalPosition()
	{
		Object objValue = getValue(0x300A, 0x0128);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets TableTopLongitudinalPosition.
	 * @param strTableTopLongitudinalPosition String value of Table Top Vertical Position.
	 */
	public void setTableTopLongitudinalPosition(String strTableTopLongitudinalPosition)
	{
		/* Accept the Table Top Longitudinal Position in String format of type DS.
		 * Table Top Longitudinal position in mm in the IEC TABLE TOP coordinate system.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0129, strTableTopLongitudinalPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0129,DicomConstants.DCM_DT_DS, strTableTopLongitudinalPosition);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves TableTopVerticalPosition.
	 * @return String - value of Table Top Vertical Position.
	 */
	public String getTableTopLongitudinalPosition()
	{
		Object objValue = getValue(0x300A, 0x0129);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets TableTopLateralPosition.
	 * @param TableTopLateralPosition String value of Table Top Lateral Position.
	 */
	public void setTableTopLateralPosition(String strTableTopLateralPosition)
	{
		/* Accept the Table Top Longitudinal Position in String format of type DS.
		 * Table Top Lateral position in mm in the IEC TABLE TOP coordinate system. 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x012A, strTableTopLateralPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x012A,DicomConstants.DCM_DT_DS, strTableTopLateralPosition);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves TableTopLateralPosition.
	 * @return String - value of Table Top Lateral Position.
	 */
	public String getTableTopLateralPosition()
	{
		Object objValue = getValue(0x300A, 0x012A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Table Top Pitch Angle
	 * Table Top Pitch Angle in degrees, i.e., 
	 * The rotation of the IEC TABLE TOP coordinate system about the X-axis of the IEC TABLE TOP coordinate system.
	 * @param arrFMaskSubPixelShift pair of floating point numbers
	 */
	public void setTableTopPitchAngle(float[] arrTableTopPitchAngle)
	{
		/* Accept the Table Top Pitch Angle in degree format of type FL.
		 * Table Top Pitch Angle in degrees
		 * The rotation of the IEC TABLE TOP coordinate system about the X-axis of the IEC TABLE TOP coordinate system.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0140, arrTableTopPitchAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0140,DicomConstants.DCM_DT_FL, arrTableTopPitchAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Table Top Pitch Angle.
	 * @return float[] - Float array of Table Top Pitch Angle.
	 */
	public float[] getTableTopPitchAngle()
	{
		Object objValue = getValue(0x300A,0x0140);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}
	
	/**
	 * Sets the TableTopPitchRotationDirection Defined in Terms of EnumTableTopPitchRotationDirection
	 * Enumerated Values:
	 * CW	:clockwise
	 * CC	:counter-clockwise
	 * NONE	:no rotation
	 * @param enumTableTopPitchRotationDirection Specifies type of the value encoded in this Item
	 */
	public void setTableTopPitchRotationDirection(EnumTableTopPitchRotationDirection enumTableTopPitchRotationDirection)
	{
		/* Accept the TableTopPitchRotationDirection in enumerated format of type CS.
		 * Direction of Table Top Pitch Rotation when viewing the table along the positive X-axis of the IEC TABLE TOP coordinate system.
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0142, enumTableTopPitchRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0142,DicomConstants.DCM_DT_CS, enumTableTopPitchRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves TableTopPitchRotationDirection type of the value encoded in this Item
	 * @return enum - Type of the value encoded in this Item
	 */
	public String getTableTopPitchRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x0142);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Table Top Roll Angle in degrees, i.e., 
	 * The rotation of the IEC TABLE TOP coordinate system about the Y-axis of the IEC TABLE TOP coordinate system. 
	 * @param arrTableTopRollAngle pair of floating point numbers
	 */
	public void setTableTopRollAngle(float[] arrTableTopRollAngle)
	{
		/* Accept the Table Top Roll Angle in type FL.
		 * The rotation of the IEC TABLE TOP coordinate system about the Y-axis
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0144, arrTableTopRollAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0144,DicomConstants.DCM_DT_FL, arrTableTopRollAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Table Top Roll Angle.
	 * @return float[] - Float Table Top Roll Angle.
	 */
	public float[] getTableTopRollAngle()
	{
		Object objValue = getValue(0x300A,0x0144);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}

	/**
	 * Sets the Value Type Defined in Terms of EnumTableTopRollRotationDirection
	 * Enumerated Values:
	 * CW	:clockwise
	 * CC	:counter-clockwise
	 * NONE	:no rotation
	 * @param enumTableTopRollRotationDirection Specifies type of the value encoded in this Item
	 */
	public void setTableTopRollRotationDirection(EnumTableTopRollRotationDirection enumTableTopRollRotationDirection)
	{
		/* Accept the Value Type in String format of type CS.
		 * Direction of Table Top Roll Rotation when viewing the table along 
		 * The positive Y-axis of the IEC TABLE TOP coordinate system,for segment following Control Point
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x0146, enumTableTopRollRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x0146,DicomConstants.DCM_DT_CS, enumTableTopRollRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves type of the value encoded in this Item
	 * @return enumTableTopRollRotationDirection - Type of the value encoded in this Item
	 */
	public String getTableTopRollRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x0146);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Angle in degrees of the head fixation for eye treatments with respect to the Table Top Pitch Angle (300A,0140) coordinate system. 
	 * Positive head fixation angle is the same direction as positive Table Top Pitch. 
	 * @param arrHeadFixationAngle pair of floating point numbers
	 */
	public void setHeadFixationAngle(float[] arrHeadFixationAngle)
	{
		/* Accept the HeadFixationAngle of type FL.
		 * Sets Angle in degrees of the head fixation for eye treatments with respect to the Table Top Pitch Angle (300A,0140) coordinate system. 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x0148, arrHeadFixationAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x0148,DicomConstants.DCM_DT_FL, arrHeadFixationAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Head Fixation Angle.
	 * @return float[] - Float array of Head Fixation Angle.
	 */
	public float[] getHeadFixationAngle()
	{
		Object objValue = getValue(0x300A,0x0148);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}

	/**
	 * Sets Gantry Pitch Angle in degrees of the radiation source, 
	 * i.e., the rotation of the IEC GANTRY coordinate system about the X-axis of the IEC GANTRY coordinate system.  
	 * @param arrHeadFixationAngle pair of floating point numbers
	 */
	public void setGantryPitchAngle(float[] arrHeadFixationAngle)
	{
		/* Accept the HeadFixationAngle of type FL.
		 * Sets Gantry Pitch Angle in degrees of the radiation source
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A,0x014A, arrHeadFixationAngle,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x014A,DicomConstants.DCM_DT_FL, arrHeadFixationAngle);

		addDataElement(objIDataElement);
	}

	/**
	 * Retrieves Gantry Pitch Angle in degrees of the radiation source.
	 * @return float[] - Float array of Gantry Pitch Angle.
	 */
	public float[] getGantryPitchAngle()
	{
		Object objValue = getValue(0x300A,0x014A);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}
	
	/**
	 * Sets the Gantry Pitch Rotation Direction Type Defined in Terms of enumGantryPitchRotationDirection
	 * Direction of Gantry Pitch Angle when viewing along the positive X-axis of the IEC GANTRY coordinate system, for segment following Control Point. 
	 * @param enumGantryPitchRotationDirection Specifies type of the value encoded in this Item
	 */
	public void setGantryPitchRotationDirection(EnumGantryPitchRotationDirection enumGantryPitchRotationDirection)
	{
		/* Accept the Value Type in String format of type CS.
		 * Direction of Gantry Pitch Angle when viewing along the positive X-axis of the IEC GANTRY coordinate system, for segment following Control Point. 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)
			objIDataElement = new ImplicitDE(0x300A, 0x014C, enumGantryPitchRotationDirection.getValue(),getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A, 0x014C,DicomConstants.DCM_DT_CS, enumGantryPitchRotationDirection.getValue());

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Gantry Pitch Rotation Direction in this Item
	 * @return String - Type of the value encoded in this Item
	 */
	public String getGantryPitchRotationDirection()
	{
		Object objValue = getValue(0x300A, 0x014C);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets axial position in mm of the snout, measured from isocenter to the downstream side of the snout  
	 * @param fSnoutPosition Float value of the Ratio of displayed pixels to source pixels
	 */
	public void setSnoutPosition( float fSnoutPosition)
	{
		/* Accept the fSnoutPosition in String format of type FL.
		 * Axial position in mm of the snout, measured from isocenter to the downstream side of the snout 
		 * Add this element to the Data Set
		 */
		IDataElement objIDataElement = null;
		if(objITransferSyntax.getVRTransferSyntax() == DicomConstants.DCM_VR_IMPLICIT)	
			objIDataElement = new ImplicitDE(0x300A,0x030D, fSnoutPosition,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300A,0x030D,DicomConstants.DCM_DT_FL, fSnoutPosition);

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves the Ratio of displayed pixels to source pixels,specified in one dimension.
	 * @return float - Float value of the Ratio of displayed pixels to source pixels
	 */
	public float getSnoutPosition()
	{
		Object objValue = getValue(0x300A,0x030D);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Retrieves pre-initialized object of Range Shifter Settings Sequence.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 RangeShifterSettingsSequence - instance of Range Shifter Settings Sequence. 
	 */
	public RangeShifterSettingsSequence getRangeShifterSettingsSequence()
	{
		RangeShifterSettingsSequence objRangeShifterSettingsSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x0360);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRangeShifterSettingsSequence = (RangeShifterSettingsSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRangeShifterSettingsSequence = (RangeShifterSettingsSequence)objDicomV3Factory.createSequence(0x300A, 0x0360, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x0360, objRangeShifterSettingsSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x0360, DicomConstants.DCM_DT_SQ, objRangeShifterSettingsSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRangeShifterSettingsSequence;
	}

	/**
	 * Retrieves pre-initialized object of Lateral Spreading Device Settings Sequence.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 LateralSpreadingDeviceSettingsSequence - instance of Lateral Spreading Device Settings Sequence. 
	 */
	public LateralSpreadingDeviceSettingsSequence getLateralSpreadingDeviceSettingsSequence()
	{
		LateralSpreadingDeviceSettingsSequence objLateralSpreadingDeviceSettingsSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x0370);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objLateralSpreadingDeviceSettingsSequence = (LateralSpreadingDeviceSettingsSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objLateralSpreadingDeviceSettingsSequence = (LateralSpreadingDeviceSettingsSequence)objDicomV3Factory.createSequence(0x300A, 0x0370, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x0370, objLateralSpreadingDeviceSettingsSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x0370, DicomConstants.DCM_DT_SQ, objLateralSpreadingDeviceSettingsSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objLateralSpreadingDeviceSettingsSequence;
	}
	
	/**
	 * Retrieves pre-initialized object of Range Modulator Settings Sequence.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 RangeModulatorSettingsSequence - instance of Range Modulator Settings Sequence. 
	 */
	public RangeModulatorSettingsSequence getRangeModulatorSettingsSequence()
	{
		RangeModulatorSettingsSequence objRangeModulatorSettingsSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x0380);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objRangeModulatorSettingsSequence = (RangeModulatorSettingsSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objRangeModulatorSettingsSequence = (RangeModulatorSettingsSequence)objDicomV3Factory.createSequence(0x300A, 0x0380, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x0380, objRangeModulatorSettingsSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x0380, DicomConstants.DCM_DT_SQ, objRangeModulatorSettingsSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objRangeModulatorSettingsSequence;
	}
	
	/**
	 * Retrieves pre-initialized object of Ion Wedge Position Sequence.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 IonWedgePositionSequence - instance of Ion Wedge Position Sequence. 
	 */
	public IonWedgePositionSequence getIonWedgePositionSequence()
	{
		IonWedgePositionSequence objIonWedgePositionSequence = null;
		IDataElement objIDataElement =  getDataForTag(0x300A, 0x03AC);
		if(objIDataElement != null)
		{
			IDicomValue objIDicomValue = objIDataElement.getDicomValue();
			if(objIDicomValue != null)
				objIonWedgePositionSequence = (IonWedgePositionSequence)objIDicomValue;
		}
		else
		{
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			int iVRTransferSyntax = objITransferSyntax.getVRTransferSyntax();
			objIDataElement = null;
			objIonWedgePositionSequence = (IonWedgePositionSequence)objDicomV3Factory.createSequence(0x300A, 0x03AC, objITransferSyntax, objIDictionaryReader);

			if(iVRTransferSyntax == DicomConstants.DCM_VR_IMPLICIT)
				objIDataElement = new ImplicitDE(0x300A, 0x03AC, objIonWedgePositionSequence.getValue(),objIDictionaryReader);
			else
				objIDataElement = new ExplicitDE(0x300A, 0x03AC, DicomConstants.DCM_DT_SQ, objIonWedgePositionSequence.getValue());
			objIDataElement.setTransferSyntax(objITransferSyntax);
			if(objIDataElement != null)
				addDataElement(objIDataElement);
		}
		return objIonWedgePositionSequence;
	}
	
	/**
	 * Sets Referenced Control Point Index. 
	 * Uniquely identifies Control Point specified by Control Point Index (300A,0112 within the Beam referenced by Referenced Beam Number (300C,0006).
	 * @param strReferencedControlPointIndex String value of Referenced Control Point Index.
	 */
	public void setReferencedControlPointIndex (String strReferencedControlPointIndex )
	{
		/* Accept the Referenced Control Point Index  in String format of type IS.
		 * 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(0x300C,0x00F0, strReferencedControlPointIndex ,getDictionaryReader());
		else
			objIDataElement = new ExplicitDE(0x300C,0x00F0,DicomConstants.DCM_DT_IS, strReferencedControlPointIndex );

		addDataElement(objIDataElement);
	}
	/**
	 * Retrieves Referenced Control Point Index.
	 * Uniquely identifies Control Point specified by Control Point Index (300A,0112 within the Beam referenced by Referenced Beam Number (300C,0006).
	 * @return String - value of Referenced Control Point Index.
	 */
	public String getReferencedControlPointIndex()
	{
		Object objValue = getValue(0x300C,0x00F0);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
}
