/*******************************************************************************
 *  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.GeneralAnatomyOptionalMacro;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedImageSequence;
import cdac.medinfo.sdk.dcm30_04.baselibs.ReferencedImageSequenceItem;
import cdac.medinfo.sdk.dcm30_04.baselibs.Tag;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IItem;
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.EnumCalibrationImage;
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.EnumPixelIntensityRelationship;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPixelRepresentation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumSamplesPerPixel;

import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidModuleException;
import cdac.medinfo.sdk.dcm30_04.exceptions.ItemLimitException;
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.ICollectionIterator;
import cdac.medinfo.sdk.dcm30_04.utils.ISingleCollection;
import cdac.medinfo.sdk.dcm30_04.utils.SingleCollection;

// TODO: Auto-generated Javadoc
/**
 \* This module describes attributes related to X-Ray Image.
 */
public class XRayImageModule extends Module  
{


	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;

	/**
	 * The obj general anatomy optional macro.
	 */
	GeneralAnatomyOptionalMacro objGeneralAnatomyOptionalMacro = null;



	/**
	 * Instantiates a new x ray image module.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public XRayImageModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0008,0x0008));
		objSingleCollection.add(new Tag(0x0008,0x1140));
		objSingleCollection.add(new Tag(0x0008,0x2111));
		objSingleCollection.add(new Tag(0x0018,0x0022));
		objSingleCollection.add(new Tag(0x0018,0x1400));
		objSingleCollection.add(new Tag(0x0018,0x2002));
		objSingleCollection.add(new Tag(0x0028,0x0002));
		objSingleCollection.add(new Tag(0x0028,0x0004));
		objSingleCollection.add(new Tag(0x0028,0x0009));
		objSingleCollection.add(new Tag(0x0028,0x000A));
		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(0x0028,0x1040));
		objSingleCollection.add(new Tag(0x0028,0x2110));
		objSingleCollection.add(new Tag(0x0028,0x6040));
		objSingleCollection.add(new Tag(0x0050,0x0004));
	}

	/**
	 * 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 returns validation status as success or failure
	 * 
	 * @throws InvalidModuleException - If validation of Module fails
	 */
	public  boolean validateModule() throws InvalidModuleException
	{

		try
		{		
			/*(0028,0009) Required if Multi-Frame Image.*/
			if(isPresent(0x0028, 0x0009) && !isPresent(0x0028, 0x0008))
				throw new ConditionFailedException("conditional element 0028,0008 required for Element 0028,0009");
			/*Mandatory attributes if not present validation fails*/
			if(!isPresent(0x0008,0x0008))
				throw new MandatoryMissingException("0008,0008");
			if(!isPresent(0x0028,0x1040))
				throw new MandatoryMissingException("0028,1040");
			if(!isPresent(0x0028,0x0002))
				throw new MandatoryMissingException("0028,0002");
			if(!isPresent(0x0028,0x0004))
				throw new MandatoryMissingException("0028,0004");
			if(!isPresent(0x0028,0x0100))
				throw new MandatoryMissingException("0028,0100");
			if(!isPresent(0x0028,0x0101))
				throw new MandatoryMissingException("0028,0101");
			if(!isPresent(0x0028,0x0102))
				throw new MandatoryMissingException("0028,0102");
			if(!isPresent(0x0028, 0x0103))
				throw new MandatoryMissingException("0028,0103");
			String[] strImageType = getImageType();
			if(strImageType != null && strImageType.length == 3)
			{
				if((EnumImageType.Value3.BIPLANE_A.getValue().equalsIgnoreCase(strImageType[2]) || EnumImageType.Value3.BIPLANE_B.getValue().equalsIgnoreCase(strImageType[2])) &&!isPresent(0x0008,0x1140))
					throw new ConditionFailedException("0008,1140 shall be present if mage Type (0008,0008) Value 3 is BIPLANE A or BIPLANE B.");
			}
			if(isPresent(0x0008,0x1140))
			{
				getReferencedImageSequence().validateForModule();
				// Validation for PurposeOfReferenceCodeSequence
				ICollectionIterator<IItem> objReferencedImageSequenceIterator = getReferencedImageSequence().iterator();
				ReferencedImageSequenceItem objReferencedImageSequenceItem = null;
				while(objReferencedImageSequenceIterator.hasNext())
				{
					objReferencedImageSequenceItem = (ReferencedImageSequenceItem)objReferencedImageSequenceIterator.next();
					if(objReferencedImageSequenceItem.contains(0x0040,0xA170))
					{
						int iNoOfItems = objReferencedImageSequenceItem.getPurposeOfReferenceCodeSequence().noOfItems();
						if(iNoOfItems > 1)
							throw new ItemLimitException("0040,A170 shall contain Single Item");
					}
				}
			}

		}
		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);

		}
		catch(ItemLimitException ile)
		{
			if(DicomConfig.createInstance().isLoggingOn())
				DicomLogger.getLogger().log(ile.getMessage());

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

		}
		return true;
	}

	/**
	 * Retrieves the Instance of GeneralAnatomyOptionalMacro.
	 * 
	 * @return GeneralAnatomyOptionalMacro Instance of {@link GeneralAnatomyOptionalMacro}
	 */
	public GeneralAnatomyOptionalMacro getGeneralAnatomyOptionalMacro()
	{
		if(objGeneralAnatomyOptionalMacro == null )
			objGeneralAnatomyOptionalMacro = new GeneralAnatomyOptionalMacro(this.objIDataSet);

		return objGeneralAnatomyOptionalMacro;
	}

	/**
	 * Sets value that is Used to specify multiple values for Frame Increment Pointer.
	 * 
	 * @param objSingleCollection  Collection of Tags (GroupNumber and ElementNumbers)
	 */
	public void setFrameIncrementPointer(ISingleCollection<ITag> objSingleCollection)
	{
		/*Accept Frame Increment Pointer in String format of type short array.
		 * 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, 0x0009, DicomConstants.DCM_DT_AT, objSingleCollection);
	}

	/**
	 * Return value that is Used to specify multiple values for Frame Increment Pointer.
	 * 
	 * @return ISingleCollection<ITag> - Collection of Tags
	 */
	@SuppressWarnings("unchecked")
	public ISingleCollection<ITag> getFrameIncrementPointer()
	{
		Object objValue = getValue(0x0028,0x0009);
		if(objValue != null)
			return (ISingleCollection<ITag>)objValue;
		return null;
	}

	/**
	 * The method is used to set Specifies whether an Image has undergone lossy compression.
	 * 
	 * @param enumLossyImageCompression :Enum value of Lossy Image Compression(Yes or No)
	 */
	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 objValue = getValue(0x0028,0x2110);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * This method is used to set 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);
	}

	/**
	 * Retrieves the Tmage Type.
	 * 
	 * @return String[] - returns the Image Type
	 */
	public String[] getImageType()
	{
		Object objValue = getValue(0x0008,0x0008);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets relationship between the Pixel sample values and the X-Ray beam intensity.
	 * 
	 * @param enumPixelIntensityRelationship  Enum value of Pixel Intensity Relationship
	 */
	public void setPixelIntensityRelationship(EnumPixelIntensityRelationship enumPixelIntensityRelationship)
	{
		/*Accept Pixel Intensity Relationship 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, 0x1040, DicomConstants.DCM_DT_ST, enumPixelIntensityRelationship.getValue());
	}

	/**
	 * Return relationship between the Pixel sample values and the X-Ray beam intensity.
	 * 
	 * @return  String - String value of Pixel Intensity Relationship
	 */
	public String getPixelIntensityRelationship()
	{
		Object objValue = getValue(0x0028,0x1040);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * 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 objValue = getValue(0x0028,0x0002);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * The method is used to set 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 objValue = getValue(0x0028,0x0004);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * 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 objValue = getValue(0x0028,0x0100);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * 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 objValue = getValue(0x0028,0x0101);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * 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 objValue = getValue(0x0028,0x0102);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * 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 specifies the 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 short - returns the pixel representation
	 */
	public short getPixelRepresentation()
	{
		Object objValue = getValue(0x0028,0x0103);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets parameters of scanning sequence.
	 * 
	 * @param arrStrScanOptions the arr str scan options
	 */
	public void setScanOptions(String[] arrStrScanOptions)
	{
		/*Accept Scan Options in Array of 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, 0x0022, DicomConstants.DCM_DT_CS, arrStrScanOptions);
	}

	/**
	 * Return Parameters of scanning sequence.
	 * 
	 * @return String Array of Scan Options.
	 */
	public String[] getScanOptions()
	{
		Object objValue = getValue(0x0018,0x0022);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets the location(s) of the R Wave in the cardiac cycles by referencing frame numbers; frame numbers begin with 1.
	 * 
	 * @param arrShRWavePointer the arr sh r wave pointer
	 */
	public void setRWavePointer(short[] arrShRWavePointer)
	{
		/*Accept R Wave Pointer in Array of String 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, 0x6040, DicomConstants.DCM_DT_US, arrShRWavePointer);
	}

	/**
	 * Return the location(s) of the R Wave in the cardiac cycles by referencing frame numbers; frame numbers begin with 1.
	 * 
	 * @return short Array - short array of RWavePointer
	 */
	public short[] getRWavePointer()
	{
		Object objValue = getValue(0x0028,0x6040);
		if(objValue != null)
			return (short[])objValue;
		return null;
	}

	/**
	 * This method Returns provides the pre-initialized object of Referenced Image Sequence
	 * return objReferencedImageSequence - object of Referenced Image Sequence. If the module contans the sequence object
	 * it retruns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 * 
	 * @return the referenced image sequence
	 */
	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, 0x1140, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0008, 0x1140, DicomConstants.DCM_DT_SQ, objReferencedImageSequence.getValue());
		}
		return objReferencedImageSequence;
	}

	/**
	 * Sets a text description of how this image was derived.
	 * 
	 * @param strDerivationDescription String value of Derivation Description
	 */
	public void setDerivationDescription(String strDerivationDescription)
	{
		/* Accept A text description of how this image was derived 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 Hash Map
		 */
		addDataElement(0x0008, 0x2111, DicomConstants.DCM_DT_ST, strDerivationDescription);
	}

	/**
	 * Return a text description of how this image was derived.
	 * 
	 * @return String - String value of Derivation Description
	 */
	public String getDerivationDescription()
	{
		Object objValue = getValue(0x0008,0x2111);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets value that Indicates any visual processing performed on the images prior to exchange.
	 * 
	 * @param strAcquisitionDeviceProcessingDescription  String value of Acquisition Device Processing Description
	 */
	public void setAcquisitionDeviceProcessingDescription(String strAcquisitionDeviceProcessingDescription)
	{
		/*Accept Acquisition Device Processing Description 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 Hash Map
		 */
		addDataElement(0x0018, 0x1400, DicomConstants.DCM_DT_LO, strAcquisitionDeviceProcessingDescription);
	}

	/**
	 * Return value that Indicates any visual processing performed on the images prior to exchange.
	 * 
	 * @return String - String value of Acquisition Device Processing Description
	 */
	public String getAcquisitionDeviceProcessingDescription()
	{
		Object objValue = getValue(0x0018,0x1400);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Sets a multi-valued attribute that contains a descriptive label for each of the image
	 * frames. The number of values shall equal the number of frames.
	 * 
	 * @param arrStrFrameLabelVector the arr str frame label vector
	 */
	public void setFrameLabelVector(String[] arrStrFrameLabelVector)
	{
		/*Accept Frame Label Vector in Array of String format of type SH.
		 * 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, 0x2002, DicomConstants.DCM_DT_SH, arrStrFrameLabelVector);
	}

	/**
	 * Return multi-valued attribute that contains a descriptive label for each of the image.
	 * 
	 * @return String[] - String Array of String array of Frame Label Vector
	 */
	public String[] getFrameLabelVector()
	{
		Object objValue = getValue(0x0018,0x2002);
		if(objValue != null)
			return (String[])objValue;
		return null;
	}

	/**
	 * Sets value that contains the Data Element Tags of one or more attributes that vary or increment
	 * for the frames of a multi-frame image.
	 * 
	 * @param arrShDimensionPointer the arr sh dimension pointer
	 */
	public void setFrameDimensionPointer(short[] arrShDimensionPointer)
	{
		/*Accept Frame Dimension Pointer in Array of short array 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,0x000A, DicomConstants.DCM_DT_US, arrShDimensionPointer);
	}

	/**
	 * Return value that contains the Data Element Tags of one or more attributes that vary or increment.
	 * 
	 * @return short[] - short array of Frame Dimension Pointer
	 */
	public short[] getFrameDimensionPointer()
	{
		Object objValue = getValue(0x0028,0x000A);
		if(objValue != null)
			return (short[])objValue;
		return null;
	}

	/**
	 * Sets value that indicates whether a reference object (phantom) of known size is present in the
	 * image and was used for calibration. Enumerated Values: YES,NO.
	 * 
	 * @param enumCalibrationImage enum value of Calibration Image
	 */
	public void setCalibrationImage(EnumCalibrationImage enumCalibrationImage)
	{
		/*Accept Calibration 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(0x0050,0x0004, DicomConstants.DCM_DT_CS, enumCalibrationImage.getValue());
	}

	/**
	 * Return value that indicates whether a reference object (phantom) of known size is present in the
	 * image and was used for calibration.
	 * 
	 * @return String - String value of Calibration Image
	 */
	public String getCalibrationImage()
	{
		Object objValue = getValue(0x0050,0x0004);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/* This method is used by the Module Iterator to iterate through the DataSet and return only
	 * those elements that belong to the respective Module class whose getVectorOfKeys is called.
	 */
	/**
	 * This method returns the vector of keys representing the DataElements that belong to this module.
	 * 
	 * @return vector of Tags - returns the vector containing the collection of tags
	 */
	public ISingleCollection<ITag> getVectorOfKeys()
	{
		return objSingleCollection;
	}


}
