Both the origin and spacing of your two images ‘InputImage’ and ‘InputImageInitialimage’ are different. Therefore, the error ’ inputs do not occupy the same physical space!’. I suggest you start with looking at functions set origin and set spacing. Hope this helps.
The example works for me with following arguments: C:\Dev\ITKExamples\Build\src\Segmentation\LevelSets\SegmentWithGeodesicActiveContourLevelSet\BrainProtonDensitySlice.png C:/a/LeftVentricle.png 81 114 5.0 1.0 -0.5 3.0 2.0 100
It looks like you modified the source code to run in 3D. Can you share it?
the code is working with PNG file. But not with DICOM.
First I have tried this example with only single DICOM image. Just added GDCMIO in my code.
These are my arguments -
./GeodesicActiveContourLevelSet IMG075.dcm contour.dcm 81 114 5.0 1.0 -0.5 3.0 2.0 100
And I got following Error:
itk::ExceptionObject (0x55d65388f360)
Location: “void itk::ImageToImageFilter<TInputImage, TOutputImage>::VerifyInputInformation() const [with TInputImage = itk::Image<float, 2>; TOutputImage = itk::Image<float, 2>]”
File: /usr/local/include/ITK-5.0/itkImageToImageFilter.hxx
Line: 233
Description: itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0x55d65388e630): Inputs do not occupy the same physical space!
InputImage Origin: [-1.9631494e+02, -3.3931494e+02], InputImageInitialImage Origin: [0.0000000e+00, 0.0000000e+00]
Tolerance: 3.7011700e-07
InputImage Spacing: [3.7011700e-01, 3.7011700e-01], InputImageInitialImage Spacing: [1.0000000e+00, 1.0000000e+00]
Tolerance: 3.7011700e-07
Is it problem with my data type?
I am getting those Output1.png, output2.png, output3.png in my directory. But not output4.png. why?
If I am working with DICOM images, then what changes should I do in my code?
Could you please check the code and tell me what is wrong with it?
Because I am getting the same error i have mentioned before. (problem with physical space)
Thank you. It solved the issue.
But I am unable to understand how to set the values of sigma, alpha and beta?
I am trying to use this geodesic active contour level set image filter to segment the liver.
I have tried different values but still unable to achieve the good result.
Do you have any tips for how to select the values for sigma, alpha & beta?
Okay. I will check it.
The code which I sent before which I modified to run in 3D, is it correct?
Could you please check that, and let me know where it has mistakes or not?
& what changes should I need to do?
Thank you so much.