Clear Filters
Clear Filters

I'm trying to find a second tumor within my data but I can't

1 view (last 30 days)
my data contains three tumors where I was able to define the position of the first tumor by the max fuction however I can find the second max but the problem is that the force that is directly lower that the max force is also a part of that tumor but want I want is to skip all of these unnessacery forces that are part of that tumor and look for other tumors. I'll attach the picture so you can understand more ....
I appreciate any help thanks ...
  1 Comment
Image Analyst
Image Analyst on 19 Apr 2015
Please make it easy for us to help you by giving us code to read in the file. csvread() does not work. I'll check back later.

Sign in to comment.

Answers (2)

Image Analyst
Image Analyst on 18 Apr 2015
I'm not exactly sure what "skip all of these unnessacery forces that are part of that tumor and look for other tumors." means, but I'm guessing that imregionalmax() may be what you need.

Image Analyst
Image Analyst on 19 Apr 2015
Try this:
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
folder = pwd;
filename = 'tissue_sample_1.csv';
% [filename, folder] = uigetfile('*.csv');
fullFileName = fullfile(folder, filename);
Force = csvread(fullFileName,4,1);
x=max(Force); % to create an array containning max values within each coulmn First_Tumor=max(x);
[row,col] = find(Force == max(Force(:)));
position_of_first_Tumor=[row,col]
subplot(2, 2, 1);
imshow(Force, [], 'InitialMagnification', 600);
title('Original Grayscale Image', 'FontSize', fontSize);
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off')
% Let's compute and display the histogram.
[pixelCount, grayLevels] = hist(Force, 256);
subplot(2, 2, 2);
bar(grayLevels, pixelCount, 'BarWidth', 1, 'FaceColor', 'b');
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
% Find tumors by thresholding at 0.5
binaryImage = Force > 1.5;
subplot(2, 2, 3);
imshow(binaryImage, [], 'InitialMagnification', 600);
title('Thresholded Image', 'FontSize', fontSize);
% Find regional maxima
regionalMax = imextendedmax(Force, 1);
subplot(2, 2, 4);
imshow(regionalMax, [], 'InitialMagnification', 600);
title('Regional Max', 'FontSize', fontSize);

Categories

Find more on Image Processing Toolbox 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!