Ejemplo n.º 1
0
        private void Apply(IPresentationImage image)
        {
            var applicator = AutoVoiLutApplicator.Create(image);

            if (applicator == null)
            {
                return;
            }

            if (IsData)
            {
                if (!String.IsNullOrEmpty(LutExplanation))
                {
                    applicator.ApplyDataLut(LutExplanation);
                }
                else
                {
                    applicator.ApplyDataLut(LutIndex ?? 0); //just apply the first one.
                }
            }
            else
            {
                if (!String.IsNullOrEmpty(LutExplanation))
                {
                    applicator.ApplyLinearLut(LutExplanation);
                }
                else if (LutIndex.HasValue)
                {
                    applicator.ApplyLinearLut(LutIndex ?? 0); //just apply the first one.
                }
            }
        }
Ejemplo n.º 2
0
        public override void Apply(IPresentationImage presentationImage)
        {
            var applicator = AutoVoiLutApplicator.Create(presentationImage);

            if (applicator == null)
            {
                throw new InvalidOperationException("The input presentation image is not supported.");
            }

            applicator.ApplyNextLut();
        }
Ejemplo n.º 3
0
        public static AutoVoiLutSelector CreateFrom(IPresentationImage image)
        {
            var applicator = AutoVoiLutApplicator.Create(image);

            if (applicator == null)
            {
                return(null);
            }

            var autoLut = applicator.GetAppliedLut();

            if (autoLut == null)
            {
                return(null);
            }

            return(!autoLut.IsHeader ? null
                       : new AutoVoiLutSelector
            {
                IsData = autoLut.IsData,
                LutExplanation = autoLut.Explanation,
                LutIndex = autoLut.Index
            });
        }
        public IVoiLut GetLut(IPresentationImage presentationImage)
        {
            var applicator = AutoVoiLutApplicator.Create(presentationImage);

            return(applicator == null ? null : applicator.GetInitialLut());
        }