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
da524dde
Commit
da524dde
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
BUG: fixing prolate segfault
parent
2b99ff51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Common/otbGenericInterpolateImageFunction.h
+10
-6
10 additions, 6 deletions
Code/Common/otbGenericInterpolateImageFunction.h
Code/Common/otbGenericInterpolateImageFunction.txx
+19
-10
19 additions, 10 deletions
Code/Common/otbGenericInterpolateImageFunction.txx
with
29 additions
and
16 deletions
Code/Common/otbGenericInterpolateImageFunction.h
+
10
−
6
View file @
da524dde
...
@@ -100,12 +100,9 @@ public:
...
@@ -100,12 +100,9 @@ public:
return
m_Function
;
return
m_Function
;
}
}
/** Delete tables.*/
/** Initialize tables: need to be call explicitely */
void
ResetOffsetTable
()
const
;
virtual
void
Initialize
();
/** Initialize used tables*/
void
InitializeTables
()
const
;
/** Fill the weight offset table*/
void
FillWeightOffsetTable
()
const
;
/** Weights normalization accessors*/
/** Weights normalization accessors*/
itkSetMacro
(
NormalizeWeight
,
bool
);
itkSetMacro
(
NormalizeWeight
,
bool
);
...
@@ -120,6 +117,13 @@ protected:
...
@@ -120,6 +117,13 @@ protected:
* flag to false */
* flag to false */
virtual
void
Modified
(
void
);
virtual
void
Modified
(
void
);
/** Delete tables.*/
virtual
void
ResetOffsetTable
();
/** Initialize used tables*/
virtual
void
InitializeTables
();
/** Fill the weight offset table*/
virtual
void
FillWeightOffsetTable
();
private
:
private
:
GenericInterpolateImageFunction
(
const
Self
&
);
//purposely not implemented
GenericInterpolateImageFunction
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
...
...
This diff is collapsed.
Click to expand it.
Code/Common/otbGenericInterpolateImageFunction.txx
+
19
−
10
View file @
da524dde
...
@@ -48,7 +48,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction,TBoundaryCondition, TCoor
...
@@ -48,7 +48,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction,TBoundaryCondition, TCoor
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
void
void
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
::ResetOffsetTable()
const
::ResetOffsetTable()
{
{
// Clear the offset table
// Clear the offset table
if (m_OffsetTable!=NULL)
if (m_OffsetTable!=NULL)
...
@@ -109,7 +109,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
...
@@ -109,7 +109,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
void
void
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
::InitializeTables()
const
::InitializeTables()
{
{
// Compute the offset table size
// Compute the offset table size
m_OffsetTableSize = 1;
m_OffsetTableSize = 1;
...
@@ -133,7 +133,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
...
@@ -133,7 +133,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
void
void
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
::FillWeightOffsetTable()
const
::FillWeightOffsetTable()
{
{
// Initialize the neighborhood
// Initialize the neighborhood
SizeType radius;
SizeType radius;
...
@@ -183,6 +183,21 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
...
@@ -183,6 +183,21 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
}
}
}
}
/** Initialize tables: need to be call explicitely */
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
void
GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>
::Initialize()
{
// Delete existing tables
this->ResetOffsetTable();
// Tables initialization
this->InitializeTables();
// fill the weigth table
this->FillWeightOffsetTable();
m_TablesHaveBeenGenerated = true;
}
/** Evaluate at image index position */
/** Evaluate at image index position */
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
template<class TInputImage, class TFunction, class TBoundaryCondition, class TCoordRep>
typename GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>::OutputType
typename GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoordRep>::OutputType
...
@@ -191,13 +206,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
...
@@ -191,13 +206,7 @@ GenericInterpolateImageFunction<TInputImage, TFunction, TBoundaryCondition, TCoo
{
{
if (!m_TablesHaveBeenGenerated)
if (!m_TablesHaveBeenGenerated)
{
{
// Delete existing tables
itkExceptionMacro(<< "The Interpolation functor need to be explicitly intanciated with the method Initialize()");
this->ResetOffsetTable();
// Tables initialization
this->InitializeTables();
// fill the weigth table
this->FillWeightOffsetTable();
m_TablesHaveBeenGenerated = true;
}
}
//unsigned int dim;
//unsigned int dim;
...
...
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