[Insight-users] ConnectedThresholdImageFilter and RGB Image

Luis Ibanez luis.ibanez at kitware.com
Tue Dec 2 15:52:20 EST 2008


Hi Anibal,

The ConnectedThresholdImageFilter will NOT work with an image of
multiple components.

The filter that you want to use with this type of input image is
"VectorConfidenceConnectedImageFilter":
http://www.itk.org/Insight/Doxygen/html/classitk_1_1VectorConfidenceConnectedImageFilter.html 


This filter will use a Mahalanobis distance concept in order to
include (or exclude) pixels from joining the segmented region.



Regards,


     Luis


--------------
Aníbal wrote:
> 
> Hi
> 
> I'm trying to use the ConnectedThresholdImageFilter with a RGB image.
> 
> #include <itkImage.h>
> #include <itkImageFileReader.h>
> #include <itkRGBPixel.h>
> typedef itk::RGBPixel<unsigned char > PixelType;
> typedef itk::Image<PixelType,2 > Image2DType;
> typedef itk::ImageFileReader<Image2DType > Reader2DType;
> 
> #include <itkConnectedThresholdImageFilter.h>
> typedef itk::ConnectedThresholdImageFilter<Image2DType,Image2DType > 
> ConnectedFilterType;
> 
> I obtain a compiling error when I try to create a ConnectedFilterType 
> object.
> Here is the code:
> 
> ConnectedFilterType::Pointer filterPtr = ConnectedFilterType::New();
> 
> The program compiles without errors If I create a 
> ConnectedThresholdImageFilter for a non rgb image:
> 
> typedef itk::Image<float,2> TestImageType;
> typedef itk::ConnectedThresholdImageFilter<TestImageType,TestImageType> 
> TestFilterType;
> 
> TestFilterType::Pointer testFilterPtr = TestFilterType::New();
> 
> I'm newbie using itk, maybe It's not possible create a 
> ConnectedThresholdImageFilter for a rgb image.
> In that case, which is the best way to solve this problem.
> 
> This is the error message (I'm using MS Visual Studio 2005 Proffesional 
> Edition)
> 
> ===================================================================================================
> 
> ------ Operación Generar iniciada: proyecto: ItkSample02, configuración: 
> Release Win32 ------
> Compilando...
> ItkSampleMainFrame.cpp
>  WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(201) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(193) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::SimpleDataObjectDecorator<T> 
> *itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::GetUpperInput(void)'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>,
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
>         d:\c++\itk samples\itk sample 02\src\ItkSampleMainFrame.h(66) : 
> vea la referencia a la creación de instancias de plantilla de clase 
> 'itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>' que se 
> está compilando
>         with
>         [
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(201) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(181) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(173) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::SimpleDataObjectDecorator<T> 
> *itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::GetLowerInput(void)'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>,
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(181) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(35) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(34) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::ConnectedThresholdImageFilter(void)'
>         with
>         [
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(35) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(36) 
> : error C2660: 'itk::NumericTraits<T>::max' : la función no acepta 0 
> argumentos
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(40) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(40) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(44) 
> : error C2660: 'itk::NumericTraits<T>::max' : la función no acepta 0 
> argumentos
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> ItkSampleApp.cpp
>  WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(201) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(193) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::SimpleDataObjectDecorator<T> 
> *itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::GetUpperInput(void)'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>,
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
>         d:\c++\itk samples\itk sample 02\src\ItkSampleMainFrame.h(66) : 
> vea la referencia a la creación de instancias de plantilla de clase 
> 'itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>' que se 
> está compilando
>         with
>         [
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(201) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(181) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(173) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::SimpleDataObjectDecorator<T> 
> *itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::GetLowerInput(void)'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>,
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(181) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(35) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
>         
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(34) 
> : durante la compilación de la función miembro de plantilla de clase 
> 'itk::ConnectedThresholdImageFilter<TInputImage,TOutputImage>::ConnectedThresholdImageFilter(void)'
>         with
>         [
>             TInputImage=Image2DType,
>             TOutputImage=Image2DType
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(35) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(36) 
> : error C2660: 'itk::NumericTraits<T>::max' : la función no acepta 0 
> argumentos
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(40) 
> : error C2039: 'NonpositiveMin' : no es un miembro de 
> 'itk::NumericTraits<T>'
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(40) 
> : error C3861: 'NonpositiveMin': no se encontró el identificador
> d:\insighttoolkit-3.10.0\code\basicfilters\itkConnectedThresholdImageFilter.txx(44) 
> : error C2660: 'itk::NumericTraits<T>::max' : la función no acepta 0 
> argumentos
>         with
>         [
>             T=itk::RGBPixel<unsigned char>
>         ]
> 
> ===================================================================================================
> 
> Thanks in advance
> 
> Hannibal
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list