[26740] | 1 | Index: ../trunk-jpl/src/m/modules/ExpToLevelSet.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/modules/ExpToLevelSet.m (revision 26540)
|
---|
| 4 | +++ ../trunk-jpl/src/m/modules/ExpToLevelSet.m (revision 26541)
|
---|
| 5 | @@ -13,37 +13,37 @@
|
---|
| 6 |
|
---|
| 7 | % Check usage
|
---|
| 8 | if nargin~=3
|
---|
| 9 | - help ExpToLevelSet
|
---|
| 10 | - error('Wrong usage (see above)');
|
---|
| 11 | + help ExpToLevelSet
|
---|
| 12 | + error('Wrong usage (see above)');
|
---|
| 13 | end
|
---|
| 14 |
|
---|
| 15 | multipleShp = 0;
|
---|
| 16 |
|
---|
| 17 | if ischar(contourname),
|
---|
| 18 | - [path,name,ext]=fileparts(contourname);
|
---|
| 19 | - if strcmpi(ext,'.shp'),
|
---|
| 20 | - %read contour from shapefile
|
---|
| 21 | - contourname=shpread(contourname);
|
---|
| 22 | - if isstruct(contourname)
|
---|
| 23 | - multipleShp = size(contourname, 2);
|
---|
| 24 | - end
|
---|
| 25 | - end
|
---|
| 26 | + [path,name,ext]=fileparts(contourname);
|
---|
| 27 | + if strcmpi(ext,'.shp'),
|
---|
| 28 | + %read contour from shapefile
|
---|
| 29 | + contourname=shpread(contourname);
|
---|
| 30 | + if isstruct(contourname)
|
---|
| 31 | + multipleShp = size(contourname, 2);
|
---|
| 32 | + end
|
---|
| 33 | + end
|
---|
| 34 | end
|
---|
| 35 |
|
---|
| 36 | % Call mex module
|
---|
| 37 | if multipleShp>0
|
---|
| 38 | - % shp file contains multiple contours
|
---|
| 39 | - distance = zeros(length(x)+1, multipleShp);
|
---|
| 40 | - for i = 1:multipleShp
|
---|
| 41 | - distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
|
---|
| 42 | - % append the NAME information at the end of the distance
|
---|
| 43 | - if isfield(contourname(i),'NAME')
|
---|
| 44 | - distance(end, i) = contourname(i).NAME;
|
---|
| 45 | - else
|
---|
| 46 | + % shp file contains multiple contours
|
---|
| 47 | + distance = zeros(length(x)+1, multipleShp);
|
---|
| 48 | + for i = 1:multipleShp
|
---|
| 49 | + distance(1:end-1, i) = ExpToLevelSet_matlab(x,y,contourname(i));
|
---|
| 50 | + % append the NAME information at the end of the distance
|
---|
| 51 | + if isfield(contourname(i),'NAME')
|
---|
| 52 | + distance(end, i) = contourname(i).NAME;
|
---|
| 53 | + else
|
---|
| 54 | distance(end, i) = i;
|
---|
| 55 | - end
|
---|
| 56 | - end
|
---|
| 57 | + end
|
---|
| 58 | + end
|
---|
| 59 | else
|
---|
| 60 | - % single shape or exp file
|
---|
| 61 | - distance = ExpToLevelSet_matlab(x,y,contourname);
|
---|
| 62 | + % single shape or exp file
|
---|
| 63 | + distance = ExpToLevelSet_matlab(x,y,contourname);
|
---|
| 64 | end
|
---|