I create with this code a black square of zeros with a white vertical line of ones at the middle and I want to create a distance map with respect to this line but only at the left side of the vertical line. How can I do this? 

The following code yields a distance map on both sides of the line. 

```
c=zeros(500,500);
c(:,250)=1;
figure, imshow(c)

[D, idx]= bwdist(c,'euclidean')

```