Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LightFieldCodingLibrary
LF
Commits
53466021
Commit
53466021
authored
6 years ago
by
Elian Dib
Browse files
Options
Downloads
Patches
Plain Diff
Simplified slicing, added mirror states
parent
56ce10a4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
@Viewer/Viewer.m
+22
-26
22 additions, 26 deletions
@Viewer/Viewer.m
with
22 additions
and
26 deletions
@Viewer/Viewer.m
+
22
−
26
View file @
53466021
...
...
@@ -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
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment