Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation using level sets fails on Windows platform #456

Open
ktbolt opened this issue Apr 25, 2019 · 3 comments

Comments

Projects
None yet
1 participant
@ktbolt
Copy link
Contributor

commented Apr 25, 2019

Describe the bug
The Segmentation Tool level set image segmentation fails on Windows platform.

To Reproduce
From the Segmentation Tool select the LevelSet button to create a segmentation. A message box appears with the infinitely informative No Valid Contour Created, Contour not created and added since it's invalid.

Expected behavior
The level set segmentation should work.

Desktop (please complete the following information):

  • OS: Windows 10
  • SimVascular Version: 2019-03-17

Additional context
This message is originating in the CreateContours() method in org.sv.gui.qt.segmentation/sv4guiSeg2DEdit.cxx.

@ktbolt ktbolt added the bug label Apr 25, 2019

@ktbolt ktbolt self-assigned this Apr 25, 2019

@ktbolt

This comment has been minimized.

Copy link
Contributor Author

commented May 15, 2019

The output from a Windows console

vtkImageImport (000002C6385B0200): Calling UpdateDataCallback: c:\cygwin64\home\nwilson\gitwork\simvascular\releases\2019-01-27\buildwithmake\ext\bin\itk-4.13.0\include\itk-4.13\itkRescaleIntensityImageFilter.hxx:58: itk::ERROR: RescaleIntensityImageFilter(000002C638E42500): Minimum output value cannot be greater than Maximum output value. LevelSet Completed in: 1 iterations with 0.00RMS Change at end
`

@ktbolt

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

@osmsc The Minimum output value error from ITK is output by

template< typename TInputImage, typename TOutputImage >
void
RescaleIntensityImageFilter< TInputImage, TOutputImage >
::BeforeThreadedGenerateData()
{
  if ( this->m_OutputMinimum > this->m_OutputMaximum )
    {
    itkExceptionMacro(<< "Minimum output value cannot be greater than Maximum output value.");
    return;
    }

m_OutputMinimum and m_OutputMaximum are the min/max of the image data type calculated in

template< typename TInputImage, typename TOutputImage >
RescaleIntensityImageFilter< TInputImage, TOutputImage >
::RescaleIntensityImageFilter() :
  m_Scale( 1.0 ),
  m_Shift( 0.0 ),
  m_InputMinimum( NumericTraits< InputPixelType >::max() ),
  m_InputMaximum( NumericTraits< InputPixelType >::ZeroValue() ),
  m_OutputMinimum( NumericTraits< OutputPixelType >::NonpositiveMin() ),
  m_OutputMaximum( NumericTraits< OutputPixelType >::max() )
{

}

So this seems to be a problem with the data type MITK is using for images on Windows? SV calls mitk::ExtractSliceFilter but I don't yet see how RescaleIntensityImageFilter is called.

@ktbolt

This comment has been minimized.

Copy link
Contributor Author

commented May 31, 2019

Sorry, SV calls vtkImageReslice, not RescaleIntensityImageFilter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.