Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 53466021 authored by Elian Dib's avatar Elian Dib
Browse files

Simplified slicing, added mirror states

parent 56ce10a4
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,6 @@ classdef Viewer < handle
end
properties(Dependent, Hidden)
state_
range_
end
......@@ -28,7 +27,7 @@ classdef Viewer < handle
classRange
currentRange
allRange
validStates = {'xy','uv','ux','vy'};
validStates = {'xy','uv','ux','vy','yx','vu','xu','yv'};
validRanges = {'class','current','all'};
end
......@@ -61,28 +60,6 @@ classdef Viewer < handle
obj.view;
end
function state_ = get.state_(obj)
nDims = ndims(obj.data);
if nDims<=5
switch lower(obj.state)
case 'xy'
state_ = [0,0,1,1,0];
case 'uv'
state_ = [1,1,0,0,0];
case 'ux'
state_ = [1,0,1,0,0];
case 'vy'
state_ = [0,1,0,1,0];
otherwise
error('Unexpected state');
end
state_ = state_(1:nDims);
else
error('Unexpected number of dimensions in input data');
end
end
function range_ = get.range_(obj)
switch lower(obj.range)
case 'class'
......@@ -135,7 +112,26 @@ classdef Viewer < handle
end
function updateSlices(obj)
obj.slices = LF.split(obj.data,obj.state_);
switch lower(obj.state)
case 'xu'
perm = [1,3,4,2,5];
case 'ux'
perm = [1,3,2,4,5];
case 'yv'
perm = [2,4,3,1,5];
case 'vy'
perm = [2,4,1,3,5];
case 'xy'
perm = [3,4,1,2,5];
case 'yx'
perm = [3,4,2,1,5];
case 'uv'
perm = [1,2,3,4,5];
case 'vu'
perm = [2,1,3,4,5];
end
obj.slices = LF.split(permute(obj.data,perm));
end
function updateFigure(obj)
......@@ -152,7 +148,7 @@ classdef Viewer < handle
title(title_);
cv = num2cell(obj.curView);
obj.im.CData = obj.slices{cv{:}};
obj.im.AlphaData = double(any(~isnan(obj.im.CData),3));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment