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
fa420f20
Commit
fa420f20
authored
18 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
Modif exemple streaming
parent
751ef106
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
Examples/IO/StreamingImageReadWrite.cxx
+12
-6
12 additions, 6 deletions
Examples/IO/StreamingImageReadWrite.cxx
with
12 additions
and
6 deletions
Examples/IO/StreamingImageReadWrite.cxx
+
12
−
6
View file @
fa420f20
...
...
@@ -62,7 +62,7 @@
#include
"otbStreamingImageFileWriter.h"
// Software Guide : EndCodeSnippet
#include
"itkRescaleIntensityImageFilter.h"
#include
"otbImage.h"
...
...
@@ -94,7 +94,8 @@ int main( int argc, char ** argv )
// Software Guide : BeginLatex
//
// We can now instantiate the types of the reader and writer. These two
// classes are parameterized over the image type.
// classes are parameterized over the image type. We will rescale
// the intensities of the as an example of intermediate processing step.
//
// \index{otb::StreamingImageFileWriter!Instantiation}
//
...
...
@@ -102,6 +103,7 @@ int main( int argc, char ** argv )
// Software Guide : BeginCodeSnippet
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
typedef
itk
::
RescaleIntensityImageFilter
<
ImageType
,
ImageType
>
RescalerType
;
typedef
otb
::
StreamingImageFileWriter
<
ImageType
>
WriterType
;
// Software Guide : EndCodeSnippet
...
...
@@ -120,6 +122,7 @@ int main( int argc, char ** argv )
// Software Guide : BeginCodeSnippet
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
RescalerType
::
Pointer
rescaler
=
RescalerType
::
New
();
WriterType
::
Pointer
writer
=
WriterType
::
New
();
// Software Guide : EndCodeSnippet
...
...
@@ -133,7 +136,8 @@ int main( int argc, char ** argv )
// Software Guide : BeginLatex
//
// The name of the file to be read or written is passed with the
// SetFileName() method.
// SetFileName() method. We also choose the range of intensities
// for the rescaler.
//
// \index{otb::ImageFileReader!SetFileName()}
// \index{otb::StreamingImageFileWriter!SetFileName()}
...
...
@@ -144,6 +148,8 @@ int main( int argc, char ** argv )
// Software Guide : BeginCodeSnippet
reader
->
SetFileName
(
inputFilename
);
rescaler
->
SetOutputMinimum
(
0
);
rescaler
->
SetOutputMaximum
(
255
);
writer
->
SetFileName
(
outputFilename
);
// Software Guide : EndCodeSnippet
...
...
@@ -151,13 +157,13 @@ int main( int argc, char ** argv )
// Software Guide : BeginLatex
//
// We can now connect these readers and writers to filters to create a
// pipeline. For example, we can create a short pipeline by passing
// the output of the reader directly to the input of the writer.
// pipeline.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
writer
->
SetInput
(
reader
->
GetOutput
()
);
rescaler
->
SetInput
(
reader
->
GetOutput
()
);
writer
->
SetInput
(
rescaler
->
GetOutput
()
);
// Software Guide : EndCodeSnippet
...
...
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