diff --git a/src/@Image/adjustDynamic.m b/src/@Image/adjustDynamic.m index 6452f60..9af75c2 100644 --- a/src/@Image/adjustDynamic.m +++ b/src/@Image/adjustDynamic.m @@ -99,8 +99,8 @@ function [mini, maxi] = computeExtremeValues(data) %#ok % 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 diff --git a/src/@Image/centroid.m b/src/@Image/centroid.m index 2a96393..a048f33 100644 --- a/src/@Image/centroid.m +++ b/src/@Image/centroid.m @@ -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)); diff --git a/src/@Image/channel.m b/src/@Image/channel.m index b649838..f7b2a3e 100644 --- a/src/@Image/channel.m +++ b/src/@Image/channel.m @@ -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 diff --git a/src/@Image/char.m b/src/@Image/char.m index a81d926..8427756 100644 --- a/src/@Image/char.m +++ b/src/@Image/char.m @@ -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)); diff --git a/src/@Image/fileInfo.m b/src/@Image/fileInfo.m index 02ab141..6e10524 100644 --- a/src/@Image/fileInfo.m +++ b/src/@Image/fileInfo.m @@ -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 @@ -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. @@ -34,7 +34,7 @@ info = imfinfo(fileName); case 'hdr' - info = c(fileName); + info = analyze75info(fileName); case 'dicom' info = dicominfo(fileName); diff --git a/src/@Image/unfold.m b/src/@Image/unfold.m index c29afb3..51656d2 100644 --- a/src/@Image/unfold.m +++ b/src/@Image/unfold.m @@ -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. % @@ -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 @@ -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 \ No newline at end of file