a b/Image Segmentation/Image Utility Functions/extraction/createMasks.m
1
function [ images ] = createMasks(images)
2
%extractNodules takes the original image and all segmentations on the image
3
%and extracts the structure provided by the segmentation
4
%   param orgImage
5
%       a the original image that will be segmented
6
% 
7
% 
8
%   param segmentedImages
9
%       a cell array of each image segmentation
10
%   
11
    %% Pre-process
12
    %Get the size of images
13
    dimensions = size(images);
14
    imageTotal = dimensions(2);
15
    
16
 
17
    %% Extraction of the nodules
18
    %I want a factory
19
    for i=1:imageTotal
20
        %check to see if otsu and extract that
21
        if(strcmp(images(i).segmentationType,'otsu')) 
22
        %run through all otsu image segmentations and extract the nodule
23
           images(i).masks = maskCreationOtsu( images(i).segmentations);
24
        %check to see if region growing and run region growing                   
25
        else if(strcmp(images(i).segmentationType,'rg'))
26
           %run through all region growing image segmentations 
27
           %extract the nodule
28
           images(i).masks = ...
29
                maskCreationRegionGrowing(images(i).segmentations);
30
            end
31
        end
32
    end
33
34
end
35