works, but weak performance seperating all brightness values from the lung
parent
060a4df5c2
commit
006adb3112
18
main.py
18
main.py
|
@ -35,11 +35,25 @@ lungsInLitre = voxelInLungs / 1000000
|
||||||
# Histogramm des CT-Bilds
|
# Histogramm des CT-Bilds
|
||||||
thoraxArray = np.array(sitk.GetArrayFromImage(img))
|
thoraxArray = np.array(sitk.GetArrayFromImage(img))
|
||||||
thoraxArray1D = thoraxArray.flatten()
|
thoraxArray1D = thoraxArray.flatten()
|
||||||
plt.hist(thoraxArray1D, 100)
|
plt.hist(thoraxArray1D, bins=100)
|
||||||
plt.title("Histogramm eines Thorax")
|
plt.title("Helligkeitswerte eines Thorax")
|
||||||
plt.xlabel("Helligkeitswert in Hounsfield-Einheiten (HU)")
|
plt.xlabel("Helligkeitswert in Hounsfield-Einheiten (HU)")
|
||||||
plt.ylabel("Häufigkeit in Millionen (mio)")
|
plt.ylabel("Häufigkeit in Millionen (mio)")
|
||||||
plt.show()
|
plt.show()
|
||||||
plt.clf()
|
plt.clf()
|
||||||
|
|
||||||
|
# Alle Helligkeitswerte der Lunge seperieren
|
||||||
|
lungBrightness = []
|
||||||
|
lungsArray1D = lungsArray.flatten()
|
||||||
|
|
||||||
|
for (ind, elem) in enumerate(lungsArray1D):
|
||||||
|
if elem > 0:
|
||||||
|
lungBrightness.append(thoraxArray1D[ind])
|
||||||
|
|
||||||
|
# Histogram aller Helligkeitswerte in der Lunge
|
||||||
|
plt.hist(lungBrightness, bins=100)
|
||||||
|
plt.title("Helligkeitswerte einer Lunge")
|
||||||
|
plt.xlabel("Helligkeitswert in Hounsfield-Einheiten (HU)")
|
||||||
|
plt.ylabel("Häufigkeit")
|
||||||
|
plt.show()
|
||||||
|
plt.clf()
|
||||||
|
|
Loading…
Reference in New Issue