Skip to content

Commit d0943d5

Browse files
committed
better support of propagation of image name during processing
1 parent a824220 commit d0943d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+362
-131
lines changed

src/@Image/Image.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@
108108
methods(Access = protected)
109109

110110
se = defaultStructuringElement(obj, varargin)
111+
112+
name = createNewName(obj, pattern)
111113
end
112114

113115
%% Constructor declaration

src/@Image/abs.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212

1313
% ------
1414
% Author: David Legland
15-
% e-mail: david.legland@inra.fr
15+
% e-mail: david.legland@inrae.fr
1616
% Created: 2010-12-02, using Matlab 7.9.0.529 (R2009b)
1717
% Copyright 2010 INRA - Cepia Software Platform.
1818

19-
res = Image('data', abs(obj.Data), 'parent', obj);
19+
name = createNewName(obj, '%s-abs');
20+
res = Image('Data', abs(obj.Data), 'Parent', obj, 'Name', name);

src/@Image/adjustDynamic.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
res = cast(res, outputClass);
9494

9595
% create resulting Image
96-
res = Image('data', res, 'parent', obj);
96+
name = createNewName(obj, '%s-adjDyn');
97+
res = Image('Data', res, 'Parent', obj, 'Name', name);
9798

9899

99100
function [mini, maxi] = computeExtremeValues(data) %#ok<DEFNU>

src/@Image/angle.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function ang = angle(this)
2-
%Returns the phase angles, in radians, of an image with complex elements.
1+
function ang = angle(obj)
2+
% Return the phase angles, in radians, of an image with complex elements.
33
%
44
% PHASE = angle(I)
55
%
@@ -15,7 +15,10 @@
1515
% Created: 2017-09-29, using Matlab 9.3.0.713579 (R2017b)
1616
% Copyright 2017 INRA - Cepia Software Platform.
1717

18-
real = getBuffer(channel(this, 1));
19-
imag = getBuffer(channel(this, 2));
18+
% retrieve components
19+
imgA = channel(obj, 1);
20+
imgB = channel(obj, 2);
2021

21-
ang = Image(atan2(imag, real));
22+
% create result image
23+
name = createNewName(obj, '%s-angle');
24+
ang = Image('Data', atan2(imgA.Data, imgB.Data), 'Parent', obj, 'Name', name);

src/@Image/blackTopHat.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
dat = imbothat(obj.Data, varargin{1});
2626

2727
% create result image
28-
res = Image('data', dat, 'parent', obj);
28+
name = createNewName(obj, '%s-BTH');
29+
res = Image('Data', dat, 'Parent', obj, 'Name', name);

src/@Image/boundary.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,8 @@
9797
%% Process
9898

9999
% erode the structure and compare with original
100-
bnd = Image('data', op(obj.Data, se) ~= obj.Data, 'parent', obj);
100+
newData = op(obj.Data, se) ~= obj.Data;
101+
102+
% create result image
103+
name = createNewName(obj, '%s-bnd');
104+
bnd = Image('Data', newData, 'Parent', obj, 'Name', name);

src/@Image/boxFilter.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@
4040
end
4141

4242
% create result image
43-
res = Image('data', data, 'parent', obj);
43+
name = createNewName(obj, '%s-boxFilt');
44+
res = Image('Data', data, 'Parent', obj, 'Name', name);

src/@Image/cat.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@
2626
data = cat(dim, data, var.Data);
2727
end
2828

29-
res = Image('data', data, 'Parent', obj);
29+
name = createNewName(obj, '%s-cat');
30+
res = Image('data', data, 'Parent', obj, 'Name', name);

src/@Image/circshift.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
% show(res)
1010
%
1111
% See also
12-
%
12+
% fftshift
1313

1414
% ------
1515
% Author: David Legland
16-
% e-mail: david.legland@inra.fr
16+
% e-mail: david.legland@inrae.fr
1717
% Created: 2011-12-18, using Matlab 7.9.0.529 (R2009b)
1818
% Copyright 2011 INRA - Cepia Software Platform.
1919

2020
% process data buffer, using Matlab Image processing Toolbox
2121
data = circshift(obj.Data, varargin{:});
2222

2323
% create new image object for storing result
24-
res = Image.create('data', data, 'parent', obj);
24+
name = createNewName(obj, '%s-circshift');
25+
res = Image('Data', data, 'Parent', obj, 'Name', name);

src/@Image/closing.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
data = imclose(getBuffer(obj), varargin{:});
1919

2020
% create new image object for storing result
21-
res = Image(data, 'parent', obj);
21+
name = createNewName(obj, '%s-clo');
22+
res = Image(data, 'Parent', obj, 'Name', name);

0 commit comments

Comments
 (0)