You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
center_coordi= (int(windowSize[1]/2),int(windowSize[0]/2)) # center coordination of the window
39
+
distance_window=make_spatial_distance_window(windowSize, center_coordi) # Euclidean distance matrix between center coordination and neighbor cordination
Tissue Segmentation Using Modified Fuzzy C-Means Algorithm on Mammography (Image segmentation)
1
+
2
+
# MFCM_segmentation (Python 3.5)
3
+
### Tissue Segmentation Using Modified Fuzzy C-Means Algorithm on Mammography (Image segmentation)
4
+
5
+
This code uses modified fuzzy c-means algorithm (MFCM) to do tissue segmentation on mammography. This code is a implementation of The paper:
6
+
7
+
[1] Z. Chen and R. Zwiggelaar, 2010. 'A Modified Fuzzy C Means Algorithm for Breast Tissue Density Segmentation in Mammograms’, IEEE/Information Technology and Applications in Biomedicine (ITAB) (https://ieeexplore.ieee.org/document/5687751)
8
+
9
+
## How to run?
10
+
11
+
### Run on mini data as default option
12
+
You just run <u>main.py<\u> in editor or enter <u>python main.py<\u> in command prompt.
13
+
(In <i>img<\i> directory, there are 2 images for the test. These images are part of mini-MIAS database. (http://peipa.essex.ac.uk/info/mias.html) )
14
+
15
+
### User mode
16
+
If you want to replace the mini data with your own data, put your images to img directory or edit path for your direrectory in <u>main.py<\u>.
17
+
If you change parameters of your experiment, you can change parameters by changing the default value of the argument in <u>main.py<\u> or you can you the command line in command prompt.
18
+
- You can see all the adjustable parameters and usage. </pre> python main.py --help</pre>
19
+
(For example, if you want to cluster with 5 clusters, enter this command in your command prompt. </u>python main.py -c 5<\u>)
20
+
21
+
## Results
22
+
23
+
<pre>
24
+
Getting filtered image..(This process can be time consuming.)
25
+
Time : 53.16970419883728
26
+
Iteration 0 : cost = 383.503160
27
+
Iteration 1 : cost = 130.096540
28
+
Iteration 2 : cost = 52.057745
29
+
Iteration 3 : cost = 36.463114
30
+
Iteration 4 : cost = 33.625992
31
+
Iteration 5 : cost = 40.136341
32
+
Iteration 6 : cost = 42.462534
33
+
Iteration 7 : cost = 29.869172
34
+
Iteration 8 : cost = 16.829851
35
+
Iteration 9 : cost = 10.073875
36
+
Iteration 10 : cost = 6.756716
37
+
Iteration 11 : cost = 4.957472
38
+
Iteration 12 : cost = 3.912657
39
+
Iteration 13 : cost = 3.158448
40
+
Iteration 14 : cost = 2.573333
41
+
Iteration 15 : cost = 2.098461
42
+
Iteration 16 : cost = 1.710719
43
+
Iteration 17 : cost = 1.394245
44
+
Iteration 18 : cost = 1.136231
45
+
Iteration 19 : cost = 0.925994
46
+
Iteration 20 : cost = 0.754842
47
+
Iteration 21 : cost = 0.615388
48
+
Iteration 22 : cost = 0.501762
49
+
Iteration 23 : cost = 0.409169
50
+
Iteration 24 : cost = 0.333715
51
+
Iteration 25 : cost = 0.272221
52
+
Iteration 26 : cost = 0.222079
53
+
Iteration 27 : cost = 0.181186
54
+
Iteration 28 : cost = 0.147834
55
+
Iteration 29 : cost = 0.120628
56
+
Iteration 30 : cost = 0.098434
57
+
Iteration 31 : cost = 0.080326
58
+
Iteration 32 : cost = 0.065552
59
+
Iteration 33 : cost = 0.053496
60
+
Iteration 34 : cost = 0.043659
61
+
</pre>
62
+
63
+
|Image| Result |
64
+
|:---:|:---: |
65
+
|mdb321.jpg|<imgsrc = 'result.png'>|
66
+
|mdb322.jpg|<imgsrc = 'result2.png'>|
67
+
68
+
69
+
## Troubleshooting:
70
+
1. If it is not an 8-bit image, the code needs to be modified.
71
+
2. When there is a problem with the environment, you can try this command line in your command prompt. <pre> pip install -r requirements.txt </pre>
72
+
73
+
## References
74
+
*[1][Z. Chen and R. Zwiggelaar "A Modified Fuzzy C Means Algorithm for Breast Tissue Density Segmentation in Mammograms." IEEE/Information Technology and Applications in Biomedicine (ITAB) 2010.](https://ieeexplore.ieee.org/document/5687751)
75
+
*[2][J. Song and Z. Zhang "A Modified Robust FCM Model with Spatial Constraints for Brain MR Image Segmentation." Information 2019.](https://www.researchgate.net/publication/331278874_A_Modified_Robust_FCM_Model_with_Spatial_Constraints_for_Brain_MR_Image_Segmentation)
76
+
*https://github.com/ab93/SIFCM
77
+
78
+
## TODO:
79
+
-[ ] It takes a lot of time to get the filtered image. This problem can be solved by using numpy.lib.stride_tricks.as_strided.
0 commit comments