WWL Sigmoid
WWL에서 center를 기준으로 좌우가 log 함수처럼 생긴 graph형태를 sigmoid라고 합니다.
DICOM에서도 이런 특이한 형태를 지원합니다. 보통 element안에 lut 형태로 저장하여 사용하게 끔 되어있습니다.
보통 많이 사용하는곳이 MR image나 Mammo영상에서 판독을 좋게 한다고 해서 가끔 사용 합니다.
internet 발췌한 간단한 sigmoid graph 그리기 입니다.
아래 함수를 통해서 구현 합니다.
python code로는 아래와 같습니다.
import math
def sigmoid(x):
a = []
for item in x:
a.append(1/(1+math.exp(-item)))
return a
import matplotlib.pyplot as plt
import numpy as np
x=np.arange(-10, 10, 0.2)
sig = sigmoid(x)
plt.plot(x,sig)
plt.show()
LeadTools library의 document에서도 쉽게 해당 식의 parameter를 참조 하여 구현 할 수 있습니다.
아래는 leadtools document에 있는 내용 발췌 입니다.
Y = uStart + (uEnd uStart) * (1./ (1 + exp(2*nFactor/10. * (x-Center))/(uEnd- uStart)) - nFirstValue)/ (nLastValue nFirstValue)
where:
nFirstValue = 1./(1+exp(2.*nFactor/10.*(nStart - Center)/ (uEnd- uStart))).
nLastValue = 1./(1+exp(2.*nFactor/10.*(nEnd - Center)/ (uEnd- uStart))).
Center = (nEnd + nStart)/2.
x = the intensity value of the selected point
uStart = the nLow parameter of this function
uEnd = the nHigh parameter of this function