private static VoiLutSequenceItem SerializeDataLut(IDataLut voiLut)
        {
            int inputLength = voiLut.Data.Length;

            int[] descriptor = new int[3];
            descriptor[0] = inputLength;
            if (descriptor[0] == 65536)
            {
                descriptor[0] = 0;
            }
            descriptor[1] = voiLut.FirstMappedPixelValue;
            descriptor[2] = 16;

            ushort[] data = new ushort[inputLength];
            unsafe
            {
                fixed(ushort *output = data)
                {
                    fixed(int *input = voiLut.Data)
                    {
                        for (int n = 0; n < inputLength; n++)
                        {
                            output[n] = (ushort)(input[n] & 0x0000FFFF);
                        }
                    }
                }
            }

            VoiLutSequenceItem lutseq = new VoiLutSequenceItem();

            lutseq.LutDescriptor  = descriptor;
            lutseq.LutData        = data;
            lutseq.LutExplanation = SR.LabelPresentationVoiDataLut;
            return(lutseq);
        }
Esempio n. 2
0
		/// <summary>
		/// Creates a single instance of a VoiLutSequence item. Does not modify the VoiLutSequence in the underlying collection.
		/// </summary>
		public VoiLutSequenceItem CreateVoiLutSequenceItem()
		{
			var iodBase = new VoiLutSequenceItem(new DicomSequenceItem());
			return iodBase;
		}
Esempio n. 3
0
        /// <summary>
        /// Creates a single instance of a VoiLutSequence item. Does not modify the VoiLutSequence in the underlying collection.
        /// </summary>
        public VoiLutSequenceItem CreateVoiLutSequenceItem()
        {
            var iodBase = new VoiLutSequenceItem(new DicomSequenceItem());

            return(iodBase);
        }