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
d3d56b18
Commit
d3d56b18
authored
16 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
Correction d'une erreur de vecteur non itinitialisé
parent
f8c58908
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
Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.txx
+19
-17
19 additions, 17 deletions
...asicFilters/otbUnaryImageFunctorWithVectorImageFilter.txx
with
19 additions
and
17 deletions
Code/BasicFilters/otbUnaryImageFunctorWithVectorImageFilter.txx
+
19
−
17
View file @
d3d56b18
...
...
@@ -53,8 +53,6 @@ UnaryImageFunctorWithVectorImageFilter<TInputImage,TOutputImage,TFunction>
::GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
// // do not call the superclass' implementation of this method since
// // this filter allows the input the output to be of different dimensions
// get pointers to the input and output
typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
...
...
@@ -66,7 +64,14 @@ UnaryImageFunctorWithVectorImageFilter<TInputImage,TOutputImage,TFunction>
}
outputPtr->SetNumberOfComponentsPerPixel( // propagate vector length info
inputPtr->GetNumberOfComponentsPerPixel());
// TODO: Check this
// The Functor vector is not initialised !
for(unsigned int i = 0;i<inputPtr->GetNumberOfComponentsPerPixel();++i)
{
FunctorType functor;
m_FunctorVector.push_back(functor);
}
}
/**
...
...
@@ -77,18 +82,11 @@ void
UnaryImageFunctorWithVectorImageFilter<TInputImage,TOutputImage,TFunction>
::ThreadedGenerateData( const OutputImageRegionType &outputRegionForThread, int threadId )
{
typename InputImageType::Pointer inputPtr = const_cast<InputImageType *>(this->GetInput());
typename OutputImageType::Pointer outputPtr = static_cast<OutputImageType *>(this->GetOutput());
// Define the portion of the input to walk for this thread, using
// the CallCopyOutputRegionToInputRegion method allows for the input
// and output images to be different dimensions
InputImageRegionType inputRegionForThread;
this->CallCopyOutputRegionToInputRegion(inputRegionForThread, outputRegionForThread);
typename Superclass::OutputImagePointer outputPtr = this->GetOutput();
typename Superclass::InputImageConstPointer inputPtr = this->GetInput();
// Define the iterators
itk::ImageRegionConstIterator<InputImageType> inputIt(inputPtr,
in
putRegionForThread);
itk::ImageRegionConstIterator<InputImageType> inputIt(inputPtr,
out
putRegionForThread);
itk::ImageRegionIterator<OutputImageType> outputIt(outputPtr, outputRegionForThread);
itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels());
...
...
@@ -96,20 +94,24 @@ UnaryImageFunctorWithVectorImageFilter<TInputImage,TOutputImage,TFunction>
inputIt.GoToBegin();
outputIt.GoToBegin();
// Null pi
u
xel construction
// Null pixel construction
InputPixelType nullPixel;
nullPixel.SetSize(
outputIt.Get().GetSize
() );
nullPixel.SetSize(
inputPtr->GetNumberOfComponentsPerPixel
() );
nullPixel.Fill(itk::NumericTraits<OutputInternalPixelType>::Zero);
std::cout<<"in: "<<inputPtr->GetNumberOfComponentsPerPixel()<<std::endl;
std::cout<<"out: "<<outputPtr->GetNumberOfComponentsPerPixel()<<std::endl;
while( !inputIt.IsAtEnd() )
{
InputPixelType inPixel = inputIt.Get();
OutputPixelType outPixel = nullPixel;//outputIt.Get();
OutputPixelType outPixel;
outPixel.SetSize( inputPtr->GetNumberOfComponentsPerPixel() );
outPixel.Fill(itk::NumericTraits<OutputInternalPixelType>::Zero);
// if the input pixel in null, the output is considered as null ( no sensor informations )
if( inPixel!= nullPixel)
{
for (unsigned int j=0; j<in
Pixel.GetSize
(); j++)
for (unsigned int j=0; j<in
putPtr->GetNumberOfComponentsPerPixel
(); j++)
{
outPixel[j] = m_FunctorVector[j]( inPixel[j] );
}
...
...
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