if nargin == 0
data = uint8(0);
end
obj = obj@uint8(data); % Store data on superclass
end
function h = showImage(obj)
data = uint8(obj);
figure; colormap(gray(256))
h = imagesc(data,[0 255]);
axis image
brighten(.2)
end
end
end
Using the DocUint8 Class
Create DocUint8 Objects
The DocUint8 class provides a method to display all images stored as DocUint8 objects
in a consistent way. For example:
cir = imread('circuit.tif');
img1 = DocUint8(cir);
img1.showImage;
Subclasses of Built-In Types Without Properties