Skip to content
Snippets Groups Projects
Commit 7de885e1 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Fixing bug #943

parent d3f1f3c1
Branches
Tags
No related merge requests found
...@@ -145,7 +145,9 @@ protected: ...@@ -145,7 +145,9 @@ protected:
void PrintSelf(std::ostream& os, itk::Indent indent) const; void PrintSelf(std::ostream& os, itk::Indent indent) const;
/** Triggers the Computation of the sample list */ /** Triggers the Computation of the sample list */
void GenerateData(void); virtual void GenerateData(void);
virtual void GenerateInputRequestedRegion(void);
/** Compute the calss statistics*/ /** Compute the calss statistics*/
void GenerateClassStatistics(); void GenerateClassStatistics();
......
...@@ -188,6 +188,27 @@ ListSampleGenerator<TImage, TVectorData> ...@@ -188,6 +188,27 @@ ListSampleGenerator<TImage, TVectorData>
return dynamic_cast<ListLabelType*>(this->itk::ProcessObject::GetOutput(3)); return dynamic_cast<ListLabelType*>(this->itk::ProcessObject::GetOutput(3));
} }
template <class TImage, class TVectorData>
void
ListSampleGenerator<TImage, TVectorData>
::GenerateInputRequestedRegion()
{
ImagePointerType img = static_cast<ImageType *>(this->ProcessObject::GetInput(0));
if(img.IsNotNull())
{
// Requested regions will be generated during GenerateData
// call. For now request an empty region so as to avoid requesting
// the largest possible region (fixes bug #943 )
typename ImageType::RegionType dummyRegion;
typename ImageType::SizeType dummySize;
dummySize.Fill(0);
dummyRegion.SetSize(dummySize);
img->SetRequestedRegion(dummyRegion);
}
}
template <class TImage, class TVectorData> template <class TImage, class TVectorData>
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment