/*******************************************************************************
 *  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.ReferencedInstanceSequence;
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.EnumInterpolationType;
import cdac.medinfo.sdk.dcm30_04.enums.EnumLossyImageCompression;
import cdac.medinfo.sdk.dcm30_04.enums.EnumPixelPresentation;
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.EnumVolumetricProperties;
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 describes attributes in Intravascular OCT Image Module.
 */
public class IntravascularOCTImageModule extends Module  
{
	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;


	/**
	 * Creates Intravascular OCT Image Module with default initialization.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public IntravascularOCTImageModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0008,0x0008));
		objSingleCollection.add(new Tag(0x0008,0x9206));
		objSingleCollection.add(new Tag(0x0008,0x9205));
		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(0x0008,0x002A));
		objSingleCollection.add(new Tag(0x0018,0x9073));
		objSingleCollection.add(new Tag(0x0020,0x0012));
		objSingleCollection.add(new Tag(0x0028,0x0103));
		objSingleCollection.add(new Tag(0x2050,0x0020));
		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,0x0301));
		objSingleCollection.add(new Tag(0x0028,0x0302));
		objSingleCollection.add(new Tag(0x0008,0x114A));
		objSingleCollection.add(new Tag(0x0020,0x4000));
		objSingleCollection.add(new Tag(0x0008,0x2144));
		objSingleCollection.add(new Tag(0x0052,0x0039));
		objSingleCollection.add(new Tag(0x0028,0x0304));
		
	}

	/**
	 * 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(0x0008,0x0008))
				throw new MandatoryMissingException("0008,0008");
			if(!isPresent(0x0008,0x9206))
				throw new MandatoryMissingException("0008,9206");
			if(!isPresent(0x0008,0x9205))
				throw new MandatoryMissingException("0008,9205");
			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(0x0008,0x002A))
				throw new MandatoryMissingException("0008,002A");
			if(!isPresent(0x0020,0x0012))
				throw new MandatoryMissingException("0020,0012");
			if(!isPresent(0x0028,0x0103))
				throw new MandatoryMissingException("0028,0103");
			if(!isPresent(0x0028,0x2110))
				throw new MandatoryMissingException("0028,2110");
			if(!isPresent(0x0028,0x0301))
				throw new MandatoryMissingException("0028,0301");
			if(!isPresent(0x0028,0x0301))
				throw new MandatoryMissingException("0028,0301");
			if(!isPresent(0x0028,0x0302))
				throw new MandatoryMissingException("0028,0302");
			
		}
		catch(MandatoryMissingException mme)
		{
			if(DicomConfig.createInstance().isLoggingOn())
				DicomLogger.getLogger().log(mme.getMessage());

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

		}
		return true;
	}
	
	/**
	 * Sets Image Type.
	 * Image identification characteristics.
	 * @param arrStrImageType :Image identification characteristics.
	 */	
	public void setImageType(String[] arrStrImageType)
	{
		/*Accept Image Type 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 Volumetric Properties .
	 * @param enumVolumetricProperties the enum approval status
	 */
	public void setVolumetricProperties(EnumVolumetricProperties  enumVolumetricProperties)
	{
		/* 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,0x9206, DicomConstants.DCM_DT_CS, enumVolumetricProperties.getValue());
	}

	/**
	 * Retrieves Volumetric Properties .
	 * 
	 * @return String - String value of Volumetric Properties.
	 */ 
	public String getVolumetricProperties()
	{
		Object objValue = getValue(0x0008,0x9206);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * 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 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.
	 * Specifies 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 Bits Allocated
	 * Number of bits allocated for each pixel sample.
	 * @param enumBitsAllocated the enum bits allocated
	 */
	public void setBitsAllocated(EnumBitsAllocated enumBitsAllocated)
	{
		/*Accept Number of bits allocated for each pixel sample 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, 0x0100, DicomConstants.DCM_DT_US, enumBitsAllocated.getValue());
	}

	/**
	 * Return the short value of the attribute Bits Allocated.
	 * 
	 * @return short - returns teh Bits Allocated
	 */
	public short getBitsAllocated()
	{Object objectValue = getValue(0x0028, 0x0100);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets Bits Stored
	 * Number of bits stored for each pixel sample.
	 * @param enumBitsStored the enum bits stored
	 */
	public void setBitsStored(EnumBitsStored enumBitsStored)
	{
		/*Accept Number of bits stored for each pixel sample 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, 0x0101, DicomConstants.DCM_DT_US, enumBitsStored.getValue());
	}
	
	/**
	 * Return the short value of the attribute 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 High Bit
	 * Most significant bit for pixel sample data.
	 * @param sHighBit : Most significant bit for pixel sample data
	 */
	public void setHighBit(short sHighBit)
	{
		/*Accept Most significant bit for pixel sample data 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, 0x0102, DicomConstants.DCM_DT_US, sHighBit);
	}
	
	/**
	 * Return the short value of the attribute High Bit.
	 * 
	 * @return short - returns High Bit
	 */
	public short getHighBit()
	{Object objectValue = getValue(0x0028, 0x0102);
		if(objectValue!=null)
			return Short.parseShort(objectValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

	/**
	 * Sets The date and time that the acquisition of data started.
	 * @param strAcquisitionDateTime String value of The date and time that the acquisition of data started.
	 */
	public void setAcquisitionDateTime(String strAcquisitionDateTime)
	{
		/* Accept the Acquisition 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 The date and time that the acquisition of data started.
	 * @return String - value of The date and time that the acquisition of data started.
	 */
	public String getAcquisitionDateTime()
	{
		Object objValue = getValue(0x0008,0x002A);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets the scan time in seconds used to create all frames of an Intravascular Optical Coherence Tomography image..
	 * 
	 * @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 scan time in seconds used to create all frames of an Intravascular Optical Coherence Tomography image..
	 * 
	 * @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 Acquisition Number
	 * A number identifying the single continuous gathering of data over a period of time that 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;
	}
	
	/**
	 * 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 a Presentation LUT Shape
	 * 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 a Lossy Image 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 - 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 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, 0x2112, DicomConstants.DCM_DT_DS, arrStrLossyImageCompressionRatio);
	}

	/**
	 * Retrieves the Lossy Image Compression.
	 * 
	 * @return - returns the Lossy Image Compression
	 */
	public String[] getLossyImageCompressionRatio()
	{
		Object objValue = getValue(0x0028,0x2112);
		if(objValue!=null)
			return (String[])objValue;
		return null;

	}
	
	/**
	 * Sets Lossy Image Compression Method.
	 * 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 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 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;
	}

	/**
	 * Sets User-defined comments about the image.
	 * 
	 * @param strImageComments - String value of Image Comments.
	 * 
	 * @return the int
	 */
	public void setImageComments(String strImageComments)
	{
		/*Accept the Image Comments in String format of type LT.
		 * 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, 0x4000, DicomConstants.DCM_DT_LT, strImageComments);
	}

	/**
	 * Retrieves User-defined comments about the image.
	 * 
	 * @return String - String value of Image Comments.
	 */
	public String getImageComments()
	{
		Object objectValue = getValue(0x0020, 0x4000);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	
	/**
	 * Sets recommended rate at which the frames of a Multi-frame image should be displayed in frames/second.
	 * 
	 * @param strRecommendedDisplayFrameRate String value of Recommended Display Frame Rate.
	 */
	public void setRecommendedDisplayFrameRate(String strRecommendedDisplayFrameRate)
	{
		/* Accept Recommended Display Frame Rate of 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(0x0008,0x2144, DicomConstants.DCM_DT_IS, strRecommendedDisplayFrameRate);
	}
	
	/**
	 * Retrieves recommended rate at which the frames of a Multi-frame image should be displayed in frames/second.
	 * 
	 * @return String - String value of Recommended Display Frame Rate.
	 */
	public String getRecommendedDisplayFrameRate()
	{
		Object objValue = getValue(0x0008,0x2144);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Interpolation Type.
	 * The type of interpolation used for the Polar to Cartesian scan-conversion.
	 * @param enumInterpolationType enum value of Interpolation Type
	 */
	public void setInterpolationType(EnumInterpolationType enumInterpolationType)
	{
		/* Accept the Interpolation Type 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(0x0052,0x0039, DicomConstants.DCM_DT_CS,enumInterpolationType);
	}
	/**
	 * Returns Interpolation Type
	 * @return String - value of Interpolation Type
	 */
	public String getInterpolationType()
	{
		Object objValue = getValue(0x0052,0x0039);
		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;
	}
	
	/**
	 * 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;
	}
}
