[ITK-users] Kmeans, Otsu on SPECT image

Cyril Jaudet drcjaudet at gmail.com
Thu Jun 28 11:11:20 EDT 2018


Hello,
i want to use Otsu and Kmeans method to segment several lesion on SPECT
image.
The threshold method is apply on different lesion independently.
I write it directly in 3DSlicer.

The code for Otsu is working: (write in simpleITK)
#######################
label_masked=ThB.Execute(label_PET, 1, 1 ,1, 0) #
    labelOtsu_parlesion=Otsu.Execute(imagePET,label_masked, 0, 1, 64, True,
1)
    LabelsOtsu=labelOtsu_parlesion
    for label in range(2, len(Nlabels)+1):
        label_masked=ThB.Execute(label_PET, label, label ,label, 0) #
        labelOtsu_parlesion=Otsu.Execute(imagePET,label_masked, 0, label,
64, True, label)
        LabelsOtsu=Add.Execute(LabelsOtsu,labelOtsu_parlesion)
    su.PushToSlicer(LabelsOtsu, 'Otsu_intermediate', 2 )
################################

I try with Kmeans but i didn't suceed to use a mask directly and is there
any kmeans++ avaible?

################################################kmeans####################
    label_masked=ThB.Execute(dilatelabelOtsu, 1, 1 ,1, 0) #
    Image_masked=Mask.Execute(imagePET,label_masked )
    labelKmeans_parlesion=Kmeans.Execute(Image_masked)
    Imagefinal2=labelKmeans_parlesion
    for label in range(2, len(Nlabels)+1):
        print label
        label_masked=ThB.Execute(dilatelabelOtsu, label, label ,label, 0) #
        Image_masked=Mask.Execute(imagePET,label_masked )
        labelKmeans_parlesion=Kmeans.Execute(Image_masked)
        Imagefinal2=Add.Execute(Imagefinal,labelKmeans_parlesion)
    su.PushToSlicer(Imagefinal2, 'Kmeans_final', 2 )
##########################################################
Also if you have idea/experience for denoising SPECT image;)

Thank you,
Cyril Jaudet, Phd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/insight-users/attachments/20180628/a9f11a3a/attachment.html>


More information about the Insight-users mailing list