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
Sébastien Peillet
otb
Commits
503a3f88
Commit
503a3f88
authored
6 years ago
by
Antoine Regimbeau
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: Get rid of commented code
parent
6adeaada
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
Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
+18
-40
18 additions, 40 deletions
Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
with
18 additions
and
40 deletions
Modules/Applications/AppImageUtils/app/otbExtractROI.cxx
+
18
−
40
View file @
503a3f88
...
@@ -255,51 +255,39 @@ private:
...
@@ -255,51 +255,39 @@ private:
inImage
->
UpdateOutputInformation
();
inImage
->
UpdateOutputInformation
();
ImageType
::
RegionType
largestRegion
=
inImage
->
GetLargestPossibleRegion
();
ImageType
::
RegionType
largestRegion
=
inImage
->
GetLargestPossibleRegion
();
// bool userExtent = !HasUserValue( "mode.extent.ulx" ) \
// && !HasUserValue( "mode.extent.uly" ) \
// && !HasUserValue( "mode.extent.lrx" ) \
// && !HasUserValue( "mode.extent.lry" );
// bool userRadius = !HasUserValue( "mode.radius.r" ) \
// && !HasUserValue( "mode.radius.cx" ) \
// && !HasUserValue( "mode.radius.cy" );
ImageType
::
RegionType
currentLargest
;
ImageType
::
RegionType
currentLargest
;
currentLargest
.
SetSize
(
0
,
GetDefaultParameterInt
(
"sizex"
)
);
// need a methode to get default value
currentLargest
.
SetSize
(
0
,
GetDefaultParameterInt
(
"sizex"
)
);
currentLargest
.
SetSize
(
1
,
GetDefaultParameterInt
(
"sizey"
)
);
// need a methode to get default value
currentLargest
.
SetSize
(
1
,
GetDefaultParameterInt
(
"sizey"
)
);
currentLargest
.
SetIndex
(
1
,
GetDefaultParameterInt
(
"starty"
)
);
currentLargest
.
SetIndex
(
1
,
GetDefaultParameterInt
(
"starty"
)
);
currentLargest
.
SetIndex
(
0
,
GetDefaultParameterInt
(
"startx"
)
);
currentLargest
.
SetIndex
(
0
,
GetDefaultParameterInt
(
"startx"
)
);
// Update default only if largest has changed
// Update default only if largest has changed
if
(
!
(
currentLargest
=
=
largestRegion
)
)
if
(
currentLargest
!
=
largestRegion
)
{
{
std
::
cout
<<
"Reseting default value"
<<
std
::
endl
;
// Setting maximum value
// Put the limit of the index and the size relative the image
SetMaximumParameterIntValue
(
"sizex"
,
largestRegion
.
GetSize
(
0
)
);
SetMaximumParameterIntValue
(
"sizex"
,
largestRegion
.
GetSize
(
0
)
);
SetMaximumParameterIntValue
(
"sizey"
,
largestRegion
.
GetSize
(
1
)
);
SetMaximumParameterIntValue
(
"sizey"
,
largestRegion
.
GetSize
(
1
)
);
SetMaximumParameterIntValue
(
"startx"
,
SetMaximumParameterIntValue
(
"startx"
,
largestRegion
.
GetIndex
(
0
)
+
largestRegion
.
GetSize
(
0
)
);
largestRegion
.
GetIndex
(
0
)
+
largestRegion
.
GetSize
(
0
)
);
SetMaximumParameterIntValue
(
"starty"
,
SetMaximumParameterIntValue
(
"starty"
,
largestRegion
.
GetIndex
(
1
)
+
largestRegion
.
GetSize
(
1
)
);
largestRegion
.
GetIndex
(
1
)
+
largestRegion
.
GetSize
(
1
)
);
// Setting default value
SetDefaultParameterInt
(
"sizex"
,
largestRegion
.
GetSize
(
0
)
);
SetDefaultParameterInt
(
"sizex"
,
largestRegion
.
GetSize
(
0
)
);
SetDefaultParameterInt
(
"sizey"
,
largestRegion
.
GetSize
(
1
)
);
SetDefaultParameterInt
(
"sizey"
,
largestRegion
.
GetSize
(
1
)
);
SetDefaultParameterInt
(
"startx"
,
largestRegion
.
GetIndex
(
0
)
);
SetDefaultParameterInt
(
"startx"
,
largestRegion
.
GetIndex
(
0
)
);
SetDefaultParameterInt
(
"starty"
,
largestRegion
.
GetIndex
(
1
)
);
SetDefaultParameterInt
(
"starty"
,
largestRegion
.
GetIndex
(
1
)
);
//
if ( !HasUserValue("sizex") )
//
Setting actual value
// SetParameterInt( "sizex" , largestRegion.GetSize(0
) )
;
if
(
!
HasUserValue
(
"sizex"
)
)
// if ( !HasUserValue("sizey") )
SetParameterFloat
(
"sizex"
,
// Se
tParameter
In
t( "size
y
"
, largestRegion.GetSize(1
) );
GetDefaul
tParameter
Floa
t
(
"size
x
"
)
);
if
(
!
HasUserValue
(
"sizey"
)
)
// Compute radius parameter with default sizex and sizey
SetParameterFloat
(
"sizey"
,
// if ( GetParameterString( "mode" ) == "radius" && userRadius )
GetDefaultParameterFloat
(
"sizey"
)
);
Compute
R
adius
FromIndex
(
inImage
,
largestRegion
);
//
Compute
r
adius
parameters default value
//
Compute
extent parameter with default sizex and sizey
Compute
RadiusFromIndex
(
inImage
,
largestRegion
);
//
if ( GetParameterString( "mode" ) == "extent" && userExtent )
//
Compute extent parameters default value
ComputeExtentFromIndex
(
inImage
,
largestRegion
);
ComputeExtentFromIndex
(
inImage
,
largestRegion
);
}
}
unsigned
int
nbComponents
=
inImage
->
GetNumberOfComponentsPerPixel
();
unsigned
int
nbComponents
=
inImage
->
GetNumberOfComponentsPerPixel
();
ListViewParameter
*
clParam
=
ListViewParameter
*
clParam
=
dynamic_cast
<
ListViewParameter
*>
(
GetParameterByKey
(
"cl"
));
dynamic_cast
<
ListViewParameter
*>
(
GetParameterByKey
(
"cl"
));
...
@@ -317,20 +305,10 @@ private:
...
@@ -317,20 +305,10 @@ private:
}
}
// Update the start and size parameter depending on the mode
// Update the start and size parameter depending on the mode
if
(
GetParameterString
(
"mode"
)
==
"extent"
)
//&& !userExtent)
if
(
GetParameterString
(
"mode"
)
==
"extent"
)
ComputeIndexFromExtent
();
ComputeIndexFromExtent
();
if
(
GetParameterString
(
"mode"
)
==
"radius"
)
//&& !userRadius)
if
(
GetParameterString
(
"mode"
)
==
"radius"
)
ComputeIndexFromRadius
();
ComputeIndexFromRadius
();
// Crop the roi region to be included in the largest possible
// region
/* if(!this->CropRegionOfInterest())
{
// Put the index of the ROI to origin and try to crop again
SetParameterInt("startx",0);
SetParameterInt("starty",0);
this->CropRegionOfInterest();
}*/
if
(
GetParameterString
(
"mode"
)
==
"fit"
)
if
(
GetParameterString
(
"mode"
)
==
"fit"
)
{
{
...
...
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