Switch to unified view

a b/combinedDeepLearningActiveContour/functions/remap_mask.m
1
%-- re-map small mask to big mask
2
3
function out_mask = remap_mask(in_mask,m_cnt,I)
4
5
    [y_max, x_max]=size(I);
6
    
7
    M=size(in_mask,1);
8
       
9
    % center
10
    m_cnt_x=m_cnt(1);    
11
    m_cnt_y=m_cnt(2);
12
13
    
14
    % top left corner
15
    x1=m_cnt_x-M/2;
16
    y1=m_cnt_y-M/2;
17
18
    % bottom right corner
19
    x4=m_cnt_x+M/2-1;
20
    y4=m_cnt_y+M/2-1;
21
22
    out_mask=zeros(x_max,y_max);
23
    out_mask(y1:y4,x1:x4)=in_mask;
24
25
    
26
end