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
Container Registry
Model registry
Operate
Environments
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
Antoine Belvire
otb
Commits
330888a0
Commit
330888a0
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: otbStandardImageViewer moving the pixel information bar to the bottom
parent
492658fe
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Visualization/otbStandardImageViewer.h
+15
-13
15 additions, 13 deletions
Code/Visualization/otbStandardImageViewer.h
Code/Visualization/otbStandardImageViewer.txx
+22
-18
22 additions, 18 deletions
Code/Visualization/otbStandardImageViewer.txx
with
37 additions
and
31 deletions
Code/Visualization/otbStandardImageViewer.h
+
15
−
13
View file @
330888a0
...
...
@@ -47,10 +47,10 @@ namespace otb
/** \class StandardImageViewer
* \brief This class implements a standard visualization tool to be
* plugged at the end of a pipeline.
*
*
*/
template
<
class
TImage
,
class
TVectorData
=
VectorData
<
double
>
>
template
<
class
TImage
,
class
TVectorData
=
VectorData
<
double
>
>
class
StandardImageViewer
:
public
itk
::
Object
{
...
...
@@ -60,10 +60,10 @@ public:
typedef
itk
::
Object
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Method for creation through the object factory */
itkNewMacro
(
Self
);
/** Runtime information */
itkTypeMacro
(
StandardImageViewer
,
Object
);
...
...
@@ -79,12 +79,12 @@ public:
/** Output image type */
typedef
itk
::
RGBPixel
<
unsigned
char
>
RGBPixelType
;
typedef
Image
<
RGBPixelType
,
2
>
OutputImageType
;
/** Image layer type */
typedef
ImageLayer
<
ImageType
>
ImageLayerType
;
typedef
typename
ImageLayerType
::
Pointer
ImageLayerPointerType
;
typedef
typename
ImageLayerType
::
HistogramType
HistogramType
;
/** Image layer generator type */
typedef
ImageLayerGenerator
<
ImageLayerType
>
ImageLayerGeneratorType
;
typedef
typename
ImageLayerGeneratorType
::
Pointer
ImageLayerGeneratorPointerType
;
...
...
@@ -92,7 +92,7 @@ public:
/** Rendering model type */
typedef
ImageLayerRenderingModel
<
OutputImageType
>
RenderingModelType
;
typedef
typename
RenderingModelType
::
Pointer
RenderingModelPointerType
;
/** View type */
typedef
ImageView
<
RenderingModelType
>
ViewType
;
typedef
typename
ViewType
::
Pointer
ViewPointerType
;
...
...
@@ -100,7 +100,7 @@ public:
/** Widget controller */
typedef
ImageWidgetController
WidgetControllerType
;
typedef
typename
WidgetControllerType
::
Pointer
WidgetControllerPointerType
;
/** Curves 2D widget */
typedef
Curves2DWidget
CurvesWidgetType
;
typedef
typename
CurvesWidgetType
::
Pointer
CurvesWidgetPointerType
;
...
...
@@ -163,7 +163,7 @@ protected:
~
StandardImageViewer
();
/** Printself method */
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
{};
private
:
StandardImageViewer
(
const
Self
&
);
// purposely not implemented
void
operator
=
(
const
Self
&
);
// purposely not implemented
...
...
@@ -173,7 +173,7 @@ private:
/** Pointer to the image */
ImagePointerType
m_Image
;
/** Pointer to the VectorData */
VectorDataPointerType
m_VectorData
;
...
...
@@ -185,7 +185,7 @@ private:
/** The pixel description model */
PixelDescriptionModelPointerType
m_PixelDescriptionModel
;
/** The view */
ViewPointerType
m_View
;
...
...
@@ -215,12 +215,14 @@ private:
/** Intial sizes */
int
m_Width
;
int
m_Height
;
int
m_SideBarWidth
;
};
// end class
int
m_BottomBarHeight
;
};
// end class
}
// end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
...
...
This diff is collapsed.
Click to expand it.
Code/Visualization/otbStandardImageViewer.txx
+
22
−
18
View file @
330888a0
...
...
@@ -23,11 +23,15 @@
namespace otb
{
template <class TImage,class TVectorData>
template <class TImage,class TVectorData>
StandardImageViewer<TImage,TVectorData>
::StandardImageViewer() : m_Label("Default label"), m_Image(), m_VectorData(), m_ImageLayer(), m_RenderingModel(),m_PixelDescriptionModel(),
m_View(), m_PixelDescriptionView(), m_CurveWidget(), m_Controller(), m_RenderingFunction(), m_Window(),
m_FullGroup(),m_SideGroup(),m_Tile(),m_Width(800),m_Height(600), m_SideBarWidth(200)
::StandardImageViewer() : m_Label("Default label"), m_Image(), m_VectorData(),
m_ImageLayer(), m_RenderingModel(),m_PixelDescriptionModel(),
m_View(), m_PixelDescriptionView(), m_CurveWidget(),
m_Controller(), m_RenderingFunction(), m_Window(),
m_FullGroup(), m_SideGroup(), m_Tile(),
m_Width(800), m_Height(600),
m_SideBarWidth(200), m_BottomBarHeight(50)
{
// Build a new rendering model
m_RenderingModel = RenderingModelType::New();
...
...
@@ -43,7 +47,7 @@ StandardImageViewer<TImage,TVectorData>
// Build the curve widget
m_CurveWidget = CurvesWidgetType::New();
// Wire the MBC
m_View->SetModel(m_RenderingModel);
m_View->SetController(m_Controller);
...
...
@@ -85,7 +89,7 @@ StandardImageViewer<TImage,TVectorData>
m_Tile = new Fl_Tile(0,0,m_Width,m_Height);
m_Window->add(m_Tile);
m_Window->resizable(m_Tile);
m_Tile->add(m_View->GetFullWidget());
// m_Tile->resizable(m_View->GetFullWidget());
...
...
@@ -94,14 +98,14 @@ StandardImageViewer<TImage,TVectorData>
m_Tile->add(m_CurveWidget);
m_Tile->add(m_PixelDescriptionView->GetPixelDescriptionWidget());
m_View->GetZoomWidget()->resize(m_Width-m_SideBarWidth,m_Height
/4
,m_SideBarWidth,m_Height
/4
);
m_View->GetFullWidget()->resize(0,0,m_Width-m_SideBarWidth,m_Height);
m_View->GetScrollWidget()->resize(m_Width-m_SideBarWidth,0,m_SideBarWidth,m_Height
/4
);
m_CurveWidget->resize(m_Width-m_SideBarWidth,m_Height
/2
,m_SideBarWidth,m_Height
/4
);
m_PixelDescriptionView->GetPixelDescriptionWidget()->resize(
m_Width-m_SideBarWidth,3*m_
Height
/4
,m_
SideBar
Width,m_Height
/4
);
m_View->GetZoomWidget()->resize(m_Width-m_SideBarWidth,
(
m_Height
-m_BottomBarHeight)/3
,m_SideBarWidth,
(
m_Height
-m_BottomBarHeight)/3
);
m_View->GetFullWidget()->resize(0,0,m_Width-m_SideBarWidth,m_Height
-m_BottomBarHeight
);
m_View->GetScrollWidget()->resize(m_Width-m_SideBarWidth,0,m_SideBarWidth,
(
m_Height
-m_BottomBarHeight)/3
);
m_CurveWidget->resize(m_Width-m_SideBarWidth,
(
m_Height
-m_BottomBarHeight)*2/3
,m_SideBarWidth,
(
m_Height
-m_BottomBarHeight)/3
);
m_PixelDescriptionView->GetPixelDescriptionWidget()->resize(
0,m_Height-m_BottomBar
Height,m_Width,m_
BottomBar
Height);
}
template <class TImage,class TVectorData>
template <class TImage,class TVectorData>
StandardImageViewer<TImage,TVectorData>
::~StandardImageViewer()
{
...
...
@@ -113,7 +117,7 @@ StandardImageViewer<TImage,TVectorData>
delete m_Window;
}
template <class TImage,class TVectorData>
template <class TImage,class TVectorData>
void
StandardImageViewer<TImage,TVectorData>
::Update()
...
...
@@ -126,7 +130,7 @@ StandardImageViewer<TImage,TVectorData>
// Update image info for further use
m_Image->UpdateOutputInformation();
// If there is a VectorData
if(m_VectorData.IsNotNull())
{
...
...
@@ -138,7 +142,7 @@ StandardImageViewer<TImage,TVectorData>
vproj->SetOutputSpacing(m_Image->GetSpacing());
vproj->SetDEMDirectory(m_DEMDirectory);
vproj->Update();
// Create a VectorData gl component
typename VectorDataGlComponentType::Pointer vgl = VectorDataGlComponentType::New();
vgl->SetVectorData(vproj->GetOutput());
...
...
@@ -169,7 +173,7 @@ StandardImageViewer<TImage,TVectorData>
m_View->GetFullWidget()->show();
m_View->GetZoomWidget()->show();
m_CurveWidget->show();
// Update the rendering model
m_RenderingModel->Update();
...
...
@@ -193,7 +197,7 @@ StandardImageViewer<TImage,TVectorData>
rhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(m_RenderingFunction->GetRedChannelIndex()));
rhistogram->SetHistogramColor(red);
rhistogram->SetLabelColor(red);
typename HistogramCurveType::Pointer ghistogram = HistogramCurveType::New();
ghistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(m_RenderingFunction->GetGreenChannelIndex()));
ghistogram->SetHistogramColor(green);
...
...
@@ -207,7 +211,7 @@ StandardImageViewer<TImage,TVectorData>
m_CurveWidget->AddCurve(ghistogram);
m_CurveWidget->AddCurve(bhistogram);
m_CurveWidget->SetXAxisLabel("Pixels");
m_CurveWidget->SetYAxisLabel("
Amount
");
m_CurveWidget->SetYAxisLabel("
Frequency
");
}
}
#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