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
4cc351f5
Commit
4cc351f5
authored
15 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add streaming to DEMToImageGenerator
parent
bd08087c
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/IO/otbDEMToImageGenerator.h
+4
-1
4 additions, 1 deletion
Code/IO/otbDEMToImageGenerator.h
Code/IO/otbDEMToImageGenerator.txx
+55
-0
55 additions, 0 deletions
Code/IO/otbDEMToImageGenerator.txx
with
59 additions
and
1 deletion
Code/IO/otbDEMToImageGenerator.h
+
4
−
1
View file @
4cc351f5
...
...
@@ -103,7 +103,10 @@ protected:
~
DEMToImageGenerator
(){};
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
;
void
GenerateData
();
// void GenerateData();
void
BeforeThreadedGenerateData
();
void
ThreadedGenerateData
(
const
OutputImageRegionType
&
outputRegionForThread
,
int
threadId
);
virtual
void
GenerateOutputInformation
();
DEMHandlerType
::
Pointer
m_DEMHandler
;
...
...
This diff is collapsed.
Click to expand it.
Code/IO/otbDEMToImageGenerator.txx
+
55
−
0
View file @
4cc351f5
...
...
@@ -70,6 +70,7 @@ void DEMToImageGenerator<TDEMImage>
output->SetOrigin(m_OutputOrigin);
}
/*
// GenerateData method
template <class TDEMImage>
void
...
...
@@ -112,8 +113,62 @@ DEMToImageGenerator<TDEMImage>
DEMImage->SetPixel(currentindex, m_DefaultUnknownValue);
}
}
}*/
template <class TDEMImage>
void
DEMToImageGenerator<TDEMImage>
::BeforeThreadedGenerateData()
{
DEMImagePointerType DEMImage = this->GetOutput();
// allocate the output buffer
DEMImage->SetBufferedRegion( DEMImage->GetRequestedRegion() );
DEMImage->Allocate();
DEMImage->FillBuffer(0);
}
template <class TDEMImage>
void
DEMToImageGenerator<TDEMImage>
::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
int threadId)
{
DEMImagePointerType DEMImage = this->GetOutput();
// Create an iterator that will walk the output region
ImageIteratorType outIt = ImageIteratorType(DEMImage,outputRegionForThread);
// Walk the output image, evaluating the height at each pixel
IndexType currentindex;
PointType phyPoint;
double height;
for (outIt.GoToBegin(); !outIt.IsAtEnd(); ++outIt)
{
currentindex=outIt.GetIndex();
DEMImage->TransformIndexToPhysicalPoint(currentindex, phyPoint);
// otbMsgDevMacro(<< "PhyPoint : (" << phyPoint[0] << "," << phyPoint[1] << ")");
height=m_DEMHandler->GetHeightAboveMSL(phyPoint); // Altitude calculation
// otbMsgDevMacro(<< "height" << height);
// MNT sets a default value (-32768) at point where it doesn't have altitude information.
// OSSIM has chosen to change this default value in OSSIM_DBL_NAN (-4.5036e15).
if (!ossim::isnan(height))
{
// Fill the image
DEMImage->SetPixel(currentindex, static_cast<PixelType>(height) );
}
else
{
// Back to the MNT default value
DEMImage->SetPixel(currentindex, m_DefaultUnknownValue);
}
}
}
template <class TDEMImage>
void
DEMToImageGenerator<TDEMImage>
...
...
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