-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from UniBoDS4H/fix/api/algorithms-search
Feat/api/largest-segmentation
- Loading branch information
Showing
13 changed files
with
76 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
function res = getLargestSegmentation(segmentations) | ||
function res = algorithm_getLargestSegmentation(segmentations) | ||
% AUTHOR: Lorenzo Drudi (E-mail: lorenzo.drudi5@studio.unibo.it) | ||
% DATE: March 24, 2022 | ||
% NAME: TDSFT (version 1.0) | ||
% | ||
% PARAMETERS: | ||
% segmentations: the aligned segmentations to be fused together | ||
% | ||
% OUTPUT: | ||
% res: the resulting segmentation | ||
% | ||
% DESCRIPTION: | ||
% Fuse all the segmentations together overlapping them and getting the largest possible segmentation which contains all the inputs. | ||
% | ||
|
||
% initialize the overlap | ||
|
||
disp('Getting the largest segmentation...'); | ||
|
||
first = segmentations{1}; | ||
[m,n] = size(first); | ||
overlap = zeros(m, n, 'uint8'); | ||
|
||
% overlap all the segmentations | ||
for i=1:length(segmentations) | ||
seg = uint8(~segmentations{i}); | ||
overlap = overlap + seg; | ||
end | ||
|
||
overlap = imbinarize(overlap); | ||
overlap = uint8(~overlap); | ||
|
||
% fill the resulting segmentation and get the perimeter | ||
fillOverlap = imfill(overlap, 'holes'); | ||
res = bwperim(fillOverlap); | ||
end |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function res = localMapStaple(segmentations) | ||
function res = algorithm_localMapStaple(segmentations) | ||
fprintf('Local map staple selected\n'); | ||
end |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
function res = staple(segmentations) | ||
function res = algorithm_staple(segmentations) | ||
fprintf('Staple selected\n'); | ||
end |
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,18 @@ | ||
function res = computeFusion(segmentations, algorithm) | ||
% AUTHOR: Lorenzo Drudi (E-mail: lorenzo.drudi5@studio.unibo.it) | ||
% DATE: March 20, 2022 | ||
% NAME: TDSFT (version 1.0) | ||
% | ||
% PARAMETERS: | ||
% segmentations: the segmentations to be fused. | ||
% algorithm: the algorithm to be used for the fusion process. | ||
% | ||
% OUTPUT: | ||
% res: the result of the fusion process. | ||
% | ||
% DESCRIPTION: | ||
% Fuse the segmentations using the specified algorithm. | ||
algorithmName = getAlgorithmFullName(algorithm); | ||
fun = str2func(algorithmName); | ||
res = fun(alignedSegmentations); | ||
end |
File renamed without changes.
File renamed without changes.
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,16 @@ | ||
function fullName = getAlgorithmFullName(algorithm) | ||
% AUTHOR: Lorenzo Drudi (E-mail: lorenzo.drudi5@studio.unibo.it) | ||
% DATE: March 24, 2022 | ||
% NAME: TDSFT (version 1.0) | ||
% | ||
% PARAMETERS: | ||
% algorithm: algorithm name. | ||
% | ||
% OUTPUT: | ||
% fullName: fullName of the algorithm. | ||
% DESCRIPTION: | ||
% Get the full name of the specified algorithm. | ||
% FullName: 'algorithm_' + algorithmName. | ||
|
||
fullName = strcat('algorithm_', algorithm); | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Binary file not shown.
Binary file not shown.