Skip to content

Commit

Permalink
various bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dlegland committed Jan 15, 2020
1 parent c42e1e5 commit 3d4f38e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/@Image/adjustDynamic.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
function [mini, maxi] = computeExtremeValues(data) %#ok<DEFNU>
% compute min and max (finite) values in image

mini = min(obj(isfinite(data)));
maxi = max(obj(isfinite(data)));
mini = min(data(isfinite(data)));
maxi = max(data(isfinite(data)));

% If the difference is too small, use default range check
if abs(maxi - mini) < 1e-12
Expand Down
2 changes: 1 addition & 1 deletion src/@Image/centroid.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
end

elseif nd == 3
dim = size(img);
dim = size(obj.Data);
for i = 1:nLabels
% extract points of the current particle
inds = find(obj.Data == labels(i));
Expand Down
2 changes: 1 addition & 1 deletion src/@Image/channel.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
if length(channelNames) == 1
newName = sprintf('%s-%s', obj.Name, channelNames{1});
else
newName = sprintf('%s-channels', obj.Name, channelName);
newName = sprintf('%s-channels', obj.Name);
end

% create a new Image
Expand Down
4 changes: 2 additions & 2 deletions src/@Image/char.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
% Created: 2010-12-09, using Matlab 7.9.0.529 (R2009b)
% Copyright 2010 INRA - Cepia Software Platform.

nd = getDimension(obj);
nd = ndims(obj);

pattern = repmat('%d x ', 1, nd);
pattern(end-2:end) = [];
pattern = [ pattern ' %s'];

string = sprintf(pattern, getSize(obj), class(obj));
string = sprintf(pattern, size(obj), class(obj));
8 changes: 4 additions & 4 deletions src/@Image/fileInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
%
% Currently supported file formats include:
% * all the formats recognized by the imread function (see imfinfo)
% * Analyze (see (see imfinfo))
% * Analyze (see analyze75info)
% * Dicom (see dicominfo)
% * MetaImage
% * MetaImage (from Kitware)
% * VGI
%
% Example
Expand All @@ -19,7 +19,7 @@

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% e-mail: david.legland@inrae.fr
% Created: 2019-08-22, using Matlab 9.6.0.1072779 (R2019a)
% Copyright 2019 INRA - Cepia Software Platform.

Expand All @@ -34,7 +34,7 @@
info = imfinfo(fileName);

case 'hdr'
info = c(fileName);
info = analyze75info(fileName);

case 'dicom'
info = dicominfo(fileName);
Expand Down
10 changes: 5 additions & 5 deletions src/@Image/unfold.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
function [tab, coordsTab] = unfold(obj)
% Unfold a vector image and returns Table instance.
function [data, coords] = unfold(obj)
% Unfold a vector image.
%
% TAB = unfold(VIMG);
% Unfold the vector image VIMG, and returns Table instance with as many
% Unfold the vector image VIMG, and returns an array with as many
% rows as the number of pixels in VIMG, and as many columns as the number
% of channels.
%
Expand Down Expand Up @@ -51,7 +51,7 @@

% create data table
data = reshape(obj.Data, [nr nc]);
tab = Table(data, colNames);
% tab = Table(data, colNames);

% optionnaly creates table of coordinates
if nargout > 1
Expand All @@ -60,6 +60,6 @@
ly = 1:size(obj, 2);
[y, x] = meshgrid(ly, lx);
coords = [reshape(x, [numel(x) 1]), reshape(y, [numel(x) 1])];
coordsTab = Table(coords, {'x', 'y'}, tab.RowNames);
% coordsTab = Table(coords, {'x', 'y'}, tab.RowNames);
end

0 comments on commit 3d4f38e

Please sign in to comment.