diff --git a/scripts/markers2csv.m b/scripts/markers2csv.m index 3c11d96..d4e500d 100644 --- a/scripts/markers2csv.m +++ b/scripts/markers2csv.m @@ -2,16 +2,14 @@ % produced by imannotate software and outputs a csv file that represnets % all the datapoints that result from this data point. -INPUT_FOLDER = ''; -OUTPUT_FOLDER = ''; -INPUT_FOLDER = 'E:\phd\kingston\fundus_datasets\Messidor_Habib\groundtruth\MA\markers\'; -OUTPUT_FOLDER = 'E:\phd\kingston\fundus_datasets\Messidor_Habib\groundtruth\MA\csv\'; +INPUT_FOLDER = uigetdir('', 'Select the input folder') +OUTPUT_FOLDER = uigetdir('', 'Select the output folder') matfiles = ls([INPUT_FOLDER, '*.mat']); for i=1:size(matfiles,1) - result = {'category', 'shape', 'datapoint'}; + result = {'X', 'Y', 'radius', 'obvious', 'regular', 'subtle', 'close_to_vessel'}; matfile = matfiles(i,:); @@ -27,10 +25,13 @@ datapoints = markerPositions.(category).data; shape = markerPositions.(category).shape; - for k = 1:length(datapoints) datapoint = datapoints{k}; - result = [result; {category, shape, datapoint}]; + tag_ctv = markerPositions.(category).tags{k}.close_to_vessel; + tag_obvious = markerPositions.(category).tags{k}.obvious; + tag_regular = markerPositions.(category).tags{k}.subtle; + tag_subtle = markerPositions.(category).tags{k}.regular; + result = [result; {datapoint(1), datapoint(2), datapoint(3), tag_obvious, tag_regular, tag_subtle, tag_ctv }]; end end