Clear Filters
Clear Filters

Classification of Brain tumor

9 views (last 30 days)
Sehrish on 10 Jul 2012
Edited: Image Analyst on 26 Dec 2020
I am working on a project of Brain tumor detection. I have extracted the tumor using k means clustering, can anyone tell me how can i classify the tumor as benign or malignant, or calculate the stage of tumor depending upon the features like area, solidity etc. during searching i have found about Knnclassify, can any one tell me how can i use it
sam  CP
sam CP on 17 Mar 2017
Edited: sam CP on 17 Mar 2017
I would like to apply SVM Classifier for detection..I am looking for the syntax for that

Sign in to comment.

Answers (3)

Image Analyst
Image Analyst on 10 Jul 2012
Although I've worked in radiology, I'm not a radiologist. I suggest you ask one to see if there are any visual clues that can distinguish a benign tumor from a malignant one. Or ask a pathologist if you're looking at biopsies instead of radiological images.
When I worked in radiology they didn't even like software to claim to make diagnoses (usurping their job). Software engineers were also reluctant to do so because of liability concerns. Would you want your software to claim it was benign, only to be sued when it turned out the patient died because it was actually malignant?

Ryan on 14 Jul 2012
In addition to IA's answer, this seems to be a question requesting a novel idea of how to differentiate tumor types accurately using current MRI technology. Honestly, if I knew how to do that I would not tell you how to do it and would instead write the program myself and copyright it.

Walter Roberson
Walter Roberson on 22 Jul 2012
The people I worked with found that it was much more effective to make classifications based upon MRS (Magnetic Resonance Spectroscopy) rather than MRI (Magnetic Resonance Imaging). We pretty much dropped automated MRI classification somewhere around a dozen years ago. The clues we were able to dig out of the relative chemical composition (MRS) often found signature chemical differences that could not be visually distinguished.
Ritesh Barache
Ritesh Barache on 26 Dec 2020
sir i am classifying brain tumor using cnn. i am not able to understand how i can resize my images in datastore and pass to cnn classifier????? sir plz help me
Image Analyst
Image Analyst on 26 Dec 2020
Edited: Image Analyst on 26 Dec 2020
You could use a script like this:
% Resizes images to a size of 227x227, which AlexNet needs, and saves the resized images in a "Resized to 227x227" subfolder of the images folder.
clc; % Clear the command window.
fprintf('Beginning to run %s.m.\n', mfilename);
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 15;
% Specify the folder where the files live.
inputImagesFolder = 'D:\Ritesh\Original'; % Change it to whatever you need, if you want/need to.
% Check to make sure that folder actually exists. Warn user if it doesn't.
if ~isfolder(inputImagesFolder)
errorMessage = sprintf('Error: The following folder does not exist:\n\n%s\n\nPlease specify to an existing folder.', inputImagesFolder);
% Try to find the highest level folder in that path that DOES exist.
while ~isfolder(inputImagesFolder) && length(inputImagesFolder) > 3
[inputImagesFolder, ~, ~] = fileparts(inputImagesFolder);
% Should have a good starting folder now.
inputImagesFolder = uigetdir(inputImagesFolder);
if inputImagesFolder == 0
% Create output folder
outputImagesFolder = fullfile(inputImagesFolder, '/Resized to 227x227');
if ~isfolder(outputImagesFolder)
% Get a list of all files in the folder with the desired file name pattern.
filePattern = fullfile(inputImagesFolder, '*.jpg'); % Change to whatever pattern you need.
theFiles = dir(filePattern)
numFiles = length(theFiles);
hFig = figure;
hFig.WindowState = 'maximized';
for k = 1 : numFiles
% Get the input file name.
baseFileName = theFiles(k).name;
fullFileName = fullfile(inputImagesFolder, baseFileName);
% Get the output file name.
outputFullFileName = fullfile(outputImagesFolder, baseFileName);
fprintf(1, 'Now reading %d of %d "%s"\n', k, numFiles, fullFileName);
% Read in input image with imread().
inputImage = imread(fullFileName);
% Resize it.
outputImage = imresize(inputImage, [227, 227]);
% Display input and output images.
subplot(1, 2, 1);
imshow(inputImage); % Display image.
caption = sprintf('Input image (%d of %d):\n"%s", %d by %d', k, numFiles, baseFileName, size(inputImage, 1), size(inputImage, 2));
title(caption, 'FontSize', fontSize, 'Interpreter', 'none');
subplot(1, 2, 2);
imshow(outputImage); % Display image.
caption = sprintf('Output image: "%s", %d by %d', baseFileName, size(outputImage, 1), size(outputImage, 2));
title(caption, 'FontSize', fontSize, 'Interpreter', 'none');
drawnow; % Force display to update immediately.
% Write out the resized output file to the output folder.
imwrite(outputImage, outputFullFileName);
fprintf('Done running %s.m.\n', mfilename);
% Open the output folder in File Explorer.

Sign in to comment.


Find more on Particle & Nuclear Physics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!