2024-10-30 17:50:07 +01:00
|
|
|
import SimpleITK as stik
|
|
|
|
|
|
|
|
img = stik.ReadImage(".\Thorax1.0B40f_Downsampled_by_2.nrrd")
|
|
|
|
|
|
|
|
xSp, ySp, zSp = img.GetSpacing()
|
|
|
|
|
2024-10-30 20:13:38 +01:00
|
|
|
#print(f"Spacing: \n{xSp = }\n{ySp = }\n{zSp = }\n")
|
|
|
|
print(f"1) Die Voxel sind Quader mit den verschiedenen Seitenlängen: X: {xSp}, Y: {ySp}, Z: {zSp} \n")
|
2024-10-30 17:50:07 +01:00
|
|
|
|
|
|
|
sizeVector = img.GetSize()
|
|
|
|
xSi, ySi, zSi = sizeVector
|
|
|
|
|
|
|
|
print(f"Size: \n{xSi = }\n{ySi = }\n{zSi = }\n")
|
|
|
|
|
2024-10-30 20:13:38 +01:00
|
|
|
print(f"2) Das Bild hat in den drei Raumrichtungen {xSi * ySi * zSi} Voxel. \n")
|
|
|
|
print(f"3) Die Methode GetSize() gibt den Typ tuple zurück. \n")
|
2024-10-30 17:53:35 +01:00
|
|
|
|
2024-11-01 15:11:23 +01:00
|
|
|
lungs = stik.ConnectedThreshold(img, seedList= (120,140,100), lower=-1100, upper=-200)
|
|
|
|
|
|
|
|
|