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
Main Repositories
otb
Commits
a365e734
Commit
a365e734
authored
8 years ago
by
Ludovic Hussonnois
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Perform more check on noDataValueAvailable.
parent
28b847ed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx
+23
-14
23 additions, 14 deletions
...ng/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx
with
23 additions
and
14 deletions
Modules/Fusion/PanSharpening/include/otbSimpleRcsPanSharpeningFusionImageFilter.txx
+
23
−
14
View file @
a365e734
...
@@ -128,35 +128,44 @@ SimpleRcsPanSharpeningFusionImageFilter
...
@@ -128,35 +128,44 @@ SimpleRcsPanSharpeningFusionImageFilter
m_ConvolutionFilter->SetRadius(this->m_Radius);
m_ConvolutionFilter->SetRadius(this->m_Radius);
m_ConvolutionFilter->SetFilter(this->m_Filter);
m_ConvolutionFilter->SetFilter(this->m_Filter);
typedef typename TPanImageType::InternalPixelType PanPixelType;
typedef typename TXsImageType::InternalPixelType XsPixelType;
// Write no-data flags for Pan image
// Write no-data flags for Pan image
std::vector<bool> noDataValuesPanAvailable;
std::vector<bool> tmpNoDataValuePanAvailable;
double tmpNoDataValuePan;
std::vector<double> tmpNoDataValuePan;
typename TPanImageType::InternalPixelType noDataValuePan;
bool noDataValuePanAvailable = false;
bool retPan = itk::ExposeMetaData<std::vector<bool>>( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, noDataValuesPanAvailable );
PanPixelType noDataValuePan = 0;
itk::ExposeMetaData<double>( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuePan );
noDataValuePan = static_cast<typename TPanImageType::InternalPixelType>( tmpNoDataValuePan );
bool retPan = itk::ExposeMetaData<std::vector<bool> >( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, tmpNoDataValuePanAvailable );
bool noDataValuePanAvailable = noDataValuesPanAvailable[0];
retPan &= itk::ExposeMetaData<std::vector<double> >( this->GetPanInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuePan );
noDataValuePanAvailable &= retPan;
if(retPan && tmpNoDataValuePanAvailable.size() > 0 && tmpNoDataValuePan.size() > 0)
{
noDataValuePanAvailable = tmpNoDataValuePanAvailable[0] && retPan;
noDataValuePan = static_cast<PanPixelType>( tmpNoDataValuePan[0] );
}
// Write no-data flags for Xs image
// Write no-data flags for Xs image
std::vector<bool> noDataValuesXsAvailable;
std::vector<bool> noDataValuesXsAvailable;
std::vector<double> tmpNoDataValuesXs;
std::vector<double> tmpNoDataValuesXs;
std::vector<typename TXsImageType::InternalPixelType> noDataValuesXs;
std::vector<XsPixelType> noDataValuesXs;
bool retXs = itk::ExposeMetaData<std::vector<bool> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, noDataValuesXsAvailable );
bool retXs = itk::ExposeMetaData<std::vector<bool> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValueAvailable, noDataValuesXsAvailable );
itk::ExposeMetaData<std::vector<double> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuesXs );
retXs &=
itk::ExposeMetaData<std::vector<double> >( this->GetXsInput()->GetMetaDataDictionary(), MetaDataKey::NoDataValue, tmpNoDataValuesXs );
// Check if noData is needed and update noDataValuesAvailable with return function value
// Check if noData is needed and update noDataValuesAvailable with return function value
if
(
retPan || retXs)
if
(
retPan || retXs
)
{
{
m_UseNoData = noDataValuePanAvailable;
m_UseNoData = noDataValuePanAvailable;
for ( unsigned int i = 0; i < noDataValuesXsAvailable.size(); ++i )
for ( unsigned int i = 0; i <
tmpNoDataValuesXs.size() && i <
noDataValuesXsAvailable.size(); ++i )
{
{
noDataValuesXs.push_back(static_cast<
typename TXsImageType::Internal
PixelType>(tmpNoDataValuesXs[i]));
noDataValuesXs.push_back(
static_cast<
Xs
PixelType>(tmpNoDataValuesXs[i])
);
m_UseNoData |= (noDataValuesXsAvailable[i] = (noDataValuesXsAvailable[i] && retXs));
m_UseNoData |= (noDataValuesXsAvailable[i] = (noDataValuesXsAvailable[i] && retXs));
}
}
}
}
// Instantiate fusion filter
// Instantiate fusion filter
if ( m_UseNoData )
if ( m_UseNoData )
{
{
...
...
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