[ITK-users] NeighborhoodOperatorImageFilter RunTime Error

badrobot mat.roscoe at gmail.com
Fri Jul 11 19:33:33 EDT 2014


HI I am fairly new to ITK I have created the following: 

	typedef itk::Image<unsigned char, 2> ScalarImage;
	typedef ScalarImage::Pointer ScalarImagePointer;

	typedef itk::Image<itk::CovariantVector<float, 2>, 2> GradientImage;
	typedef GradientImage::Pointer GradientImagePointer;

	typedef itk::NeighborhoodOperatorImageFilter<ScalarImage, ScalarImage,
float> NeighborhoodImageFilter;
	typedef itk::ForwardDifferenceOperator<float, 2> DerivativeOperator;
	itk::Size<2> derivative_kernel_radius;
	derivative_kernel_radius.Fill( 1 );

	DLOG(INFO) << "Creating X Derivative Operator";
	// Compute the derivative in the X direction.
	DerivativeOperator DerivativeX;
	DerivativeX.SetDirection( 0 );
	DerivativeX.CreateToRadius( derivative_kernel_radius );

	DLOG(INFO) << "Computing X Derivative";
	typename NeighborhoodImageFilter::Pointer DerivativeXFilter =
NeighborhoodImageFilter::New();
	DerivativeXFilter->SetOperator( DerivativeX );
	DerivativeXFilter->SetInput( input_depth_map );
	DerivativeXFilter->Update();

Everything in this works fine until I run the update command when I get the
following output: 

I0711 20:09:07.657845  4045 DepthDerivative.cpp:62] Creating X Derivative
Operator
I0711 20:09:07.657874  4045 DepthDerivative.cpp:68] Computing X Derivative
terminate called after throwing an instance of 'itk::ExceptionObject'
  what(): 
/home/badrobit/InsightToolkit-4.5.2/Modules/Core/Common/src/itkProcessObject.cxx:1370:
itk::ERROR: NeighborhoodOperatorImageFilter(0x1c01500): Input Primary is
required but not set.
Aborted (core dumped)


This looks like it should be a fairly simply problem to catch but I am
unable to figure it out. I was hoping someone here could help me.



--
View this message in context: http://itk-users.7.n7.nabble.com/NeighborhoodOperatorImageFilter-RunTime-Error-tp34225.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list