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
928adeaf
Commit
928adeaf
authored
7 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
BUG:
#1534
: support cases where input largest doesn't start at (0,0)
parent
8e770af9
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/IO/ImageIO/include/otbImageFileWriter.txx
+5
-11
5 additions, 11 deletions
Modules/IO/ImageIO/include/otbImageFileWriter.txx
with
5 additions
and
11 deletions
Modules/IO/ImageIO/include/otbImageFileWriter.txx
+
5
−
11
View file @
928adeaf
...
@@ -468,7 +468,6 @@ ImageFileWriter<TInputImage>
...
@@ -468,7 +468,6 @@ ImageFileWriter<TInputImage>
*/
*/
inputPtr->UpdateOutputInformation();
inputPtr->UpdateOutputInformation();
InputImageRegionType inputRegion = inputPtr->GetLargestPossibleRegion();
InputImageRegionType inputRegion = inputPtr->GetLargestPossibleRegion();
typename TInputImage::PointType origin = inputPtr->GetOrigin();
/** Parse region size modes */
/** Parse region size modes */
if(m_FilenameHelper->BoxIsSet())
if(m_FilenameHelper->BoxIsSet())
...
@@ -485,9 +484,7 @@ ImageFileWriter<TInputImage>
...
@@ -485,9 +484,7 @@ ImageFileWriter<TInputImage>
size[0] = boxVector[2]; // size along X
size[0] = boxVector[2]; // size along X
size[1] = boxVector[3]; // size along Y
size[1] = boxVector[3]; // size along Y
inputRegion.SetSize(size);
inputRegion.SetSize(size);
inputRegion.SetIndex(start);
m_ShiftOutputIndex = start;
inputRegion.SetIndex(m_ShiftOutputIndex);
if (!inputRegion.Crop(inputPtr->GetLargestPossibleRegion()))
if (!inputRegion.Crop(inputPtr->GetLargestPossibleRegion()))
{
{
...
@@ -501,11 +498,9 @@ ImageFileWriter<TInputImage>
...
@@ -501,11 +498,9 @@ ImageFileWriter<TInputImage>
e.SetDataObject(inputPtr);
e.SetDataObject(inputPtr);
throw e;
throw e;
}
}
inputPtr->TransformIndexToPhysicalPoint(inputRegion.GetIndex(), origin);
otbLogMacro(Info,<<"Writing user defined region ["<<start[0]<<", "<<start[0]+size[0]-1<<"]x["<<start[1]<<", "<<start[1]+size[1]<<"]");
otbLogMacro(Info,<<"Writing user defined region ["<<start[0]<<", "<<start[0]+size[0]-1<<"]x["<<start[1]<<", "<<start[1]+size[1]<<"]");
}
}
m_ShiftOutputIndex = inputRegion.GetIndex();
/**
/**
* Determine of number of pieces to divide the input. This will be the
* Determine of number of pieces to divide the input. This will be the
...
@@ -544,6 +539,8 @@ ImageFileWriter<TInputImage>
...
@@ -544,6 +539,8 @@ ImageFileWriter<TInputImage>
//
//
// Setup the ImageIO with information from inputPtr
// Setup the ImageIO with information from inputPtr
//
//
typename TInputImage::PointType origin;
inputPtr->TransformIndexToPhysicalPoint(inputRegion.GetIndex(), origin);
const typename TInputImage::SpacingType& spacing = inputPtr->GetSpacing();
const typename TInputImage::SpacingType& spacing = inputPtr->GetSpacing();
const typename TInputImage::DirectionType& direction = inputPtr->GetDirection();
const typename TInputImage::DirectionType& direction = inputPtr->GetDirection();
m_ImageIO->SetNumberOfDimensions(TInputImage::ImageDimension);
m_ImageIO->SetNumberOfDimensions(TInputImage::ImageDimension);
...
@@ -665,7 +662,7 @@ ImageFileWriter<TInputImage>
...
@@ -665,7 +662,7 @@ ImageFileWriter<TInputImage>
//Reset global shift on input region (box parameter)
//Reset global shift on input region (box parameter)
//It allows calling multiple update over the writer
//It allows calling multiple update over the writer
m_ShiftOutputIndex
.Fill(0
);
m_ShiftOutputIndex
= inputPtr->GetLargestPossibleRegion().GetIndex(
);
}
}
...
@@ -721,10 +718,7 @@ ImageFileWriter<TInputImage>
...
@@ -721,10 +718,7 @@ ImageFileWriter<TInputImage>
InputImageRegionType ioRegion;
InputImageRegionType ioRegion;
// No shift of the ioRegion from the buffered region is expected
// No shift of the ioRegion from the buffered region is expected
typename InputImageRegionType::IndexType tmpIndex;
tmpIndex.Fill(0);
itk::ImageIORegionAdaptor<TInputImage::ImageDimension>::
itk::ImageIORegionAdaptor<TInputImage::ImageDimension>::
//Convert(m_ImageIO->GetIORegion(), ioRegion, tmpIndex);
Convert(m_ImageIO->GetIORegion(), ioRegion, m_ShiftOutputIndex);
Convert(m_ImageIO->GetIORegion(), ioRegion, m_ShiftOutputIndex);
InputImageRegionType bufferedRegion = input->GetBufferedRegion();
InputImageRegionType bufferedRegion = input->GetBufferedRegion();
...
...
This diff is collapsed.
Click to expand it.
Guillaume Pasero
@gpasero
mentioned in merge request
!35 (merged)
·
7 years ago
mentioned in merge request
!35 (merged)
mentioned in merge request !35
Toggle commit list
Rémi Cresson
@remicress
·
7 years ago
Owner
My bad. I forgot this case.
My bad. I forgot this case.
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