Exemplo n.º 1
0
        private static List <VoiDataLut> Create(DicomElementSq voiLutSequence, int pixelRepresentation)
        {
            bool isFirstMappedPixelSigned = pixelRepresentation != 0;

            List <DataLut> dataLuts = DataLut.Create(voiLutSequence, isFirstMappedPixelSigned, false);

            return(Convert(dataLuts));
        }
Exemplo n.º 2
0
        internal static ModalityDataLut Create(DicomElementSq modalityLutSequence, int pixelRepresentation)
        {
            List <DataLut> data = DataLut.Create(modalityLutSequence, pixelRepresentation != 0, false);

            if (data.Count == 0)
            {
                return(null);
            }

            string modalityLutType = ((DicomSequenceItem[])modalityLutSequence.Values)[0][DicomTags.ModalityLutType].ToString();

            return(new ModalityDataLut(data[0], modalityLutType));
        }
Exemplo n.º 3
0
        private static List <VoiDataLut> Create(DicomElementSq voiLutSequence, int bitsStored, int pixelRepresentation, double rescaleSlope, double rescaleIntercept)
        {
            int  minPixelValue;
            int  maxPixelValue;
            bool isSigned = pixelRepresentation != 0;

            GetMinMaxPixelValue(bitsStored, isSigned, out minPixelValue, out maxPixelValue);

            double minModalityLutValue = minPixelValue * rescaleSlope + rescaleIntercept;
            double maxModalityLutValue = maxPixelValue * rescaleSlope + rescaleIntercept;

            bool isFirstMappedPixelValueSigned = minModalityLutValue < 0 || maxModalityLutValue < 0;

            List <DataLut> dataLuts = DataLut.Create(voiLutSequence, isFirstMappedPixelValueSigned, false);

            return(Convert(dataLuts));
        }