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
Julien Cabieces
otb
Commits
d2799d73
Commit
d2799d73
authored
11 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
WIP: use a shifted index to manage non zero index when box extended parameter is used
parent
d399840f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/IO/otbImageFileWriter.h
+8
-6
8 additions, 6 deletions
Code/IO/otbImageFileWriter.h
Code/IO/otbImageFileWriter.txx
+10
-3
10 additions, 3 deletions
Code/IO/otbImageFileWriter.txx
with
18 additions
and
9 deletions
Code/IO/otbImageFileWriter.h
+
8
−
6
View file @
d2799d73
...
...
@@ -75,6 +75,7 @@ public:
typedef
typename
InputImageType
::
Pointer
InputImagePointer
;
typedef
typename
InputImageType
::
RegionType
InputImageRegionType
;
typedef
typename
InputImageType
::
PixelType
InputImagePixelType
;
typedef
typename
InputImageType
::
IndexType
InputIndexType
;
typedef
TInputImage
OutputImageType
;
typedef
typename
OutputImageType
::
Pointer
OutputImagePointer
;
typedef
typename
OutputImageType
::
RegionType
OutputImageRegionType
;
...
...
@@ -156,19 +157,19 @@ public:
/** Set the only input of the writer */
virtual
void
SetInput
(
const
InputImageType
*
input
);
/** Get writer only input */
const
InputImageType
*
GetInput
();
/** Override Update() from ProcessObject because this filter
* has no output. */
virtual
void
Update
();
/** ImageFileWriter Methods */
virtual
void
SetFileName
(
const
char
*
extendedFileName
);
virtual
void
SetFileName
(
std
::
string
extendedFileName
);
virtual
const
char
*
GetFileName
()
const
;
/** Specify the region to write. If left NULL, then the whole image
* is written. */
void
SetIORegion
(
const
itk
::
ImageIORegion
&
region
);
...
...
@@ -192,7 +193,7 @@ public:
itkSetObjectMacro
(
ImageIO
,
otb
::
ImageIOBase
);
itkGetObjectMacro
(
ImageIO
,
otb
::
ImageIOBase
);
itkGetConstObjectMacro
(
ImageIO
,
otb
::
ImageIOBase
);
protected
:
ImageFileWriter
();
virtual
~
ImageFileWriter
();
...
...
@@ -244,7 +245,7 @@ private:
bool
m_UseInputMetaDataDictionary
;
// whether to use the
// MetaDataDictionary from the
// input or not.
bool
m_WriteGeomFile
;
// Write a geom file to store the
// kwl
...
...
@@ -254,6 +255,7 @@ private:
bool
m_IsObserving
;
unsigned
long
m_ObserverID
;
InputIndexType
m_ShiftOutputIndex
;
};
}
// end namespace otb
...
...
This diff is collapsed.
Click to expand it.
Code/IO/otbImageFileWriter.txx
+
10
−
3
View file @
d2799d73
...
...
@@ -68,6 +68,9 @@ ImageFileWriter<TInputImage>
m_IsObserving(true),
m_ObserverID(0)
{
//Init output index shift
m_ShiftOutputIndex.Fill(0);
// By default, we use tiled streaming, with automatic tile size
// We don't set any parameter, so the memory size is retrieved from the OTB configuration options
this->SetAutomaticAdaptativeStreaming();
...
...
@@ -494,7 +497,9 @@ ImageFileWriter<TInputImage>
size[1] = atoi(it->c_str()); // size along Y
inputRegion.SetSize(size);
inputRegion.SetIndex(start);
m_ShiftOutputIndex = start;
inputRegion.SetIndex(m_ShiftOutputIndex);
otbMsgDevMacro(<< "inputRegion " << inputRegion);
...
...
@@ -623,7 +628,8 @@ ImageFileWriter<TInputImage>
{
ioRegion.SetSize(i, streamRegion.GetSize(i));
ioRegion.SetIndex(i, streamRegion.GetIndex(i));
//ioRegion.SetIndex(i, streamRegion.GetIndex(i) - inputRegion.GetIndex(i));
//Set the ioRegion index using the shifted index ( (0,0 without box parameter))
ioRegion.SetIndex(i, streamRegion.GetIndex(i) - m_ShiftOutputIndex[i]);
}
otbMsgDevMacro(<< "ioregion " << ioRegion )
this->SetIORegion(ioRegion);
...
...
@@ -711,7 +717,8 @@ ImageFileWriter<TInputImage>
typename InputImageRegionType::IndexType tmpIndex;
tmpIndex.Fill(0);
itk::ImageIORegionAdaptor<TInputImage::ImageDimension>::
Convert(m_ImageIO->GetIORegion(), ioRegion, tmpIndex);
//Convert(m_ImageIO->GetIORegion(), ioRegion, tmpIndex);
Convert(m_ImageIO->GetIORegion(), ioRegion, m_ShiftOutputIndex);
InputImageRegionType bufferedRegion = input->GetBufferedRegion();
// before this test, bad stuff would happend when they don't match
...
...
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