Skip to content
Snippets Groups Projects
Commit 7381d43f authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: check m_Model early during update

parent 10dc6489
No related branches found
No related tags found
No related merge requests found
......@@ -82,10 +82,6 @@ void
ImageDimensionalityReductionFilter<TInputImage, TOutputImage, TMaskImage>
::BeforeThreadedGenerateData()
{
if (!m_Model)
{
itkGenericExceptionMacro(<< "No model for classification");
}
if(m_BatchMode)
{
#ifdef _OPENMP
......@@ -129,7 +125,11 @@ template <class TInputImage, class TOutputImage, class TMaskImage>
void ImageDimensionalityReductionFilter<TInputImage, TOutputImage, TMaskImage>::GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
this->GetOutput()->SetNumberOfComponentsPerPixel( m_Model->GetDimension() );
if (!m_Model)
{
itkGenericExceptionMacro(<< "No model for dimensionality reduction");
}
this->GetOutput()->SetNumberOfComponentsPerPixel( m_Model->GetDimension() );
}
template <class TInputImage, class TOutputImage, class TMaskImage>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment