/*******************************************************************************
 *  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.DicomV3Factory;
import cdac.medinfo.sdk.dcm30_04.baselibs.EventTimerSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.GeneralAnatomyMandatoryMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.IconImageSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.MRSpectroscopyDescriptionMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.MandatoryViewandSliceProgressionDirectionMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedImageSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedInstanceSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedRawDataSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.SourceImageSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.StageCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.Tag;
import cdac.medinfo.sdk.dcm30_04.baselibs.TransducerApplicationCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.TransducerBeamSteeringCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.TransducerGeometryCodeSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.TransducerScanPatternCodeSequence;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataElement;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDicomValue;
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.EnumImageType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumLossyImageCompression;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPhotometricInterpretation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumDimensionOrganizationType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPositionMeasuringDeviceUsed;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPerformedProtocolType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPixelRepresentation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPresentationLUTShape;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRecognizableVisualFeatures;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRescaleIntercept;
import cdac.medinfo.sdk.dcm30_04.enums.EnumRescaleSlope;
import cdac.medinfo.sdk.dcm30_04.enums.EnumSamplesPerPixel;

import cdac.medinfo.sdk.dcm30_04.enums.EnumVolumeBasedCalculationTechnique;
import cdac.medinfo.sdk.dcm30_04.enums.EnumVolumetricProperties;
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 is used for Enhanced US Image Module.
*/
public class EnhancedUSImageModule extends Module
{
	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;
	/**
	 * Instantiates a new enhanced US image module.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	MandatoryViewandSliceProgressionDirectionMacro objMandatoryViewandSliceProgressionDirectionMacro=null;
	GeneralAnatomyMandatoryMacro objGeneralAnatomyMandatoryMacro=null;
	public EnhancedUSImageModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}
	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0008,0x0008));
		objSingleCollection.add(new Tag(0x0028,0x0002));
		objSingleCollection.add(new Tag(0x0028,0x0004));
		objSingleCollection.add(new Tag(0x0028,0x0100));
		objSingleCollection.add(new Tag(0x0028,0x0101));
		objSingleCollection.add(new Tag(0x0028,0x0102));
		objSingleCollection.add(new Tag(0x0028,0x0103));
		objSingleCollection.add(new Tag(0x0020,0x9311));
		
		objSingleCollection.add(new Tag(0x0008,0x002A));
		objSingleCollection.add(new Tag(0x0018,0x9073));
		objSingleCollection.add(new Tag(0x0018,0x980C));
		objSingleCollection.add(new Tag(0x0028,0x2110));
		objSingleCollection.add(new Tag(0x0028,0x2112));
		objSingleCollection.add(new Tag(0x0028,0x2114));
		
		objSingleCollection.add(new Tag(0x2050,0x0020));
		objSingleCollection.add(new Tag(0x0028,0x1052));
		objSingleCollection.add(new Tag(0x0028,0x1053));
		objSingleCollection.add(new Tag(0x0008,0x2112));
		objSingleCollection.add(new Tag(0x008,0x2124));
		objSingleCollection.add(new Tag(0x008,0x2122));
		objSingleCollection.add(new Tag(0x0008,0x1140));
		objSingleCollection.add(new Tag(0x0008,0x9121));
		objSingleCollection.add(new Tag(0x0008,0x2133));
		objSingleCollection.add(new Tag(0x0028,0x0301));
		objSingleCollection.add(new Tag(0x0028,0x0302));
		objSingleCollection.add(new Tag(0x0088,0x0200));
		objSingleCollection.add(new Tag(0x0018,0x5010));
		objSingleCollection.add(new Tag(0x0018,0x9809));
		objSingleCollection.add(new Tag(0x0018,0x980D));
		objSingleCollection.add(new Tag(0x0018,0x980E));
		objSingleCollection.add(new Tag(0x0018,0x980F));
		objSingleCollection.add(new Tag(0x0018,0x5020));
		objSingleCollection.add(new Tag(0x0018,0x5022));
		objSingleCollection.add(new Tag(0x0018,0x5024));
		objSingleCollection.add(new Tag(0x0018,0x5026));
		objSingleCollection.add(new Tag(0x0018,0x5027));
		objSingleCollection.add(new Tag(0x0018,0x9801));
		objSingleCollection.add(new Tag(0x0018,0x5050));
	}

	/**
	 * 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 Boolean - status indicating success or failure
	 * 
	 * @throws InvalidModuleException - Throws when validation for any Module.
	 */
	public  boolean validateModule() throws InvalidModuleException
	{

		try
		{	
			if(!isPresent(0x0008, 0x0008))
				throw new MandatoryMissingException("Missing Mandatory Element 0008,0008");
			 if(!isPresent(0x0028,0x0002))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0002");
			 if(!isPresent(0x0028,0x0004))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0004");
			 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(0x0028,0x0103))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0103");
			 if(!isPresent(0x0020,0x9311))
				throw new MandatoryMissingException("Missing Mandatory Element 0020,9311");
			 if(!isPresent(0x0008,0x002A))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0008,002A");
			 if(!isPresent(0x0018,0x9073))
				throw new MandatoryMissingException("Missing Mandatory DataElement 0018,x9073");
			
			WholeSlideMicroscopyImageModule objWholeSlideMicroscopyImageModule = new WholeSlideMicroscopyImageModule(objIDataSet);
		
			String strVolumetricProperties=objWholeSlideMicroscopyImageModule.getVolumetricProperties();
			
			MRSpectroscopyDescriptionMacro objMRSpectroscopyDescriptionMacro = new MRSpectroscopyDescriptionMacro(objIDataSet);
			
			String strVolumeBasedCalculationTechnique=objMRSpectroscopyDescriptionMacro.getVolumeBasedCalculationTechnique();
			
			 if(strVolumeBasedCalculationTechnique.equalsIgnoreCase(EnumVolumeBasedCalculationTechnique.NONE.getValue()) && strVolumetricProperties.equalsIgnoreCase(EnumVolumetricProperties.VOLUME.getValue()))
				if(!isPresent(0x0018,0x980C))
					throw new ConditionFailedException("0018,980C");
			
			
			 if(!isPresent(0x0028,0x2110))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,2110");
			
			 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");
			
				 if(!isPresent(0x2050,0x0020))
					throw new MandatoryMissingException("Missing Mandatory DataElement 2050,0020");
				 if(!isPresent(0x0028,0x1052))
					throw new MandatoryMissingException("Missing Mandatory DataElement 0028,1052)");
				 if(!isPresent(0x0028,0x1053))
					throw new MandatoryMissingException("Missing Mandatory DataElement 0028,1053)");
			
			String strImageType=getImageType().toString();			
			if(strImageType.equalsIgnoreCase(EnumImageType.Value1.DERIVED.getValue()))
					if(!isPresent(0x0008,0x2112))
						throw new ConditionFailedException("0008,2112");
			
			EnhancedUSSeriesModule objEnhancedUSSeriesModule = new EnhancedUSSeriesModule(objIDataSet);
			
			String strPerformedProtocolType=objEnhancedUSSeriesModule.getPerformedProtocolType();
			if(strPerformedProtocolType.equalsIgnoreCase(EnumPerformedProtocolType.STAGED.getValue()))
				if(!isPresent(0x008,0x2124))
					throw new ConditionFailedException("0008,2124");
			
			if(strPerformedProtocolType.equalsIgnoreCase(EnumPerformedProtocolType.STAGED.getValue()))
				if(!isPresent(0x0008,0x000A))
					throw new ConditionFailedException("0008,2122");
			
			if(strPerformedProtocolType.equalsIgnoreCase(EnumPerformedProtocolType.STAGED.getValue()))
				if(!isPresent(0x0040,0x2122))
					throw new ConditionFailedException("0040,000A");
			
			if(!isPresent(0x0028,0x0301))
				throw new MandatoryMissingException("Missing Mandatory Element 0028,0301");
			if(!isPresent(0x0018,0x9809))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,9809");
			if(!isPresent(0x0018,0x980D))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,980D");
			if(!isPresent(0x0018,0x980E))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,980E");
			if(!isPresent(0x0018,0x980F))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,980F");
			if(!isPresent(0x0018,0x5022))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,5022");
			if(!isPresent(0x0018,0x5024))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,5024");
			if(!isPresent(0x0018,0x5026))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,5026");
			if(!isPresent(0x0018,0x5027))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,5027");
			if(!isPresent(0x0018,0x5050))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,5050");
			if(!isPresent(0x0018,0x9801))
				throw new MandatoryMissingException("Missing Mandatory Element 0018,9801");		
	
		}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;
	}
	
	/**
	 * Sets Image identification characteristics.
	 * 
	 * @param arrStrImageType - String array of 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 Image Type.
	 * 
	 * @return String[]- String array of Image identification characteristics.
	 */
	public String[] getImageType()
	{
		if (objIDataSet == null)
			return null;
		IDataElement objIDataElement =  objIDataSet.getDataForTag(0x0008, 0x0008);
		if(objIDataElement == null)
			return null;
		IDicomValue objIDicomValue = objIDataElement.getDicomValue();
		if(objIDicomValue == null)
			return null;
		if(objIDicomValue.getValue()==null)
			return null;
		return (String[])objIDicomValue.getValue();
	}
	/**
	 * Sets Samples per Pixel (0028,0002) is the number of separate planes in the image. One, three, and
	 * four image planes are defined. For monochrome (gray scale) and palette color images, the number of planes is 1. For RGB and
	 * other three vector color models, the value of this attribute is 3. For four vector color models, the
	 * value of this attribute is 4.
	 * 
	 * @param enumSamplesPerPixel - specifies the samples per pixel in the image
	 */
	public void setSamplesPerPixel(EnumSamplesPerPixel enumSamplesPerPixel)
	{
		/*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 Data Set
		 */
		addDataElement(0x0028, 0x0002, DicomConstants.DCM_DT_US, enumSamplesPerPixel.getValue());
	}

	/**
	 * Retrieves the 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 Specifies the intended interpretation of the pixel data.
	 * 
	 * @param enumPhotometricInterpretation - Enum value Photometric Interpretation
	 */
	public void setPhotometricInterpretation(EnumPhotometricInterpretation enumPhotometricInterpretation)
	{
		/*Accept Specifies the intended interpretation of the pixel data in String format of type ST.
		 * 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, 0x0004, DicomConstants.DCM_DT_CS, enumPhotometricInterpretation.getValue());
	}

	/**
	 * Retrieves the 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 Number of bits allocated for each pixel sample. Each sample shall have the same
	 * number of bits allocated.
	 * 
	 * @param enumBitsAllocated - specifies the number 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 the number of bits allocated.
	 * 
	 * @return Short - returns the number 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 - specifies the number 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 the number of bits stored.
	 * 
	 * @return Short - returns the number 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 - specifies the 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 the high bit.
	 * 
	 * @return Short - returns the high bit
	 */
	public short getHighBit()
	{
		Object objectValue = getValue(0x0028, 0x0102);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * 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 DimensionOrganizationType
	 * @param enumDimensionOrganizationType the enum DimensionOrganizationType
	 */
	public void setDimensionOrganizationType(EnumDimensionOrganizationType enumDimensionOrganizationType)
	{
		/*Accept DimensionOrganizationType 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(0x0020, 0x9311, DicomConstants.DCM_DT_CS, enumDimensionOrganizationType.getValue());
	}

	/**
	 * Retrieves the DimensionOrganizationType
	 * 
	 * @return - returns the DimensionOrganizationType
	 */
	public String getDimensionOrganizationType()
	{
		Object objectValue = getValue(0x0020, 0x9311);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * Sets a number identifying the single continuous gathering of data over a period of time which resulted in this image.
	 * 
	 * @param strAcquisitionNumber - String value of Acquisition Number.
	 */
	public void setAcquisitionNumber(String strAcquisitionNumber)
	{
		/*Accept number identifying the single continuous gathering of data
		 * 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(0x0020, 0x0012, DicomConstants.DCM_DT_IS, strAcquisitionNumber);
	}

	/**
	 * Return the String value of the attribute Acquisition Number.
	 * 
	 * @return String - returns the Acquisition Number
	 */
	public String getAcquisitionNumber()
	{
		Object objectValue = getValue(0x0020, 0x0012);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}

	/**
	 * The method is used to set The Date and Time the acquisition of data that resulted in this image started
	 * The function accepts a String Value and creates the
	 * DE based on the transfer syntax and populates the DE with right values.
	 * This De is then added to the Module HashMap
	 * 
	 * @param strAcquisitionDatetime - String value of Acquisition Date and Time
	 */
	public void setAcquisitionDatetime(String strAcquisitionDatetime)
	{
		/*Accept The Date and Time the acquisition of data that resulted in this image started in String format 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 Hash Map
		 */
		addDataElement(0x0008, 0x002A, DicomConstants.DCM_DT_DT, strAcquisitionDatetime);
	}

	/**
	 * Retrieves the Date and Time of Acquisition.
	 * 
	 * @return String - returns the Date and Time of Acquisition
	 */
	public String getAcquisitionDatetime()
	{
		 Object objValue = getValue(0x0008,0x002A);
   if(objValue!=null)
      return objValue.toString();
   return null;

	}

	/**
	 * Sets the time in seconds needed to run the prescribed pulse sequence.
	 * 
	 * @param dAcquisitionDuration - double value of Acquisition Duration.
	 */
	public void setAcquisitionDuration(double dAcquisitionDuration)
	{
		/* Accept Acquisition Duration 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(0x0018, 0x9073, DicomConstants.DCM_DT_FD, dAcquisitionDuration);
	}

	/**
	 * Retrieves the time in seconds needed to run the prescribed pulse sequence.
	 * 
	 * @return double - double value of Acquisition Duration.
	 */
	public double getAcquisitionDuration()
	{Object objectValue = getValue(0x0018, 0x9073);
		if(objectValue!=null)
			return Double.parseDouble(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets PositionMeasuringDeviceUsed
	 * @param enumPositionMeasuringDeviceUsed the enum PositionMeasuringDeviceUsed
	 */
	public void setPositionMeasuringDeviceUsed(EnumPositionMeasuringDeviceUsed enumPositionMeasuringDeviceUsed)
	{
		/*Accept DimensionOrganizationType 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(0x0018, 0x980C, DicomConstants.DCM_DT_CS, enumPositionMeasuringDeviceUsed.getValue());
	}

	/**
	 * Retrieves the PositionMeasuringDeviceUsed
	 * 
	 * @return - returns the PositionMeasuringDeviceUsed
	 */
	public String getPositionMeasuringDeviceUsed()
	{
		Object objectValue = getValue(0x0018, 0x980C);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * Sets a value that specifies whether an Image has undergone lossy compression.
	 * Enumerated Values:
	 * 00 = Image has NOT been subjected to lossy compression,
	 * 01 = Image has been subjected to lossy compression.
	 * 
	 * @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 - returns the Lossy Image Compression
	 */
	public String getLossyImageCompression()
	{
		Object objectValue = getValue(0x0028, 0x2110);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}

	/**
	 * Sets the approximate lossy compression ratio(s) that have been applied to this image.
	 * 
	 * @param arrStrLossyImageCompressionRatio - String array 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.
	 * 
	 * @return String[] - returns the Lossy Image Compression
	 */
	public String[] getLossyImageCompressionRatio()
	{
		 Object objValue = getValue(0x0028,0x2112);
   if(objValue!=null)
      return (String[])objValue;
   return null;

	}		
	/**
	 * Sets LossyImageCompressionMethod
	 * @param arrStrLossyImageCompressionMethod - String array of LossyImageCompressionMethod
	 */
	public void setLossyImageCompressionMethod(String[] arrStrLossyImageCompressionMethod)
	{
		/*Accept the LossyImageCompressionMethod 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 LossyImageCompressionMethod
	 * 
	 * @return String[] - returns the LossyImageCompressionMethod
	 */
	public String[] getLossyImageCompressionMethod()
	{
		 Object objValue = getValue(0x0028,0x2114);
		 if(objValue!=null)
			 return (String[])objValue;
		 return null;
	}	
	/**
	 * Sets a subset of a conceptual Presentation LUT.
	 * Enumerated Values:
	 * IDENTITY - output is in P-Values.
	 * @param enumPresentationLUTShape the enum presentation lut shape
	 */
	public void setPresentationLUTShape(EnumPresentationLUTShape enumPresentationLUTShape)
	{
		/* Accept Presentation LUT Shape 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(0x2050,0x0020, DicomConstants.DCM_DT_CS, enumPresentationLUTShape.getValue());
	}
	/**
	 * Retrieves a subset of a conceptual Presentation LUT.
	 * 
	 * @return - String value of Presentation LUT Shape
	 */
	public String getPresentationLUTShape()
	{Object objectValue = getValue(0x2050,0x0020);
	if(objectValue!=null)
		return objectValue.toString();
	return null;
	}
	/**
	 * Sets RescaleIntercept
	 * @param enumRescaleIntercept the enum RescaleIntercept
	 */
	public void setRescaleIntercept(EnumRescaleIntercept enumRescaleIntercept)
	{
		/* Accept RescaleIntercept in String format of type DS.
		 * 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,0x1052, DicomConstants.DCM_DT_DS, enumRescaleIntercept.getValue());
	}
	/**
	 * Retrieves RescaleIntercept
	 * 
	 * @return - String value of RescaleIntercept
	 */
	public String getRescaleIntercept()
	{Object objectValue = getValue(0x0028,0x1052);
	if(objectValue!=null)
		return objectValue.toString();
	return null;
	}
	/**
	 * Sets RescaleSlope
	 * @param enumRescaleSlope the enum RescaleSlope
	 */
	public void setRescaleSlope(EnumRescaleSlope enumRescaleSlope)
	{
		/* Accept RescaleSlope in String format of type DS.
		 * 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,0x1053, DicomConstants.DCM_DT_DS, enumRescaleSlope.getValue());
	}
	/**
	 * Retrieves RescaleSlope
	 * 
	 * @return - String value of RescaleSlope
	 */
	public String getRescaleSlope()
	{Object objectValue = getValue(0x0028,0x1053);
	if(objectValue!=null)
		return objectValue.toString();
	return null;
	}
	/**
	 * Retrieves Source Image Sequence 	 * 
	 * @return SourceImageSequence - instance of {@link SourceImageSequence}.
	 */
	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 a sequence that identifies the set of Raw Image Sequence
	 * 
	 * @return ReferencedImageSequence - instance of {@link ReferencedImageSequence}.
	 */
	public ReferencedImageSequence getReferencedImageSequence()
	{
		ReferencedImageSequence objReferencedImageSequence = (ReferencedImageSequence)getDicomValue(0x0008,0x1140);
		if(objReferencedImageSequence == 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();
			objReferencedImageSequence = (ReferencedImageSequence)objDicomV3Factory.createSequence(0x0008,0x11401, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x1140, DicomConstants.DCM_DT_SQ, objReferencedImageSequence.getValue());
		}
		return objReferencedImageSequence;
	}
	
	/**
	 * Retrieves a sequence that identifies the set of Raw Data SOP Class/Instance pairs of the Raw
	 * data which were used to derive this Image.
	 * 
	 * @return ReferencedRawDataSequence - instance of {@link ReferencedRawDataSequence}.
	 */
	public ReferencedRawDataSequence getReferencedRawDataSequence()
	{
		ReferencedRawDataSequence objReferencedRawDataSequence = (ReferencedRawDataSequence)getDicomValue(0x0008,0x9121);
		if(objReferencedRawDataSequence == 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();
			objReferencedRawDataSequence = (ReferencedRawDataSequence)objDicomV3Factory.createSequence(0x0008,0x9121, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x9121, DicomConstants.DCM_DT_SQ, objReferencedRawDataSequence.getValue());
		}
		return objReferencedRawDataSequence;
	}
	
	/**
	 * Retrieves a sequence that identifies the set of Referenced Instance Sequence
	 * @return ReferencedInstanceSequence - instance of {@link ReferencedInstanceSequence}.
	 */
	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;
	}
	/**
	 * Sets a NumberOfStages
	 * @param strNumberOfStages - String value of NumberOfStages.
	 */
	public void setNumberOfStages(String strNumberOfStages)
	{
		/*Accept number identifying the single continuous gathering of data
		 * 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(0x0008, 0x2124, DicomConstants.DCM_DT_IS, strNumberOfStages);
	}
	/**
	 * Return the String value of the attribute NumberOfStages
	 * @return String - returns the NumberOfStages
	 */
	public String getNumberOfStages()
	{
		Object objectValue = getValue(0x0008, 0x2124);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * Sets a StageNumber
	 * @param strStageNumber - String value of StageNumber.
	 */
	public void setStageNumber(String strStageNumber)
	{
		/*Accept number identifying the single continuous gathering of data
		 * 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(0x0008, 0x2122, DicomConstants.DCM_DT_IS, strStageNumber);
	}
	/**
	 * Return the String value of the attribute StageNumber
	 * @return String - returns the StageNumber
	 */
	public String getStageNumber()
	{
		Object objectValue = getValue(0x0008, 0x2122);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * Retrieves a sequence that identifies the set of Stage Code Sequence
	 * @return StageCodeSequence - instance of {@link StageCodeSequence}.
	 */
	public StageCodeSequence getStageCodeSequence()
	{
		StageCodeSequence objStageCodeSequence = (StageCodeSequence)getDicomValue(0x0040,0x000A);
		if(objStageCodeSequence == 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();
			objStageCodeSequence = (StageCodeSequence)objDicomV3Factory.createSequence(0x0040,0x000A, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0040,0x000A, DicomConstants.DCM_DT_SQ, objStageCodeSequence.getValue());
		}
		return objStageCodeSequence;
	}
	/**
	 * Get the Instance of Mandatory View and Slice ProgressionDirection Macro Attributes
	 * Calling this method multiple times will return the same Macro
	 * 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 Mandatory View and Slice ProgressionDirection Macro Attributes which the user programmer can populate
	 */
	public MandatoryViewandSliceProgressionDirectionMacro getMandatoryViewandSliceProgressionDirectionMacro()
	{
		if(objMandatoryViewandSliceProgressionDirectionMacro == null)
			objMandatoryViewandSliceProgressionDirectionMacro = new MandatoryViewandSliceProgressionDirectionMacro(objIDataSet);
		return objMandatoryViewandSliceProgressionDirectionMacro; 
	}
	/**
	 * Retrieves a sequence that identifies the set of Event Timer Sequence
	 * @return EventTimerSequence - instance of {@link EventTimerSequence}.
	 */
	public EventTimerSequence getEventTimerSequence()
	{
		EventTimerSequence objEventTimerSequence = (EventTimerSequence)getDicomValue(0x0008,0x2133);
		if(objEventTimerSequence == 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();
			objEventTimerSequence = (EventTimerSequence)objDicomV3Factory.createSequence(0x0008,0x2133, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008,0x2133, DicomConstants.DCM_DT_SQ, objEventTimerSequence.getValue());
		}
		return objEventTimerSequence;
	}
	/**
	 * Get the Instance of General Anatomy Mandatory Macro Attributes
	 * Calling this method multiple times will return the same Macro
	 * 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 Attributes which the user programmer can populate
	 */
	public GeneralAnatomyMandatoryMacro getGeneralAnatomyMandatoryMacro()
	{
		if(objGeneralAnatomyMandatoryMacro == null)
			objGeneralAnatomyMandatoryMacro = new GeneralAnatomyMandatoryMacro(objIDataSet);
		return objGeneralAnatomyMandatoryMacro; 
	}
	/**
	 * Sets Indicates whether or not the encapsulated document contains sufficient burned in annotation to identify the patient and date the data was acquired.
	 * @param enumBurnedInAnnotation enum value of BurnedInAnnotation
	 */
	public void setBurnedInAnnotation(EnumBurnedInAnnotation enumBurnedInAnnotation)
	{
		/* Accept the BurnedInAnnotation 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,0x0301, DicomConstants.DCM_DT_CS,enumBurnedInAnnotation);
	}
	/**
	 * Returns Indicates whether or not the encapsulated document contains sufficient burned in annotation to identify the patient and date the data was acquired.
	 * @return String - value of BurnedInAnnotation
	 */
	public String getBurnedInAnnotation()
	{
		Object objValue = getValue(0x0028,0x0301);
		if(objValue != null)
			return objValue.toString();
		return null;
	}		
	/**
	 * Sets Indicates whether or not the image contains sufficiently recognizable visual features to allow the image or a reconstruction from a set ofimages to identify the patient.
	 * @param enumRecognizableVisualFeatures enum value of Recognizable VisualFeatures
	 */
	public void setRecognizableVisualFeatures(EnumRecognizableVisualFeatures enumRecognizableVisualFeatures)
	{
		/* Accept the Recognizable VisualFeatures 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);
	}
	/**
	 * Returns Indicates whether or not the image contains sufficiently recognizable visual features to allow the image or a reconstruction from a set ofimages to identify the patient.
	 * @return String - value of Recognizable VisualFeatures
	 */
	public String getRecognizableVisualFeatures()
	{
		Object objValue = getValue(0x0028,0x0302);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Retrieves a sequence that identifies the set of Icon Image Sequence
	 * @return IconImageSequence - instance of {@link IconImageSequence}.
	 */
	public IconImageSequence getIconImageSequence()
	{
		IconImageSequence objIconImageSequence = (IconImageSequence)getDicomValue(0x0088,0x0200);
		if(objIconImageSequence == 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();
			objIconImageSequence = (IconImageSequence)objDicomV3Factory.createSequence(0x0088,0x0200, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0088,0x0200, DicomConstants.DCM_DT_SQ, objIconImageSequence.getValue());
		}
		return objIconImageSequence;
	}
	
	/**
	 * Sets TransducerData
	 * @param strArrTransducerData String value of TransducerData.
	 */
	public void setTransducerData(String[] strArrTransducerData)
	{
		/* Accept the TransducerData in String format of type LO.
		 * 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(0x0018,0x5010, DicomConstants.DCM_DT_LO,strArrTransducerData);
	}

	/**
	 * Return user-defined label identifier for TransducerData
	 * @return String - value of TransducerData
	 */
	public String[] getTransducerData()
	{
		Object objValue = getValue(0x0018,0x5010);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}
	/**
	 * Retrieves a sequence that identifies the set of Transducer Scan PatternCode Sequence
	 * @return TransducerScanPatternCodeSequence - instance of {@link TransducerScanPatternCodeSequence}.
	 */
	public TransducerScanPatternCodeSequence getTransducerScanPatternCodeSequence()
	{
		TransducerScanPatternCodeSequence objTransducerScanPatternCodeSequence = (TransducerScanPatternCodeSequence)getDicomValue(0x0018,0x9809);
		if(objTransducerScanPatternCodeSequence == 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();
			objTransducerScanPatternCodeSequence = (TransducerScanPatternCodeSequence)objDicomV3Factory.createSequence(0x0018,0x9809, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0018,0x9809, DicomConstants.DCM_DT_SQ, objTransducerScanPatternCodeSequence.getValue());
		}
		return objTransducerScanPatternCodeSequence;
	}
	/**
	 * Retrieves a sequence that identifies the set of Transducer Geometry CodeSequence
	 * @return TransducerGeometryCodeSequence - instance of {@link TransducerGeometryCodeSequence}.
	 */
	public TransducerGeometryCodeSequence getTransducerGeometryCodeSequence()
	{
		TransducerGeometryCodeSequence objTransducerGeometryCodeSequence = (TransducerGeometryCodeSequence)getDicomValue(0x0018,0x980D);
		if(objTransducerGeometryCodeSequence == 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();
			objTransducerGeometryCodeSequence = (TransducerGeometryCodeSequence)objDicomV3Factory.createSequence(0x0018,0x980D, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0018,0x980D, DicomConstants.DCM_DT_SQ, objTransducerGeometryCodeSequence.getValue());
		}
		return objTransducerGeometryCodeSequence;
	}
	/**
	 * Retrieves a sequence that identifies the set of Transducer Beam SteeringCode Sequence
	 * @return TransducerBeamSteeringCodeSequence - instance of {@link TransducerBeamSteeringCodeSequence}.
	 */
	public TransducerBeamSteeringCodeSequence getTransducerBeamSteeringCodeSequence()
	{
		TransducerBeamSteeringCodeSequence objTransducerBeamSteeringCodeSequence = (TransducerBeamSteeringCodeSequence)getDicomValue(0x0018,0x980E);
		if(objTransducerBeamSteeringCodeSequence == 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();
			objTransducerBeamSteeringCodeSequence = (TransducerBeamSteeringCodeSequence)objDicomV3Factory.createSequence(0x0018,0x980E, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0018,0x980E, DicomConstants.DCM_DT_SQ, objTransducerBeamSteeringCodeSequence.getValue());
		}
		return objTransducerBeamSteeringCodeSequence;
	}
	/**
	 * Retrieves a sequence that identifies the set of Transducer ApplicationCode Sequence
	 * @return TransducerApplicationCodeSequence - instance of {@link TransducerApplicationCodeSequence}.
	 */
	public TransducerApplicationCodeSequence getTransducerApplicationCodeSequence()
	{
		TransducerApplicationCodeSequence objTransducerApplicationCodeSequence = (TransducerApplicationCodeSequence)getDicomValue(0x0018,0x980F);
		if(objTransducerApplicationCodeSequence == 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();
			objTransducerApplicationCodeSequence = (TransducerApplicationCodeSequence)objDicomV3Factory.createSequence(0x0018,0x980F, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0018,0x980F, DicomConstants.DCM_DT_SQ, objTransducerApplicationCodeSequence.getValue());
		}
		return objTransducerApplicationCodeSequence;
	}
	/**
	 * Sets Code or description of processing functions applied to the data.
	 * 
	 * @param strProcessingFunction - String value of Processing Function
	 */
	public void setProcessingFunction(String strProcessingFunction)
	{
		/*Accept Processing Function in String format of type LO.
		 * 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(0x0018, 0x5020, DicomConstants.DCM_DT_LO, strProcessingFunction);
	}

	/**
	 * Returns Code or description of processing functions applied to the data.
	 * 
	 * @return String - String value of Processing Function.
	 */
	public String getProcessingFunction()
	{
		Object objectValue = getValue(0x0018, 0x5020);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * The thermal index is defined according to the Standard for Real-Time Display of thermal
	 * Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @param strBoneThermalIndex String value of Bone Thermal Index.
	 */
	public void setBoneThermalIndex(String strBoneThermalIndex)
	{
		/*Accept Bone Thermal Index in String format of type DS.
		 * 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(0x0018, 0x5024, DicomConstants.DCM_DT_DS, strBoneThermalIndex);
	}

	/**
	 * The thermal index is defined according to the Standard for Real-Time Display of thermal Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @param strCranialThermalIndex String value of Cranial Thermal Index.
	 */
	public void setCranialThermalIndex(String strCranialThermalIndex)
	{
		/*Accept Cranial Thermal Index in String format of type DS.
		 * 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(0x0018, 0x5026, DicomConstants.DCM_DT_DS, strCranialThermalIndex);
	}

	/**
	 * The thermal index is defined according to the Standard for Real-Time Display of thermal
	 * Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @param strSoftTissueThermalIndex String value of Soft Tissue Thermal Index.
	 */
	public void setSoftTissueThermalIndex(String strSoftTissueThermalIndex)
	{
		/*Accept Soft Tissue Thermal Index in String format of type DS.
		 * 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(0x0018, 0x5027, DicomConstants.DCM_DT_DS, strSoftTissueThermalIndex);
	}
	/**
	 * Return the thermal index as defined according to the Standard for Real-Time Display of thermal
	 * Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @return String - String value of Bone Thermal Index.
	 */
	public String getBoneThermalIndex()
	{Object objectValue = getValue(0x0018,0x5024);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}

	/**
	 * Return the thermal index as defined according to the Standard for Real-Time Display of thermal
	 * Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @return the cranial thermal index
	 */
	public String getCranialThermalIndex()
	{Object objectValue = getValue(0x0018,0x5026);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}

	/**
	 * Return the thermal index as defined according to the Standard for Real-Time Display of thermal
	 * Index on Diagnostic Ultrasound Equipment.
	 * 
	 * @return String  - String value of Soft Tissue Thermal Index.
	 */
	public String getSoftTissueThermalIndex()
	{Object objectValue = getValue(0x0018,0x5027);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * Sets the Depth(s) of Focus
	 * @param dblArrDepthsOfFocus Double value of Depth(s) of Focus
	 */
	public void setDepthsOfFocus(double[] dblArrDepthsOfFocus)
	{
		/*Accept the Depth(s) of Focus 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
		 */
		addDataElement(0x0018,0x9801,DicomConstants.DCM_DT_FD,dblArrDepthsOfFocus);
	}
	/**
	 * Retrieves the Depth(s) of Focus
	 * @return double - double value of Depth(s) of Focus
	 */
	public double[] getDepthsOfFocus()
	{
		Object objValue = getValue(0x0018,0x9801);
		if(objValue != null)
			return (double[])objValue;
		return null;
	}
	/**
	 * The depth, in mm, from the transducer face to the deepest point included in the
	 * displayed image the field of view.
	 * 
	 * @param strDepthOfScanField String value of Depth of Scan Field.
	 */
	public void setDepthOfScanField(String strDepthOfScanField)
	{
		/*Accept Depth of Scan Field in String format of type DS.
		 * 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(0x0018, 0x5050, DicomConstants.DCM_DT_IS, strDepthOfScanField);
	}
	/**
	 * Return the depth, in mm, from the transducer face to the deepest point included in the
	 * displayed image the field of view.
	 * 
	 * @return String - String value of Depth of Scan Field.
	 */
	public String getDepthOfScanField()
	{Object objectValue = getValue(0x0018,0x5050);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * This method returns the vector of keys representing the DataElements
	 * that belong to this module.
	 * 
	 * @return ISingleCollection - the customized collection containing the data element tags
	 * that belong to this module
	 */
	public ISingleCollection<ITag> getVectorOfKeys()
	{
		return objSingleCollection;
	}
}
