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
4d9c387d
Commit
4d9c387d
authored
16 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Adding GenerateInputRequestedRegion() to MIRegistrationFilter
parent
fd848145
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/DisparityMap/otbMIRegistrationFilter.h
+3
-0
3 additions, 0 deletions
Code/DisparityMap/otbMIRegistrationFilter.h
Code/DisparityMap/otbMIRegistrationFilter.txx
+68
-2
68 additions, 2 deletions
Code/DisparityMap/otbMIRegistrationFilter.txx
with
71 additions
and
2 deletions
Code/DisparityMap/otbMIRegistrationFilter.h
+
3
−
0
View file @
4d9c387d
...
...
@@ -127,6 +127,9 @@ protected:
/** Apply update. */
virtual
void
ApplyUpdate
(
TimeStepType
dt
);
/** Update the Input requested region. */
virtual
void
GenerateInputRequestedRegion
();
private
:
MIRegistrationFilter
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
...
...
This diff is collapsed.
Click to expand it.
Code/DisparityMap/otbMIRegistrationFilter.txx
+
68
−
2
View file @
4d9c387d
...
...
@@ -15,9 +15,9 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbMIRegistrationFilter_txx
#define __otbMIRegistrationFilter_txx
#include "otbMIRegistrationFilter.h"
namespace otb {
...
...
@@ -187,7 +187,73 @@ MIRegistrationFilter<TFixedImage,TMovingImage,TDeformationField>
}
template <class TFixedImage, class TMovingImage, class TDeformationField>
void
MIRegistrationFilter<TFixedImage,TMovingImage,TDeformationField>
::GenerateInputRequestedRegion()
{
// get pointers to the input and output
typename Superclass::FixedImagePointer fixedPtr =
const_cast< TFixedImage * >( this->GetFixedImage() );
typename Superclass::MovingImagePointer movingPtr =
const_cast< TMovingImage * >( this->GetMovingImage() );
typename TDeformationField::Pointer outputPtr = this->GetOutput();
if ( !fixedPtr || !movingPtr || !outputPtr )
{
return;
}
// get a copy of the input requested region (should equal the output
// requested region)
typename TDeformationField::RegionType requestedRegion;
requestedRegion = outputPtr->GetRequestedRegion();
// pad the input requested region by the operator radius
requestedRegion.PadByRadius( this->GetMIRadius() );
// crop the input requested region at the input's largest possible region
if ( requestedRegion.Crop(fixedPtr->GetLargestPossibleRegion()))
{
if ( requestedRegion.Crop(movingPtr->GetLargestPossibleRegion()))
{
fixedPtr->SetRequestedRegion( requestedRegion );
movingPtr->SetRequestedRegion( requestedRegion );
return;
}
else
{
// Couldn't crop the region (requested region is outside the largest
// possible region). Throw an exception.
// store what we tried to request (prior to trying to crop)
movingPtr->SetRequestedRegion( requestedRegion );
// build an exception
itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
e.SetLocation(ITK_LOCATION);
e.SetDescription("Requested region is (at least partially) outside the largest possible region of the moving image.");
e.SetDataObject(movingPtr);
throw e;
}
}
else
{
// Couldn't crop the region (requested region is outside the largest
// possible region). Throw an exception.
// store what we tried to request (prior to trying to crop)
fixedPtr->SetRequestedRegion( requestedRegion );
// build an exception
itk::InvalidRequestedRegionError e(__FILE__, __LINE__);
e.SetLocation(ITK_LOCATION);
e.SetDescription("Requested region is (at least partially) outside the largest possible region of the fixed image.");
e.SetDataObject(fixedPtr);
throw e;
}
}
} // end namespace otb
...
...
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