Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
David Youssefi
otb
Commits
74f2aed2
Commit
74f2aed2
authored
12 years ago
by
Otmane Lahlou
Browse files
Options
Downloads
Patches
Plain Diff
ENH: use the min/max of the histogram to limit the asymptotes
parent
d5269de5
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
Code/Visualization/otbHistogramActionHandler.h
+24
-6
24 additions, 6 deletions
Code/Visualization/otbHistogramActionHandler.h
with
24 additions
and
6 deletions
Code/Visualization/otbHistogramActionHandler.h
+
24
−
6
View file @
74f2aed2
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include
"otbCurves2DWidget.h"
#include
"otbCurves2DWidget.h"
#include
"otbVerticalAsymptoteCurve.h"
#include
"otbVerticalAsymptoteCurve.h"
#include
"itkNumericTraits.h"
namespace
otb
namespace
otb
{
{
...
@@ -129,14 +130,16 @@ public:
...
@@ -129,14 +130,16 @@ public:
if
(
m_ModifyLeft
)
if
(
m_ModifyLeft
)
{
{
double
tx
=
x
-
abcisseL
;
double
tx
=
x
-
abcisseL
;
if
(
m_LeftAsymptote
->
GetAbcisse
()
+
tx
<
m_RightAsymptote
->
GetAbcisse
())
double
newLeftAbcisse
=
m_LeftAsymptote
->
GetAbcisse
()
+
tx
;
if
(
newLeftAbcisse
<
m_RightAsymptote
->
GetAbcisse
()
&&
newLeftAbcisse
>=
m_MinimumAbcisse
)
{
{
m_LeftAsymptote
->
SetAbcisse
(
m_
LeftA
symptote
->
GetAbcisse
()
+
tx
);
m_LeftAsymptote
->
SetAbcisse
(
new
LeftA
bcisse
);
m_Curve
->
redraw
();
m_Curve
->
redraw
();
// Update The Rendering Function min and max
// Update The Rendering Function min and max
ParametersType
param
=
m_RenderingFunction
->
GetParameters
();
ParametersType
param
=
m_RenderingFunction
->
GetParameters
();
param
.
SetElement
(
2
*
m_Channel
,
m_
LeftA
symptote
->
GetAbcisse
()
+
tx
);
param
.
SetElement
(
2
*
m_Channel
,
new
LeftA
bcisse
);
param
.
SetElement
(
2
*
m_Channel
+
1
,
m_RightAsymptote
->
GetAbcisse
());
param
.
SetElement
(
2
*
m_Channel
+
1
,
m_RightAsymptote
->
GetAbcisse
());
m_RenderingFunction
->
SetParameters
(
param
);
m_RenderingFunction
->
SetParameters
(
param
);
}
}
...
@@ -145,15 +148,18 @@ public:
...
@@ -145,15 +148,18 @@ public:
if
(
m_ModifyRight
)
if
(
m_ModifyRight
)
{
{
double
tx
=
x
-
abcisseR
;
double
tx
=
x
-
abcisseR
;
if
(
m_RightAsymptote
->
GetAbcisse
()
+
tx
>
m_LeftAsymptote
->
GetAbcisse
())
double
newRightAbcisse
=
m_RightAsymptote
->
GetAbcisse
()
+
tx
;
//std::cout <<"right abcisse "<< newRightAbcisse << " max "<< m_MaximumAbcisse << std::endl;
if
(
newRightAbcisse
>
m_LeftAsymptote
->
GetAbcisse
()
&&
newRightAbcisse
<
m_MaximumAbcisse
)
{
{
m_RightAsymptote
->
SetAbcisse
(
m_
RightA
symptote
->
GetA
bcisse
()
+
tx
);
m_RightAsymptote
->
SetAbcisse
(
new
RightAbcisse
+
tx
);
m_Curve
->
redraw
();
m_Curve
->
redraw
();
// Update The Rendering Function min and max
// Update The Rendering Function min and max
ParametersType
param
=
m_RenderingFunction
->
GetParameters
();
ParametersType
param
=
m_RenderingFunction
->
GetParameters
();
param
.
SetElement
(
2
*
m_Channel
,
m_LeftAsymptote
->
GetAbcisse
());
param
.
SetElement
(
2
*
m_Channel
,
m_LeftAsymptote
->
GetAbcisse
());
param
.
SetElement
(
2
*
m_Channel
+
1
,
m_
RightA
symptote
->
GetAbcisse
()
+
tx
);
param
.
SetElement
(
2
*
m_Channel
+
1
,
new
RightA
bcisse
);
m_RenderingFunction
->
SetParameters
(
param
);
m_RenderingFunction
->
SetParameters
(
param
);
}
}
}
}
...
@@ -182,6 +188,12 @@ public:
...
@@ -182,6 +188,12 @@ public:
/** Set/Get the rendering Function */
/** Set/Get the rendering Function */
itkSetObjectMacro
(
RenderingFunction
,
RenderingFunctionType
);
itkSetObjectMacro
(
RenderingFunction
,
RenderingFunctionType
);
/** Set Extremum of the histogram (used as limit for the
* asymptotes). If not set, values are initialized to double type extremum
*/
itkSetMacro
(
MaximumAbcisse
,
double
);
itkSetMacro
(
MinimumAbcisse
,
double
);
/** Set/Get the channel dealed with in the image*/
/** Set/Get the channel dealed with in the image*/
itkSetMacro
(
Channel
,
unsigned
int
);
itkSetMacro
(
Channel
,
unsigned
int
);
...
@@ -192,6 +204,8 @@ protected:
...
@@ -192,6 +204,8 @@ protected:
m_Channel
=
0
;
m_Channel
=
0
;
m_ModifyLeft
=
false
;
m_ModifyLeft
=
false
;
m_ModifyRight
=
false
;
m_ModifyRight
=
false
;
m_MaximumAbcisse
=
itk
::
NumericTraits
<
double
>::
max
();
m_MinimumAbcisse
=
itk
::
NumericTraits
<
double
>::
NonpositiveMin
();
}
}
/** Destructor */
/** Destructor */
...
@@ -229,6 +243,10 @@ private:
...
@@ -229,6 +243,10 @@ private:
//Channel we're dealing handling
//Channel we're dealing handling
unsigned
int
m_Channel
;
unsigned
int
m_Channel
;
// extremum of the histogram used as limit for the abcisse
double
m_MaximumAbcisse
;
double
m_MinimumAbcisse
;
};
// end class
};
// end class
}
// end namespace otb
}
// end namespace otb
#endif
#endif
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