Ejemplo n.º 1
0
            /// <summary>
            /// Factory method for linear modality luts.
            /// </summary>
            public override IModalityLut GetModalityLutLinear(int bitsStored, bool isSigned, double rescaleSlope, double rescaleIntercept)
            {
                ModalityLutLinear modalityLut = new ModalityLutLinear(bitsStored, isSigned, rescaleSlope, rescaleIntercept);
                string            key         = modalityLut.GetKey();

                lock (_syncLock)
                {
                    if (_modalityLutCache.ContainsKey(key))
                    {
                        return(new CachedModalityLutProxy(_modalityLutCache[key]));
                    }

                    ModalityLutCacheItem item = new ModalityLutCacheItem(modalityLut);
                    _modalityLutCache[key] = item;
                    return(new CachedModalityLutProxy(item));
                }
            }
Ejemplo n.º 2
0
 internal ModalityLutCacheItem(ModalityLutLinear sourceLut)
 {
     _sourceLut = sourceLut;
     _sourceLut.Clear();
 }