Skip to content

Commit f6ff64b

Browse files
committed
add FilePath property
1 parent ff44651 commit f6ff64b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/@Image/Image.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@
5050
% Image name, empty by default.
5151
Name = '';
5252

53+
% The path to the file containing the image, if relevant.
54+
% This property is set for images read from a file. It is usually not
55+
% kept in images resulting from operators.
56+
FilePath = '';
57+
5358
% Boolean flag indicating whether the image is calibrated or not.
5459
Calibrated = false;
5560

@@ -252,6 +257,7 @@ function copyFields(obj, that)
252257
% Does not copy the data buffer.
253258

254259
obj.Name = that.Name;
260+
% The "FileName" property is intentionnally not copied.
255261

256262
if isCompatibleType(obj, that.Type)
257263
obj.Type = that.Type;

src/@Image/read.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,6 @@
121121
img = Image(data);
122122
end
123123

124-
img.Name = [name ext];
124+
% populate additional meta-data
125+
img.Name = name;
126+
img.FilePath = fileName;

src/@Image/readSeries.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function img = readSeries(fileName, varargin)
2-
% Reads a series of 2D images as a 3D image.
2+
% Read a series of 2D images as a 3D image.
33
%
44
% Syntax:
55
% IMG = Image.readSeries(FILEPATH);
@@ -95,3 +95,7 @@
9595
end
9696

9797
img = Image('data', data, 'parent', img0);
98+
99+
% populate additional meta-data
100+
img.Name = name;
101+
img.FilePath = fileName;

0 commit comments

Comments
 (0)