Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lesion candidate extraction from a data set abstracted on a separate …
…function
- Loading branch information
1 parent
395eb47
commit cf68050
Showing
2 changed files
with
37 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
RedLesionDetection/util/candidate_detection/getLesionCandidatesFromDataset.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
function getLesionCandidatesFromDataset(image_path, masks_path, output_path, L0, step, L, K, px) | ||
|
||
% get image filenames | ||
img_names = getMultipleImagesFileNames(image_path); | ||
% get masks filenames | ||
mask_names = getMultipleImagesFileNames(masks_path); | ||
|
||
% For each of the images | ||
for i = 1 : length(img_names) | ||
|
||
fprintf('Extracting candidates from image %i/%i\n', i, length(img_names)); | ||
|
||
% open i-th image and its corresponding FOV mask, OD and vessel | ||
% segmentation | ||
I = imread(fullfile(image_path, img_names{i})); | ||
mask = imread(fullfile(masks_path, mask_names{i})); | ||
|
||
% get candidates | ||
tic | ||
[ current_candidates ] = getLesionCandidates(I, mask, L0, step, L, K, px); | ||
toc | ||
|
||
% get only the image name | ||
[~, filename, extension] = fileparts(img_names{i}); | ||
if (~strcmp(extension, '.gif')) | ||
filename = strcat(filename, '.gif'); | ||
end | ||
|
||
% save the image | ||
imwrite(current_candidates, fullfile(output_path, strcat(filename))); | ||
|
||
end |