gsunit / Pectoral-Muscle-Removal-From-Mammograms

Algorithm to segment pectoral muscles in breast mammograms
35 stars 6 forks source link

ValueError: the input array must have size 3 along `channel_axis`, got (354, 179, 4) #2

Open kevin801221 opened 1 year ago

kevin801221 commented 1 year ago

As the title, I face this problem "ValueError: the input array must have size 3 along channel_axis, got (354, 179, 4)". How to solve it? Can you update your source code please! Thank you.

RsGoksel commented 1 year ago

i think you are trying multiple images. Try convert your image to single 3D RGB array. I handled this error and it was like yours ( in my case the error was 2D problems)

kevin801221 commented 1 year ago

Can you teach me how to remove the muscle on CBIS-DDSM kaggle dataset(https://www.kaggle.com/datasets/awsaf49/cbis-ddsm-breast-cancer-image-dataset) in your code? Please

RsGoksel commented 1 year ago

Of course. I can share my experiences.

First of all, I did not use this data set, yet my data set is similar to this because it is a mammogram too. The First step was to transform dicom files to PNG files. I used the "linear stretching" algorithm for that. Second was, To reduce the load on the model, i reduced lower valued pixels from 0 (which was already lower than 15, make them all 0) in this way, I got more contrasted colors. These steps are important because removing the pectoral muscle algorithm worked flawlessly thanks to these steps.

Then I used the ROI (region of interest) algorithm for removing pectoral muscle from MLO typed images. You have to choose the correct values for that. For trimming to suit every different breast shape, I used all images width and height values. In this way, the algorithm worked well at most of the images. You can find similar studies for ROI at kaggle and github platforms. Have a good works.

kevin801221 @.***>, 16 Şub 2023 Per, 13:32 tarihinde şunu yazdı:

Can you teach me how to remove the muscle on CBIS-DDSM kaggle dataset( https://www.kaggle.com/datasets/awsaf49/cbis-ddsm-breast-cancer-image-dataset) in your code? Please

— Reply to this email directly, view it on GitHub https://github.com/gsunit/Pectoral-Muscle-Removal-From-Mammograms/issues/2#issuecomment-1432868366, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATHX5JXKRYM434HWP63QJ6TWXX63VANCNFSM6AAAAAAUKR5L34 . You are receiving this because you commented.Message ID: @.*** .com>

RsGoksel commented 1 year ago

Kevin. Did you accomplish your task ?

16 Şub 2023 Per 17:16 tarihinde Kadir Göksel Gündüz @.***> şunu yazdı:

Of course. I can share my experiences.

First of all, I did not use this data set, yet my data set is similar to this because it is a mammogram too. The First step was to transform dicom files to PNG files. I used the "linear stretching" algorithm for that. Second was, To reduce the load on the model, i reduced lower valued pixels from 0 (which was already lower than 15, make them all 0) in this way, I got more contrasted colors. These steps are important because removing the pectoral muscle algorithm worked flawlessly thanks to these steps.

Then I used the ROI (region of interest) algorithm for removing pectoral muscle from MLO typed images. You have to choose the correct values for that. For trimming to suit every different breast shape, I used all images width and height values. In this way, the algorithm worked well at most of the images. You can find similar studies for ROI at kaggle and github platforms. Have a good works.

kevin801221 @.***>, 16 Şub 2023 Per, 13:32 tarihinde şunu yazdı:

Can you teach me how to remove the muscle on CBIS-DDSM kaggle dataset( https://www.kaggle.com/datasets/awsaf49/cbis-ddsm-breast-cancer-image-dataset) in your code? Please

— Reply to this email directly, view it on GitHub https://github.com/gsunit/Pectoral-Muscle-Removal-From-Mammograms/issues/2#issuecomment-1432868366, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATHX5JXKRYM434HWP63QJ6TWXX63VANCNFSM6AAAAAAUKR5L34 . You are receiving this because you commented.Message ID: <gsunit/Pectoral-Muscle-Removal-From-Mammograms/issues/2/1432868366@ github.com>