Operations on Datafiles
Many standard Matlab operations are overloaded for variables of the datafile type. They are just stored as an operation inside the variable and only executed at the moment the datafile is converted into a dataset. All annotations like labels are preserved during the operation. In case of dyadic operations the annotation of the first datafile is used for the resulting datafile.
|Examples of standard |
Matlab operations applied to datafiles
|B = A([3 6 7],:)||Construct a new datafile with just the objects |
|C = [A;B]||Add the objects of datafile |
B to those of
B should be subsets of the same original datafile.
|B = A+7||Add |
7 to all elements of all objects of
|C = ((A>0.5).* A*7) + (A<=0.5).*A||Multiply all elements of |
A that are larger than
|mean(A,2)||Returns a column vector of object averages.|
|std(A,,2) ||Returns a column vector of object standard deviations.|
Matlab operators are defined for datafiles:
+, -, *, .*, .^ , /, , ./, |, &, ~, xor, abs
Dyadic operations like C = A+B have severe restrictions. They are only implemented for datafiles
B that refer to the same original datafile. So
B should both be the result of, most likely different, operations on the same underlying original datafile. For instance,
(C==1) & (im_unif(C)<0.9), which finds the inner contour pixels, is a valid operation as the two inputs
im_gauss(C)<0.9 refer to the same datafile
For dyadic operations the annotation of the first datafile is used for the resulting datafile. Dyadic operations of datafiles and arrays of doubles are supported, provided that the dimensions fit. So all objects should have the same size for operations like this.
The logic operations
>, >=, <, <=, =, ~=
applied to datafiles return binary images in case images are stored in the datafile.
Matlab commands are overloaded for datafiles are:
sqrt. Monadic operations not overloaded for datafiles can be defined by
B = filtm(A,'log10')
operations: basic, datasets, datafiles, mappings, classifiers, stacked, parallel, sequential, dyadic
commands: datasets, representation , classifiers, evaluation, clustering and regression, examples, support