diff --git a/lungs.nrrd b/lungs.nrrd new file mode 100644 index 0000000..a45d35e Binary files /dev/null and b/lungs.nrrd differ diff --git a/main.py b/main.py index 3234bfb..1226225 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ -import SimpleITK as stik +import SimpleITK as sitk -img = stik.ReadImage("Thorax1.0B40f_Downsampled_by_2.nrrd") +img = sitk.ReadImage("Thorax1.0B40f_Downsampled_by_2.nrrd") xSp, ySp, zSp = img.GetSpacing() @@ -15,6 +15,11 @@ print(f"Size: \n{xSi = }\n{ySi = }\n{zSi = }\n") 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") -lungs = stik.ConnectedThreshold(img, seedList= (120,140,100), lower=-1100, upper=-200) + +seedList = [(120,140,100)] + +lungs = sitk.ConnectedThreshold(img, seedList , -1100, -200) +sitk.WriteImage(lungs, "lungs.nrrd") +