コード例 #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.
                }
            }
        }
コード例 #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();
        }
コード例 #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
            });
        }
コード例 #4
0
 public override bool AppliesTo(IPresentationImage presentationImage)
 {
     return(AutoVoiLutApplicator.CanCreate(presentationImage));
 }
コード例 #5
0
        public IVoiLut GetLut(IPresentationImage presentationImage)
        {
            var applicator = AutoVoiLutApplicator.Create(presentationImage);

            return(applicator == null ? null : applicator.GetInitialLut());
        }
コード例 #6
0
 private static IMemorable GetOriginator(IPresentationImage image)
 {
     return(!AutoVoiLutApplicator.CanCreate(image) ? null : ((IVoiLutProvider)image).VoiLutManager);
 }