[ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space!

Robert scorpiuni at gmail.com
Mon May 16 12:54:22 EDT 2016


Hello,
Yes, the Update was actually part of the problem, why could I forget this...
However, now I have this result:
Code:
fastMarching->GetOutput()->SetOrigin(sigmoid->GetOutput()->GetOrigin());
  fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing());
 
fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection());
  fastMarching->GetOutput()->Update();
  geodesicActiveContour->SetInput(  fastMarching->GetOutput() );
//  geodesicActiveContour->SetInput(  fastMarching->GetOutput() );
//  geodesicActiveContour->Print( std::cout );


  std::cout << "-------After geodesicActiveContour fastmarching ->
GetOutput() IMPORTANT--------"<< std::endl;
  const InternalImageType::PointType & origin3 =
fastMarching->GetOutput()->GetOrigin();
  std::cout << "Origin FastMarching = ";
  std::cout << origin3[0] << ", "
  << origin3[1] << ", "
  << origin3[2] << std::endl;
  InternalImageType::SpacingType spacing =
fastMarching->GetOutput()->GetSpacing();
  std::cout << "spacing FastMarching = ";
  std::cout << spacing[0] << ", "
  << spacing[1] << ", "
  << spacing[2] << std::endl;
  const InternalImageType::DirectionType& direction =
fastMarching->GetOutput()->GetDirection();
  std::cout << "Direction fast marching = " << std::endl;
  std::cout << direction << std::endl;



 // float ori[3] = {7, 7, 7};
 // sigmoid->GetOutput()->SetOrigin(ori);
  geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() );
 // sigmoid->GetOutput()->Set
  fastMarching->GetOutput()->Update();
  const InternalImageType::PointType & originx =
sigmoid->GetOutput()->GetOrigin();
  std::cout << "Origin Sigmoid= ";
  std::cout << originx[0] << ", "
  << originx[1] << ", "
  << originx[2] << std::endl;
  InternalImageType::SpacingType spacing1 =
sigmoid->GetOutput()->GetSpacing();
  std::cout << "spacing Sigmoid = ";
  std::cout << spacing1[0] << ", "
  << spacing1[1] << ", "
  << spacing1[2] << std::endl;
  const InternalImageType::DirectionType& direction1 =
sigmoid->GetOutput()->GetDirection();
  std::cout << "Direction Sigmoid = " << std::endl;
  std::cout << direction1 << std::endl;
//  geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() );
//  geodesicActiveContour->Print( std::cout );

Console Output:

Origin FastMarching = 7.29914, 10.5533, -7.87177
spacing FastMarching = 0.16, 0.16, 0.16
Direction fast marching = 
-1 0 0
0 -1 0
0 0 1

Origin Sigmoid= 7.29914, 10.5533, -7.87177
spacing Sigmoid = 0.16, 0.16, 0.16
Direction Sigmoid = 
-1 0 0
0 -1 0
0 0 1

-------After thresholder--------
Origin Thresholder = 7.29914, 10.5533, -7.87177
Exception caught !

itk::ExceptionObject (0x125d5f0)
Location: "void itk::ImageToImageFilter<TInputImage,
TOutputImage>::VerifyInputInformation() [with TInputImage =
itk::Image<float, 3u>; TOutputImage = itk::Image<float, 3u>]" 
File: /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx
Line: 250
Description: itk::ERROR:
GeodesicActiveContourLevelSetImageFilter(0x1256d40): Inputs do not occupy
the same physical space! 
InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00],
InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00]
	Tolerance: 1.0000000e-06
InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00],
InputImage_1 Spacing: [1.6000000e-01, 1.6000000e-01, 1.5999985e-01]
	Tolerance: 1.0000000e-06
InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00
0.0000000e+00 1.0000000e+00 0.0000000e+00
0.0000000e+00 0.0000000e+00 1.0000000e+00
, InputImage_1 Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00
0.0000000e+00 -1.0000000e+00 0.0000000e+00
0.0000000e+00 0.0000000e+00 1.0000000e+00

	Tolerance: 1.0000000e-06

So the error is still the same as before, even with my 2 filters
updated/having the same output now.... Is there another Update() that I
missed? I mean, it should now get 2 times the same values, right?



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588855.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list