File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -305,14 +305,22 @@ function setInnerData(obj, data)
305305
306306 function initImageType(obj )
307307 % Determines a priori the type of image
308- if islogical(obj .Data )
309- obj.Type = ' binary' ;
310- elseif isfloat(obj .Data )
311- obj.Type = ' intensity' ;
312- elseif obj .DataSize(4 ) == 3
313- obj.Type = ' color' ;
308+
309+ if obj .DataSize(4 ) == 1
310+ if islogical(obj .Data )
311+ obj.Type = ' binary' ;
312+ elseif ismember(class(obj .Data ), {' uint8' , ' uint16' , ' uint32' })
313+ obj.Type = ' grayscale' ;
314+ else
315+ obj.Type = ' intensity' ;
316+ end
317+
314318 elseif obj .DataSize(4 ) == 2
315319 obj.Type = ' complex' ;
320+
321+ elseif obj .DataSize(4 ) == 3
322+ obj.Type = ' color' ;
323+
316324 elseif obj .DataSize(4 ) > 3
317325 obj.Type = ' vector' ;
318326 end
You can’t perform that action at this time.
0 commit comments