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. } } }
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(); }
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()); }