Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
b3530da1
Commit
b3530da1
authored
Feb 21, 2008
by
Julien Michel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
suite de l'intégration des histogrammes.
parent
06fb03a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
29 deletions
+26
-29
Code/Visu/otbHistogramAndTransfertFunctionWidget.txx
Code/Visu/otbHistogramAndTransfertFunctionWidget.txx
+16
-16
Code/Visu/otbImageViewer.txx
Code/Visu/otbImageViewer.txx
+1
-4
Code/Visu/otbImageViewerFullWidget.h
Code/Visu/otbImageViewerFullWidget.h
+1
-1
Code/Visu/otbImageViewerHistogramAndTransfertFunctionWidget.h
.../Visu/otbImageViewerHistogramAndTransfertFunctionWidget.h
+7
-7
Code/Visu/otbImageWidgetTransfertFunction.h
Code/Visu/otbImageWidgetTransfertFunction.h
+1
-1
No files found.
Code/Visu/otbHistogramAndTransfertFunctionWidget.txx
View file @
b3530da1
...
...
@@ -60,7 +60,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
m_MarginY = 30;
m_GridSizeX=5;
m_GridSizeY=5;
m_OutputHistogramMargin =
100
;
m_OutputHistogramMargin =
0.2
;
m_HistogramClamping = 1;
m_Updating = false;
}
...
...
@@ -114,7 +114,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
y=static_cast<double>(i)*gridYSpacing+m_MarginY;
x=m_MarginX;
glVertex2d(x,y);
x = static_cast<double>(this->w())-m_MarginX-m_OutputHistogramMargin;
x = static_cast<double>(this->w())-m_MarginX-m_OutputHistogramMargin
*static_cast<double>(this->w())
;
glVertex2d(x,y);
}
glEnd();
...
...
@@ -130,7 +130,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
glVertex2d(m_MarginX,m_MarginY);
glVertex2d(m_MarginX,static_cast<double>(this->h())-m_MarginY/2);
glVertex2d(m_MarginX,m_MarginY);
glVertex2d(static_cast<double>(this->w())-m_MarginX/2-m_OutputHistogramMargin,m_MarginY);
glVertex2d(static_cast<double>(this->w())-m_MarginX/2-m_OutputHistogramMargin
*static_cast<double>(this->w())
,m_MarginY);
glEnd();
}
...
...
@@ -176,15 +176,15 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
glBegin(GL_LINES);
double factor = (m_Histogram->Quantile(0,1.)-m_Histogram->Quantile(0,0.))
/(static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin);
/(static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin
*static_cast<double>(this->w())
);
x = m_MarginX + static_cast<double>(m_TransfertFunction->GetLowerBound())/factor;
x = m_MarginX + static_cast<double>(m_TransfertFunction->GetLowerBound()
-m_Histogram->Quantile(0,0.)
)/factor;
y = m_MarginY;
glVertex2d(x,y);
y = static_cast<double>(this->h())-m_MarginY;
glVertex2d(x,y);
x = m_MarginX + static_cast<double>(m_TransfertFunction->GetUpperBound())/factor;
x = m_MarginX + static_cast<double>(m_TransfertFunction->GetUpperBound()
-m_Histogram->Quantile(0,0.)
)/factor;
glVertex2d(x,y);
y= m_MarginY;
glVertex2d(x,y);
...
...
@@ -240,7 +240,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
double x,y;
double step = (m_Histogram->Quantile(0,1.)-m_Histogram->Quantile(0,0.))
/static_cast<double>(m_Histogram->GetSize()[0]);
double xscale = (static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin)/static_cast<double>(m_Histogram->GetSize()[0]);
double xscale = (static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin
*static_cast<double>(this->w())
)/static_cast<double>(m_Histogram->GetSize()[0]);
double yscale = (static_cast<double>(this->h())-2*m_MarginY)/255.;
for(unsigned int i=0;i<m_Histogram->Size()+1;++i)
{
...
...
@@ -287,7 +287,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
otb::GluPolygonDrawingHelper drawer;
double binWidth = (static_cast<double>(this->h())-2*m_MarginY)/255.;
double binLengthRatio = m_HistogramClamping*m_OutputHistogramMargin/static_cast<double>(maxFrequency);
double binLengthRatio = m_HistogramClamping*m_OutputHistogramMargin
*static_cast<double>(this->w())
/static_cast<double>(maxFrequency);
double starty = m_MarginY;
...
...
@@ -298,28 +298,28 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
drawer.BeginPolygon();
drawer.BeginContour();
x =static_cast<double>(this->w())-m_OutputHistogramMargin-m_MarginX/2;
x =static_cast<double>(this->w())-m_OutputHistogramMargin
*static_cast<double>(this->w())
-m_MarginX/2;
y = starty;
drawer.Vertex2d(x,y);
x += binLengthRatio*static_cast<double>((*vit)> maxFrequency/m_HistogramClamping ? maxFrequency/m_HistogramClamping : (*vit));
drawer.Vertex2d(x,y);
y += binWidth;
drawer.Vertex2d(x,y);
x =static_cast<double>(this->w())-m_OutputHistogramMargin-m_MarginX/2;
x =static_cast<double>(this->w())-m_OutputHistogramMargin
*static_cast<double>(this->w())
-m_MarginX/2;
drawer.Vertex2d(x,y);
drawer.EndContour();
drawer.EndPolygon();
}
}
glBegin(GL_LINE_LOOP);
x = static_cast<double>(this->w())-m_OutputHistogramMargin-m_MarginX/2;
x = static_cast<double>(this->w())-m_OutputHistogramMargin
*static_cast<double>(this->w())
-m_MarginX/2;
y = m_MarginY;
glVertex2d(x,y);
x+=m_OutputHistogramMargin;
x+=m_OutputHistogramMargin
*static_cast<double>(this->w())
;
glVertex2d(x,y);
y = static_cast<double>(this->h())-m_MarginY;
glVertex2d(x,y);
x = static_cast<double>(this->w())-m_OutputHistogramMargin-m_MarginX/2;
x = static_cast<double>(this->w())-m_OutputHistogramMargin
*static_cast<double>(this->w())
-m_MarginX/2;
glVertex2d(x,y);
glEnd();
}
...
...
@@ -332,7 +332,7 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
{
//rendering label
gl_font(FL_COURIER_BOLD,12);
gl_draw(m_TransfertFunctionLabel.c_str(),static_cast<float>(this->w()-m_MarginX/2-m_OutputHistogramMargin),static_cast<float>(m_MarginY/2));
gl_draw(m_TransfertFunctionLabel.c_str(),static_cast<float>(this->w()-m_MarginX/2-m_OutputHistogramMargin
*static_cast<double>(this->w())
),static_cast<float>(m_MarginY/2));
}
...
...
@@ -364,9 +364,9 @@ HistogramAndTransfertFunctionWidget<THistogram,TPixel>
}
}
double binWidth = static_cast<double>(this->w()-2*m_MarginX-m_OutputHistogramMargin)/static_cast<double>(m_Histogram->GetSize()[0]);
double binWidth = static_cast<double>(this->w()-2*m_MarginX-m_OutputHistogramMargin
*static_cast<double>(this->w())
)/static_cast<double>(m_Histogram->GetSize()[0]);
double binHeightRatio = m_HistogramClamping*static_cast<double>(this->h()-2*m_MarginY)/static_cast<double>(maxFrequency);
double gridXSpacing = (static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin)/static_cast<double>(m_GridSizeX);
double gridXSpacing = (static_cast<double>(this->w())-2*m_MarginX-m_OutputHistogramMargin
*static_cast<double>(this->w())
)/static_cast<double>(m_GridSizeX);
double gridYSpacing = (static_cast<double>(this->h())-2*m_MarginY)/static_cast<double>(m_GridSizeY);
OpenGlSetup();
...
...
Code/Visu/otbImageViewer.txx
View file @
b3530da1
...
...
@@ -145,10 +145,7 @@ namespace otb
m_ScrollWindow->resizable(this->GetScrollWidget());
m_ScrollWindow->end();
}
int wzoom = this->GetZoomWidget()->w();
int hzoom = this->GetZoomWidget()->h();
// Create the zoom window
std::string zoomLabel=this->GetLabel();
zoomLabel.append(" - Zoom Window (X4)");
...
...
Code/Visu/otbImageViewerFullWidget.h
View file @
b3530da1
...
...
@@ -323,8 +323,8 @@ class ITK_EXPORT ImageViewerFullWidget
}
return
1
;
}
}
return
0
;
}
}
virtual
int
handle
(
int
event
)
...
...
Code/Visu/otbImageViewerHistogramAndTransfertFunctionWidget.h
View file @
b3530da1
...
...
@@ -74,9 +74,9 @@ class ITK_EXPORT ImageViewerHistogramAndTransfertFunctionWidget
virtual
int
handle
(
int
event
)
{
double
factor
=
(
this
->
GetHistogram
()
->
Quantile
(
0
,
1.
)
-
this
->
GetHistogram
()
->
Quantile
(
0
,
0.
))
/
(
static_cast
<
double
>
(
this
->
w
())
-
2
*
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
());
double
xupper
=
this
->
GetMarginX
()
+
static_cast
<
double
>
(
this
->
GetTransfertFunction
()
->
GetUpperBound
())
/
factor
;
double
xlower
=
this
->
GetMarginX
()
+
static_cast
<
double
>
(
this
->
GetTransfertFunction
()
->
GetLowerBound
())
/
factor
;
/
(
static_cast
<
double
>
(
this
->
w
())
-
2
*
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
()
*
static_cast
<
double
>
(
this
->
w
())
);
double
xupper
=
this
->
GetMarginX
()
+
static_cast
<
double
>
(
this
->
GetTransfertFunction
()
->
GetUpperBound
()
-
this
->
GetHistogram
()
->
Quantile
(
0
,
0.
)
)
/
factor
;
double
xlower
=
this
->
GetMarginX
()
+
static_cast
<
double
>
(
this
->
GetTransfertFunction
()
->
GetLowerBound
()
-
this
->
GetHistogram
()
->
Quantile
(
0
,
0.
)
)
/
factor
;
switch
(
event
)
{
case
FL_PUSH
:
...
...
@@ -107,16 +107,16 @@ class ITK_EXPORT ImageViewerHistogramAndTransfertFunctionWidget
{
double
x
=
Fl
::
event_x
();
if
(
m_ModifyLower
&&
(
x
>
this
->
GetMarginX
())
&&
(
x
<
static_cast
<
double
>
(
this
->
w
())
-
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
()))
if
(
m_ModifyLower
&&
(
x
>
this
->
GetMarginX
())
&&
(
x
<
static_cast
<
double
>
(
this
->
w
())
-
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
()
*
static_cast
<
double
>
(
this
->
w
())
))
{
x
=
(
x
>
xupper
?
xupper
:
x
);
this
->
GetTransfertFunction
()
->
SetLowerBound
(
static_cast
<
PixelType
>
((
x
-
this
->
GetMarginX
())
*
factor
));
this
->
GetTransfertFunction
()
->
SetLowerBound
(
static_cast
<
PixelType
>
(
this
->
GetHistogram
()
->
Quantile
(
0
,
0.
)
+
(
x
-
this
->
GetMarginX
())
*
factor
));
this
->
redraw
();
}
else
if
(
m_ModifyUpper
&&
(
x
<
static_cast
<
double
>
(
this
->
w
())
-
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
()))
else
if
(
m_ModifyUpper
&&
(
x
<
static_cast
<
double
>
(
this
->
w
())
-
this
->
GetMarginX
()
-
this
->
GetOutputHistogramMargin
()
*
static_cast
<
double
>
(
this
->
w
())
))
{
x
=
(
x
<
xlower
?
xlower
:
x
);
this
->
GetTransfertFunction
()
->
SetUpperBound
(
static_cast
<
PixelType
>
((
x
-
this
->
GetMarginX
())
*
factor
));
this
->
GetTransfertFunction
()
->
SetUpperBound
(
static_cast
<
PixelType
>
(
this
->
GetHistogram
()
->
Quantile
(
0
,
0.
)
+
(
x
-
this
->
GetMarginX
())
*
factor
));
this
->
redraw
();
}
return
1
;
...
...
Code/Visu/otbImageWidgetTransfertFunction.h
View file @
b3530da1
...
...
@@ -56,7 +56,7 @@ class ITK_EXPORT ImageWidgetTransfertFunction
* \param value the value to map
* \return the screen printable value
*/
virtual
unsigned
char
Map
(
PixelType
value
){};
virtual
unsigned
char
Map
(
PixelType
value
){
return
0
;
};
protected:
/** Constructor */
...
...
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