/*******************************************************************************
 *  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.Tag;
import cdac.medinfo.sdk.dcm30_04.baselibs.TotalPixelMatrixOriginSequence;
import cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.commoninterface.ITag;
import cdac.medinfo.sdk.dcm30_04.enums.EnumBurnedInAnnotation;
import cdac.medinfo.sdk.dcm30_04.enums.EnumExtendedDepthofField;
import cdac.medinfo.sdk.dcm30_04.enums.EnumFocusMethod;
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.EnumPresentationLUTShape;
import cdac.medinfo.sdk.dcm30_04.enums.EnumSpecimenLabelInImage;

import cdac.medinfo.sdk.dcm30_04.enums.EnumVolumetricProperties;
import cdac.medinfo.sdk.dcm30_04.exceptions.ConditionFailedException;
import cdac.medinfo.sdk.dcm30_04.exceptions.InvalidItemException;
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;
//TODO: Auto-generated Javadoc
/**
\* This module describes attributes related to Whole Slide Microscopy Image Module.
*/
public class WholeSlideMicroscopyImageModule extends Module  
{
	/**
	 * The obj single collection.
	 */
	public static ISingleCollection<ITag> objSingleCollection = null;



	/**
	 * Instantiates a new rT general plan module.
	 * 
	 * @param objIDataSet the obj i data set
	 */
	public WholeSlideMicroscopyImageModule(IDataSet objIDataSet)
	{
		super(objIDataSet);
	}

	static
	{
		objSingleCollection = new SingleCollection<ITag>();
		objSingleCollection.add(new Tag(0x0008,0x0008)); 
		objSingleCollection.add(new Tag(0x0048,0x0001)); 
		objSingleCollection.add(new Tag(0x0048,0x0002)); 
		objSingleCollection.add(new Tag(0x0048,0x0003)); 
		objSingleCollection.add(new Tag(0x0048,0x0004)); 
		objSingleCollection.add(new Tag(0x0048,0x0005));
		objSingleCollection.add(new Tag(0x0048,0x0006)); 
		objSingleCollection.add(new Tag(0x0048,0x0007)); 
		objSingleCollection.add(new Tag(0x0048,0x0008));
		objSingleCollection.add(new Tag(0x0048,0x0102)); 
		objSingleCollection.add(new Tag(0x0028,0x0002)); 
		objSingleCollection.add(new Tag(0x0028,0x0004));
		objSingleCollection.add(new Tag(0x0028,0x0006));
		objSingleCollection.add(new Tag(0x0028,0x0008)); 
		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(0x0008,0x002A)); 
		objSingleCollection.add(new Tag(0x0018,0x9073)); 
		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,0x1052)); 
		objSingleCollection.add(new Tag(0x0028,0x1053)); 
		objSingleCollection.add(new Tag(0x0008,0x9206)); 
		objSingleCollection.add(new Tag(0x0048,0x0010)); 
		objSingleCollection.add(new Tag(0x0028,0x0301)); 
		objSingleCollection.add(new Tag(0x0048,0x0011)); 
		objSingleCollection.add(new Tag(0x0048,0x0012)); 
		objSingleCollection.add(new Tag(0x0048,0x0013)); 
		objSingleCollection.add(new Tag(0x0048,0x0014)); 
		objSingleCollection.add(new Tag(0x0018,0x1400)); 
		objSingleCollection.add(new Tag(0x0048,0x1210)); 
		objSingleCollection.add(new Tag(0x0048,0x0015)); 
	}
	
	/**
	 * 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
		{		
		
			if(!isPresent(0x0008,0x0008))
				throw new MandatoryMissingException("0008,0008");
			if(!isPresent(0x0048,0x0001))
				throw new MandatoryMissingException("0048,0001");
			if(!isPresent(0x0048,0x0002))
				throw new MandatoryMissingException("0048,0002");
			if(!isPresent(0x0048,0x0003))
				throw new MandatoryMissingException("0048,0003");
			if(!isPresent(0x0048,0x0006))
				throw new MandatoryMissingException("0048,0006");
			if(!isPresent(0x0048,0x0007))
				throw new MandatoryMissingException("0048,0007");
			if(!isPresent(0x0048,0x0008))
				throw new MandatoryMissingException("0048,0008");
			if(!isPresent(0x0048,0x0008))
				throw new MandatoryMissingException("0048,0008");
			if(!isPresent(0x0048,0x0102))
				throw new MandatoryMissingException("0048,0102");
			if(!isPresent(0x0028,0x0002))
				throw new MandatoryMissingException("0028,0002");
			if(!isPresent(0x0028,0x0004))
				throw new MandatoryMissingException("0028,0004");
			if(!isPresent(0x0028,0x0006))
				throw new ConditionFailedException("0028,0006");
			if(!isPresent(0x0028,0x0008))
				throw new MandatoryMissingException("0028,0008");
			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");
			if(!isPresent(0x0008,0x002A))
				throw new MandatoryMissingException("0008,002A");
			if(!isPresent(0x0018,0x9073))
				throw new MandatoryMissingException("0018,9073");
			if(!isPresent(0x0028,0x2110))
				throw new MandatoryMissingException("0028,2110");
			if(!isPresent(0x0028,0x2112))
				throw new ConditionFailedException("0028,2112");
			if(!isPresent(0x0028,0x2114))
				throw new ConditionFailedException("0028,2114");
			if(!isPresent(0x2050,0x0020))
				throw new ConditionFailedException("2050,0020");
			if(!isPresent(0x0028,0x1052))
				throw new ConditionFailedException("0028,1052");
			if(!isPresent(0x0028,0x1053))
				throw new ConditionFailedException("0028,1053");
			if(!isPresent(0x0008,0x9206))
				throw new MandatoryMissingException("0008,9206");
			if(!isPresent(0x0048,0x0010))
				throw new MandatoryMissingException("0048,0010");
			if(!isPresent(0x0028,0x0301))
				throw new MandatoryMissingException("0028,0301");
			if(!isPresent(0x0048,0x0011))
				throw new MandatoryMissingException("0048,0011");
			if(!isPresent(0x0048,0x0012))
				throw new MandatoryMissingException("0048,0012");
			if(!isPresent(0x0048,0x0013))
				throw new ConditionFailedException("0048,0013");
			if(!isPresent(0x0048,0x0014))
				throw new ConditionFailedException("0048,0014");
		}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(InvalidItemException iie)
		{
			if(DicomConfig.createInstance().isLoggingOn())
				DicomLogger.getLogger().log(iie.getMessage());

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

		}
		return true;
	}
	/**
	 * Sets Image Type.
	 * Image identification characteristics.
	 * @param enumImageType the enum approval status
	 */
	public void setImageType(EnumImageType  enumImageType)
	{
		/* Accept ImageType 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,0x0008, DicomConstants.DCM_DT_CS, EnumImageType.Value1.valueOf(getImageType()).getValue());
	}

	/**
	 * Retrieves ImageType.
	 * 
	 * @return String - String value of ImageType.
	 */ 
	public String getImageType()
	{
		Object objValue = getValue(0x0008,0x0008);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	

	/**
	 * Sets Imaged Volume Width.
	 * Width of total imaged volume (distance in the direction of rows in each frame) in mm.
	 * @param fImagedVolumeWidth Float value of the Imaged Volume Width
	 */
	public void setImagedVolumeWidth( float fImagedVolumeWidth)
	{
		/*
		 * Accept the ImagedVolumeWidth in String format of type FL.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0048,0x0001, DicomConstants.DCM_DT_FL,fImagedVolumeWidth);
	}
	/**
	 * Retrieves ImagedVolumeWidth
	 * @return float - Float value of the ImagedVolumeWidth
	 */
	public float getImagedVolumeWidth()
	{
		Object objValue = getValue(0x0048,0x0001);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets Imaged Volume Height.
	 * Height of total imaged volume (distance in the direction of columns in each frame) in mm.
	 * @param fImagedVolumeHeight Float value of the Imaged Volume Width
	 */
	public void setImagedVolumeHeight( float fImagedVolumeHeight)
	{
		/*
		 * Accept the ImagedVolumeWidth in String format of type FL.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0048,0x0002, DicomConstants.DCM_DT_FL,fImagedVolumeHeight);
	}
	/**
	 * Retrieves ImagedVolumeHeight
	 * @return float - Float value of the ImagedVolumeWidth
	 */
	public float getImagedVolumeHeight()
	{
		Object objValue = getValue(0x0048,0x0002);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets Imaged Volume Depth.
	 * Depth of total imaged volume (distance in the Z direction of focal planes) in μm.
	 * @param fImagedVolumeDepth Float value of the Imaged Volume Width
	 */
	public void setImagedVolumeDepth( float fImagedVolumeDepth)
	{
		/*
		 * Accept the ImagedVolumeWidth in String format of type FL.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0048,0x0003, DicomConstants.DCM_DT_FL,fImagedVolumeDepth);
	}
	/**
	 * Retrieves ImagedVolumeDepth
	 * @return float - Float value of the ImagedVolumeDepth
	 */
	public float getImagedVolumeDepth()
	{
		Object objValue = getValue(0x0048,0x0003);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Sets Total Pixel Matrix Columns.
	 * Total number of columns in pixel matrix; i.e., width of total imaged volume in pixels.
	 * @param iTotalPixelMatrixColumns int value of Offset of the First Directory Record of the Root Directory.
	 */
	public void setTotalPixelMatrixColumns(int iTotalPixelMatrixColumns)
	{
		/* Accept Total Pixel Matrix Columns  of type UL.
		 * 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 DataSet
		 */
		addDataElement(0x0048,0x0006, DicomConstants.DCM_DT_UL, iTotalPixelMatrixColumns);
	}

	/**
	 * Retrieves Total Pixel Matrix Columns. 
	 * @return int - int value of Total Pixel Matrix Columns.
	 */
	public int getTotalPixelMatrixColumns()
	{
		Object objValue = getValue(0x0048,0x0006);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * Sets Total Pixel Matrix Rows.
	 * Total number of Rows in pixel matrix; i.e., width of total imaged volume in pixels.
	 * @param iTotalPixelMatrixRows int value of Offset of the First Directory Record of the Root Directory.
	 */
	public void setTotalPixelMatrixRows(int iTotalPixelMatrixRows)
	{
		/* Accept Total Pixel Matrix Rows  of type UL.
		 * 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 DataSet
		 */
		addDataElement(0x0048,0x0007, DicomConstants.DCM_DT_UL, iTotalPixelMatrixRows);
	}

	/**
	 * Retrieves Total Pixel Matrix Rows. 
	 * @return int - int value of Total Pixel Matrix Rows.
	 */
	public int getTotalPixelMatrixRows()
	{
		Object objValue = getValue(0x0048,0x0007);
		if(objValue != null)
			return Integer.parseInt(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	
	/**
	 * This method provides the pre-initialized object of TotalPixelMatrixOriginSequence.
	 * @return - object of Total Pixel Matrix Origin Sequence. If the module contains the sequence object
	 * it returns the same otherwise it creates the sequence adds to the module with proper initialization
	 * and then returns the object of sequence
	 */
	public TotalPixelMatrixOriginSequence getReferencedVisitSequence()
	{
		TotalPixelMatrixOriginSequence objTotalPixelMatrixOriginSequence = (TotalPixelMatrixOriginSequence)getDicomValue(0x0048,0x0008);
		if(objTotalPixelMatrixOriginSequence == 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();
			objTotalPixelMatrixOriginSequence = (TotalPixelMatrixOriginSequence)objDicomV3Factory.createSequence(0x0048,0x0008, objITransferSyntax, objIDictionaryReader);
			
			// This will add Data Element of SQ to the DataSet.
			addDataElement(0x0048,0x0008, DicomConstants.DCM_DT_SQ, objTotalPixelMatrixOriginSequence.getValue());
		}
		return objTotalPixelMatrixOriginSequence;
	}
	/**
	 * Sets the Image Orientation (Slide).
	 * 
	 * @param strArrImageOrientationSlide String value of Image Orientation Slide.
	 */
	public void setImageOrientationSlide(String[] strArrImageOrientationSlide)
	{
		/* Accept ImageOrientationSlide 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(0x0048,0x0102, DicomConstants.DCM_DT_DS, strArrImageOrientationSlide);
	}

	/**
	 * Return Image Orientation Slide .
	 * @return String - String value of Image Orientation Slide.
	 */
	public String[] getImageOrientationSlide()
	{Object objectValue = getValue(0x0048,0x0102);
		if(objectValue!=null)
			return (String[])objectValue;
		return null;
	}
	/**
	 * Sets the Samples per Pixel.
	 * 
	 * @param sSamplesPerPixel short value of Samples per Pixel.
	 */
	public void setSamplesPerPixel(short sSamplesPerPixel)
	{
		/* Accept Samples per Pixel 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, sSamplesPerPixel);
	}
	/**
	 * Retrieves the Samples per Pixel.
	 * 
	 * @return short - short value of Samples per Pixel.
	 */
	public short getSamplesPerPixel()
	{
		Object objValue = getValue(0x0028,0x0002);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets Photometric Interpretation.
	 * @param enumPhotometricInterpretation the enum approval status
	 */
	public void setPhotometricInterpretation(EnumPhotometricInterpretation enumPhotometricInterpretation)
	{
		/* Accept Photometric Interpretations 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,0x0004, DicomConstants.DCM_DT_CS, enumPhotometricInterpretation.getValue());
	}

	/**
	 * Retrieves Photometric Interpretation.
	 * @return String - String value of Photometric Interpretation.
	 */ 
	public String getPhotometricInterpretation()
	{
		Object objValue = getValue(0x0028,0x0004);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the Planar Configuration.
	 * 
	 * @param sPlanarConfiguration short value of PlanarConfiguration.
	 */
	public void setPlanarConfiguration(short sPlanarConfiguration)
	{
		/* Accept Planar Configuration 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,0x0006, DicomConstants.DCM_DT_US, sPlanarConfiguration);
	}

	/**
	 * Retrieves the Planar Configuration.
	 * 
	 * @return short - short value of Planar Configuration.
	 */
	public short getPlanarConfiguration()
	{
		Object objValue = getValue(0x0028,0x0006);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets Number of Frames.
	 * Number of frames in a multi-frame image.
	 * @param strNumberOfFrames String value of Number Of Frames.
	 */
	public void setNumberOfFrames(String strNumberOfFrames)
	{
		/* Accept Number Of Frames in String format of type IS.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create.
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Hash Map
		 */
		addDataElement(0x0028,0x0008, DicomConstants.DCM_DT_IS,strNumberOfFrames);
	}

	/**
	 * Return number of Number Of Frames.
	 * 
	 * @return String - String value of NumberOfFrames.
	 */
	public String getNumberOfFrames()
	{
		Object objValue = getValue(0x0028,0x0008);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the Bits Allocated.
	 * Number of bits allocated for each pixel sample
	 * @param sBitsAllocated short value of Bits Allocated.
	 */
	public void setBitsAllocated(short sBitsAllocated)
	{
		/* Accept BitsAllocated 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, sBitsAllocated);
	}

	/**
	 * Retrieves the Bits Allocated.
	 * @return short - short value of Bits Allocated.
	 */
	public short getBitsAllocated()
	{
		Object objValue = getValue(0x0028,0x0100);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets the BitsStored.
	 * Number of bits stored for each pixel sample. Shall be equal to Bits Allocated (0028,0100).
	 * @param sBitsStored short value of Bits Stored.
	 */
	public void setBitsStored(short sBitsStored)
	{
		/* Accept BitsStored 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, sBitsStored);
	}
	/**
	 * Retrieves the BitsStored.
	 * 
	 * @return short - short value of BitsStored.
	 */
	public short getBitsStored()
	{
		Object objValue = getValue(0x0028,0x0101);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets the HighBit.
	 * Most significant bit for pixel sample data. High Bit (0028,0102) shall be one less than Bits Stored (0028,0101).
	 * @param sHighBit short value of HighBit.
	 */
	public void setHighBit(short sHighBit)
	{
		/* Accept HighBit 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, sHighBit);
	}

	/**
	 * Retrieves the HighBit.
	 * 
	 * @return short - short value of HighBit
	 */
	public short getHighBit()
	{
		Object objValue = getValue(0x0028,0x0102);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets the Pixel Representation.
	 * Data representation of pixel samples.
	 * @param sPixelRepresentation short value of Pixel Representation.
	 */
	public void setAnnotationPosition(short sPixelRepresentation)
	{
		/* Accept Pixel Representation 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, sPixelRepresentation);
	}

	/**
	 * Retrieves the PixelRepresentation.
	 * 
	 * @return short - short value of Pixel Representation.
	 */
	public short getPixelRepresentation()
	{
		Object objValue = getValue(0x0028,0x0103);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Set 
	 * The date and time that the acquisition of data that resulted in this image started.
	 * @param strAcquisitionDatetime - String value of AAcquisition DateTime
	 */
	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.
	 * Duration of the image acquisition in seconds.
	 * @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 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 - 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;
	}
	/**
	 * The method is used to set lossy compression method(s) that have been applied to this image.
	 * 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 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 a subset of a conceptual Presentation LUT.This Attribute defines an identity transformation or inverse
	 * identity transformation.
	 * Enumerated Values:
	 * IDENTITY - output is in P-Values - shall be
	 * used if Photometric Interpretation
	 * (0028,0004) is MONOCHROME2.
	 * INVERSE - output after inversion is in PValues
	 * - shall be used if Photometric
	 * Interpretation (0028,0004) is
	 * MONOCHROME1.
	 * 
	 * @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;
	}
	/**
	 * The method is used to setThe value b in relationship between stored values (SV) and Hounsfield (HU).
	 * 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 strRescaleIntercept :String value of Rescale Intercept
	 */
	public void setRescaleIntercept(String strRescaleIntercept)
	{
		/*Accept The value b in relationship between stored values (SV) and Hounsfield (HU) 
		 * 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, strRescaleIntercept);
	}
	/**
	 * Return the String value of the attribute Rescale Intercept.
	 * 
	 * @return String - returns the Rescale Intercept
	 */
	public String getRescaleIntercept()
	{
		Object objectValue = getValue(0x0028, 0x1052);
		if(objectValue!=null)
			return objectValue.toString();
		return null;
	}
	/**
	 * The method is used to set the equation specified in Rescale Intercept
	 * 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 strRescaleScope :String value of Rescale Scope
	 */
	public void setRescaleScope(String strRescaleScope)
	{
		/*Accept the equation specified in Rescale Intercept
		 * 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, strRescaleScope);
	}
	/**
	 * Return the String value of the attribute Rescale Scope.
	 * 
	 * @return String - returns the Rescale Scope
	 */
	public String getRescaleScope()
	{
		Object objectValue = getValue(0x0028, 0x1053);
		if(objectValue!=null)
			return objectValue.toString();
		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 SpecimenLabelInImage.
	 * @param enumSpecimenLabelInImage the enum Specimen Label In Image
	 */
	public void setSpecimenLabelInImage(EnumSpecimenLabelInImage  enumSpecimenLabelInImage)
	{
		/* Accept SpecimenLabelInImage 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(0x0048,0x0010, DicomConstants.DCM_DT_CS, enumSpecimenLabelInImage.getValue());
	}

	/**
	 * Retrieves SpecimenLabelInImage .
	 * @return String - String value of SpecimenLabelInImage.
	 */ 
	public String getSpecimenLabelInImage()
	{
		Object objValue = getValue(0x0048,0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	
	/**
	 * Sets Burned In Annotation .
	 * @param enumBurnedInAnnotation the enum Burned In Annotation .
	 */
	public void setBurnedInAnnotation(EnumBurnedInAnnotation  enumBurnedInAnnotation)
	{
		/* Accept Burned In Annotation 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(0x0048,0x0010, DicomConstants.DCM_DT_CS, enumBurnedInAnnotation.getValue());
	}

	/**
	 * Retrieves BurnedInAnnotation .
	 * @return String - String value of BurnedInAnnotation.
	 */ 
	public String getBurnedInAnnotation()
	{
		Object objValue = getValue(0x0048,0x0010);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets Focus Method .
	 * @param enumFocusMethod the enum Focus Method .
	 */
	public void setFocusMethod(EnumFocusMethod  enumFocusMethod)
	{
		/* Accept Focus Method 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(0x0048,0x0011, DicomConstants.DCM_DT_CS, enumFocusMethod.getValue());
	}

	/**
	 * Retrieves Focus Method .
	 * @return String - String value of FocusMethod.
	 */ 
	public String getFocusMethod()
	{
		Object objValue = getValue(0x0048,0x0011);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets Extended Depth of Field .
	 * @param enumFocusMethod the enum Extended Depth of Field .
	 */
	public void setExtendedDepthofField(EnumExtendedDepthofField  enumFocusMethod)
	{
		/* Accept Extended Depth of Field 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(0x0048,0x0012, DicomConstants.DCM_DT_CS, enumFocusMethod.getValue());
	}

	/**
	 * Retrieves Extended Depth of Field .
	 * @return String - String value of ExtendedDepthofField.
	 */ 
	public String getExtendedDepthofField()
	{
		Object objValue = getValue(0x0048,0x0012);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * Sets the Number of Focal Planes.
	 * 
	 * @param sNumberofFocalPlanes short value of Number of Focal Planes.
	 */
	public void setNumberofFocalPlanes(short sNumberofFocalPlanes)
	{
		/* Accept Number of Focal Planes 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(0x0048,0x0013, DicomConstants.DCM_DT_US, sNumberofFocalPlanes);
	}

	/**
	 * Retrieves the Number of Focal Planes.
	 * 
	 * @return short - short value of Number of Focal Planes.
	 */
	public short getNumberofFocalPlanes()
	{
		Object objValue = getValue(0x0048,0x0013);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Sets DistanceBetweenFocalPlanes
	 * @param fDistanceBetweenFocalPlanes Float value of the DistanceBetweenFocalPlanes
	 */
	public void setDistanceBetweenFocalPlanes( float fDistanceBetweenFocalPlanes)
	{
		/*
		 * Accept the DistanceBetweenFocalPlanes in String format of type FL.
		 * Read the Transfer Syntax and check if ImplicitDE or ExplicitDE to create
		 * Set the iGroupNumber and iElementNumber to ImplicitDE object 
		 * Set the iVRType
		 * Set length from the element
		 * Add this element to the Data Set
		 */
		addDataElement(0x0048,0x0014, DicomConstants.DCM_DT_FL,fDistanceBetweenFocalPlanes);
	}
	/**
	 * Retrieves DistanceBetweenFocalPlanes
	 * @return float - Float value of the DistanceBetweenFocalPlanes
	 */
	public float getDistanceBetweenFocalPlanes()
	{
		Object objValue = getValue(0x0048,0x0014);
		if(objValue != null)
			return Float.parseFloat(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}
	/**
	 * Gets the acquisition device processing description.
	 * 
	 * @return the acquisition device processing description
	 */
	public String getAcquisitionDeviceProcessingDescription()
	{
		Object objValue = getValue(0x0018,0x1400);
		if(objValue != null)
			return objValue.toString();
		return null;
	}

	/**
	 * Gets the acquisition device processing code.
	 * 
	 * @return the acquisition device processing code
	 */
	public String getAcquisitionDeviceProcessingCode()
	{
		Object objValue = getValue(0x0018,0x1401);
		if(objValue != null)
			return objValue.toString();
		return null;
	}
	/**
	 * This method is used to set the convolution kernel
	 * 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 arrStrConvolutionKernel :Image Convolution Kernel
	 * 
	 * 
	 */	
	public void setConvolutionKernel(String[] arrStrConvolutionKernel)
	{
		/*Accept the convolution kernel in String Array format of type SH.
		 * 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, 0x1210, DicomConstants.DCM_DT_SH, arrStrConvolutionKernel);

	}
	/**
	 * Return the String values of the attribute Convolution Kernel.
	 * 
	 * @return the convolution kernel
	 */
	public String[] getConvolutionKernel()
	{
		Object objectValue = getValue(0x0018, 0x1210);
		if(objectValue!=null)
			return (String[])objectValue;
		return null;
	}
	/**
	 * Sets the RecommendedAbsentPixelCIELabValue.
	 * A color value with which it is recommended to display the pixels of the Total Pixel Matrix that are not encoded.
	 *  The units are specified in PCS-Values, and the value is encoded as CIELab
	 * @param sRecommendedAbsentPixelCIELabValue short value of RecommendedAbsentPixelCIELabValue.
	 */
	public void setRecommendedAbsentPixelCIELabValue(short sRecommendedAbsentPixelCIELabValue)
	{
		/* Accept RecommendedAbsentPixelCIELabValue 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(0x0048,0x0015, DicomConstants.DCM_DT_US, sRecommendedAbsentPixelCIELabValue);
	}

	/**
	 * Retrieves the RecommendedAbsentPixelCIELabValue.
	 * @return short - short value of RecommendedAbsentPixelCIELabValue.
	 */
	public short getRecommendedAbsentPixelCIELabValue()
	{
		Object objValue = getValue(0x0048,0x0015);
		if(objValue != null)
			return Short.parseShort(objValue.toString());
		return DicomConstants.DCM_NO_VALUE;
	}

}
