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
3b67da41
Commit
3b67da41
authored
7 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
ENH: move initialisation of output image file in GenerateOutputInformation()
parent
013fa54a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!33
Multi writer
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Modules/IO/ImageIO/include/otbImageFileWriter.h
+3
-0
3 additions, 0 deletions
Modules/IO/ImageIO/include/otbImageFileWriter.h
Modules/IO/ImageIO/include/otbImageFileWriter.txx
+29
-19
29 additions, 19 deletions
Modules/IO/ImageIO/include/otbImageFileWriter.txx
with
32 additions
and
19 deletions
Modules/IO/ImageIO/include/otbImageFileWriter.h
+
3
−
0
View file @
3b67da41
...
...
@@ -207,6 +207,9 @@ protected:
/** Does the real work. */
void
GenerateData
(
void
)
ITK_OVERRIDE
;
/** Prepare the streaming and write the output information on disk */
void
GenerateOutputInformation
(
void
)
override
;
private
:
ImageFileWriter
(
const
ImageFileWriter
&
);
//purposely not implemented
void
operator
=
(
const
ImageFileWriter
&
);
//purposely not implemented
...
...
This diff is collapsed.
Click to expand it.
Modules/IO/ImageIO/include/otbImageFileWriter.txx
+
29
−
19
View file @
3b67da41
...
...
@@ -268,13 +268,11 @@ ImageFileWriter<TInputImage>
return static_cast<const InputImageType*>(this->ProcessObject::GetInput(0));
}
/**
* Update method : update output information of input and write to file
*/
/** Prepare everything and call m_ImageIO.WriteInformation() */
template<class TInputImage>
void
ImageFileWriter<TInputImage>
::
Update(
)
::
GenerateOutputInformation(void
)
{
// Update output information on input image
InputImagePointer inputPtr =
...
...
@@ -393,14 +391,6 @@ ImageFileWriter<TInputImage>
}
}
this->SetAbortGenerateData(0);
this->SetProgress(0.0);
/**
* Tell all Observers that the filter is starting
*/
this->InvokeEvent(itk::StartEvent());
/** Prepare ImageIO : create ImageFactory */
if (m_FileName == "")
...
...
@@ -479,7 +469,6 @@ ImageFileWriter<TInputImage>
/**
* Grab the input
*/
inputPtr->UpdateOutputInformation();
InputImageRegionType inputRegion = inputPtr->GetLargestPossibleRegion();
/** Parse region size modes */
...
...
@@ -544,12 +533,6 @@ ImageFileWriter<TInputImage>
m_NumberOfDivisions = m_StreamingManager->GetNumberOfSplits();
otbMsgDebugMacro(<< "Number Of Stream Divisions : " << m_NumberOfDivisions);
/**
* Loop over the number of pieces, execute the upstream pipeline on each
* piece, and copy the results into the output image.
*/
InputImageRegionType streamRegion;
//
// Setup the ImageIO with information from inputPtr
//
...
...
@@ -588,12 +571,33 @@ ImageFileWriter<TInputImage>
m_ImageIO->SetFileName(m_FileName.c_str());
m_ImageIO->WriteImageInformation();
}
/**
* Update method : update output information of input and write to file
*/
template<class TInputImage>
void
ImageFileWriter<TInputImage>
::Update()
{
this->UpdateOutputInformation();
this->SetAbortGenerateData(0);
this->SetProgress(0.0);
/**
* Tell all Observers that the filter is starting
*/
this->InvokeEvent(itk::StartEvent());
this->UpdateProgress(0);
m_CurrentDivision = 0;
m_DivisionProgress = 0;
// Get the source process object
InputImagePointer inputPtr =
const_cast<InputImageType *>(this->GetInput());
itk::ProcessObject* source = inputPtr->GetSource();
m_IsObserving = false;
m_ObserverID = 0;
...
...
@@ -615,6 +619,12 @@ ImageFileWriter<TInputImage>
itkWarningMacro(<< "Could not get the source process object. Progress report might be buggy");
}
/**
* Loop over the number of pieces, execute the upstream pipeline on each
* piece, and copy the results into the output image.
*/
InputImageRegionType streamRegion;
for (m_CurrentDivision = 0;
m_CurrentDivision < m_NumberOfDivisions && !this->GetAbortGenerateData();
m_CurrentDivision++, m_DivisionProgress = 0, this->UpdateFilterProgress())
...
...
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