Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
35
Issues
35
List
Boards
Labels
Milestones
JIRA
JIRA
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LimaGroup
Lima
Commits
596fc05f
Commit
596fc05f
authored
Nov 16, 2016
by
Laurent Claustre
Committed by
Sebastien Petitdemange
Dec 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctimage: fixed roi when software operation is activated (rotation,flip...)
parent
5112c03c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
27 deletions
+35
-27
common/VERSION
common/VERSION
+1
-1
control/src/CtImage.cpp
control/src/CtImage.cpp
+34
-26
No files found.
common/VERSION
View file @
596fc05f
1.6.
2
1.6.
3
control/src/CtImage.cpp
View file @
596fc05f
...
...
@@ -112,7 +112,7 @@ void CtSwBinRoiFlip::setRoi(const Roi& roi)
if
(
roi
.
isEmpty
())
THROW_CTL_ERROR
(
InvalidValue
)
<<
"Software roi is empty"
;
if
(
!
m_max_roi
.
containsRoi
(
roi
))
THROW_CTL_ERROR
(
InvalidValue
)
<<
"Roi out of limts"
;
THROW_CTL_ERROR
(
InvalidValue
)
<<
"Roi out of limits"
<<
DEB_VAR2
(
m_max_roi
,
roi
)
;
m_roi
=
roi
;
}
...
...
@@ -757,6 +757,8 @@ void CtImage::_setHSBin(const Bin &bin)
{
DEB_MEMBER_FUNCT
();
DEB_PARAM
()
<<
DEB_VAR1
(
bin
);
Roi
user_roi
;
getRoi
(
user_roi
);
Bin
user_bin
;
getBin
(
user_bin
);
if
(
m_hw
->
hasBinCapability
())
{
Bin
set_hw_bin
=
bin
;
...
...
@@ -768,7 +770,9 @@ void CtImage::_setHSBin(const Bin &bin)
Bin
set_sw_bin
=
bin
/
set_hw_bin
;
m_sw
->
setBin
(
set_sw_bin
);
}
_completeWithSoftRoi
(
m_hw
->
getSetRoi
(),
m_hw
->
getRealRoi
());
user_roi
=
user_roi
.
getUnbinned
(
user_bin
);
user_roi
=
user_roi
.
getBinned
(
bin
);
_completeWithSoftRoi
(
user_roi
,
m_hw
->
getRealRoi
());
}
else
{
m_sw
->
setBin
(
bin
);
}
...
...
@@ -794,15 +798,22 @@ void CtImage::_setHSRoi(const Roi &roi)
roi_unbin
=
roi
.
getUnbinned
(
bin_total
);
roi_by_hw
=
roi_unbin
.
getBinned
(
bin_by_hw
);
const
Size
&
max_roi_size
=
m_hw
->
getMaxRoiSize
();
// Remove the rotation to hardware Roi
RotationMode
aSoftwareRotation
=
m_sw
->
getRotation
();
roi_by_hw
=
roi_by_hw
.
getUnrotated
(
aSoftwareRotation
,
max_roi_size
);
// Remove the software Flip to hardware Roi
const
Flip
&
aSoftwareFlip
=
m_sw
->
getFlip
();
roi_by_hw
=
roi_by_hw
.
getFlipped
(
aSoftwareFlip
,
max_roi_size
);
roi_set_hw
=
roi_by_hw
;
m_hw
->
setRoi
(
roi_set_hw
,
true
);
DEB_TRACE
()
<<
DEB_VAR2
(
roi_by_hw
,
roi_set_hw
);
_completeWithSoftRoi
(
roi
_by_hw
,
roi_set_hw
);
_completeWithSoftRoi
(
roi
,
roi_set_hw
);
}
else
{
m_sw
->
setRoi
(
roi
);
}
...
...
@@ -813,30 +824,27 @@ void CtImage::_completeWithSoftRoi(Roi roi_set,Roi hw_roi)
DEB_MEMBER_FUNCT
();
DEB_PARAM
()
<<
DEB_VAR2
(
roi_set
,
hw_roi
);
if
(
roi_set
==
hw_roi
)
{
m_sw
->
resetRoi
();
}
else
{
const
Size
&
max_roi_size
=
m_hw
->
getMaxRoiSize
();
RotationMode
aSoftwareRotation
=
m_sw
->
getRotation
();
// Remove the rotation to hardware Roi
hw_roi
=
hw_roi
.
getUnrotated
(
aSoftwareRotation
,
max_roi_size
);
// Remove the software Flip to hardware Roi
const
Flip
&
aSoftwareFlip
=
m_sw
->
getFlip
();
hw_roi
=
hw_roi
.
getFlipped
(
aSoftwareFlip
,
max_roi_size
);
const
Size
&
max_roi_size
=
m_hw
->
getMaxRoiSize
();
// Apply software flip to hardware roi
roi_set
=
roi_set
.
getFlipped
(
aSoftwareFlip
,
max_roi_size
);
hw_roi
=
hw_roi
.
getFlipped
(
aSoftwareFlip
,
max_roi_size
);
//Apply software rotation to hardware roi
roi_set
=
roi_set
.
getRotated
(
aSoftwareRotation
,
max_roi_size
);
hw_roi
=
hw_roi
.
getRotated
(
aSoftwareRotation
,
max_roi_size
);
//Calc the roi by soft needed
Bin
bin_by_sw
=
m_sw
->
getBin
();
// First flip the hardware roi
const
Flip
&
aSoftwareFlip
=
m_sw
->
getFlip
();
Roi
hw_roi_ref_soft
=
hw_roi
.
getFlipped
(
aSoftwareFlip
,
max_roi_size
);
// than the rotation if needed to have the same referential than the soft roi
RotationMode
aSoftwareRotation
=
m_sw
->
getRotation
();
hw_roi_ref_soft
=
hw_roi_ref_soft
.
getRotated
(
aSoftwareRotation
,
max_roi_size
);
if
(
roi_set
.
isEmpty
()
||
roi_set
==
hw_roi_ref_soft
)
{
m_sw
->
resetRoi
();
}
else
{
Roi
roi_by_sw
;
roi_by_sw
=
hw_roi
.
subRoiAbs2Rel
(
roi_set
);
roi_by_sw
=
roi_by_sw
.
getBinned
(
bin_by_sw
);
if
(
hw_roi
.
isEmpty
())
roi_by_sw
=
roi_set
;
else
roi_by_sw
=
hw_roi_ref_soft
.
subRoiAbs2Rel
(
roi_set
);
m_sw
->
setRoi
(
roi_by_sw
);
DEB_TRACE
()
<<
DEB_VAR1
(
roi_by_sw
);
}
...
...
@@ -931,8 +939,8 @@ void CtImage::resetBin()
{
DEB_MEMBER_FUNCT
();
m_hw
->
resetBin
();
m_sw
->
resetBin
(
);
Bin
bin
(
1
,
1
);
setBin
(
bin
);
}
void
CtImage
::
resetRoi
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment