Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jens Krüger
Lima
Commits
448444ea
Commit
448444ea
authored
Sep 07, 2012
by
Sebastien Petitdemange
Browse files
Add protection when when new binning is uncompatible with old roi
parent
dcce0723
Changes
1
Hide whitespace changes
Inline
Side-by-side
control/src/CtImage.cpp
View file @
448444ea
...
...
@@ -250,6 +250,10 @@ void CtHwBinRoiFlip::setBin(Bin& bin, bool round)
if
((
!
round
)
&&
(
set_bin
!=
bin
))
THROW_CTL_ERROR
(
InvalidValue
)
<<
"Given hardware binning not possible"
;
if
(
set_bin
!=
m_bin
)
{
Bin
old_bin
=
m_bin
;
Roi
old_roi
=
m_set_roi
;
Roi
old_max_roi
=
m_max_roi
;
if
(
!
m_set_roi
.
isEmpty
())
m_set_roi
=
m_set_roi
.
getUnbinned
(
m_bin
);
...
...
@@ -259,7 +263,18 @@ void CtHwBinRoiFlip::setBin(Bin& bin, bool round)
if
(
!
m_bin
.
isOne
()
&&
!
m_set_roi
.
isEmpty
())
m_set_roi
=
m_set_roi
.
getBinned
(
m_bin
);
m_max_roi
.
setSize
(
m_max_size
/
m_bin
);
_updateSize
();
try
{
_updateSize
();
}
catch
(
Exception
&
exc
)
{
m_bin
=
old_bin
;
m_set_roi
=
old_roi
;
m_max_roi
=
old_max_roi
;
m_hw_bin
->
setBin
(
m_bin
);
throw
exc
;
}
}
bin
=
set_bin
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment