back to iatexture

Images from Faculty of Medical Imaging

01. from iatexture import *
02. import ia870
03. import time
04. 
05. #img = adreadgray('p/LesionMRI/EM/Iani Surian Batalini - 746587-5 - 32A/22.png')
06. #roi = adreadgray('p/LesionMRI/EM/Iani Surian Batalini - 746587-5 - 32A/Peri_22_1.png')>0
07. 
08. img = adreadgray('p/LesionMRI/EM/Agnaldo Jose Costa - 808572-1 - 38A/22.png')
09. roi = adreadgray('p/LesionMRI/EM/Agnaldo Jose Costa - 808572-1 - 38A/Peri_22_1.png')>0
10. 
11. aux = ia870.ialabel(roi)
12. aux = ia870.iablob(aux,'area')
13. roi2 = aux>aux.max()-1 # ensure that it is only one lesion, use the biggest blob, avoid manual segmentation mistakes.
14. 
15. rate = 8
16. 
17. adshow(img,'img')
18. adshow(ia870.iagshow(img,roi2),'roi')
19. t1 = time.time()
20. print 'texture attributes (including histogram entropy,median,mode;excluding distances 4 and 5 for GMCL) = '
21. desc = textpipe(img,roi2,rate,comp=1)
22. print desc
23. print 'processing time:',time.time()-t1
24. 
25. print
26. t1 = time.time()
27. print 'texture attributes (including histogram entropy,median,mode;excluding distances 4 and 5 for GMCL) = '
28. desc = textpipe(img,roi2,rate,comp=1,bb_use=0)
29. print desc
30. print 'processing time without bb:',time.time()-t1
texture attributes (including histogram entropy,median,mode;excluding distances 4 and 5 for GMCL) = 
[  1.09157025e+02   4.60991872e+02   2.08919694e-01  -3.82340877e-01
   6.70000000e+01   8.10000000e+01   1.09000000e+02   1.35000000e+02
   1.57000000e+02   1.77165806e+00   9.70000000e+01   1.09000000e+02
   9.67107861e-03   2.21915933e+02   7.33005418e-01   4.12810518e+02
   8.42968337e-02   2.25326427e+02   1.40619940e+03   1.83554174e+00
   2.01725244e+00   8.10826547e+01   1.40153658e+00   1.13094610e-02
   5.01891204e+02   4.15077839e-01   4.22043422e+02   5.33959611e-02
   2.27476037e+02   1.15034750e+03   1.76204626e+00   1.94937186e+00
   1.73845044e+02   1.52811935e+00   1.38393408e-02   7.38514899e+02
   1.77568740e-01   4.47807252e+02   2.11750134e-02   2.27881735e+02
   9.50905282e+02   1.67946827e+00   1.86587259e+00   2.23920283e+02
   1.51616927e+00   1.12916868e+02   2.28065580e+00   1.07025042e+00
   9.82437394e-01   9.77272727e-01   2.53484745e+01   1.66903118e+02
   5.37502239e-01   2.33356852e-01   1.00000000e+00]
processing time: 1.66717004776

texture attributes (including histogram entropy,median,mode;excluding distances 4 and 5 for GMCL) = 
[  1.09157025e+02   4.60991872e+02   2.08919694e-01  -3.82340877e-01
   6.70000000e+01   8.10000000e+01   1.09000000e+02   1.35000000e+02
   1.57000000e+02   1.77165806e+00   9.70000000e+01   1.09000000e+02
   9.67107861e-03   2.21915933e+02   7.33005418e-01   4.12810518e+02
   8.42968337e-02   2.25326427e+02   1.40619940e+03   1.83554174e+00
   2.01725244e+00   8.10826547e+01   1.40153658e+00   1.13094610e-02
   5.01891204e+02   4.15077839e-01   4.22043422e+02   5.33959611e-02
   2.27476037e+02   1.15034750e+03   1.76204626e+00   1.94937186e+00
   1.73845044e+02   1.52811935e+00   1.38393408e-02   7.38514899e+02
   1.77568740e-01   4.47807252e+02   2.11750134e-02   2.27881735e+02
   9.50905282e+02   1.67946827e+00   1.86587259e+00   2.23920283e+02
   1.51616927e+00   1.12916868e+02   2.28065580e+00   1.07025042e+00
   9.82437394e-01   9.77272727e-01   2.53484745e+01   1.66903118e+02
   5.37502239e-01   2.33356852e-01   1.00000000e+00]
processing time without bb: 2.02076387405

img

roi

1. import homemariana.att_lib as att_lib
2. 
3. t1=time.time()
4. img = att_lib.quantimg(img,rate)
5. desc2 = att_lib.textureAtt(img,roi2)
6. desc2 = att_lib.textComp(desc2)
7. print ' texture attributes using the old library\n',desc2
8. #print 'difference between old and new texture library\n',desc2-desc
9. print 'processing time:',time.time()-t1
texture attributes using the old library
[  1.10157025e+02   4.60991872e+02   2.08919694e-01  -3.82340877e-01
   6.80000000e+01   8.20000000e+01   1.10000000e+02   1.36000000e+02
   1.58000000e+02   9.67107861e-03   2.21915933e+02   7.33005418e-01
   4.12810518e+02   8.42968337e-02   2.25326427e+02   1.40619940e+03
   1.83554174e+00   2.01725244e+00   8.10826547e+01   1.40153658e+00
   1.13094610e-02   5.01891204e+02   4.15077839e-01   4.22043422e+02
   5.33959611e-02   2.27476037e+02   1.15034750e+03   1.76204626e+00
   1.94937186e+00   1.73845044e+02   1.52811935e+00   1.38393408e-02
   7.38514899e+02   1.77568740e-01   4.47807252e+02   2.11750134e-02
   2.27881735e+02   9.50905282e+02   1.67946827e+00   1.86587259e+00
   2.23920283e+02   1.51616927e+00   1.79384311e-02   9.21185123e+02
   6.68589961e-02   4.90226033e+02   2.99782517e-02   2.26558305e+02
   8.82164627e+02   1.62621999e+00   1.76437649e+00   2.66662996e+02
   1.50703206e+00   2.61069007e-02   1.08446098e+03   5.21173563e-02
   4.84651787e+02   2.25585317e-02   2.24590372e+02   7.99994209e+02
   1.52119248e+00   1.63376147e+00   3.04052053e+02   1.43843749e+00
   1.12916868e+02   2.28065580e+00   1.07025042e+00   9.82437394e-01
   9.77272727e-01   2.53484745e+01   1.66903118e+02   5.37502239e-01
   2.33356852e-01   1.00000000e+00]
processing time: 4.3487610817