Skip to content

Commit 5b56ff3

Browse files
committed
rename xxxNumber methods to xxxCount
1 parent 205409a commit 5b56ff3

24 files changed

+165
-59
lines changed

src/@Image/catFrames.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function res = catFrames(obj, varargin)
2-
% Frame concatenation of several images.
2+
% Concatenate the frames of several time-lapse images.
33
%
44
% RES = catFrames(IMG1, IMG2)
55
%
@@ -10,12 +10,12 @@
1010
% show(res);
1111
%
1212
% See also
13-
% splitFrames, cat, catChannels
13+
% splitFrames, cat, catChannels, frameCount
1414
%
1515

1616
% ------
1717
% Author: David Legland
18-
% e-mail: david.legland@inra.fr
18+
% e-mail: david.legland@inrae.fr
1919
% Created: 2011-11-22, using Matlab 7.9.0.529 (R2009b)
2020
% Copyright 2011 INRA - Cepia Software Platform.
2121

src/@Image/channel.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function channel = channel(obj, index, varargin)
2-
%Returns a specific channel from a Vector Image.
2+
% Return a specific channel from a multi-channel Image.
33
%
44
% CHANNEL = channel(IMG, INDEX)
55
% Returns the channel indexed by INDEX in a vector or color image.
@@ -22,12 +22,12 @@
2222
% show(Image.createRGB(green, blue, red));
2323
%
2424
% See also
25-
% channelNumber, catChannels, splitChannels
25+
% channelCount, catChannels, splitChannels
2626
%
2727

2828
% ------
2929
% Author: David Legland
30-
% e-mail: david.legland@inra.fr
30+
% e-mail: david.legland@inrae.fr
3131
% Created: 2010-07-08, using Matlab 7.9.0.529 (R2009b)
3232
% Copyright 2010 INRA - Cepia Software Platform.
3333

src/@Image/channelCount.m

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
function nc = channelCount(this)
2+
% Returns the number of channels of the image.
3+
%
4+
% NC = channelNumber(IMG)
5+
% Returns the number of channels (color components, or spectral bands...)
6+
% of the input image. For grayscale or binary images, returns 1.
7+
%
8+
% Example
9+
% img = Image.read('peppers.png');
10+
% channelCount(img)
11+
% ans =
12+
% 3
13+
%
14+
% See also
15+
% size, channel
16+
%
17+
18+
% ------
19+
% Author: David Legland
20+
21+
% Created: 2010-11-17, using Matlab 7.9.0.529 (R2009b)
22+
% Copyright 2010 INRA - Cepia Software Platform.
23+
24+
nc = size(this.Data, 4);

src/@Image/channelNumber.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
function nc = channelNumber(this)
22
% Returns the number of channels of the image.
33
%
4+
% Deprecated: renamed as channelCount
5+
%
46
% NC = channelNumber(IMG)
57
% Returns the number of channels (color components, or spectral bands...)
68
% of the input image. For grayscale or binary images, returns 1.
@@ -21,4 +23,6 @@
2123
% Created: 2010-11-17, using Matlab 7.9.0.529 (R2009b)
2224
% Copyright 2010 INRA - Cepia Software Platform.
2325

26+
warning('deprecated, use ''channelCount'' instead');
27+
2428
nc = size(this.Data, 4);

src/@Image/createRGB.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function rgb = createRGB(red, green, blue)
2-
% Create a RGB color image.
2+
% Create a RGB color image from scalar channels.
33
%
44
% RGB = createRGB(DATA)
55
% Create a RGB image from data array DATA, using the third dimension as
@@ -17,11 +17,11 @@
1717
% createRGB
1818
%
1919
% See also
20-
% create, Image
20+
% create, Image, catChannels
2121

2222
% ------
2323
% Author: David Legland
24-
% e-mail: david.legland@inra.fr
24+
% e-mail: david.legland@inrae.fr
2525
% Created: 2010-11-25, using Matlab 7.9.0.529 (R2009b)
2626
% Copyright 2010 INRA - Cepia Software Platform.
2727

@@ -111,7 +111,7 @@
111111
if nd == 2
112112
dim = [dim 1];
113113
end
114-
newDim = [dim(1:3) 3 frameNumber(refImage)];
114+
newDim = [dim(1:3) 3 frameCount(refImage)];
115115

116116
% compute data type of image
117117
if isa(refImage, 'Image')

src/@Image/elementCount.m

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
function count = elementCount(obj)
2+
% Count the total number of elements (pixels or voxels).
3+
%
4+
% COUNT = elementCount(IMG)
5+
% COUNT = IMG.elementCount(IMG)
6+
%
7+
% Example
8+
% % number of pixels of a grayscale image
9+
% img = Image.read('cameraman.tif');
10+
% elementCount(img)
11+
% ans =
12+
% 65536
13+
% % equal to 256*256
14+
%
15+
% % number of pixels of a color image
16+
% img = Image.read('peppers.png');
17+
% elementCount(img)
18+
% ans =
19+
% 196608
20+
% % equal to 512*384
21+
%
22+
% % number of elements of a 3D grayscale image
23+
% img = Image.read('brainMRI.hdr');
24+
% elementCount(img)
25+
% ans =
26+
% 442368
27+
% % equal to 128*128*27
28+
%
29+
% See also
30+
% histogram, elementSize
31+
%
32+
33+
% ------
34+
% Author: David Legland
35+
36+
% Created: 2010-11-26, using Matlab 7.9.0.529 (R2009b)
37+
% Copyright 2010 INRA - Cepia Software Platform.
38+
39+
count = prod(obj.DataSize(1:3));

src/@Image/elementNumber.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
function count = elementNumber(obj)
22
% Count the total number of elements (pixels or voxels).
33
%
4+
% Deprecated, replaced by elementCount.
5+
%
46
% COUNT = elementNumber(IMG)
57
% COUNT = IMG.elementNumber(IMG)
68
%
@@ -36,4 +38,6 @@
3638
% Created: 2010-11-26, using Matlab 7.9.0.529 (R2009b)
3739
% Copyright 2010 INRA - Cepia Software Platform.
3840

41+
warning('deprecated, use ''elementCount'' instead');
42+
3943
count = prod(obj.DataSize(1:3));

src/@Image/elementSize.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
% 3 1
2020
%
2121
% See also
22-
% size, dataSize, channelNumber
22+
% size, dataSize, elementCount, channelCount, frameCount
2323
%
2424

2525
% ------
2626
% Author: David Legland
27-
% e-mail: david.legland@inra.fr
27+
% e-mail: david.legland@inrae.fr
2828
% Created: 2010-12-08, using Matlab 7.9.0.529 (R2009b)
2929
% Copyright 2010 INRA - Cepia Software Platform.
3030

src/@Image/frame.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
% frame
1010
%
1111
% See also
12-
% channel
12+
% splitFrames, catFrames, frameCount, channel
1313
%
1414

1515
% ------
1616
% Author: David Legland
17-
% e-mail: david.legland@inra.fr
17+
% e-mail: david.legland@inrae.fr
1818
% Created: 2010-12-08, using Matlab 7.9.0.529 (R2009b)
1919
% Copyright 2010 INRA - Cepia Software Platform.
2020

src/@Image/frameCount.m

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function nf = frameCount(obj)
2+
% Return the number of frames in the image.
3+
%
4+
% NF = frameCount(IMG);
5+
% or
6+
% NF = IMG.frameCount
7+
%
8+
%
9+
% Example
10+
% frameNumber
11+
%
12+
% See also
13+
% frame, channelCount, elementSize
14+
%
15+
16+
% ------
17+
% Author: David Legland
18+
19+
% Created: 2010-12-08, using Matlab 7.9.0.529 (R2009b)
20+
% Copyright 2010 INRA - Cepia Software Platform.
21+
22+
nf = obj.DataSize(5);

0 commit comments

Comments
 (0)