function [val] = find_domain(index, rows, cols)
% Find subsect rectangle indices in the granul matix index

[m, n] = ind2sub([rows, cols], index);
val.row = [min(m), max(m)];
val.col = [min(n), max(n)];
val.row_size = val.row(2) - val.row(1) + 1;
val.col_size = val.col(2) - val.col(1) + 1;
