/*******************************************************************************
 *  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.dicommodel.modules;

import cdac.medinfo.sdk.dcm30_04.baselibs.AcquisitionMethodAlgorithmSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.AcquisitionMethodCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.DicomV3Factory;
import cdac.medinfo.sdk.dcm30_04.baselibs.GeneralAnatomyMandatoryMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.OphthalmicThicknessMapTypeCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.OphthalmicThicknessMappingNormalsSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.PixelValueMappingtoCodedConceptSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.RealWorldValueMappingMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedInstanceSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.RegistrationtoLocalizerSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.RelativeImagePositionCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.RelevantOPTAttributesSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.RetinalThicknessDefinitionCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.SourceImageSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.Tag;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITag;
import cdac.medinfo.sdk.dcm30_04.enums.EnumBitsAllocated;
import cdac.medinfo.sdk.dcm30_04.enums.EnumBitsStored;
import cdac.medinfo.sdk.dcm30_04.enums.EnumBurnedInAnnotation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumHighBit;
import cdac.medinfo.sdk.dcm30_04.enums.EnumImageLaterality;
import cdac.medinfo.sdk.dcm30_04.enums.EnumLossyImageCompression;
import cdac.medinfo.sdk.dcm30_04.enums.EnumOphthalmicMappingDeviceType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPixelPresentation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPixelRepresentation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRecognizableVisualFeatures;

import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidModuleException;
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;
import cdac.medinfo.sdk.dcm30_04.utils.ISingleCollection;
import cdac.medinfo.sdk.dcm30_04.utils.SingleCollection;
/**
 \* This module specifies the attributes that describe an Ophthalmic Thickness Map Module.
 */
public class OphthalmicThicknessMapModule extends Module  
{
	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;

	/**
	 * The obj General Anatomy Mandatory Macro.
	 */
	GeneralAnatomyMandatoryMacro objGeneralAnatomyMandatoryMacro = null;
	
	/**
	 * The obj Real World Value Mapping Macro.
	 */
	RealWorldValueMappingMacro objRealWorldValueMappingMacro = null;


	/**
	 * Creates Ophthalmic Thickness Map Module with default initialization.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public OphthalmicThicknessMapModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0022,0x1415));
		objSingleCollection.add(new Tag(0x0022,0x1420));
		objSingleCollection.add(new Tag(0x0022,0x1423));
		objSingleCollection.add(new Tag(0x0020,0x0013));
		objSingleCollection.add(new Tag(0x0008,0x0023));
		objSingleCollection.add(new Tag(0x0008,0x0033));
		objSingleCollection.add(new Tag(0x0008,0x002A));
		objSingleCollection.add(new Tag(0x0008,0x0008));
		objSingleCollection.add(new Tag(0x0028,0x0002));
		objSingleCollection.add(new Tag(0x0028,0x0004));
		objSingleCollection.add(new Tag(0x0028,0x0103));
		objSingleCollection.add(new Tag(0x0028,0x0030));
		objSingleCollection.add(new Tag(0x0028,0x0034));
		objSingleCollection.add(new Tag(0x0028,0x0100));
		objSingleCollection.add(new Tag(0x0028,0x0101));
		objSingleCollection.add(new Tag(0x0028,0x0102));
		objSingleCollection.add(new Tag(0x0008,0x9205));
		objSingleCollection.add(new Tag(0x0028,0x0304));
		objSingleCollection.add(new Tag(0x0028,0x2110));
		objSingleCollection.add(new Tag(0x0028,0x2112));
		objSingleCollection.add(new Tag(0x0028,0x2114));
		objSingleCollection.add(new Tag(0x0028,0x0301));
		objSingleCollection.add(new Tag(0x0028,0x0302));
		objSingleCollection.add(new Tag(0x0020,0x0062));
		objSingleCollection.add(new Tag(0x0022,0x1436));
		objSingleCollection.add(new Tag(0x0022,0x1450));
		objSingleCollection.add(new Tag(0x0022,0x1443));
		objSingleCollection.add(new Tag(0x0022,0x1472));
		objSingleCollection.add(new Tag(0x0008,0x2112));
		objSingleCollection.add(new Tag(0x0008,0x114A));
		objSingleCollection.add(new Tag(0x0022,0x1465));
		objSingleCollection.add(new Tag(0x0022,0x001D));
		objSingleCollection.add(new Tag(0x0022,0x1463));
		objSingleCollection.add(new Tag(0x0022,0x1445));
		
	}

	/**
	 * This method validates each Attribute in the Module according to the Type
	 * of the Attribute.Attributes are of 5 types.
	 * Type 1,Type 2 are Mandatory:
	 * Mandatory Attributes have to present in the Module.
	 * Type 1C,2C are Conditional:
	 * Conditional Attributes' presence depend on a condition.
	 * If the condition is satisfied the Attribute has to be present.
	 * Type 3 are Optional
	 * Optional Attributes can be added as and when required.
	 * 
	 * @return true, if validate module
	 * 
	 * @throws InvalidModuleException - If validation of Module fails
	 */
	public  boolean validateModule() throws InvalidModuleException
	{

		try
		{			/*
		 * Validation Rules for Mandatory Elements
		 */
			if(!isPresent(0x0022,0x1415))
				throw new MandatoryMissingException("0022,1415");
			if(!isPresent(0x0022,0x1420))
				throw new MandatoryMissingException("0022,1420");
			if(!isPresent(0x0008, 0x0023))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0008,0023");
			if(!isPresent(0x0008, 0x0033))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0008,0033");
			if(!isPresent(0x0020, 0x0013))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0020, 0013");
			if(!isPresent(0x0008,0x002A))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0008,002A");
			if(!isPresent(0x0008,0x0008))
				throw new MandatoryMissingException("0008,0008");
			else if(!isPresent(0x0028,0x0002))
				throw new MandatoryMissingException("0028,0002");
			else if(!isPresent(0x0028,0x0004))
				throw new MandatoryMissingException("0028,0004");
			if(!isPresent(0x0028,0x0103))
				throw new MandatoryMissingException("0028,0103");
			if(!isPresent(0x0028,0x0030))
				throw new MandatoryMissingException("0028,0030");
			if(!isPresent(0x0028,0x0034))
				throw new MandatoryMissingException("0028,0034");
			if(!isPresent(0x0028,0x0100))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0100");
			if(!isPresent(0x0028,0x0101))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0101");
			if(!isPresent(0x0028,0x0102))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0102");
			if(!isPresent(0x0008,0x9205))
				throw new MandatoryMissingException("0008,9205");
			if(!isPresent(0x0022,0x0301))
				throw new MandatoryMissingException("0022,0301");
			if(!isPresent(0x0022,0x0302))
				throw new MandatoryMissingException("0022,0302");
			if(!isPresent(0x0020,0x0062))
				throw new MandatoryMissingException("Missing Mandatory Element 0020,0062");
			if(!isPresent(0x0022,0x1436))
				throw new MandatoryMissingException("0022,1436");
			
			if(isPresent(0x0008,0x9205) && getPixelPresentation().equalsIgnoreCase(EnumPixelPresentation.COLOR_REF.getValue()))
				if(!isPresent(0x0028,0x0304))
					throw new ConditionFailedException("0x0028,0x0304");
			
			if(isPresent(0x0028,0x2110) && getLossyImageCompression().equalsIgnoreCase(EnumLossyImageCompression.LOSSY_COMPRESSED.getValue()))
				if(!isPresent(0x0028,0x2112))
					throw new ConditionFailedException("0x0028,0x2112");
			
			if(isPresent(0x0028,0x2110) && getLossyImageCompression().equalsIgnoreCase(EnumLossyImageCompression.LOSSY_COMPRESSED.getValue()))
				if(!isPresent(0x0028,0x2114))
					throw new ConditionFailedException("0x0028,0x2114");
			
		}
		catch(MandatoryMissingException mme)
		{
			if(DicomConfig.createInstance().isLoggingOn())
				DicomLogger.getLogger().log(mme.getMessage());

			
				throw new InvalidModuleException(this.getClass().getSimpleName(),mme);

		}
		catch(ConditionFailedException cfe)
		{
			if(DicomConfig.createInstance().isLoggingOn())
				DicomLogger.getLogger().log(cfe.getMessage());

			
				throw new InvalidModuleException(this.getClass().getSimpleName(),cfe);

		}
		return true;
	}
	
	/**
	 * Get the Instance of General Anatomy Mandatory Macro.Attributes related to General Anatomy Mandatory Macro will be set in Macro
	 * using the setter methods provided in the Macro.Calling this method multiple times will return the same Marco
	 * Instance that was created at first. Hence, any attributes in this Macro,if set multiple times will contain the value that was
	 * set in the last call to its setter method.
	 * 
	 * @return - object of General Anatomy Mandatory Macro which the user programmer can populate
	 */
	public GeneralAnatomyMandatoryMacro getGeneralAnatomyMandatoryMacro()
	{
		if(objGeneralAnatomyMandatoryMacro == null)
			objGeneralAnatomyMandatoryMacro = new GeneralAnatomyMandatoryMacro(objIDataSet);
		return objGeneralAnatomyMandatoryMacro; 
	}
	
	/**
	 * Get the Instance of RealWorld Value Mapping Macro.Attributes related to RealWorld Value Mapping Macro will be set in Macro
	 * using the setter methods provided in the Macro.Calling this method multiple times will return the same Marco
	 * Instance that was created at first. Hence, any attributes in this Macro,if set multiple times will contain the value that was
	 * set in the last call to its setter method.
	 * 
	 * @return - object of RealWorld Value Mapping Macro which the user programmer can populate
	 */
	public RealWorldValueMappingMacro getRealWorldValueMappingMacro()
	{
		if(objRealWorldValueMappingMacro == null)
			objRealWorldValueMappingMacro = new RealWorldValueMappingMacro(objIDataSet);
		return objRealWorldValueMappingMacro; 
	}

	
	/**
	 * Sets OphthalmicMappingDeviceType
	 * @param enumOphthalmicMappingDeviceType Enum value of OphthalmicMappingDeviceType
	 */
	public void setOphthalmicMappingDeviceType(EnumOphthalmicMappingDeviceType enumOphthalmicMappingDeviceType)
	{
		/* Accept OphthalmicMappingDeviceType in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0022,0x1415, DicomConstants.DCM_DT_CS, enumOphthalmicMappingDeviceType.getValue());
	}

	/**
	 * Retrieves OphthalmicMappingDeviceType
	 * @return String - String value of OphthalmicMappingDeviceType
	 */
	public String getOphthalmicMappingDeviceType()
	{
		Object objValue = getValue(0x0022,0x1415);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * This method provides the pre-initialized object of Acquisition Method CodeSequence.
	 * 
	 * @return - object of Acquisition Method CodeSequence. 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
	 */
	public AcquisitionMethodCodeSequence getAcquisitionMethodCodeSequence()
	{
		AcquisitionMethodCodeSequence objAcquisitionMethodCodeSequence = (AcquisitionMethodCodeSequence)getDicomValue(0x0022, 0x1420);
		if(objAcquisitionMethodCodeSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objAcquisitionMethodCodeSequence = (AcquisitionMethodCodeSequence)objDicomV3Factory.createSequence(0x0022, 0x1420, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1420, DicomConstants.DCM_DT_SQ, objAcquisitionMethodCodeSequence.getValue());
		}
		return objAcquisitionMethodCodeSequence;
	}
	
	/**
	 * This method provides the pre-initialized object of Acquisition MethodAlgorithm Sequence.
	 * 
	 * @return - object of Acquisition MethodAlgorithm 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
	 */
	public AcquisitionMethodAlgorithmSequence getAcquisitionMethodAlgorithmSequence()
	{
		AcquisitionMethodAlgorithmSequence objAcquisitionMethodAlgorithmSequence = (AcquisitionMethodAlgorithmSequence)getDicomValue(0x0022, 0x1423);
		if(objAcquisitionMethodAlgorithmSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objAcquisitionMethodAlgorithmSequence = (AcquisitionMethodAlgorithmSequence)objDicomV3Factory.createSequence(0x0022, 0x1423, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1423, DicomConstants.DCM_DT_SQ, objAcquisitionMethodAlgorithmSequence.getValue());
		}
		return objAcquisitionMethodAlgorithmSequence;
	}
	
	/**
	 * Sets A number that identifies this SOP Instance. The value shall be unique within a series. 
	 * @param strInstanceNumber String value of Instance Number.
	 */
	public void setInstanceNumber(String strInstanceNumber )
	{
		/*Accept the Instance Number  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
		 */
		addDataElement(0x0020, 0x0013, DicomConstants.DCM_DT_IS,strInstanceNumber);
	}
	/**
	 * Retrieves A number that identifies this SOP Instance. The value shall be unique within a series. 
	 * @return String - value of Instance Number.
	 */
	public String getInstanceNumber()
	{
		Object objValue = getValue(0x0020, 0x0013);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets date the data creation started.
	 * @param strContentDate String value of date the data creation started.
	 */
	public void setContentDate(String strContentDate)
	{
		/* Accept the date the content creation started. of type DA.
		 * 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
		 */
		addDataElement(0x0008, 0x0023, DicomConstants.DCM_DT_DA,strContentDate);
	}
	/**
	 * Retrieves date the data creation started.
	 * @return String - value of date the data creation started.
	 */
	public String getContentDate()
	{
		Object objValue = getValue(0x0008, 0x0023);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets time the data creation started
	 * @param strContentTime String value of time the data creation started
	 */
	public void setContentTime(String strContentTime)
	{
		/* Accept time the content creation started of type TM.
		 * 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
		 */
		addDataElement(0x0008,0x0033, DicomConstants.DCM_DT_TM,strContentTime);
	}

	/**
	 * Retrieves time the data creation started
	 * @return String - value of time the content creation started
	 */
	public String getContentTime()
	{
		Object objValue = getValue(0x0008, 0x0033);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets date and time that the original generation of the data in the document started
	 * @param strAcquisitionDateTime String value of date and time that the original generation of the data in the document started
	 */
	public void setAcquisitionDateTime(String strAcquisitionDateTime)
	{
		/* Accept the Verification DateTime of type DT.
		 * 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
		 */
		addDataElement(0x0008,0x002A, DicomConstants.DCM_DT_DT,strAcquisitionDateTime);
	}

	/**
	 * Retrieves date and time that the original generation of the data in the document started
	 * @return String - value of date and time that the original generation of the data in the document started
	 */
	public String getAcquisitionDateTime()
	{
		Object objValue = getValue(0x0008,0x002A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Image Type.
	 * Image identification characteristics.
	 * @param arrStrImageType :Image identification characteristics.
	 */	
	public void setImageType(String[] arrStrImageType)
	{
		/*Accept Image identification characteristics in String Array format of type CS.
		 * Read the Transfer Syntax and check to create ImplicitDE or ExplicitDE .
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Hash Map
		 */
		addDataElement(0x0008, 0x0008, DicomConstants.DCM_DT_CS, arrStrImageType);
	}
	
	/**
	 * Return the String values of the attribute Image Type.
	 * 
	 * @return String[] - returns the type of image
	 */
	public String[] getImageType()
	{
		Object objectValue = getValue(0x0008, 0x0008);
		if(objectValue!=null)
			return (String[])objectValue;
		return null;
	}

	/**
	 * Sets Samples Per Pixel.
	 * Number of samples (planes) in this image.
	 * @param sSamplesPerPixel the s samples per pixel
	 */
	public void setSamplesPerPixel(short sSamplesPerPixel)
	{
		/*Accept Number of samples (planes) in this image 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 Hash Map
		 */
		addDataElement(0x0028, 0x0002, DicomConstants.DCM_DT_US, sSamplesPerPixel);
	}

	/**
	 * Return the short value of the attribute Samples Per Pixel.
	 * 
	 * @return short - returns the Samples per pixel
	 */
	public short getSamplesPerPixel()
	{Object objectValue = getValue(0x0028, 0x0002);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Sets Photometric Interpretation.
	 * Specified the intended interpretation of the pixel data.
	 * @param strPhotometricInterpretation :String value Photometric Interpretation
	 */
	public void setPhotometricInterpretation(String strPhotometricInterpretation)
	{
		/*Accept Specifies the intended interpretation of the pixel data in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x0004, DicomConstants.DCM_DT_CS, strPhotometricInterpretation);
	}

	/**
	 * Return the String value of the attribute Photometric Interpretation.
	 * 
	 * @return String - returns the Photometric Interpretation
	 */
	public String getPhotometricInterpretation()
	{
		Object objectValue = getValue(0x0028, 0x0004);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * Sets Data representation of the pixel samples. Each sample shall have the same pixel
	 * representation. Enumerated Values: 0000H = unsigned integer. 0001H = 2's complement
	 * 
	 * @param enumPixelRepresentation the enum pixel representation
	 */
	public void setPixelRepresentation(EnumPixelRepresentation enumPixelRepresentation)
	{
		/*Accept Data representation of pixel in this image 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
		 */
		addDataElement(0x0028, 0x0103, DicomConstants.DCM_DT_US, enumPixelRepresentation.getValue());
	}

	/**
	 * Retrieves the pixel representation.
	 * 
	 * @return - returns the pixel representation
	 */
	public short getPixelRepresentation()
	{
		Object objectValue = getValue(0x0028, 0x0103);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	 /**
	 * Sets physical distance in the patient between the center of each pixel, specified by a
	 * numeric pair - adjacent row spacing (delimiter) adjacent column spacing in mm.
	 * 
	 * @param arrStrPixelSpacing : String array of Pixel Spacing.
	 */	
	public void setPixelSpacing(String[] arrStrPixelSpacing)
	{
		/*Accept the direction cosines of the first row and the first column with respect
		 *to the patient in String Array format of type DS.
		 * Read the Transfer Syntax and check to create ImplicitDE or ExplicitDE .
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Hash Map
		 */
		addDataElement(0x0028, 0x0030, DicomConstants.DCM_DT_DS, arrStrPixelSpacing);
	}

	/**
	 * Retrieves physical distance in the patient between the center of each pixel.
	 * 
	 * @return String[] - String array of Pixel Spacing.
	 */
	public String[] getPixelSpacing()
	{
		Object objValue = getValue(0x0028,0x0030);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	
	/**
	 * Sets Pixel Aspect Ratio.
	 * 
	 * @param strPixelAspectRatio String value of Memory Allocation.
	 */
	public void setPixelAspectRatio(String strPixelAspectRatio)
	{
		/* Accept Pixel Aspect Ratio 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 Hash Map
		 */
		addDataElement(0x0028,0x0034, DicomConstants.DCM_DT_IS, strPixelAspectRatio);
	}

	/**
	 * Return Pixel Aspect Ratio.
	 * 
	 * @return String - String value of Pixel Aspect Ratio.
	 */
	public String getPixelAspectRatio()
	{
		Object objValue = getValue(0x0028,0x0034);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Number of bits allocated for each pixel sample. Each sample shall have the same
	 * number of bits allocated.
	 * 
	 * @param enumBitsAllocated - enum value of bits allocated
	 */
	public void setBitsAllocated(EnumBitsAllocated enumBitsAllocated)
	{
		/*Accept bits allocated for each pixel in this image 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
		 */
		addDataElement(0x0028, 0x0100, DicomConstants.DCM_DT_US, enumBitsAllocated.getValue());
	}
	
	/**
	 * Retrieves Number of bits allocated for each pixel sample.
	 * 
	 * @return short - short value of Bits Allocated.
	 */
	public short getBitsAllocated()
	{Object objectValue = getValue(0x0028, 0x0100);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets Number of bits stored for each pixel sample. Each sample shall have the same
	 * number of bits stored.
	 * 
	 * @param enumBitsStored - enum value of bits stored
	 */
	public void setBitsStored(EnumBitsStored enumBitsStored)
	{
		/*Accept bits stored for each pixel in this image 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
		 */
		addDataElement(0x0028, 0x0101, DicomConstants.DCM_DT_US, enumBitsStored.getValue());
	}

	/**
	 * Retrieves Number of bits stored for each pixel sample.
	 * 
	 * @return Short - Short value of Bits Stored.
	 */
	public short getBitsStored()
	{Object objectValue = getValue(0x0028, 0x0101);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Sets Most significant bit for pixel sample data. Each sample shall have the same high bit.
	 * 
	 * @param enumHighBit - enum value of High Bit
	 */
	public void setHighBit(EnumHighBit enumHighBit)
	{
		/*Accept Most significant bit for pixel in this image 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
		 */
		addDataElement(0x0028, 0x0102, DicomConstants.DCM_DT_US, enumHighBit.getValue());
	}

	/**
	 * Retrieves Most significant bit for pixel sample data.
	 * 
	 * @return short - short value of High Bit.
	 */
	public short getHighBit()
	{Object objectValue = getValue(0x0028, 0x0102);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Sets Pixel Presentation.
	 * @param enumPixelPresentation the enum approval status
	 */
	public void setPixelPresentation(EnumPixelPresentation  enumPixelPresentation)
	{
		/* Accept VolumetricProperties in String format of type CS.
		 * 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
		 */
		addDataElement(0x0008,0x9205, DicomConstants.DCM_DT_CS, enumPixelPresentation.getValue());
	}

	/**
	 * Retrieves Pixel Presentation.
	 * 
	 * @return String - String value of Pixel Presentation.
	 */ 
	public String getPixelPresentation()
	{
		Object objValue = getValue(0x0008,0x9205);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Referenced Color Palette Instance UID.
	 * @param strReferencedColorPaletteInstanceUID - Referenced Color Palette Instance UID.
	 */
	public void setReferencedColorPaletteInstanceUID(String strReferencedColorPaletteInstanceUID)
	{
		/*Accept Referenced Color Palette Instance UID in String format of type UI.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x0304, DicomConstants.DCM_DT_UI, strReferencedColorPaletteInstanceUID);
	}


	/**
	 * Retrieves the Referenced Color Palette Instance UID.
	 * 
	 * @return - returns the Referenced Color Palette Instance UID
	 */
	public String getReferencedColorPaletteInstanceUID()
	{
		Object objectValue = getValue(0x0028, 0x0304);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * Sets Lossy Image Compression.
	 * Specifies whether an Image has undergone lossy compression (ata point in its lifetime).
	 * @param enumLossyImageCompression the enum lossy image compression
	 */
	public void setLossyImageCompression(EnumLossyImageCompression enumLossyImageCompression)
	{
		/*Accept Specifies whether an Image has undergone lossy compression.
		 * in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x2110, DicomConstants.DCM_DT_CS, enumLossyImageCompression.getValue());
	}
	
	/**
	 * Retrieves the Lossy Image Compression.
	 * 
	 * @return String - the Lossy Image Compression
	 */
	public String getLossyImageCompression()
	{
		Object objValue = objIDataSet.getValue(0x0028, 0x2110);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets Lossy Image CompressionRatio.
	 * Describes the approximate lossy compression ratio(s) that havebeen applied to this image.
	 * @param arrStrLossyImageCompressionRatio - String value of Lossy Image Compression Ratio
	 */
	public void setLossyImageCompressionRatio(String[] arrStrLossyImageCompressionRatio)
	{
		/*Accept the approximate lossy compression ratio(s) that have been applied to this image.
		 * in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x2112, DicomConstants.DCM_DT_DS, arrStrLossyImageCompressionRatio);
	}
	
	/**
	 * Retrieves the Lossy Image Compression Ratio.
	 * 
	 * @return String[] - the Lossy Image Compression Ratio
	 */
	public String[] getLossyImageCompressionRatio()
	{
		Object objValue = objIDataSet.getValue(0x0028, 0x2112);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	
	/**
	 * Sets Lossy Image CompressionMethod.
	 * A label for the lossy compression method(s) that have been appliedto this image.
	 * @param arrStrLossyImageCompressionMethod - Lossy Image Compression Method
	 */
	public void setLossyImageCompressionMethod(String[] arrStrLossyImageCompressionMethod)
	{
		/*Accept lossy compression method(s) that have been applied to this image
		 * in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x2114, DicomConstants.DCM_DT_CS, arrStrLossyImageCompressionMethod);
	}

	/**
	 * Retrieves the Lossy Image Compression Method.
	 * 
	 * @return String[] - the Lossy Image Compression Method
	 */
	public String[] getLossyImageCompressionMethod()
	{
		Object objValue = objIDataSet.getValue(0x0028, 0x2114);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	
	/**
	 * Sets value that indicates whether or not image contains sufficient burned in annotation to identify the
	 * patient and date the image was acquired.
	 * Enumerated Values:
	 * YES
	 * NO
	 * 
	 * @param enumBurnedInAnnotation the enum burned in annotation
	 */
	public void setBurnedInAnnotation(EnumBurnedInAnnotation enumBurnedInAnnotation)
	{
		/*Accept Indicates whether or not image contains 
		 * sufficient burned in annotation to identify the patient and date the image was acquired 
		 * in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0028, 0x0301, DicomConstants.DCM_DT_CS, enumBurnedInAnnotation.getValue());
	}

	/**
	 * Retrieves value that indicates whether or not image contains sufficient burned in annotation to identify the
	 * patient and date the image was acquired.
	 * 
	 * @return - String value of Burned In Annotation(Yes or No)
	 */
	public String getBurnedInAnnotation()
	{Object objectValue = getValue(0x0028,0x0301);
	if(objectValue!=null)
		return objectValue.toString();
	return null;
	}
	
	/**
	 * Sets Recognizable Visual Features.
	 * Indicates whether or not the image contains sufficiently recognizable visual features 
	 * to allow the image or a reconstruction from a set of images to identify the patient.
	 * Enumerated Values:
	 * 1) YES 
	 * 2) NO
	 * 
	 * @param enumRecognizableVisualFeatures the enum Recognizable Visual Features
	 */
	public void setRecognizableVisualFeatures(EnumRecognizableVisualFeatures  enumRecognizableVisualFeatures)
	{
		/* Accept Recognizable Visual Features in String format of type CS.
		 * 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
		 */
		addDataElement(0x0028, 0x0302, DicomConstants.DCM_DT_CS, enumRecognizableVisualFeatures.getValue());
	}

	/**
	 * Retrieves Recognizable Visual Features.
	 * 
	 * @return String - String value of Recognizable Visual Features.
	 */ 
	public String getRecognizableVisualFeatures()
	{
		Object objValue = getValue(0x0028,0x0302);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Laterality of (possibly paired) body part (as described in Anatomic Region Sequence(0008,2218)) examined.
	 * Enumerated Values:
	 * R = right
	 * L = left
	 * 
	 * @param enumImageLaterality the enum image laterality
	 */
	public void setImageLaterality(EnumImageLaterality enumImageLaterality)
	{
		/*Accept Image Laterality in String format of type CS.
		 * 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 Hash Map
		 */
		addDataElement(0x0020, 0x0062, DicomConstants.DCM_DT_CS, enumImageLaterality.getValue());
	}

	/**
	 * Gets the image laterality.
	 * 
	 * @return the image laterality
	 */
	public String getImageLaterality()
	{
		Object objectValue = getValue(0x0020, 0x0062);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * This method provides the pre-initialized object of Ophthalmic Thickness MapType Code Sequence.
	 * 
	 * @return - object of Ophthalmic Thickness MapType Code 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
	 */
	public OphthalmicThicknessMapTypeCodeSequence getOphthalmicThicknessMapTypeCodeSequence()
	{
		OphthalmicThicknessMapTypeCodeSequence objOphthalmicThicknessMapTypeCodeSequence = (OphthalmicThicknessMapTypeCodeSequence)getDicomValue(0x0022, 0x1436);
		if(objOphthalmicThicknessMapTypeCodeSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objOphthalmicThicknessMapTypeCodeSequence = (OphthalmicThicknessMapTypeCodeSequence)objDicomV3Factory.createSequence(0x0022, 0x1436, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1436, DicomConstants.DCM_DT_SQ, objOphthalmicThicknessMapTypeCodeSequence.getValue());
		}
		return objOphthalmicThicknessMapTypeCodeSequence;
	}
	
	/**
	 * This method provides the pre-initialized object of Pixel Value Mapping toCoded Concept Sequence.
	 * 
	 * @return - object of Pixel Value Mapping toCoded Concept 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
	 */
	public PixelValueMappingtoCodedConceptSequence getPixelValueMappingtoCodedConceptSequence()
	{
		PixelValueMappingtoCodedConceptSequence objPixelValueMappingtoCodedConceptSequence = (PixelValueMappingtoCodedConceptSequence)getDicomValue(0x0022, 0x1450);
		if(objPixelValueMappingtoCodedConceptSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objPixelValueMappingtoCodedConceptSequence = (PixelValueMappingtoCodedConceptSequence)objDicomV3Factory.createSequence(0x0022, 0x1450, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1450, DicomConstants.DCM_DT_SQ, objPixelValueMappingtoCodedConceptSequence.getValue());
		}
		return objPixelValueMappingtoCodedConceptSequence;
	}
	
	/**
	 * This method provides the pre-initialized object of Ophthalmic ThicknessMapping NormalsSequence.
	 * 
	 * @return - object of Ophthalmic ThicknessMapping NormalsSequence. 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
	 */
	public OphthalmicThicknessMappingNormalsSequence getOphthalmicThicknessMappingNormalsSequence()
	{
		OphthalmicThicknessMappingNormalsSequence objOphthalmicThicknessMappingNormalsSequence = (OphthalmicThicknessMappingNormalsSequence)getDicomValue(0x0022, 0x1443);
		if(objOphthalmicThicknessMappingNormalsSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objOphthalmicThicknessMappingNormalsSequence = (OphthalmicThicknessMappingNormalsSequence)objDicomV3Factory.createSequence(0x0022, 0x1443, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1443, DicomConstants.DCM_DT_SQ, objOphthalmicThicknessMappingNormalsSequence.getValue());
		}
		return objOphthalmicThicknessMappingNormalsSequence;
	}
	
	/**
	 * This method provides the pre-initialized object of Relevant OPT AttributesSequence.
	 * 
	 * @return - object of Relevant OPT AttributesSequence. 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
	 */
	public RelevantOPTAttributesSequence getRelevantOPTAttributesSequence()
	{
		RelevantOPTAttributesSequence objRelevantOPTAttributesSequence = (RelevantOPTAttributesSequence)getDicomValue(0x0022, 0x1472);
		if(objRelevantOPTAttributesSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objRelevantOPTAttributesSequence = (RelevantOPTAttributesSequence)objDicomV3Factory.createSequence(0x0022, 0x1472, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1472, DicomConstants.DCM_DT_SQ, objRelevantOPTAttributesSequence.getValue());
		}
		return objRelevantOPTAttributesSequence;
	}
	
	/**
	 * Retrieves a sequence which provides references to Source Image Sequence
	 * @return - instance of {@link Source Image Sequence}
	 */
	public SourceImageSequence getSourceImageSequence()
	{
		SourceImageSequence objSourceImageSequence = (SourceImageSequence)getDicomValue(0x0008,0x2112);
		if(objSourceImageSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objSourceImageSequence = (SourceImageSequence)objDicomV3Factory.createSequence(0x0008,0x2112, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x2112, DicomConstants.DCM_DT_SQ, objSourceImageSequence.getValue());
		}
		return objSourceImageSequence;
	}	
	
	/**
	 * Retrieves pre-initialized object of Referenced Instance 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 ReferencedInstanceSequence - instance of Referenced Instance Sequence.
	 */
	public ReferencedInstanceSequence getReferencedInstanceSequence()
	{
		ReferencedInstanceSequence objReferencedInstanceSequence = (ReferencedInstanceSequence)getDicomValue(0x0008,0x114A);
		if(objReferencedInstanceSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objReferencedInstanceSequence = (ReferencedInstanceSequence)objDicomV3Factory.createSequence(0x0008,0x114A, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x114A, DicomConstants.DCM_DT_SQ, objReferencedInstanceSequence.getValue());
		}
		return objReferencedInstanceSequence;
	}
	
	/**
	 * Retrieves pre-initialized object of Registration to LocalizerSequence.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 RegistrationtoLocalizerSequence - instance of Registration to LocalizerSequence.
	 */
	public RegistrationtoLocalizerSequence getRegistrationtoLocalizerSequence()
	{
		RegistrationtoLocalizerSequence objRegistrationtoLocalizerSequence = (RegistrationtoLocalizerSequence)getDicomValue(0x0022,0x1465);
		if(objRegistrationtoLocalizerSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objRegistrationtoLocalizerSequence = (RegistrationtoLocalizerSequence)objDicomV3Factory.createSequence(0x0022,0x1465, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022,0x1465, DicomConstants.DCM_DT_SQ, objRegistrationtoLocalizerSequence.getValue());
		}
		return objRegistrationtoLocalizerSequence;
	}
	
	/**
	 * This method Returns provides the pre-initialized object of Relative Image Position Code Sequence
	 * return - object of Relative Image Position Code Sequence. If the module contans 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 SourceImageSequence - the Relative Image Position Code Sequence
	 */
	public RelativeImagePositionCodeSequence getRelativeImagePositionCodeSequence()
	{
		RelativeImagePositionCodeSequence objRelativeImagePositionCodeSequence = (RelativeImagePositionCodeSequence)getDicomValue(0x0022, 0x001D);
		if(objRelativeImagePositionCodeSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objRelativeImagePositionCodeSequence = (RelativeImagePositionCodeSequence)objDicomV3Factory.createSequence(0x0022, 0x001D, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x001D, DicomConstants.DCM_DT_SQ, objRelativeImagePositionCodeSequence.getValue());
		}
		return objRelativeImagePositionCodeSequence;
	}
	
	/**
	 * Sets Anatomic StructureReference Point
	 * @param arrFAnatomicStructureReferencePoint pair of Anatomic StructureReference Point
	 */
	public void setAnatomicStructureReferencePoint(float[] arrFAnatomicStructureReferencePoint)
	{
		/* Accept the Anatomic StructureReference Point in short 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
		 */

		addDataElement(0x0022,0x1463, DicomConstants.DCM_DT_FL,arrFAnatomicStructureReferencePoint);
	}

	/**
	 * Retrieves Anatomic StructureReference Point
	 * @return float[] - Float array of Anatomic StructureReference Point
	 */
	public float[] getAnatomicStructureReferencePoint()
	{
		Object objValue = getValue(0x0022,0x1463);
		if(objValue != null)
			return (float[])objValue;
		return null;
	}

	/**
	 * This method Returns provides the pre-initialized object of Retinal Thickness DefinitionCode Sequence
	 * return - object of Retinal Thickness DefinitionCode Sequence. If the module contans 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 SourceImageSequence - the Relative Image Position Code Sequence
	 */
	public RetinalThicknessDefinitionCodeSequence getRetinalThicknessDefinitionCodeSequence()
	{
		RetinalThicknessDefinitionCodeSequence objRetinalThicknessDefinitionCodeSequence = (RetinalThicknessDefinitionCodeSequence)getDicomValue(0x0022, 0x1445);
		if(objRetinalThicknessDefinitionCodeSequence == null)
		{
			/*
			 * If the sequence object is not present in the DataSet, a new sequence object is created and
			 * the TransferSyntax and DictionaryReader is set into it as it is set in the Module. This ensures that 
			 * the DataElements getting added in the DataSet follow the same TransferSyntax and use the same
			 * DictionaryReader object as that of the module.
			 */
			DicomV3Factory objDicomV3Factory = DicomV3Factory.createInstance();
			objRetinalThicknessDefinitionCodeSequence = (RetinalThicknessDefinitionCodeSequence)objDicomV3Factory.createSequence(0x0022, 0x1445, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0022, 0x1445, DicomConstants.DCM_DT_SQ, objRetinalThicknessDefinitionCodeSequence.getValue());
		}
		return objRetinalThicknessDefinitionCodeSequence;
	}
	
	
	/**
	 * This method returns the collection of keys representing the DataElements that belong to this module.
	 * 
	 * @return Collection of Tags - returns the collection containing the tags
	 */
	public ISingleCollection<ITag> getVectorOfKeys()
	{
		return objSingleCollection;
	}
}
